mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-09 06:01:29 +00:00
Added resume functionality to -d and fixed logging with -d
This commit is contained in:
@@ -27,7 +27,8 @@ try:
|
||||
except:
|
||||
import md5
|
||||
import sha
|
||||
|
||||
|
||||
import pickle
|
||||
import sys
|
||||
import struct
|
||||
import urllib
|
||||
@@ -38,7 +39,13 @@ def base64decode(string):
|
||||
return string.decode("base64")
|
||||
|
||||
def base64encode(string):
|
||||
return string.encode("base64")[:-1]
|
||||
return string.encode("base64")[:-1].replace("\n", "")
|
||||
|
||||
def base64pickle(string):
|
||||
return base64encode(pickle.dumps(string))
|
||||
|
||||
def base64unpickle(string):
|
||||
return pickle.loads(base64decode(string))
|
||||
|
||||
def hexdecode(string):
|
||||
string = string.lower()
|
||||
|
||||
@@ -123,14 +123,14 @@ def __setOutputResume():
|
||||
if not conf.flushSession:
|
||||
readSessionFP = open(conf.sessionFile, "r")
|
||||
lines = readSessionFP.readlines()
|
||||
|
||||
|
||||
for line in lines:
|
||||
if line.count("][") == 4:
|
||||
line = line.split("][")
|
||||
|
||||
|
||||
if len(line) != 5:
|
||||
continue
|
||||
|
||||
|
||||
url, _, _, expression, value = line
|
||||
|
||||
if not value:
|
||||
@@ -141,10 +141,10 @@ def __setOutputResume():
|
||||
|
||||
if value[-1] == "\n":
|
||||
value = value[:-1]
|
||||
|
||||
if url != conf.url:
|
||||
|
||||
if url not in ( conf.url, conf.hostname ):
|
||||
continue
|
||||
|
||||
|
||||
if url not in kb.resumedQueries.keys():
|
||||
kb.resumedQueries[url] = {}
|
||||
kb.resumedQueries[url][expression] = value
|
||||
|
||||
Reference in New Issue
Block a user