forked from hash3liZer/Subrake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pull.py
executable file
·206 lines (174 loc) · 5.36 KB
/
pull.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
import sys
import os
import random
__logo__ = """%s
______ _____ ______
/_/_/__/ | | \\ \ | | | /
\______ |___ |__\\_/ __ | / |____\\
_____\ | | |\\ || / /\\ \ | / | /
/_/_/_/ |__| |_\\_|| \_ \_\\/_/| \\_/\\|_|__\\
%s
%sv1.0. @hash3liZer%s
"""
__help__ = """
Description:
A subdomain Enumeration tool for identifying subdomains, their response codes on HTTP and HTTPS, Possible used server using headers and CNAMES of identified subdomains.
Syntax:
$ python subrake -d shellvoide.com -w [ Sublister Output ]
$ python subrake -d shellvoide.com -d shellvoide.com --wordlist wordlist/small.lst --filter --csv output.csv
Options:
Args Description Default
-h, --help Show this manual NONE
-d, --domain Target domain. Possible
example: [example.com] NONE
-w, --wordlists Wordlists containing subdomains
to test. Multiple wordlists can
be specified. NONE
-t, --threads Number of threads to spawn 25
-o, --output Store output in a seperate file NONE
-c, --csv Store output in CSV format NONE
-p, --ports Comma-seperated ports to scan. NONE
Depends on --scan-ports.
-s, --search Search for subdomains Online FALSE
--filter Filter subdomains with same IP FALSE
--subs Store Validated Subdomains in a
seperate file NONE
--scan-ports Turns on the port scanning
feature FALSE
"""
class PULLY:
LFLUSH = ">"
WHITE = '\033[0m'
PURPLE = '\033[95m'
CYAN = '\033[96m'
DARKCYAN = '\033[36m'
BLUE = '\033[94m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
RED = '\033[91m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
END = '\033[0m'
LINEUP = '\033[F'
MIXTURE = {
'WHITE': '\033[0m',
'PURPLE': '\033[95m',
'CYAN': '\033[96m',
'DARKCYAN': '\033[36m',
'BLUE': '\033[94m',
'GREEN': '\033[92m',
'YELLOW': '\033[93m',
'RED': '\033[91m',
'BOLD': '\033[1m',
'UNDERLINE': '\033[4m',
'END': '\033[0m',
'LINEUP': '\033[F'
}
VACANT = {
'WHITE': '',
'PURPLE': '',
'CYAN': '',
'DARKCYAN': '',
'BLUE': '',
'GREEN': '',
'YELLOW': '',
'RED': '',
'BOLD': '',
'UNDERLINE': '',
'END': '',
'LINEUP': ''
}
def __init__(self):
if not self.support_colors:
self.win_colors()
def support_colors(self):
plat = sys.platform
supported_platform = plat != 'Pocket PC' and (plat != 'win32' or \
'ANSICON' in os.environ)
is_a_tty = hasattr(sys.stdout, 'isatty') and sys.stdout.isatty()
if not supported_platform or not is_a_tty:
return False
return True
def win_colors(self):
self.WHITE = ''
self.PURPLE = ''
self.CYAN = ''
self.DARKCYAN = ''
self.BLUE = ''
self.GREEN = ''
self.YELLOW = ''
self.RED = ''
self.BOLD = ''
self.UNDERLINE = ''
self.END = ''
self.MIXTURE = {
'WHITE': '',
'PURPLE': '',
'CYAN': '',
'DARKCYAN': '',
'BLUE': '',
'GREEN': '',
'YELLOW': '',
'RED': '',
'BOLD': '',
'UNDERLINE': '',
'END': '',
'LINEUP': ''
}
for (key, val) in self.MIXTURE.items():
self.MIXTURE[ key ] = ''
def gthen(self, _tshow, cc='', *colors):
for color in colors:
cc += color
print "%s[>]%s %s" % ( cc, self.END, _tshow )
def lthen(self, _tshow, cc='', *colors):
for color in colors:
cc += color
print "%s[<]%s %s" % ( cc, self.END, _tshow )
def brick(self, _tshow, cc='', *colors):
for color in colors:
cc += color
sys.exit( "%s[~]%s %s" % ( cc, self.END, _tshow ) )
def slasher(self, _tshow, cc='', *colors):
for color in colors:
cc += color
print " %s-%s %s" % ( cc, self.END, _tshow )
def lflush(self, _tshow, cc='', *colors):
for color in colors:
cc += color
sys.stdout.write( "%s[%s]%s %s\r" % ( cc, self.LFLUSH, self.END, _tshow ) )
if self.LFLUSH == ">":
self.LFLUSH = "<"
elif self.LFLUSH == "<":
self.LFLUSH = ">"
def psheada(self, color, **headfms):
rs = headfms[ 'rs' ] # Resolution
cd = headfms[ 'cd' ] # Codes
sv = headfms[ 'sv' ] # Server
sb = headfms[ 'sb' ] # Subdomain
print color + rs.format( "RESOLUTION" ) + cd.format( "[HTTP/HTTPS]" ) + sb.format( "SUBOMAIN" ) + sv.format( "SERVER" ) + self.END
def psrowa(self, color, **rowhvals):
rsv = rowhvals[ 'rsv' ]
cdv = rowhvals[ 'cdv' ]
svv = rowhvals[ 'svv' ]
sbv = rowhvals[ 'sbv' ]
print rsv + cdv + sbv + svv
def psheadb(self, color, **headfms):
cdh = headfms[ 'cdh' ]
sbh = headfms[ 'sbh' ]
pth = headfms[ 'pth' ]
cnh = headfms[ 'cnh' ]
print color + cdh.format( "[HTTP/HTTPS]" ) + sbh.format( "SUBDOMAIN" ) + pth.format( "PORTS" ) + cnh.format( "CNAME" ) + self.END
def psrowb(self, color, **rowfms):
cdv = rowfms[ 'cdv' ]
sbv = rowfms[ 'sbv' ]
ptv = rowfms[ 'ptv' ]
cnv = rowfms[ 'cnv' ]
print cdv + sbv + ptv + cnv
def linebreak(self, _num = 1):
sys.stdout.write( "\n" * _num )
def logo(self):
_tochoose = [self.BLUE, self.YELLOW, self.RED, self.DARKCYAN, self.GREEN]
print __logo__ % (self.BOLD + random.choice(_tochoose), self.END, self.BOLD, self.END)
def help(self):
print __help__