@@ -767,7 +767,12 @@ def client(host=RESTAPI_DEFAULT_ADDRESS, port=RESTAPI_DEFAULT_PORT):
767767 logger .error ("Program arguments are missing" )
768768 continue
769769
770- argv = ["sqlmap.py" ] + shlex .split (command )[1 :]
770+ try :
771+ argv = ["sqlmap.py" ] + shlex .split (command )[1 :]
772+ except Exception , ex :
773+ logger .error ("Error occurred while parsing arguments ('%s')" % ex )
774+ taskid = None
775+ continue
771776
772777 try :
773778 cmdLineOptions = cmdLineParser (argv ).__dict__
@@ -819,18 +824,19 @@ def client(host=RESTAPI_DEFAULT_ADDRESS, port=RESTAPI_DEFAULT_PORT):
819824 return
820825
821826 elif command in ("help" , "?" ):
822- msg = "help Show this help message\n "
823- msg += "new ARGS Start a new scan task with provided arguments (e.g. 'new -u \" http://testphp.vulnweb.com/artists.php?artist=1\" ')\n "
824- msg += "use TASKID Switch current context to different task (e.g. 'use c04d8c5c7582efb4')\n "
825- msg += "data Retrieve and show data for current task\n "
826- msg += "log Retrieve and show log for current task\n "
827- msg += "status Retrieve and show status for current task\n "
828- msg += "option Retrieve and show options for current task\n "
829- msg += "stop Stop current task\n "
830- msg += "kill Kill current task\n "
831- msg += "list Display all tasks\n "
832- msg += "flush Flush tasks (delete all tasks)\n "
833- msg += "exit Exit this client\n "
827+ msg = "help Show this help message\n "
828+ msg += "new ARGS Start a new scan task with provided arguments (e.g. 'new -u \" http://testphp.vulnweb.com/artists.php?artist=1\" ')\n "
829+ msg += "use TASKID Switch current context to different task (e.g. 'use c04d8c5c7582efb4')\n "
830+ msg += "data Retrieve and show data for current task\n "
831+ msg += "log Retrieve and show log for current task\n "
832+ msg += "status Retrieve and show status for current task\n "
833+ msg += "option OPTION Retrieve and show option for current task\n "
834+ msg += "options Retrieve and show all options for current task\n "
835+ msg += "stop Stop current task\n "
836+ msg += "kill Kill current task\n "
837+ msg += "list Display all tasks\n "
838+ msg += "flush Flush tasks (delete all tasks)\n "
839+ msg += "exit Exit this client\n "
834840
835841 dataToStdout (msg )
836842
0 commit comments