forked from 0xInfection/TIDoS-Framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathosdetect.py
More file actions
82 lines (72 loc) · 2.73 KB
/
Copy pathosdetect.py
File metadata and controls
82 lines (72 loc) · 2.73 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/usr/bin/env python
# coding: utf-8
#-:-:-:-:-:-:-:-:-:-:-:-:#
# TIDoS Framework #
#-:-:-:-:-:-:-:-:-:-:-:-:#
#Author : @_tID
#This module requires TIDoS Framework
#https://github.com/0xInfection/TIDoS-Framework
from __future__ import print_function
import re
import socket
import cookielib
import subprocess
import time
from re import search
from getports import *
from core.Core.colors import *
from getcensys import getos0x00
def port0x00(web):
time.sleep(0.7)
print(O+' [!] Moving on to the second phase...')
time.sleep(0.8)
print(O+' [*] Initiating port scan (TCP+UDP)...')
try:
getports(web)
except Exception as e:
print(R+' [-] Exception : '+str(e))
print(GR+' [*] Initiating OS detection response analysis...')
response = subprocess.check_output(['nmap','-Pn','-O','-sSU','-F','--osscan-guess','-T4', web])
if "No OS matches for host".lower() not in response.lower():
if 'running:' in response.lower():
regex = re.compile("Running:(.*)")
result = regex.findall(response)
print(C+' [+] OS Running Matched : '+B+result[0].strip())
if 'os cpe:' in response.lower():
regex = re.compile("OS CPE:(.*)")
result = regex.findall(response)
print(C+' [+] OS CPE Detected : '+B+result[0].strip())
if 'os details:' in response.lower():
regex = re.compile("OS details:(.*)")
result = regex.findall(response)
print(C+' [+] Operating System Details : '+B+result[0].strip())
else:
print(R+' [-] No exact matches for OS via port scan...')
def osdetect(web):
try:
time.sleep(0.4)
print(R+'\n ===================================')
print(R+' O S F I N G E R P R I N T I N G')
print(R+' ===================================\n')
web = web.replace('http://','')
web = web.replace('https://','')
print(GR+' [*] Initialising Module [1]...')
flag = getos0x00(web)
print(G+'\n [+] Module [1] Completed!')
if flag == 0x01:
q = raw_input(O+' [#] OS Identified!\n [#] Move on to to module [2]? (y/N) :> ')
if q == 'Y'or q == 'y':
print(GR+'\n [*] Initialising Module [2]...')
port0x00(web)
elif q == 'N' or q == 'n':
print(G+' [+] Done!')
elif flag == 0x00:
print(GR+' [*] Initialising Module [2]...')
port0x00(web)
else:
print(R+' [-] Fuck, something went wrong!')
print(flag)
except Exception as e:
print(R+' [-] Unhandled Exception occured...')
print(R+' [-] Exception : '+str(e))
print(G+' [+] OS Fingerprinting Module Completed!\n')