How to use the command aireplay-ng (with examples)
In wireless network security testing, it often becomes necessary to inject packets into a network to perform various attacks. The aireplay-ng
command, which is part of the popular aircrack-ng
suite, allows penetration testers and network administrators to inject packets into a wireless network for testing and analysis purposes.
Use case 1: Sending disassociate packets to a specific client
Code:
sudo aireplay-ng --deauth 100 --bssid 00:11:22:33:44:55 --dmac AA:BB:CC:DD:EE:FF wlan0
Motivation:
A common use case for aireplay-ng
is to forcefully disconnect a client from an access point. This can be useful for testing the security of a wireless network, as it allows you to simulate a client getting disconnected and see how the network reacts.
Explanation:
--deauth count
: Specifies the number of deauthentication packets to send. In this example, we are sending 100 packets.--bssid ap_mac
: Specifies the MAC address of the access point to target. In this example, it is set to00:11:22:33:44:55
.--dmac client_mac
: Specifies the MAC address of the client to deauthenticate. In this example, it is set toAA:BB:CC:DD:EE:FF
.interface
: Specifies the network interface to use for injection. In this example, it is set towlan0
.
Example output:
17:42:33 Sending 64 directed DeAuth. STMAC: [AA:BB:01:01:01:01] [ 0|3370 ACKs]
17:42:33 Sending DeAuth to broadcast -- BSSID: [00:11:22:33:44:55]
17:42:33 Sending DeAuth to broadcast -- BSSID: [00:11:22:33:44:55]
17:42:33 Sending DeAuth to broadcast -- BSSID: [00:11:22:33:44:55]
...
Conclusion:
The aireplay-ng
command provides an essential tool for injecting packets into wireless networks for testing and analysis purposes. By understanding its various use cases, users can effectively simulate network attacks and assess the security of wireless networks.