Skip to content

Commit 037db0f

Browse files
committed
Fixes #3381
1 parent 3f1bf74 commit 037db0f

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

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.2.11.14"
22+
VERSION = "1.2.11.15"
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)

plugins/generic/takeover.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import os
99

1010
from lib.core.common import Backend
11+
from lib.core.common import getSafeExString
1112
from lib.core.common import isStackingAvailable
1213
from lib.core.common import readInput
1314
from lib.core.common import runningAsAdmin
@@ -20,6 +21,7 @@
2021
from lib.core.exception import SqlmapMissingMandatoryOptionException
2122
from lib.core.exception import SqlmapMissingPrivileges
2223
from lib.core.exception import SqlmapNotVulnerableException
24+
from lib.core.exception import SqlmapSystemException
2325
from lib.core.exception import SqlmapUndefinedMethod
2426
from lib.core.exception import SqlmapUnsupportedDBMSException
2527
from lib.takeover.abstraction import Abstraction
@@ -132,12 +134,16 @@ def osPwn(self):
132134
errMsg += "http://code.google.com/p/impacket/downloads/list"
133135
raise SqlmapMissingDependence(errMsg)
134136

135-
sysIgnoreIcmp = "/proc/sys/net/ipv4/icmp_echo_ignore_all"
137+
filename = "/proc/sys/net/ipv4/icmp_echo_ignore_all"
136138

137-
if os.path.exists(sysIgnoreIcmp):
138-
fp = open(sysIgnoreIcmp, "wb")
139-
fp.write("1")
140-
fp.close()
139+
if os.path.exists(filename):
140+
try:
141+
with open(filename, "wb") as f:
142+
f.write("1")
143+
except IOError, ex:
144+
errMsg = "there has been a file opening/writing error "
145+
errMsg += "for filename '%s' ('%s')" % (filename, getSafeExString(ex))
146+
raise SqlmapSystemException(errMsg)
141147
else:
142148
errMsg = "you need to disable ICMP replies by your machine "
143149
errMsg += "system-wide. For example run on Linux/Unix:\n"

txt/checksum.md5

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ c8c386d644d57c659d74542f5f57f632 lib/core/patch.py
4949
0c3eef46bdbf87e29a3f95f90240d192 lib/core/replication.py
5050
a7db43859b61569b601b97f187dd31c5 lib/core/revision.py
5151
fcb74fcc9577523524659ec49e2e964b lib/core/session.py
52-
668bbf57ac4603b3adf6308646c719dc lib/core/settings.py
52+
95c2d218452e270a1a84849448d69110 lib/core/settings.py
5353
a971ce157d04de96ba6e710d3d38a9a8 lib/core/shell.py
5454
a7edc9250d13af36ac0108f259859c19 lib/core/subprocessng.py
5555
721198b5be72c8015a02acb116532a1f lib/core/target.py
@@ -222,7 +222,7 @@ f5d5419efddfe04648ea5e953c650793 plugins/generic/fingerprint.py
222222
f7874230e5661910d5fd21544c7d1022 plugins/generic/misc.py
223223
30b421f06dc98998ddc1923a9048b7fc plugins/generic/search.py
224224
a70cc0ada4b0cc9e7df23cb6d48a4a0c plugins/generic/syntax.py
225-
a37c21cc3fa5c0c220d33d450bf503ed plugins/generic/takeover.py
225+
f990d799e578dfbc3cde5728655a7854 plugins/generic/takeover.py
226226
1265241e309da72bb82c3863a4c1b4bd plugins/generic/users.py
227227
1e5532ede194ac9c083891c2f02bca93 plugins/__init__.py
228228
5dc693e22f5d020c5c568d7325bd4226 shell/backdoors/backdoor.asp_

0 commit comments

Comments
 (0)