Skip to content

Commit 315a792

Browse files
committedNov 16, 2019
VULNX_MODE:add dorks functionnality
1 parent 6e4c918 commit 315a792

File tree

1 file changed

+53
-25
lines changed

1 file changed

+53
-25
lines changed
 

‎cli.py

+53-25
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
'Connection': 'keep-alive',}
3333

3434
history = []
35-
35+
numberpage=1
36+
output_dir='logs'
3637
variables = {
3738
"URL":'',
3839
"TIMEOUT":'',
@@ -63,7 +64,7 @@
6364

6465
class Cli():
6566
#banner_function
66-
banner()
67+
6768

6869
def __runExploits(self,url,headers):
6970
wp_wysija(url,headers,vulnresults)
@@ -121,10 +122,10 @@ def _dorks_action_help():
121122
Command Description
122123
-------- -------------
123124
? \t\tHelp menu
124-
list \t\tset timeout
125-
use \t\tscan ports
126-
num page \t\tget domains & sub domains
127-
run \t\tget cms info (version , user ..)
125+
list \t\tlist dorks
126+
set dork \t\tset exploit name
127+
num page \t\tset num page
128+
run \t\tsearch web with specified dork
128129
back \t\tmove back from current context
129130
""")
130131

@@ -133,30 +134,64 @@ def _clearscreen():
133134
return os.system('clear')
134135

135136
@staticmethod
136-
def _generalCLI(url):
137-
regex=r'^set url (.+)'
138-
url=re.search(re.compile(regex),url).group(1)
137+
def getDork(pattern):
138+
dork_search=r'^set dork (.+)'
139+
dork=re.search(re.compile(dork_search),pattern).group(1)
140+
if dork:
141+
return dork
142+
143+
@property
144+
def getUrl(self,pattern):
145+
url_search=r'^set url (.+)'
146+
147+
url=re.search(re.compile(url_search),pattern).group(1)
148+
139149
if url:
140150
return url#ParseURL(url)
141151
else:
142152
print("need (help) (?)")
153+
143154

144-
def send_commands(self,cmd):
145-
regxpr=re.compile(r'^set url')
155+
def setdorkCLI(self,cmd_interpreter):
156+
while True:
157+
dorkname=re.compile(r'^set dork')
158+
cmd_interpreter=input("%s%svulnx%s%s (%sDorks%s)> %s" %(bannerblue2,W_UL,end,W,B,W,end))
159+
if cmd_interpreter == 'back':
160+
break
161+
if cmd_interpreter == 'list':
162+
print('\n%s[*]%s Listing dorks name..' %(B,end))
163+
from modules.dorksEngine import DorkList as DL
164+
DL.dorkslist()
165+
elif dorkname.search(cmd_interpreter):
166+
while True:
167+
cmd_interpreter_wp=input("%s%svulnx%s%s (%sDorks-%s%s)> %s" %(bannerblue2,W_UL,end,W,B,Cli.getDork(cmd_interpreter),W,end))
168+
if cmd_interpreter_wp=='run':
169+
print('\n')
170+
from modules.dorksEngine import Dorks as D
171+
D.searchengine(Cli.getDork(cmd_interpreter),headers,output_dir,numberpage)
172+
if cmd_interpreter_wp=='back':
173+
break
174+
if cmd_interpreter == 'help' or cmd_interpreter == '?':
175+
self._dorks_action_help()
146176

177+
def send_commands(self,cmd):
178+
reurl=re.compile(r'^set url')
179+
redork=re.compile(r'^dork')
147180
while True:
148181
cmd = input("%s%svulnx%s > "% (bannerblue2,W_UL,end))
149182
dork_command="dorks"
150183

151-
if regxpr.search(cmd):
152-
# url target
184+
if reurl.search(cmd):
185+
186+
#url session
187+
153188
while True:
154-
cmd_interpreter=input("%s%svulnx%s%s target(%s%s%s) > %s" %(bannerblue2,W_UL,end,W,R,Cli._generalCLI(cmd),W,end))
189+
cmd_interpreter=input("%s%svulnx%s%s target(%s%s%s) > %s" %(bannerblue2,W_UL,end,W,R,self.getUrl(cmd),W,end))
155190
if cmd_interpreter == 'back':
156191
break
157192
elif cmd_interpreter == 'run exploit':
158193
print('\n%s[*]%s Running exploits..' %(B,end))
159-
root = Cli._generalCLI(cmd)
194+
root = self.getUrl(cmd)
160195
if root.startswith('http'):
161196
url_root = root
162197
else:
@@ -168,16 +203,9 @@ def send_commands(self,cmd):
168203
sys.exit()
169204
else:
170205
print("you mean (cms info) or (web info) show more use help ?")
171-
elif cmd == dork_command:
172-
173-
while True:
174-
cmd_interpreter=input("%svulnx (%sDorks%s)> %s" %(W,B,W,end))
175-
if cmd_interpreter == 'back':
176-
break
177-
if cmd_interpreter == 'run exploit':
178-
print('\n%s[*]%s Running exploits..' %(B,end))
179-
if cmd_interpreter == 'help' or cmd_interpreter == '?':
180-
self._dorks_action_help()
206+
elif redork.search(cmd):
207+
#dork session
208+
self.setdorkCLI(cmd)
181209
elif cmd == 'quit' or cmd == 'exit':
182210
sys.exit()
183211
elif cmd == 'help' or cmd == '?':

0 commit comments

Comments
 (0)
Please sign in to comment.