Minor update

This commit is contained in:
Miroslav Stampar 2017-07-05 14:07:21 +02:00
parent d038d027f9
commit c9b3b47d6f
5 changed files with 25 additions and 7 deletions

View File

@ -1118,6 +1118,13 @@ def sanitizeStr(value):
return getUnicode(value).replace("\n", " ").replace("\r", "") return getUnicode(value).replace("\n", " ").replace("\r", "")
def getHeader(headers, key): def getHeader(headers, key):
"""
Returns header value ignoring the letter case
>>> getHeader({"Foo": "bar"}, "foo")
'bar'
"""
retVal = None retVal = None
for _ in (headers or {}): for _ in (headers or {}):
if _.upper() == key.upper(): if _.upper() == key.upper():
@ -1619,6 +1626,13 @@ def getRemoteIP():
return retVal return retVal
def getFileType(filePath): def getFileType(filePath):
"""
Returns "magic" file type for given file path
>>> getFileType(__file__)
'text'
"""
try: try:
_ = magic.from_file(filePath) _ = magic.from_file(filePath)
except: except:
@ -4387,6 +4401,9 @@ def getSafeExString(ex, encoding=None):
""" """
Safe way how to get the proper exception represtation as a string Safe way how to get the proper exception represtation as a string
(Note: errors to be avoided: 1) "%s" % Exception(u'\u0161') and 2) "%s" % str(Exception(u'\u0161')) (Note: errors to be avoided: 1) "%s" % Exception(u'\u0161') and 2) "%s" % str(Exception(u'\u0161'))
>>> getSafeExString(Exception('foobar'))
u'foobar'
""" """
retVal = ex retVal = ex

View File

@ -19,7 +19,7 @@ from lib.core.enums import DBMS_DIRECTORY_NAME
from lib.core.enums import OS from lib.core.enums import OS
# sqlmap version (<major>.<minor>.<month>.<monthly commit>) # sqlmap version (<major>.<minor>.<month>.<monthly commit>)
VERSION = "1.1.7.9" VERSION = "1.1.7.10"
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable" TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34} TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE) VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

View File

@ -13,6 +13,7 @@ import re
import StringIO import StringIO
import time import time
from lib.core.bigarray import BigArray
from lib.core.settings import VERSION from lib.core.settings import VERSION
# Reference: https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/HAR/Overview.html # Reference: https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/HAR/Overview.html
@ -27,7 +28,7 @@ class HTTPCollectorFactory:
class HTTPCollector: class HTTPCollector:
def __init__(self): def __init__(self):
self.messages = [] self.messages = BigArray()
def collectRequest(self, requestMessage, responseMessage, startTime=None, endTime=None): def collectRequest(self, requestMessage, responseMessage, startTime=None, endTime=None):
self.messages.append(RawPair(requestMessage, responseMessage, startTime, endTime)) self.messages.append(RawPair(requestMessage, responseMessage, startTime, endTime))

View File

@ -331,7 +331,7 @@ def main():
if conf.get("harFile"): if conf.get("harFile"):
with openFile(conf.harFile, "w+b") as f: with openFile(conf.harFile, "w+b") as f:
f.write(json.dumps(conf.httpCollector.obtain(), indent=4, separators=(',', ': '))) json.dump(conf.httpCollector.obtain(), fp=f, indent=4, separators=(',', ': '))
if cmdLineOptions.get("sqlmapShell"): if cmdLineOptions.get("sqlmapShell"):
cmdLineOptions.clear() cmdLineOptions.clear()

View File

@ -27,7 +27,7 @@ a97df93b552ee4e4ba3692eae870de7c lib/controller/handler.py
310efc965c862cfbd7b0da5150a5ad36 lib/controller/__init__.py 310efc965c862cfbd7b0da5150a5ad36 lib/controller/__init__.py
d58e85ffeac2471ef3af729076b3b5f7 lib/core/agent.py d58e85ffeac2471ef3af729076b3b5f7 lib/core/agent.py
6cc95a117fbd34ef31b9aa25520f0e31 lib/core/bigarray.py 6cc95a117fbd34ef31b9aa25520f0e31 lib/core/bigarray.py
ebf31aa9c5af54188e999719593e8ba4 lib/core/common.py 68dd8d8d430d6b569ec3210e87f4dce9 lib/core/common.py
5065a4242a8cccf72f91e22e1007ae63 lib/core/convert.py 5065a4242a8cccf72f91e22e1007ae63 lib/core/convert.py
a8143dab9d3a27490f7d49b6b29ea530 lib/core/data.py a8143dab9d3a27490f7d49b6b29ea530 lib/core/data.py
7936d78b1a7f1f008ff92bf2f88574ba lib/core/datatype.py 7936d78b1a7f1f008ff92bf2f88574ba lib/core/datatype.py
@ -46,7 +46,7 @@ b9ff4e622c416116bee6024c0f050349 lib/core/enums.py
d8e9250f3775119df07e9070eddccd16 lib/core/replication.py d8e9250f3775119df07e9070eddccd16 lib/core/replication.py
785f86e3f963fa3798f84286a4e83ff2 lib/core/revision.py 785f86e3f963fa3798f84286a4e83ff2 lib/core/revision.py
40c80b28b3a5819b737a5a17d4565ae9 lib/core/session.py 40c80b28b3a5819b737a5a17d4565ae9 lib/core/session.py
3f23a17e519b6334d343e57e0018efd1 lib/core/settings.py fa6387225fb4dd399abfcb77e5ef8b94 lib/core/settings.py
d91291997d2bd2f6028aaf371bf1d3b6 lib/core/shell.py d91291997d2bd2f6028aaf371bf1d3b6 lib/core/shell.py
2ad85c130cc5f2b3701ea85c2f6bbf20 lib/core/subprocessng.py 2ad85c130cc5f2b3701ea85c2f6bbf20 lib/core/subprocessng.py
4416fdcab26b286a5a3a88e75aa60044 lib/core/target.py 4416fdcab26b286a5a3a88e75aa60044 lib/core/target.py
@ -103,7 +103,7 @@ db3090ff9a740ba096ba676fcf44ebfc lib/techniques/union/use.py
c08d2487a53a1db8170178ebcf87c864 lib/utils/crawler.py c08d2487a53a1db8170178ebcf87c864 lib/utils/crawler.py
ba12c69a90061aa14d848b8396e79191 lib/utils/deps.py ba12c69a90061aa14d848b8396e79191 lib/utils/deps.py
3b9fd519164e0bf275d5fd361c3f11ff lib/utils/getch.py 3b9fd519164e0bf275d5fd361c3f11ff lib/utils/getch.py
1cd7599b5e6addb29cbab85d292ccf6c lib/utils/har.py 7143c26b3e18973bc5169c202b775245 lib/utils/har.py
ccfdad414ce2ec0c394c3deaa39a82bf lib/utils/hashdb.py ccfdad414ce2ec0c394c3deaa39a82bf lib/utils/hashdb.py
12e0e0ab70c6fe5786bc561c35dc067f lib/utils/hash.py 12e0e0ab70c6fe5786bc561c35dc067f lib/utils/hash.py
e76a08237ee6a4cd6855af79610ea8a5 lib/utils/htmlentities.py e76a08237ee6a4cd6855af79610ea8a5 lib/utils/htmlentities.py
@ -224,7 +224,7 @@ c3cc8b7727161e64ab59f312c33b541a shell/stager.aspx_
1f7f125f30e0e800beb21e2ebbab18e1 shell/stager.jsp_ 1f7f125f30e0e800beb21e2ebbab18e1 shell/stager.jsp_
01e3505e796edf19aad6a996101c81c9 shell/stager.php_ 01e3505e796edf19aad6a996101c81c9 shell/stager.php_
0751a45ac4c130131f2cdb74d866b664 sqlmapapi.py 0751a45ac4c130131f2cdb74d866b664 sqlmapapi.py
f53c10492a13c9f53024d8a963bd86a3 sqlmap.py b83d4f9b170014ff158f3caa7b735415 sqlmap.py
08c711a470d7e0bf705320ba3c48b886 tamper/apostrophemask.py 08c711a470d7e0bf705320ba3c48b886 tamper/apostrophemask.py
e8509df10d3f1c28014d7825562d32dd tamper/apostrophenullencode.py e8509df10d3f1c28014d7825562d32dd tamper/apostrophenullencode.py
bb27f7dc980ea07fcfedbd7da5e5e029 tamper/appendnullbyte.py bb27f7dc980ea07fcfedbd7da5e5e029 tamper/appendnullbyte.py