<?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 </title>
    <link>https://old.frang4.tech/tags/python/</link>
    <description>Recent content in Python on </description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Tue, 24 Jun 2025 03:38:50 -0300</lastBuildDate>
    <atom:link href="https://old.frang4.tech/tags/python/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Artificial - HTB Machine</title>
      <link>https://old.frang4.tech/posts/htb-machines/artificial/writeup/</link>
      <pubDate>Tue, 24 Jun 2025 03:38:50 -0300</pubDate>
      <guid>https://old.frang4.tech/posts/htb-machines/artificial/writeup/</guid>
      <description>&lt;p&gt;&lt;code&gt;Artificial&lt;/code&gt; is a Hack The Box machine from season 8&lt;/p&gt;&#xA;&lt;h2 id=&#34;summary-how&#34;&gt;Summary (How?)&lt;/h2&gt;&#xA;&lt;p&gt;Artificial is a machine with a web interface that allows to upload and execute TensorFlow .h5 model files. The initial foothold was obtained by embedding a reverse shell code inside a Lambda layer and exploiting the backend&amp;rsquo;s behavior which loads these models without sandboxing. From there, we accessed the Flask app&amp;rsquo;s source code, extracted database credentials, dumped the user table, cracked hashes using rockyou.txt, and obtained valid SSH credentials for user gael, leading to the user flag.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Code - HTB Machine</title>
      <link>https://old.frang4.tech/posts/htb-machines/code/writeup/</link>
      <pubDate>Sat, 14 Jun 2025 03:38:50 -0300</pubDate>
      <guid>https://old.frang4.tech/posts/htb-machines/code/writeup/</guid>
      <description>&lt;p&gt;&lt;code&gt;Code&lt;/code&gt; is a Hack The Box machine released on 22 Mar 2025&lt;/p&gt;&#xA;&lt;h2 id=&#34;summary-how&#34;&gt;Summary (How?)&lt;/h2&gt;&#xA;&lt;p&gt;We’re presented with a Python-based code editor exposed via a web application, allowing users to write, save, and execute Python scripts. However, execution is limited by a blacklist of restricted keywords, making direct command execution impossible at first glance. The first part of the challenge involves bypassing these restrictions to achieve Remote Code Execution (RCE).&lt;/p&gt;&#xA;&lt;p&gt;To do so, we leverage &lt;strong&gt;object-oriented introspection&lt;/strong&gt; to enumerate loaded Python subclasses and locate the index of the &lt;code&gt;sys&lt;/code&gt; module. With access to &lt;code&gt;sys.modules&lt;/code&gt;, we enumerate all loaded modules and identify one that exposes a &lt;code&gt;call&lt;/code&gt; function—specifically, &lt;code&gt;subprocess.call()&lt;/code&gt;—which enables us to execute system commands and obtain a reverse shell.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
