forked from mrh0wl/Cloudmare
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Cloudmare.py
92 lines (82 loc) · 3.8 KB
/
Cloudmare.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/usr/bin/env python
# coding: utf-8
# By: MrH0wl
from __future__ import print_function
from __future__ import absolute_import
import sys
from lib.parse.cmdline import parser_cmd
from lib.parse.settings import logotype, osclear, checkImports, PYVERSION
from lib.parse.colors import info, bad
while True:
try:
from lib.analyzer.ipscan import IPscan
from lib.analyzer.dnslookup import scan, DNSLookup
from lib.tools import sublist3r
from lib.tools.netcat import netcat
from lib.tools.bruter import nameserver
from lib.tools.censys import censys
from lib.tools.shodan import shodan
from lib.tools.securitytrails import securitytrails
break
except Exception as e:
err = e.name if PYVERSION.startswith('3') else str(e).split('named')[1]
checkImports(err).downloadLib()
if __name__=="__main__":
try:
args, parsErr = parser_cmd()
output = "data/output/subdomains-from-" + (args.domain).split('.')[0] + ".txt" if args.outSub == None else False
http = 'http://' if 'http://' in args.domain else 'https://'
args.domain = args.domain.replace(http, '').split('/')[0].split(".", 1)[1] if args.domain.count(".") >= 2 else args.domain.replace(http, '').split('/')[0]
if args.disableSub == False:
args.subbrute = False
subdomain = sublist3r.main(args.domain, args.threads, output, ports=None, silent=False, verbose=args.verbose, enable_bruteforce=args.subbrute, engines=None)
if len(subdomain) == 0 and not any((args.host, args.brute, args.subbrute, args.censys, args.shodan)):
logotype()
parsErr("cannot continue with tasks. Add another argument to task (e.g. \"--host\", \"--bruter\"")
else:
subdomain = []
if args.headers != None and 'host:' in args.headers:
logotype()
parsErr("Remove the 'host:' header from the '--header' argument. Instead use '--host' argument")
if args.host != None:
nameservers = []
if args.brute == True:
nameservers = nameserver(args.domain)
nameservers.append(args.host)
if args.censys != None:
CensysIP = censys(args.domain, args.censys)
subdomain.extend(CensysIP)
if args.shodan != None:
ShodanIP = shodan(args.domain, args.shodan)
subdomain.extend(ShodanIP)
list_length = len(nameservers) if args.brute == True else 1
for i in range(0, list_length):
host = nameservers[i] if args.brute == True else args.host
scan(args.domain, host, args.uagent, args.randomAgent, args.headers)
netcat(args.domain, host, args.ignoreRedirects, args.uagent, args.randomAgent, args.headers, count=0)
A = DNSLookup(args.domain, host)
IPscan(args.domain, host, A, args.uagent, args.randomAgent, args.headers, args)
else:
if args.brute == True:
nameservers = nameserver(args.domain)
subdomain.extend(nameservers)
if args.censys != None:
CensysIP = censys(args.domain, args.censys)
subdomain.extend(CensysIP)
if args.shodan != None:
ShodanIP = shodan(args.domain, args.shodan)
subdomain.extend(ShodanIP)
if args.securitytrails != None:
STIP = securitytrails(args.domain, args.securitytrails)
subdomain.extend(STIP)
list_length = len(subdomain)
for i in range(0, list_length):
host = subdomain[i]
scan(args.domain, host, args.uagent, args.randomAgent, args.headers)
netcat(args.domain, host, args.ignoreRedirects, args.uagent, args.randomAgent, args.headers, count=0)
A = DNSLookup(args.domain, host)
IPscan(args.domain, host, A, args.uagent, args.randomAgent, args.headers, args)
except KeyboardInterrupt:
question = input('\n' + info + 'Do you want to clear the screen? y/n: ') if sys.version_info[0] == 3 else raw_input(info + '[INFO] Do you want to clear the screen? y/n: ')
if question in ["yes", "y", "Y", "ye"]:
osclear(unknown= bad + " " +" Sorry, but I cannot clear this OS")