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

Skip to content

Commit 75e6d77

Browse files
committed
Minor refactoring
1 parent fbaeecd commit 75e6d77

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

lib/request/direct.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from lib.core.data import kb
2222
from lib.core.data import logger
2323
from lib.core.dicts import SQL_STATEMENTS
24+
from lib.core.enums import CUSTOM_LOGGING
2425
from lib.core.enums import DBMS
2526
from lib.core.enums import EXPECTED
2627
from lib.core.settings import UNICODE_ENCODING
@@ -44,7 +45,7 @@ def direct(query, content=True):
4445
if select and not query.upper().startswith("SELECT "):
4546
query = "SELECT %s" % query
4647

47-
logger.log(9, query)
48+
logger.log(CUSTOM_LOGGING.PAYLOAD, query)
4849

4950
output = hashDBRetrieve(query, True, True)
5051
start = time.time()

lib/utils/google.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from lib.core.common import urlencode
1717
from lib.core.data import conf
1818
from lib.core.data import logger
19+
from lib.core.enums import CUSTOM_LOGGING
1920
from lib.core.exception import SqlmapConnectionException
2021
from lib.core.exception import SqlmapGenericException
2122
from lib.core.settings import GOOGLE_REGEX
@@ -67,7 +68,7 @@ def search(self, dork):
6768

6869
requestMsg = "HTTP request:\nGET %s" % url
6970
requestMsg += " %s" % httplib.HTTPConnection._http_vsn_str
70-
logger.log(8, requestMsg)
71+
logger.log(CUSTOM_LOGGING.TRAFFIC_OUT, requestMsg)
7172

7273
page = conn.read()
7374
code = conn.code
@@ -82,7 +83,7 @@ def search(self, dork):
8283
elif conf.verbose > 4:
8384
responseMsg += "%s\n%s\n" % (responseHeaders, page)
8485

85-
logger.log(7, responseMsg)
86+
logger.log(CUSTOM_LOGGING.TRAFFIC_IN, responseMsg)
8687
except urllib2.HTTPError, e:
8788
try:
8889
page = e.read()

lib/utils/timeout.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import threading
99

1010
from lib.core.data import logger
11+
from lib.core.enums import CUSTOM_LOGGING
1112

1213
def timeout(func, args=(), kwargs={}, duration=1, default=None):
1314
class InterruptableThread(threading.Thread):
@@ -19,7 +20,7 @@ def run(self):
1920
try:
2021
self.result = func(*args, **kwargs)
2122
except Exception, msg:
22-
logger.log(7, msg)
23+
logger.log(CUSTOM_LOGGING.TRAFFIC_IN, msg)
2324
self.result = default
2425

2526
thread = InterruptableThread()

0 commit comments

Comments
 (0)