File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -404,7 +404,7 @@ def filePathToString(filePath):
404404 return strRepl
405405
406406def dataToStdout (data , forceOutput = False ):
407- if conf .verbose > 0 or forceOutput :
407+ if forceOutput or conf .verbose > 0 :
408408 try :
409409 sys .stdout .write (data )
410410 sys .stdout .flush ()
@@ -569,10 +569,12 @@ def banner():
569569 This function prints sqlmap banner with its version
570570 """
571571
572- print """
572+ ban = """
573573 %s - %s
574- %s
575- """ % (VERSION_STRING , DESCRIPTION , SITE )
574+ %s\n
575+ """ % (VERSION_STRING , DESCRIPTION , SITE )
576+
577+ dataToStdout (ban , forceOutput = True )
576578
577579def parsePasswordHash (password ):
578580 blank = " " * 8
Original file line number Diff line number Diff line change 2424from subprocess import PIPE
2525from subprocess import Popen as execute
2626
27- from lib .core .common import getUnicode
2827from lib .core .common import dataToStdout
28+ from lib .core .common import getUnicode
2929from lib .core .common import pollProcess
3030from lib .core .common import readInput
3131from lib .core .data import conf
@@ -209,7 +209,7 @@ def notify(event_dict):
209209 return
210210
211211 if action .find ('_completed' ) == - 1 :
212- print "%s\t %s" % (prefix , event_dict ['path' ])
212+ dataToStdout ( "%s\t %s\n " % (prefix , event_dict ['path' ]) )
213213 else :
214214 revision = getUnicode (event_dict ['revision' ])
215215 index = revision .find ('number ' )
Original file line number Diff line number Diff line change 77See the file 'doc/COPYING' for copying permission
88"""
99
10+ from lib .core .common import dataToStdout
1011from lib .core .common import readInput
1112from lib .core .data import conf
1213from lib .core .data import kb
@@ -76,7 +77,7 @@ def runCmd(self, cmd):
7677 if output :
7778 conf .dumper .string ("command standard output" , output )
7879 else :
79- print "No output"
80+ dataToStdout ( "No output\n " )
8081 else :
8182 self .execCmd (cmd , forgeCmd = True )
8283
Original file line number Diff line number Diff line change 1010import os
1111
1212from lib .core .agent import agent
13+ from lib .core .common import dataToStdout
1314from lib .core .common import readInput
1415from lib .core .convert import urlencode
1516from lib .core .data import conf
@@ -360,7 +361,7 @@ def udfInjectCustom(self):
360361 if output :
361362 conf .dumper .string ("return value" , output )
362363 else :
363- print "No return value"
364+ dataToStdout ( "No return value\n " )
364365 else :
365366 self .udfExecCmd (cmd , udfName = udfToCall , silent = True )
366367
Original file line number Diff line number Diff line change @@ -1769,4 +1769,4 @@ def sqlShell(self):
17691769 pass
17701770
17711771 elif output != "Quit" :
1772- print "No output"
1772+ dataToStdout ( "No output\n " )
Original file line number Diff line number Diff line change 2525
2626from lib .controller .controller import start
2727from lib .core .common import banner
28+ from lib .core .common import dataToStdout
2829from lib .core .common import getUnicode
2930from lib .core .common import setPaths
3031from lib .core .common import weAreFrozen
@@ -64,7 +65,7 @@ def main():
6465 banner ()
6566 cmdLineOptions = cmdLineParser ()
6667
67- print "[*] starting at: %s\n " % time .strftime ("%X" )
68+ dataToStdout ( "[*] starting at: %s\n \n " % time .strftime ("%X" ), forceOutput = True )
6869
6970 try :
7071 init (cmdLineOptions )
@@ -112,7 +113,7 @@ def main():
112113 else :
113114 closeDumper (True )
114115
115- print "\n [*] shutting down at: %s\n " % time .strftime ("%X" )
116+ dataToStdout ( "\n [*] shutting down at: %s\n \n " % time .strftime ("%X" ), forceOutput = True )
116117
117118if __name__ == "__main__" :
118119 main ()
You can’t perform that action at this time.
0 commit comments