-
Notifications
You must be signed in to change notification settings - Fork 0
/
Scanman.py
61 lines (48 loc) · 3.71 KB
/
Scanman.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/env python3
import os,sys
import subprocess
from colorama import Fore
from colorama import Style
print(f'{Fore.RED} ______ {Style.RESET_ALL}')
print(f'{Fore.RED} / \ {Style.RESET_ALL}')
print(f'{Fore.RED} /$$$$$$ | _______ ______ _______ _____ ____ ______ _______ {Style.RESET_ALL}')
print(f'{Fore.RED} $$ \__$$/ / | / \ / \ / \/ \ / \ / \ {Style.RESET_ALL}')
print(f'{Fore.RED} $$ \ /$$$$$$$/ $$$$$$ |$$$$$$$ |$$$$$$ $$$$ | $$$$$$ |$$$$$$$ |{Style.RESET_ALL}')
print(f'{Fore.WHITE} $$$$$$ |$$ | / $$ |$$ | $$ |$$ | $$ | $$ | / $$ |$$ | $$ |{Style.RESET_ALL}')
print(f'{Fore.WHITE} / \__$$ |$$ \_____ /$$$$$$$ |$$ | $$ |$$ | $$ | $$ |/$$$$$$$ |$$ | $$ |{Style.RESET_ALL}')
print(f'{Fore.RED} $$ $$/ $$ |$$ $$ |$$ | $$ |$$ | $$ | $$ |$$ $$ |$$ | $$ |{Style.RESET_ALL}')
print(f'{Fore.RED} $$$$$$/ $$$$$$$/ $$$$$$$/ $$/ $$/ $$/ $$/ $$/ $$$$$$$/ $$/ $$/ {Style.RESET_ALL}')
print(f'{Fore.BLUE} BY: MahmoudJOO{Style.RESET_ALL}')
print (" ")
a = input ("Enter The Pcap File Path: ")
print (" ")
print (f'{Fore.GREEN} ^--------------------------------^ {Style.RESET_ALL}')
print(f'{Fore.GREEN}____________________| PLEASE WAIT UNTIL SCAN FINISH |_____________________{Style.RESET_ALL}')
print (f'{Fore.GREEN} O--------------------------------O {Style.RESET_ALL}')
print (" ")
subprocess.run(f'tshark -T fields -e ip.src -r {a}>SM1.txt ', shell=True )
subprocess.run('cat -n SM1.txt | sort -uk2 | sort -nk1 | cut -f2->HOSTip.txt', shell=True)
subprocess.run('echo "\033[1;91m----------------------------------\033[m" > RESULTS.txt ' , shell=True)
subprocess.run('echo "\033[1;93mIdentified Protocol For Each HOST\033[m" >>RESULTS.txt' , shell=True)
subprocess.run('echo "\033[1;91m-----------------------------------\033[m" >> RESULTS.txt ' , shell=True)
subprocess.run('echo >> RESULTS.txt' , shell=True)
subprocess.run('nmap -T5 -sO --open -iL HOSTip.txt | grep -Ev "Not|is|Status|done|Starting" >> RESULTS.txt ' , shell=True )
subprocess.run('echo >> RESULTS.txt' , shell=True)
subprocess.run('echo "\033[1;32m==============================================================================================\033[m" >> RESULTS.txt ' , shell=True)
subprocess.run('echo >> RESULTS.txt' , shell=True)
print ("SCAN Identified protocol DONE : " '\n')
subprocess.run('echo "\033[1;91m---------------------------------\033[m " >> RESULTS.txt ' , shell=True)
subprocess.run('echo "\033[1;93mOS And Open Ports For Each HOST \033[m" >>RESULTS.txt' , shell=True)
subprocess.run('echo "\033[1;91m---------------------------------\033[m" >> RESULTS.txt ' , shell=True)
subprocess.run('echo >> RESULTS.txt' , shell=True)
subprocess.run('nmap -O -T4 --open -iL HOSTip.txt | grep -Ev "shown|Warning|detection|hops|done|Starting|Host|closed|Runing|CPE" | cut -c 1-80 >> RESULTS.txt ' , shell=True)
print ("SCAN OS & Open Ports DONE : " '\n')
print(f'{Fore.GREEN} __..._ _...__{Style.RESET_ALL}' )
print(f'{Fore.GREEN} _..-" `Y` "-._{Style.RESET_ALL}' )
print(f'{Fore.GREEN} \ | /{Style.RESET_ALL}' )
print(f'{Fore.GREEN} \\ THE RESULTS //{Style.RESET_ALL}' )
print(f'{Fore.GREEN} \\\ | ///{Style.RESET_ALL}')
print(f'{Fore.GREEN} \\\ _..---. |.---.._ ///{Style.RESET_ALL}')
print(f'{Fore.GREEN} \\`_..--- .Y.---.._`//{Style.RESET_ALL}')
print (" ")
subprocess.run('cat RESULTS.txt' , shell=True)