diff --git a/__main__.py b/__main__.py index 56aacbb..3500fb5 100644 --- a/__main__.py +++ b/__main__.py @@ -3,16 +3,21 @@ import argparse import wifi_bruteforce +import network_scanner def main(): parser = argparse.ArgumentParser() parser.add_argument("-w", "--wifi_brute_force", action="store_true", help="Try to brute force all wifi detected by this device") + parser.add_argument("-a", "--scan_ips", action="store_true", help="Scan all IPs on this networks") args = parser.parse_args() if args.wifi_brute_force: wifi_bruteforce.start() + if args.scan_ips: + network_scanner.scan() + if __name__ == '__main__': diff --git a/network_scanner.py b/network_scanner.py new file mode 100644 index 0000000..485e91b --- /dev/null +++ b/network_scanner.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# inspired by http://null-byte.wonderhowto.com/how-to/build-arp-scanner-using-scapy-and-python-0162731/ + +import sys +from datetime import datetime + +from scapy.all import srp,Ether,ARP,conf + +def scan_ips(interface='wlan0', ips='192.168.1.0/24'): + """a simple ARP scan with Scapy""" + try: + print('[*] Start to scan') + conf.verb = 0 # hide all verbose of scapy + ether = Ether(dst="ff:ff:ff:ff:ff:ff") + arp = ARP(pdst = ips) + answer, unanswered = srp(ether/arp, timeout = 2, iface = interface, inter = 0.1) + + for sent, received in answer: + print(received.summary()) + + except KeyboardInterupt: + print('[*] User requested Shutdown') + print('[*] Quitting...') + sys.exit(1) \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..a1360af --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +scapy +wifi \ No newline at end of file