File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88import codecs
99import os
1010import random
11+ import re
12+ import sys
1113
1214import lib .controller .checks
1315import lib .core .common
3032from lib .core .compat import xrange
3133from lib .core .convert import stdoutEncode
3234from lib .core .data import conf
35+ from lib .core .enums import PLACE
3336from lib .core .option import _setHTTPHandlers
3437from lib .core .option import setVerbosity
3538from lib .core .settings import IS_WIN
@@ -77,6 +80,10 @@ def _(self, *args):
7780 # to prevent too much "guessing" in case of binary data retrieval
7881 thirdparty .chardet .universaldetector .MINIMUM_THRESHOLD = 0.90
7982
83+ match = re .search (r" --method[= ](\w+)" , " " .join (sys .argv ))
84+ if match and match .group (1 ).upper () != PLACE .POST :
85+ PLACE .CUSTOM_POST = PLACE .CUSTOM_POST .replace ("POST" , "%s (body)" % match .group (1 ))
86+
8087 # https://github.com/sqlmapproject/sqlmap/issues/4314
8188 try :
8289 os .urandom (1 )
Original file line number Diff line number Diff line change 1818from thirdparty .six import unichr as _unichr
1919
2020# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
21- VERSION = "1.4.12.21 "
21+ VERSION = "1.4.12.22 "
2222TYPE = "dev" if VERSION .count ('.' ) > 2 and VERSION .split ('.' )[- 1 ] != '0' else "stable"
2323TYPE_COLORS = {"dev" : 33 , "stable" : 90 , "pip" : 34 }
2424VERSION_STRING = "sqlmap/%s#%s" % ('.' .join (VERSION .split ('.' )[:- 1 ]) if VERSION .count ('.' ) > 2 and VERSION .split ('.' )[- 1 ] == '0' else VERSION , TYPE )
Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ class WebSocketException(Exception):
6464from lib .core .convert import getBytes
6565from lib .core .convert import getText
6666from lib .core .convert import getUnicode
67+ from lib .core .data import cmdLineOptions
6768from lib .core .data import conf
6869from lib .core .data import kb
6970from lib .core .data import logger
@@ -520,9 +521,9 @@ class _(dict):
520521
521522 logger .log (CUSTOM_LOGGING .TRAFFIC_OUT , requestMsg )
522523 else :
523- if method and method not in (HTTPMETHOD .GET , HTTPMETHOD .POST ):
524+ if target and cmdLineOptions . method or method and method not in (HTTPMETHOD .GET , HTTPMETHOD .POST ):
524525 req = MethodRequest (url , post , headers )
525- req .set_method (method )
526+ req .set_method (cmdLineOptions . method or method )
526527 elif url is not None :
527528 req = _urllib .request .Request (url , post , headers )
528529 else :
You can’t perform that action at this time.
0 commit comments