@@ -166,71 +166,6 @@ def _thread():
166166
167167 return retVal
168168
169- def fuzzTest ():
170- count = 0
171- address , port = "127.0.0.10" , random .randint (1025 , 65535 )
172-
173- def _thread ():
174- vulnserver .init (quiet = True )
175- vulnserver .run (address = address , port = port )
176-
177- thread = threading .Thread (target = _thread )
178- thread .daemon = True
179- thread .start ()
180-
181- while True :
182- s = socket .socket (socket .AF_INET , socket .SOCK_STREAM )
183- try :
184- s .connect ((address , port ))
185- break
186- except :
187- time .sleep (1 )
188-
189- handle , config = tempfile .mkstemp (suffix = ".conf" )
190- os .close (handle )
191-
192- url = "http://%s:%d/?id=1" % (address , port )
193-
194- content = open (os .path .abspath (os .path .join (os .path .dirname (__file__ ), ".." , ".." , "sqlmap.conf" ))).read ().replace ("url =" , "url = %s" % url )
195- open (config , "w+" ).write (content )
196-
197- while True :
198- lines = content .split ("\n " )
199-
200- for i in xrange (20 ):
201- j = random .randint (0 , len (lines ) - 1 )
202-
203- if any (_ in lines [j ] for _ in ("googleDork" ,)):
204- continue
205-
206- if re .search (r"= (True|False)" , lines [j ]):
207- lines [j ] = lines [j ].replace (" = False" , " = True" )
208- continue
209-
210- if lines [j ].strip ().endswith ('=' ):
211- lines [j ] += random .sample (("True" , "False" , randomStr (), str (randomInt ())), 1 )[0 ]
212-
213- k = random .randint (0 , len (lines ) - 1 )
214- if '=' in lines [k ] and not re .search (r"= (True|False)" , lines [k ]):
215- lines [k ] += chr (random .randint (0 , 255 ))
216-
217- open (config , "w+" ).write ("\n " .join (lines ))
218-
219- cmd = "%s %s -c %s --non-interactive --answers='Github=n' --flush-session --technique=%s --banner" % (sys .executable , os .path .abspath (os .path .join (os .path .dirname (__file__ ), ".." , ".." , "sqlmap.py" )), config , random .sample ("BEUQ" , 1 )[0 ])
220- output = shellExec (cmd )
221-
222- if "Traceback" in output :
223- dataToStdout ("---\n \n $ %s\n " % cmd )
224- dataToStdout ("%s---\n " % output , coloring = False )
225-
226- handle , config = tempfile .mkstemp (prefix = "sqlmapcrash" , suffix = ".conf" )
227- os .close (handle )
228- open (config , "w+" ).write ("\n " .join (lines ))
229- else :
230- dataToStdout ("\r %d\r " % count )
231-
232- count += 1
233-
234169def smokeTest ():
235170 """
236171 Runs the basic smoke testing of a program
0 commit comments