mirror of
https://github.com/k4m4/kickthemout.git
synced 2024-11-22 04:54:26 +01:00
18 lines
455 B
Python
18 lines
455 B
Python
#!/usr/bin/env python
|
|
# -.- coding: utf-8 -.-
|
|
# scan.py
|
|
|
|
def scanNetwork(network):
|
|
returnlist = []
|
|
import nmap
|
|
nm = nmap.PortScanner()
|
|
a = nm.scan(hosts=network, arguments='-sP')
|
|
|
|
for k, v in a['scan'].iteritems():
|
|
if str(v['status']['state']) == 'up':
|
|
try:
|
|
returnlist.append([str(v['addresses']['ipv4']), str(v['addresses']['mac'])])
|
|
except:
|
|
pass
|
|
|
|
return returnlist |