Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cdd4007

Browse files
committed
Fixes #3502
1 parent c89c1e7 commit cdd4007

4 files changed

Lines changed: 32 additions & 24 deletions

File tree

lib/core/enums.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,13 +156,17 @@ class HASH:
156156

157157
# Reference: http://www.zytrax.com/tech/web/mobile_ids.html
158158
class MOBILES:
159-
BLACKBERRY = ("BlackBerry 9900", "Mozilla/5.0 (BlackBerry; U; BlackBerry 9900; en) AppleWebKit/534.11+ (KHTML, like Gecko) Version/7.1.0.346 Mobile Safari/534.11+")
160-
GALAXY = ("Samsung Galaxy S", "Mozilla/5.0 (Linux; U; Android 2.2; en-US; SGH-T959D Build/FROYO) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1")
159+
BLACKBERRY = ("BlackBerry Z10", "Mozilla/5.0 (BB10; Kbd) AppleWebKit/537.35+ (KHTML, like Gecko) Version/10.3.3.2205 Mobile Safari/537.35+")
160+
GALAXY = ("Samsung Galaxy S7", "Mozilla/5.0 (Linux; Android 7.0; SM-G930V Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.125 Mobile Safari/537.36")
161161
HP = ("HP iPAQ 6365", "Mozilla/4.0 (compatible; MSIE 4.01; Windows CE; PPC; 240x320; HP iPAQ h6300)")
162-
HTC = ("HTC Sensation", "Mozilla/5.0 (Linux; U; Android 4.0.3; de-ch; HTC Sensation Build/IML74K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30")
163-
IPHONE = ("Apple iPhone 4s", "Mozilla/5.0 (iPhone; CPU iPhone OS 5_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9B179 Safari/7534.48.3")
162+
HTC = ("HTC 10", "Mozilla/5.0 (Linux; Android 8.0.0; HTC 10 Build/OPR1.170623.027) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Mobile Safari/537.36")
163+
HUAWEI = ("Huawei P8", "Mozilla/5.0 (Linux; Android 4.4.4; HUAWEI H891L Build/HuaweiH891L) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/33.0.0.0 Mobile Safari/537.36")
164+
IPHONE = ("Apple iPhone 8", "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1")
165+
LUMIA = ("Microsoft Lumia 950", "Mozilla/5.0 (Windows Phone 10.0; Android 6.0.1; Microsoft; Lumia 950) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Mobile Safari/537.36 Edge/15.14977")
164166
NEXUS = ("Google Nexus 7", "Mozilla/5.0 (Linux; Android 4.1.1; Nexus 7 Build/JRO03D) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Safari/535.19")
165167
NOKIA = ("Nokia N97", "Mozilla/5.0 (SymbianOS/9.4; Series60/5.0 NokiaN97-1/10.0.012; Profile/MIDP-2.1 Configuration/CLDC-1.1; en-us) AppleWebKit/525 (KHTML, like Gecko) WicKed/7.1.12344")
168+
PIXEL = ("Google Pixel", "Mozilla/5.0 (Linux; Android 8.0.0; Pixel Build/OPR3.170623.013) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.111 Mobile Safari/537.36")
169+
XIAOMI = ("Xiaomi Mi 3", "Mozilla/5.0 (Linux; U; Android 4.4.4; en-gb; MI 3W Build/KTU84P) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/39.0.0.0 Mobile Safari/537.36 XiaoMi/MiuiBrowser/2.1.1")
166170

167171
class PROXY_TYPE:
168172
HTTP = "HTTP"
@@ -381,4 +385,4 @@ class TIMEOUT_STATE:
381385

382386
class HINT:
383387
PREPEND = 0
384-
APPEND = 1
388+
APPEND = 1

lib/core/option.py

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,28 +1278,32 @@ def _setHTTPUserAgent():
12781278
file choosed as user option
12791279
"""
12801280

1281+
debugMsg = "setting the HTTP User-Agent header"
1282+
logger.debug(debugMsg)
1283+
12811284
if conf.mobile:
1282-
message = "which smartphone do you want sqlmap to imitate "
1283-
message += "through HTTP User-Agent header?\n"
1284-
items = sorted(getPublicTypeMembers(MOBILES, True))
1285+
if conf.randomAgent:
1286+
_ = random.sample([_[1] for _ in getPublicTypeMembers(MOBILES, True)], 1)[0]
1287+
conf.httpHeaders.append((HTTP_HEADER.USER_AGENT, _))
1288+
else:
1289+
message = "which smartphone do you want sqlmap to imitate "
1290+
message += "through HTTP User-Agent header?\n"
1291+
items = sorted(getPublicTypeMembers(MOBILES, True))
12851292

1286-
for count in xrange(len(items)):
1287-
item = items[count]
1288-
message += "[%d] %s%s\n" % (count + 1, item[0], " (default)" if item == MOBILES.IPHONE else "")
1293+
for count in xrange(len(items)):
1294+
item = items[count]
1295+
message += "[%d] %s%s\n" % (count + 1, item[0], " (default)" if item == MOBILES.IPHONE else "")
12891296

1290-
test = readInput(message.rstrip('\n'), default=items.index(MOBILES.IPHONE) + 1)
1297+
test = readInput(message.rstrip('\n'), default=items.index(MOBILES.IPHONE) + 1)
12911298

1292-
try:
1293-
item = items[int(test) - 1]
1294-
except:
1295-
item = MOBILES.IPHONE
1299+
try:
1300+
item = items[int(test) - 1]
1301+
except:
1302+
item = MOBILES.IPHONE
12961303

1297-
conf.httpHeaders.append((HTTP_HEADER.USER_AGENT, item[1]))
1304+
conf.httpHeaders.append((HTTP_HEADER.USER_AGENT, item[1]))
12981305

12991306
elif conf.agent:
1300-
debugMsg = "setting the HTTP User-Agent header"
1301-
logger.debug(debugMsg)
1302-
13031307
conf.httpHeaders.append((HTTP_HEADER.USER_AGENT, conf.agent))
13041308

13051309
elif not conf.randomAgent:

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from lib.core.enums import OS
2020

2121
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
22-
VERSION = "1.3.2.33"
22+
VERSION = "1.3.3.0"
2323
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2424
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2525
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

txt/checksum.md5

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,19 @@ abcb1121eb56d3401839d14e8ed06b6e lib/core/data.py
3838
5f4680b769ae07f22157bd832c97cf8f lib/core/defaults.py
3939
9dfc69ba47209a4ceca494dde9ee8183 lib/core/dicts.py
4040
4ba141124699fd7a763dea82f17fe523 lib/core/dump.py
41-
5c91145204092b995ed1ac641e9e291d lib/core/enums.py
41+
0a49eaf3f940382464ee08c03c9891a8 lib/core/enums.py
4242
84ef8f32e4582fcc294dc14e1997131d lib/core/exception.py
4343
fb6be55d21a70765e35549af2484f762 lib/core/__init__.py
4444
18c896b157b03af716542e5fe9233ef9 lib/core/log.py
4545
151136142a14bee82cb02a9ca64c741d lib/core/optiondict.py
46-
fca2d30cc9f9f5906e53542b2a9c247e lib/core/option.py
46+
7f9d7b65f2278e5d233008a8bdd22c87 lib/core/option.py
4747
fe370021c6bc99daf44b2bfc0d1effb3 lib/core/patch.py
4848
4b12aa67fbf6c973d12e54cf9cb54ea0 lib/core/profiling.py
4949
d5ef43fe3cdd6c2602d7db45651f9ceb lib/core/readlineng.py
5050
7d8a22c582ad201f65b73225e4456170 lib/core/replication.py
5151
3179d34f371e0295dd4604568fb30bcd lib/core/revision.py
5252
d6269c55789f78cf707e09a0f5b45443 lib/core/session.py
53-
7992ca5bdf434688788659bbd586b4fc lib/core/settings.py
53+
dd5a87792c98d150cd5d9c85bc086d13 lib/core/settings.py
5454
4483b4a5b601d8f1c4281071dff21ecc lib/core/shell.py
5555
10fd19b0716ed261e6d04f311f6f527c lib/core/subprocessng.py
5656
43772ea73e9e3d446f782af591cb4eda lib/core/target.py

0 commit comments

Comments
 (0)