<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Thijs Boelman</title>
    <description>The latest articles on DEV Community by Thijs Boelman (@ixmprove).</description>
    <link>https://dev.to/ixmprove</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F746252%2Fa88a0a7a-e159-4b0f-ae68-2aa86fd98e72.png</url>
      <title>DEV Community: Thijs Boelman</title>
      <link>https://dev.to/ixmprove</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ixmprove"/>
    <language>en</language>
    <item>
      <title>Disconnect devices from WiFi networks. Deauthentication Attack using aireplay-ng</title>
      <dc:creator>Thijs Boelman</dc:creator>
      <pubDate>Sun, 27 Feb 2022 04:24:37 +0000</pubDate>
      <link>https://dev.to/ixmprove/deauthentication-attack-using-aireplay-ng-46i</link>
      <guid>https://dev.to/ixmprove/deauthentication-attack-using-aireplay-ng-46i</guid>
      <description>&lt;p&gt;Hello! In this post I will explain to you how to deauthenticate any device from a WiFi network without beeing connected to the network itself!&lt;br&gt;
&lt;strong&gt;&lt;em&gt;Beware, this is illegal without permission, and it can be detected.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  What you should know:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Target Device MUST be connected to a WiFi network. &lt;/li&gt;
&lt;li&gt;The target device might switch to another WiFi network that's saved. Or use mobile data.&lt;/li&gt;
&lt;li&gt;You need a WiFi adapter that supports monitor mode. (&lt;em&gt;I am using the &lt;strong&gt;Alfa AWUS036ACH&lt;/strong&gt;&lt;/em&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Data you need to perform the attack:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;The router its &lt;em&gt;BSSID&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;The target device its &lt;em&gt;MAC Address&lt;/em&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;(Will be explained how to get this data.)&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How it's done:
&lt;/h2&gt;

&lt;p&gt;First you need to make sure that your adapter is in monitor mode (&lt;em&gt;so it can start receiving packets around you.&lt;/em&gt;)&lt;br&gt;
You can check the mode of your adapter with &lt;code&gt;$ iwconfig&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcfp9pzc58bs3stqrw4i8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcfp9pzc58bs3stqrw4i8.png" alt="iwconfig command in managed mode"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If it's not in monitor mode yet you need to follow these steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Disable your adapter &lt;code&gt;$ ifconfig wlan1 down&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Change mode to monitor mode &lt;code&gt;$ iwconfig wlan1 mode monitor&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Enable the adapter &lt;code&gt;$ ifconfig wlan1 up&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flkom0wca45muo921sdvf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flkom0wca45muo921sdvf.png" alt="commands to enable monitor mode"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that your adapter is in monitor mode, it can receive all WiFi packets sent all around you from different devices. (&lt;em&gt;Even if you are not connected to the network, or if you don't have the password of the network.&lt;/em&gt;)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiwxdgb7td9uoi94fae5r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiwxdgb7td9uoi94fae5r.png" alt="iwconfig command with monitor mode turned on"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What we need to do now, is intercept those packets. To intercept those packets we are using a packet sniffer called &lt;em&gt;airodump-ng&lt;/em&gt;.&lt;br&gt;
This will allow us to collect data from nearby WiFi connections (&lt;em&gt;such as the &lt;strong&gt;BSSID&lt;/strong&gt;, &lt;strong&gt;Channel&lt;/strong&gt;, &lt;strong&gt;Encryption method&lt;/strong&gt;&lt;/em&gt;) and even devices connected to the networks.&lt;/p&gt;

&lt;p&gt;To use &lt;em&gt;airodump-ng&lt;/em&gt; we can run the following command, and the given interface &lt;em&gt;[wlan1]&lt;/em&gt; will start collecting data.&lt;br&gt;
&lt;code&gt;$ airodump-ng wlan1&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvs7mkdj66r6qqxiqsz9n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvs7mkdj66r6qqxiqsz9n.png" alt="terminal airodump-ng wlan1"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When you see the networks listed. You can use this information as a filter to collect data of a specific network.&lt;br&gt;
Now you can specify the bssid and channel of the network.&lt;br&gt;
&lt;code&gt;$ airodump-ng --bssid [NETWORK_BSSID] --channel [NETWORK_CHANNEL] wlan1&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Optionally you can use &lt;code&gt;--write [filename]&lt;/code&gt; in the command. This way you save the collected packets in a file, which you could analyze further with wireshark.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fafeqfwt8108jx0walyxq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fafeqfwt8108jx0walyxq.png" alt="command airodump-ng with bssid and channel specified"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we can see the devices connected to the network. (Listed under &lt;strong&gt;&lt;em&gt;STATION&lt;/em&gt;&lt;/strong&gt;)&lt;br&gt;
Once you have the &lt;em&gt;MAC Address&lt;/em&gt; of the target device, and the &lt;em&gt;BSSID&lt;/em&gt; of the router. You have enough information to start the deauthentication attack.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg47ohuognm7xkmtt909v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg47ohuognm7xkmtt909v.png" alt="result airodump-ng with bssid and channel specified"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To start the deauthentication attack you can use the following command:&lt;br&gt;
&lt;code&gt;$ aireplay-ng --deauth 0 -a [ROUTER_BSSID] -c [TARGET_MAC_ADDRESS] wlan1&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;--deauth 0&lt;/code&gt; means that you will send infinite deauthentication packets. It stops sending packets whenever you stop the program from executing. (&lt;code&gt;CTRL + C&lt;/code&gt;)&lt;br&gt;
&lt;strong&gt;&lt;em&gt;(NOTE: airodump-ng should be running with the bssid &amp;amp; channel specified simultaneously with aireplay-ng! )&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6x0z7k8qfw022nl0fxir.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6x0z7k8qfw022nl0fxir.png" alt="terminal of deauthentication attack"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>ethicalhacking</category>
      <category>hacking</category>
      <category>linux</category>
    </item>
  </channel>
</rss>
