Tag Archives: Python

Wireless “Deauth” Attack using Aireplay-ng, Python, and Scapy

What are Deauth Attacks Used For?

Before we start performing deauth attacks, let’s first get an understanding of what they can be used for. Obviously, the primary thing they can do is force stations (clients) off of a given network, causing a Denial of Service (DoS) attack. We can also use deauth attacks to reveal otherwise hidden SSIDs (not included in Beacon frames) by disconnecting the clients, and then monitoring for Probe Requests which always contain the SSID.

Read More

How to kick everyone around you off wifi with Python


This script will find the most powerful wifi interface and turn on monitor mode. If a monitor mode interface is already up it will use the first one it finds instead. It will then start sequentially hopping channels 1 per second from channel 1 to 11 identifying all access points and clients connected to those access points. On the first pass through all the wifi channels it is only identifying targets. After that the 1sec per channel time limit is eliminated and channels are hopped as soon as the deauth packets finish sending. Note that it will still add clients and APs as it finds them after the first pass through.

Upon hopping to a new channel it will identify targets that are on that channel and send 1 deauth packet to the client from the AP, 1 deauth to the AP from the client, and 1 deauth to the AP destined for the broadcast address to deauth all clients connected to the AP. Many APs ignore deauths to broadcast addresses.

# Console colors
W  = '\033[0m'  # white (normal)
R  = '\033[31m' # red
G  = '\033[32m' # green
O  = '\033[33m' # orange
B  = '\033[34m' # blue
P  = '\033[35m' # purple
C  = '\033[36m' # cyan
GR = '\033[37m' # gray
T  = '\033[93m' # tan

Set up terminal colors. Not perfect since some different terminal setups may break the colors but I can’t find a common setup that this doesn’t work with… yet.

Read More

Python – Socket using a file

Server Program: #!/usr/bin/python # Echo server program import socket,os s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) try: os.remove(“/tmp/py_socket”) except OSError: pass s.bind(“/tmp/py_socket”) s.listen(1) conn, addr = s.accept() while 1: sock_data = conn.recv(1024) if not sock_data: break conn.send(sock_data) conn.close() Client Program: #!/usr/bin/python # Echo client program import socket s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) s.connect(“/tmp/py_socket”) s.send(‘Hello, world’) data = s.recv(1024) s.close()

Read More

Bad Behavior has blocked 59 access attempts in the last 7 days.