Como executar este script python específico (anexado na pergunta)

1

Eu tenho uma rede pequena e as últimas 2 semanas recebo muitas desconexões nas estações sem fio um amigo meu me disse que 90% eu sou atacado por deauth pacotes eu pesquisei um pouco e encontrei este script py. Mas infelizmente não consegui encontrar nenhuma ajuda sobre como usá-lo .. Sou muito novo no linux existe alguém disposto a ajudar?


#!/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)
    
por HemaN 31.08.2013 / 02:52

2 respostas

2

O problema com o seu script foi um problema de recuo, que é comum com iniciantes em python:

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

o espaço entre ]") e ^ é preenchido com caracteres de tabulação e isso confunde o interpretador. Aqui está com o recuo corrigido:

#!/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)
    
por Braiam 31.08.2013 / 17:42
0

É declarado como parte do script sobre como executá-lo:

Usage: python authWatch.py

O que você faz é abrir um terminal ( Ctrl + Alt + T ), navegue para onde quer que você salvou o script, e digite python authWatch.py .

    
por Thomas Ward 31.08.2013 / 02:55