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

Skip to content

Commit 2a810fb

Browse files
committed
Trivial modifications (thou shalt not judge people by trivial commits)
1 parent 8f7a7be commit 2a810fb

18 files changed

Lines changed: 49 additions & 41 deletions

File tree

extra/shutils/newlines.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#! /usr/bin/env python
2+
3+
# Runs pylint on all python scripts found in a directory tree
4+
# Reference: http://rowinggolfer.blogspot.com/2009/08/pylint-recursively.html
5+
6+
import os
7+
import re
8+
import sys
9+
10+
def check(filepath):
11+
if filepath.endswith(".py"):
12+
content = open(filepath, "rb").read()
13+
#if re.search(r"\r?\n\r?\n", content):
14+
if "\n\n\n" in content:
15+
index = content.find("\n\n\n")
16+
print filepath, repr(content[index-30:index+30])
17+
18+
if __name__ == "__main__":
19+
try:
20+
BASE_DIRECTORY = sys.argv[1]
21+
except IndexError:
22+
print "no directory specified, defaulting to current working directory"
23+
BASE_DIRECTORY = os.getcwd()
24+
25+
print "looking for *.py scripts in subdirectories of ", BASE_DIRECTORY
26+
for root, dirs, files in os.walk(BASE_DIRECTORY):
27+
if any(_ in root for _ in ("extra", "thirdparty")):
28+
continue
29+
for name in files:
30+
filepath = os.path.join(root, name)
31+
check(filepath)

lib/controller/checks.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1562,7 +1562,6 @@ def checkConnection(suppressOutput=False):
15621562
else:
15631563
kb.errorIsNone = True
15641564

1565-
15661565
threadData = getCurrentThreadData()
15671566

15681567
if kb.redirectChoice == REDIRECTION.YES and threadData.lastRedirectURL and threadData.lastRedirectURL[0] == threadData.lastRequestUID:

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.5.0"
22+
VERSION = "1.2.5.1"
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)

lib/parse/headers.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
from lib.core.data import paths
1414
from lib.parse.handler import FingerprintHandler
1515

16-
1716
def headersParser(headers):
1817
"""
1918
This function calls a class that parses the input HTTP headers to

lib/request/connect.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ class WebSocketException(Exception):
120120
from thirdparty.odict.odict import OrderedDict
121121
from thirdparty.socks.socks import ProxyError
122122

123-
124123
class Connect(object):
125124
"""
126125
This class defines methods used to perform HTTP requests

lib/takeover/abstraction.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
from lib.takeover.web import Web
2828
from lib.takeover.xp_cmdshell import XP_cmdshell
2929

30-
3130
class Abstraction(Web, UDF, XP_cmdshell):
3231
"""
3332
This class defines an abstraction layer for OS takeover functionalities

lib/takeover/web.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
from lib.request.connect import Connect as Request
5454
from thirdparty.oset.pyoset import oset
5555

56-
5756
class Web:
5857
"""
5958
This class defines web-oriented OS takeover functionalities for

lib/techniques/dns/test.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
from lib.core.exception import SqlmapNotVulnerableException
1515
from lib.techniques.dns.use import dnsUse
1616

17-
1817
def dnsTest(payload):
1918
logger.info("testing for data retrieval through DNS channel")
2019

lib/techniques/dns/use.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
from lib.core.unescaper import unescaper
3434
from lib.request.connect import Connect as Request
3535

36-
3736
def dnsUse(payload, expression):
3837
"""
3938
Retrieve the output of a SQL query taking advantage of the DNS

lib/utils/api.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,7 @@ def execute(self, statement, arguments=None):
104104

105105
def init(self):
106106
self.execute("CREATE TABLE logs(id INTEGER PRIMARY KEY AUTOINCREMENT, taskid INTEGER, time TEXT, level TEXT, message TEXT)")
107-
108107
self.execute("CREATE TABLE data(id INTEGER PRIMARY KEY AUTOINCREMENT, taskid INTEGER, status INTEGER, content_type INTEGER, value TEXT)")
109-
110108
self.execute("CREATE TABLE errors(id INTEGER PRIMARY KEY AUTOINCREMENT, taskid INTEGER, error TEXT)")
111109

112110
class Task(object):
@@ -199,7 +197,6 @@ def engine_get_returncode(self):
199197
def engine_has_terminated(self):
200198
return isinstance(self.engine_get_returncode(), int)
201199

202-
203200
# Wrapper functions for sqlmap engine
204201
class StdDbOut(object):
205202
def __init__(self, taskid, messagetype="stdout"):
@@ -573,7 +570,6 @@ def scan_data(taskid):
573570
logger.debug("[%s] Retrieved scan data and error messages" % taskid)
574571
return jsonize({"success": True, "data": json_data_message, "error": json_errors_message})
575572

576-
577573
# Functions to handle scans' logs
578574
@get("/scan/<taskid>/log/<start>/<end>")
579575
def scan_log_limited(taskid, start, end):
@@ -601,7 +597,6 @@ def scan_log_limited(taskid, start, end):
601597
logger.debug("[%s] Retrieved scan log messages subset" % taskid)
602598
return jsonize({"success": True, "log": json_log_messages})
603599

604-
605600
@get("/scan/<taskid>/log")
606601
def scan_log(taskid):
607602
"""
@@ -621,7 +616,6 @@ def scan_log(taskid):
621616
logger.debug("[%s] Retrieved scan log messages" % taskid)
622617
return jsonize({"success": True, "log": json_log_messages})
623618

624-
625619
# Function to handle files inside the output directory
626620
@get("/download/<taskid>/<target>/<filename:path>")
627621
def download(taskid, target, filename):
@@ -648,7 +642,6 @@ def download(taskid, target, filename):
648642
logger.warning("[%s] File does not exist %s" % (taskid, target))
649643
return jsonize({"success": False, "message": "File does not exist"})
650644

651-
652645
def server(host=RESTAPI_DEFAULT_ADDRESS, port=RESTAPI_DEFAULT_PORT, adapter=RESTAPI_DEFAULT_ADAPTER, username=None, password=None):
653646
"""
654647
REST-JSON API server

0 commit comments

Comments
 (0)