<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Web on </title>
    <link>https://old.frang4.tech/tags/web/</link>
    <description>Recent content in Web on </description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Sat, 14 Jun 2025 03:38:50 -0300</lastBuildDate>
    <atom:link href="https://old.frang4.tech/tags/web/index.xml" rel="self" type="application/rss+xml" />
    <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>
