-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnsa2.py
45 lines (32 loc) · 1013 Bytes
/
nsa2.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Aktif bilgisayar tespiti
import nmap
nm = nmap.PortScanner()
hostlist = ['ipler_buraya']
for h in hostlist:
sc = nm.scan(h, '80', '-sV -O')
state = sc['nmap']['scanstats']['uphosts']
if state == '1':
print h, " : Aktif host :)"
else:
print h, " : Kapali host :("
# Aktif bilgisayarların mac tespiti
import nmap
nm = nmap.PortScanner()
hostlist = ['ipler_buraya']
for h in hostlist:
sc = nm.scan(h, '80', '-sV -O')
state = sc['nmap']['scanstats']['uphosts']
if state == '1':
mac = sc['scan']['addressses']['mac']
print mac, " : ", h
# Aktif bilgisayarların işletim sistemi bilgisini elde etmek
import nmap
nm = nmap.PortScanner()
hostlist = ['ipler_buraya']
for h in hostlist:
sc = nm.scan(h, '80', '-sV -O')
state = sc['nmap']['scanstats']['uphosts']
if state == '1':
os = sc['scan'][h]['osmatch'][1]['osclass'][0]['osfamily']
mac = sc['scan']['addressses']['mac']
print mac, " : ", h, " : ", os