<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Python on t0x1n</title><link>http://t0x1n.cc/tags/python/</link><description>Recent content in Python on t0x1n</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sun, 31 Mar 2024 10:00:00 +0530</lastBuildDate><atom:link href="http://t0x1n.cc/tags/python/index.xml" rel="self" type="application/rss+xml"/><item><title>Using pip to Run Malicious Commands</title><link>http://t0x1n.cc/posts/pip-malicious-commands/</link><pubDate>Sun, 31 Mar 2024 10:00:00 +0530</pubDate><guid>http://t0x1n.cc/posts/pip-malicious-commands/</guid><description>&lt;p>So, recently I was solving a hacktheboox room OnlyForYou and I got the user flag but I was struggling to get the root flag. User had this previlage to run as sudo.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">&lt;span class="o">(&lt;/span>root&lt;span class="o">)&lt;/span> NOPASSWD: /usr/bin/pip3 download http&lt;span class="se">\:&lt;/span>//127.0.0.1&lt;span class="se">\:&lt;/span>3000/*.tar.gz
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>&lt;img src="http://t0x1n.cc/images/pip-malicious-blog/pip-exploit.png" alt="Sudo pip privilege showing download permission" title="Sudo permission to run pip download">&lt;/p>
&lt;p>But I had never seen a malicious use of pip before so I started doing research. And I founf some interesting stuffs.&lt;/p></description></item></channel></rss>