Skip to content

Commit

Permalink
add ips scanner
Browse files Browse the repository at this point in the history
  • Loading branch information
madeindjs committed Aug 21, 2016
1 parent 2deb271 commit 83a2b72
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
5 changes: 5 additions & 0 deletions __main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__':
Expand Down
26 changes: 26 additions & 0 deletions network_scanner.py
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
scapy
wifi

0 comments on commit 83a2b72

Please sign in to comment.