Skip to content

Commit 7e675fe

Browse files
committed
1 parent 5bf52c3 commit 7e675fe

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

lib/core/patch.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
import codecs
99
import os
1010
import random
11+
import re
12+
import sys
1113

1214
import lib.controller.checks
1315
import lib.core.common
@@ -30,6 +32,7 @@
3032
from lib.core.compat import xrange
3133
from lib.core.convert import stdoutEncode
3234
from lib.core.data import conf
35+
from lib.core.enums import PLACE
3336
from lib.core.option import _setHTTPHandlers
3437
from lib.core.option import setVerbosity
3538
from 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)

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from 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"
2222
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2323
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2424
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

lib/request/connect.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ class WebSocketException(Exception):
6464
from lib.core.convert import getBytes
6565
from lib.core.convert import getText
6666
from lib.core.convert import getUnicode
67+
from lib.core.data import cmdLineOptions
6768
from lib.core.data import conf
6869
from lib.core.data import kb
6970
from 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:

0 commit comments

Comments
 (0)