Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 1523  / 2 Years ago, tue, october 11, 2022, 9:17:36

I Have a small net and last 2 weeks i get a lot of disconnections on my wireless stations
a friend of mine told me that 90% i get attacked by deauth packets i i researched a bit and found this py script. But unfortunately i couldn't find any help on how to use it..
I m really new on linux is there anyone willing to help?





#!/usr/bin/env python

######################################################
# authWatch.py v. 0.1 (Quick, Dirty and Loud) - by TinMan
# Place card in monitor mode and set the channel.
# If you want channel hopping, run airodump-ng in
# another terminal. Will add channel hopping
# in the next version.
######################################################
#
# Usage: python authWatch.py
#

import sys
from scapy import *

interface = sys.argv[1]

def sniffReq(p):
if p.haslayer(Dot11Deauth):
# Look for a deauth packet and print the AP BSSID, Client BSSID and the reason for the deauth.
print p.sprintf("Deauth Found from AP [%Dot11.addr2%] Client [%Dot11.addr1%], Reason [%Dot11Deauth.reason%]")
# Look for an association request packet and print the Station BSSID, Client BSSID, AP info.
if p.haslayer(Dot11AssoReq):
print p.sprintf("Association request from Station [%Dot11.addr1%], Client [%Dot11.addr2%], AP [%Dot11Elt.info%]")
# Look for an authentication packet and print the Client and AP BSSID
if p.haslayer(Dot11Auth):
print p.sprintf("Authentication Request from [%Dot11.addr1%] to AP [%Dot11.addr2%]")
print p.sprintf("------------------------------------------------------------------------------------------")
sniff(iface=interface,prn=sniffReq)

More From » python

 Answers
1

The problem with your script was a indentation problem, that is common with python beginners:



python script.py 
File "script.py", line 28
print p.sprintf("Authentication Request from [%Dot11.addr1%] to AP [%Dot11.addr2%]")

^
IndentationError: unindent does not match any outer indentation level


the space between ]") and ^ is filled with tabulation characters and that confuses the interpreter. Here is with the indentation corrected:




#!/usr/bin/env python

######################################################
# authWatch.py v. 0.1 (Quick, Dirty and Loud) - by TinMan
# Place card in monitor mode and set the channel.
# If you want channel hopping, run airodump-ng in
# another terminal. Will add channel hopping
# in the next version.
######################################################
#
# Usage: python authWatch.py
#

import sys
from scapy import *

interface = sys.argv[1]

def sniffReq(p):
if p.haslayer(Dot11Deauth):
# Look for a deauth packet and print the AP BSSID, Client BSSID and the reason for the deauth.
print p.sprintf("Deauth Found from AP [%Dot11.addr2%] Client [%Dot11.addr1%], Reason [%Dot11Deauth.reason%]")
# Look for an association request packet and print the Station BSSID, Client BSSID, AP info.
if p.haslayer(Dot11AssoReq):
print p.sprintf("Association request from Station [%Dot11.addr1%], Client [%Dot11.addr2%], AP [%Dot11Elt.info%]")
# Look for an authentication packet and print the Client and AP BSSID
if p.haslayer(Dot11Auth):
print p.sprintf("Authentication Request from [%Dot11.addr1%] to AP [%Dot11.addr2%]")
print p.sprintf("------------------------------------------------------------------------------------------")
sniff(iface=interface,prn=sniffReq)

[#29681] Thursday, October 13, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
howesale

Total Points: 224
Total Questions: 117
Total Answers: 116

Location: Nauru
Member since Thu, May 18, 2023
1 Year ago
;