<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Pwnable on Tyler's Blog</title><link>https://blog.zars.me/tags/pwnable/</link><description>Recent content in Pwnable on Tyler's Blog</description><generator>Hugo</generator><language>en-us</language><copyright>© Athul</copyright><lastBuildDate>Mon, 10 Jul 2023 12:13:32 +0530</lastBuildDate><atom:link href="https://blog.zars.me/tags/pwnable/index.xml" rel="self" type="application/rss+xml"/><item><title>pwnable blackjack</title><link>https://blog.zars.me/posts/pwnable/blackjack/</link><pubDate>Mon, 10 Jul 2023 12:13:32 +0530</pubDate><guid>https://blog.zars.me/posts/pwnable/blackjack/</guid><description>Source The source provided in the game can be found here: Link
Analysis I noticed the main gameplay block was quite interesting in the way it handled the users bet:
if(p&amp;lt;=21) //If player total is less than 21, ask to hit or stay { printf(&amp;#34;\n\nWould You Like to Hit or Stay?&amp;#34;); scanf(&amp;#34;%c&amp;#34;, &amp;amp;choice3); //... if((choice3==&amp;#39;H&amp;#39;) || (choice3==&amp;#39;h&amp;#39;)) // If Hit, continues { //... if(dealer_total==21) //Is dealer total is 21, loss { printf(&amp;#34;\nDealer Has the Better Hand.</description></item><item><title>pwnable cmd1</title><link>https://blog.zars.me/posts/pwnable/cmd1/</link><pubDate>Mon, 10 Jul 2023 12:13:32 +0530</pubDate><guid>https://blog.zars.me/posts/pwnable/cmd1/</guid><description>Starting to solve the pwnable.kr series of problems!
Provided Source #include &amp;lt;stdio.h&amp;gt; #include &amp;lt;string.h&amp;gt; int filter(char* cmd){ int r=0; r += strstr(cmd, &amp;#34;flag&amp;#34;)!=0; r += strstr(cmd, &amp;#34;sh&amp;#34;)!=0; r += strstr(cmd, &amp;#34;tmp&amp;#34;)!=0; return r; } int main(int argc, char* argv[], char** envp){ putenv(&amp;#34;PATH=/thankyouverymuch&amp;#34;); if(filter(argv[1])) return 0; system( argv[1] ); return 0; } Breaking this down, we can see three main parts:
Reset the $PATH to only include one entry Filter the input to no include any strings Run system() Solving The $PATH holds the main directories for where binaries are located, allowing for users to just run something short like pwd instead of /bin/pwd.</description></item></channel></rss>