| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -18,15 +18,15 @@ def check(module): | |||
| 18 | 18 | if module[-3:] == ".py": | |
| 19 | 19 | ||
| 20 | 20 | print "CHECKING ", module | |
| 21 | - pout = os.popen('pylint --rcfile=/dev/null %s'% module, 'r') | ||
| 21 | + pout = os.popen("pylint --rcfile=/dev/null %s" % module, 'r') | ||
| 22 | 22 | for line in pout: | |
| 23 | 23 | if re.match("E....:.", line): | |
| 24 | 24 | print line | |
| 25 | 25 | if __RATING__ and "Your code has been rated at" in line: | |
| 26 | - print line | ||
| 27 | - score = re.findall("\d.\d\d", line)[0] | ||
| 28 | - total += float(score) | ||
| 29 | - count += 1 | ||
| 26 | + print line | ||
| 27 | + score = re.findall("\d.\d\d", line)[0] | ||
| 28 | + total += float(score) | ||
| 29 | + count += 1 | ||
| 30 | 30 | ||
| 31 | 31 | if __name__ == "__main__": | |
| 32 | 32 | try: | |
@@ -46,5 +46,5 @@ def check(module): | |||
| 46 | 46 | ||
| 47 | 47 | if __RATING__: | |
| 48 | 48 | print "==" * 50 | |
| 49 | - print "%d modules found"% count | ||
| 50 | - print "AVERAGE SCORE = %.02f"% (total / count) | ||
| 49 | + print "%d modules found" % count | ||
| 50 | + print "AVERAGE SCORE = %.02f" % (total / count) | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,7 +20,7 @@ | |||
| 20 | 20 | TABLES_FILE = 'tables.txt' | |
| 21 | 21 | USER_AGENT = 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; AskTB5.3)' | |
| 22 | 22 | SEARCH_URL = 'http://www.google.com/m?source=mobileproducts&dc=gorganic' | |
| 23 | - MAX_FILE_SIZE = 2 * 1024 * 1024 # if a result (.sql) file for downloading is more than 2MB in size just skip it | ||
| 23 | + MAX_FILE_SIZE = 2 * 1024 * 1024 # if a result (.sql) file for downloading is more than 2MB in size just skip it | ||
| 24 | 24 | QUERY = 'CREATE TABLE ext:sql' | |
| 25 | 25 | REGEX_URLS = r';u=([^"]+?)&q=' | |
| 26 | 26 | REGEX_RESULT = r'(?i)CREATE TABLE\s*(/\*.*\*/)?\s*(IF NOT EXISTS)?\s*(?P<result>[^\(;]+)' | |
@@ -33,7 +33,7 @@ def main(): | |||
| 33 | 33 | opener.addheaders = [("User-Agent", USER_AGENT)] | |
| 34 | 34 | ||
| 35 | 35 | conn = opener.open(SEARCH_URL) | |
| 36 | - page = conn.read() #set initial cookie values | ||
| 36 | + page = conn.read() # set initial cookie values | ||
| 37 | 37 | ||
| 38 | 38 | config = ConfigParser.ConfigParser() | |
| 39 | 39 | config.read(CONFIG_FILE) | |
@@ -82,7 +82,7 @@ def main(): | |||
| 82 | 82 | break | |
| 83 | 83 | ||
| 84 | 84 | sys.stdout.write("\n---------------\n") | |
| 85 | - sys.stdout.write("Result page #%d\n" % (i+1)) | ||
| 85 | + sys.stdout.write("Result page #%d\n" % (i + 1)) | ||
| 86 | 86 | sys.stdout.write("---------------\n") | |
| 87 | 87 | ||
| 88 | 88 | for sqlfile in files: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -319,7 +319,7 @@ def start(): | |||
| 319 | 319 | elif conf.method == HTTPMETHOD.GET: | |
| 320 | 320 | if targetUrl.find("?") > -1: | |
| 321 | 321 | firstPart = targetUrl[:targetUrl.find("?")] | |
| 322 | - secondPart = targetUrl[targetUrl.find("?")+1:] | ||
| 322 | + secondPart = targetUrl[targetUrl.find("?") + 1:] | ||
| 323 | 323 | message = "Edit GET data [default: %s]: " % secondPart | |
| 324 | 324 | test = readInput(message, default=secondPart) | |
| 325 | 325 | test = _randomFillBlankFields(test) | |
@@ -603,7 +603,7 @@ def start(): | |||
| 603 | 603 | showHttpErrorCodes() | |
| 604 | 604 | ||
| 605 | 605 | if kb.maxConnectionsFlag: | |
| 606 | - warnMsg = "it appears that the target " | ||
| 606 | + warnMsg = "it appears that the target " | ||
| 607 | 607 | warnMsg += "has a maximum connections " | |
| 608 | 608 | warnMsg += "constraint" | |
| 609 | 609 | logger.warn(warnMsg) | |
@@ -612,8 +612,9 @@ def start(): | |||
| 612 | 612 | logger.info("fetched data logged to text files under '%s'" % conf.outputPath) | |
| 613 | 613 | ||
| 614 | 614 | if conf.multipleTargets and conf.resultsFilename: | |
| 615 | - infoMsg = "you can find results of scanning in multiple targets " | ||
| 615 | + infoMsg = "you can find results of scanning in multiple targets " | ||
| 616 | 616 | infoMsg += "mode inside the CSV file '%s'" % conf.resultsFilename | |
| 617 | 617 | logger.info(infoMsg) | |
| 618 | 618 | ||
| 619 | 619 | return True | |
| 620 | + | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -758,15 +758,15 @@ def limitQuery(self, num, query, field=None, uniqueField=None): | |||
| 758 | 758 | limitStr = queries[Backend.getIdentifiedDbms()].limit.query | |
| 759 | 759 | fromIndex = limitedQuery.index(" FROM ") | |
| 760 | 760 | untilFrom = limitedQuery[:fromIndex] | |
| 761 | - fromFrom = limitedQuery[fromIndex+1:] | ||
| 761 | + fromFrom = limitedQuery[fromIndex + 1:] | ||
| 762 | 762 | orderBy = False | |
| 763 | 763 | ||
| 764 | 764 | if Backend.getIdentifiedDbms() in (DBMS.MYSQL, DBMS.PGSQL, DBMS.SQLITE): | |
| 765 | 765 | limitStr = queries[Backend.getIdentifiedDbms()].limit.query % (num, 1) | |
| 766 | 766 | limitedQuery += " %s" % limitStr | |
| 767 | 767 | ||
| 768 | 768 | elif Backend.isDbms(DBMS.FIREBIRD): | |
| 769 | - limitStr = queries[Backend.getIdentifiedDbms()].limit.query % (num+1, num+1) | ||
| 769 | + limitStr = queries[Backend.getIdentifiedDbms()].limit.query % (num + 1, num + 1) | ||
| 770 | 770 | limitedQuery += " %s" % limitStr | |
| 771 | 771 | ||
| 772 | 772 | elif Backend.getIdentifiedDbms() in (DBMS.ORACLE, DBMS.DB2): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -560,7 +560,7 @@ def paramToDict(place, parameters=None): | |||
| 560 | 560 | elif len(conf.testParameter) != len(testableParameters.keys()): | |
| 561 | 561 | for parameter in conf.testParameter: | |
| 562 | 562 | if parameter not in testableParameters: | |
| 563 | - warnMsg = "provided parameter '%s' " % parameter | ||
| 563 | + warnMsg = "provided parameter '%s' " % parameter | ||
| 564 | 564 | warnMsg += "is not inside the %s" % place | |
| 565 | 565 | logger.warn(warnMsg) | |
| 566 | 566 | ||
@@ -1489,7 +1489,7 @@ def getConsoleWidth(default=80): | |||
| 1489 | 1489 | if os.getenv("COLUMNS", "").isdigit(): | |
| 1490 | 1490 | width = int(os.getenv("COLUMNS")) | |
| 1491 | 1491 | else: | |
| 1492 | - output=execute('stty size', shell=True, stdout=PIPE, stderr=PIPE).stdout.read() | ||
| 1492 | + output = execute("stty size", shell=True, stdout=PIPE, stderr=PIPE).stdout.read() | ||
| 1493 | 1493 | items = output.split() | |
| 1494 | 1494 | ||
| 1495 | 1495 | if len(items) == 2 and items[1].isdigit(): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -54,8 +54,8 @@ def md5hash(value): | |||
| 54 | 54 | return md5.new(value).hexdigest() | |
| 55 | 55 | ||
| 56 | 56 | def orddecode(value): | |
| 57 | - packedString = struct.pack("!"+"I" * len(value), *value) | ||
| 58 | - return "".join(chr(char) for char in struct.unpack("!"+"I"*(len(packedString)/4), packedString)) | ||
| 57 | + packedString = struct.pack("!" + "I" * len(value), *value) | ||
| 58 | + return "".join(chr(char) for char in struct.unpack("!" + "I" * (len(packedString) / 4), packedString)) | ||
| 59 | 59 | ||
| 60 | 60 | def ordencode(value): | |
| 61 | 61 | return tuple(ord(char) for char in value) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,7 +7,7 @@ | |||
| 7 | 7 | ||
| 8 | 8 | from lib.core.datatype import AttribDict | |
| 9 | 9 | ||
| 10 | - _defaults = { | ||
| 10 | + _defaults = { | ||
| 11 | 11 | "csvDel": ",", | |
| 12 | 12 | "timeSec": 5, | |
| 13 | 13 | "googlePage": 1, | |
@@ -23,6 +23,6 @@ | |||
| 23 | 23 | "dumpFormat": "CSV", | |
| 24 | 24 | "tech": "BEUSTQ", | |
| 25 | 25 | "torType": "HTTP" | |
| 26 | - } | ||
| 26 | + } | ||
| 27 | 27 | ||
| 28 | 28 | defaults = AttribDict(_defaults) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -69,38 +69,38 @@ | |||
| 69 | 69 | } | |
| 70 | 70 | ||
| 71 | 71 | MYSQL_PRIVS = { | |
| 72 | - 1:"select_priv", | ||
| 73 | - 2:"insert_priv", | ||
| 74 | - 3:"update_priv", | ||
| 75 | - 4:"delete_priv", | ||
| 76 | - 5:"create_priv", | ||
| 77 | - 6:"drop_priv", | ||
| 78 | - 7:"reload_priv", | ||
| 79 | - 8:"shutdown_priv", | ||
| 80 | - 9:"process_priv", | ||
| 81 | - 10:"file_priv", | ||
| 82 | - 11:"grant_priv", | ||
| 83 | - 12:"references_priv", | ||
| 84 | - 13:"index_priv", | ||
| 85 | - 14:"alter_priv", | ||
| 86 | - 15:"show_db_priv", | ||
| 87 | - 16:"super_priv", | ||
| 88 | - 17:"create_tmp_table_priv", | ||
| 89 | - 18:"lock_tables_priv", | ||
| 90 | - 19:"execute_priv", | ||
| 91 | - 20:"repl_slave_priv", | ||
| 92 | - 21:"repl_client_priv", | ||
| 93 | - 22:"create_view_priv", | ||
| 94 | - 23:"show_view_priv", | ||
| 95 | - 24:"create_routine_priv", | ||
| 96 | - 25:"alter_routine_priv", | ||
| 97 | - 26:"create_user_priv", | ||
| 72 | + 1: "select_priv", | ||
| 73 | + 2: "insert_priv", | ||
| 74 | + 3: "update_priv", | ||
| 75 | + 4: "delete_priv", | ||
| 76 | + 5: "create_priv", | ||
| 77 | + 6: "drop_priv", | ||
| 78 | + 7: "reload_priv", | ||
| 79 | + 8: "shutdown_priv", | ||
| 80 | + 9: "process_priv", | ||
| 81 | + 10: "file_priv", | ||
| 82 | + 11: "grant_priv", | ||
| 83 | + 12: "references_priv", | ||
| 84 | + 13: "index_priv", | ||
| 85 | + 14: "alter_priv", | ||
| 86 | + 15: "show_db_priv", | ||
| 87 | + 16: "super_priv", | ||
| 88 | + 17: "create_tmp_table_priv", | ||
| 89 | + 18: "lock_tables_priv", | ||
| 90 | + 19: "execute_priv", | ||
| 91 | + 20: "repl_slave_priv", | ||
| 92 | + 21: "repl_client_priv", | ||
| 93 | + 22: "create_view_priv", | ||
| 94 | + 23: "show_view_priv", | ||
| 95 | + 24: "create_routine_priv", | ||
| 96 | + 25: "alter_routine_priv", | ||
| 97 | + 26: "create_user_priv", | ||
| 98 | 98 | } | |
| 99 | 99 | ||
| 100 | 100 | PGSQL_PRIVS = { | |
| 101 | - 1:"createdb", | ||
| 102 | - 2:"super", | ||
| 103 | - 3:"catupd", | ||
| 101 | + 1: "createdb", | ||
| 102 | + 2: "super", | ||
| 103 | + 3: "catupd", | ||
| 104 | 104 | } | |
| 105 | 105 | ||
| 106 | 106 | FIREBIRD_PRIVS = { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -117,27 +117,27 @@ def lister(self, header, elements, sort=True): | |||
| 117 | 117 | if elements: | |
| 118 | 118 | self._write("") | |
| 119 | 119 | ||
| 120 | - def banner(self,data): | ||
| 120 | + def banner(self, data): | ||
| 121 | 121 | self.string("banner", data) | |
| 122 | 122 | ||
| 123 | - def currentUser(self,data): | ||
| 123 | + def currentUser(self, data): | ||
| 124 | 124 | self.string("current user", data) | |
| 125 | 125 | ||
| 126 | - def currentDb(self,data): | ||
| 126 | + def currentDb(self, data): | ||
| 127 | 127 | if Backend.isDbms(DBMS.MAXDB): | |
| 128 | 128 | self.string("current database (no practical usage on %s)" % Backend.getIdentifiedDbms(), data) | |
| 129 | 129 | elif Backend.isDbms(DBMS.ORACLE): | |
| 130 | 130 | self.string("current schema (equivalent to database on %s)" % Backend.getIdentifiedDbms(), data) | |
| 131 | 131 | else: | |
| 132 | 132 | self.string("current database", data) | |
| 133 | 133 | ||
| 134 | - def hostname(self,data): | ||
| 134 | + def hostname(self, data): | ||
| 135 | 135 | self.string("hostname", data) | |
| 136 | 136 | ||
| 137 | - def dba(self,data): | ||
| 137 | + def dba(self, data): | ||
| 138 | 138 | self.string("current user is DBA", data) | |
| 139 | 139 | ||
| 140 | - def users(self,users): | ||
| 140 | + def users(self, users): | ||
| 141 | 141 | self.lister("database management system users", users) | |
| 142 | 142 | ||
| 143 | 143 | def userSettings(self, header, userSettings, subHeader): | |
@@ -174,7 +174,7 @@ def userSettings(self, header, userSettings, subHeader): | |||
| 174 | 174 | ||
| 175 | 175 | self.singleString("") | |
| 176 | 176 | ||
| 177 | - def dbs(self,dbs): | ||
| 177 | + def dbs(self, dbs): | ||
| 178 | 178 | self.lister("available databases", dbs) | |
| 179 | 179 | ||
| 180 | 180 | def dbTables(self, dbTables): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -272,7 +272,7 @@ def _parseBurpLog(content): | |||
| 272 | 272 | index = 5 | |
| 273 | 273 | ||
| 274 | 274 | url = line[index:line.index(" HTTP/")] | |
| 275 | - method = line[:index-1] | ||
| 275 | + method = line[:index - 1] | ||
| 276 | 276 | ||
| 277 | 277 | if "?" in line and "=" in line: | |
| 278 | 278 | params = True | |
@@ -587,7 +587,7 @@ def _findPageForms(): | |||
| 587 | 587 | for i in xrange(len(targets)): | |
| 588 | 588 | try: | |
| 589 | 589 | target = targets[i] | |
| 590 | - page, _, _= Request.getPage(url=target.strip(), crawling=True, raise404=False) | ||
| 590 | + page, _, _ = Request.getPage(url=target.strip(), crawling=True, raise404=False) | ||
| 591 | 591 | findPageForms(page, target, False, True) | |
| 592 | 592 | ||
| 593 | 593 | if conf.verbose in (1, 2): | |
@@ -942,7 +942,7 @@ def _setHTTPProxy(): | |||
| 942 | 942 | try: | |
| 943 | 943 | port = int(hostnamePort[1]) | |
| 944 | 944 | except: | |
| 945 | - pass #drops into the next check block | ||
| 945 | + pass # drops into the next check block | ||
| 946 | 946 | ||
| 947 | 947 | if not all((scheme, hasattr(PROXY_TYPE, scheme), hostname, port)): | |
| 948 | 948 | errMsg = "proxy value must be in format '(%s)://url:port'" % "|".join(_[0].lower() for _ in getPublicTypeMembers(PROXY_TYPE)) | |
@@ -1373,8 +1373,9 @@ def _cleanupOptions(): | |||
| 1373 | 1373 | conf.data = re.sub(INJECT_HERE_MARK.replace(" ", r"[^A-Za-z]*"), CUSTOM_INJECTION_MARK_CHAR, conf.data, re.I) | |
| 1374 | 1374 | ||
| 1375 | 1375 | if re.search(r'%[0-9a-f]{2}', conf.data, re.I): | |
| 1376 | + class _(unicode): | ||
| 1377 | + pass | ||
| 1376 | 1378 | original = conf.data | |
| 1377 | - class _(unicode): pass | ||
| 1378 | 1379 | conf.data = _(urldecode(conf.data)) | |
| 1379 | 1380 | setattr(conf.data, UNENCODED_ORIGINAL_VALUE, original) | |
| 1380 | 1381 | else: | |
@@ -1409,7 +1410,7 @@ class _(unicode): pass | |||
| 1409 | 1410 | conf.code = int(conf.code) | |
| 1410 | 1411 | ||
| 1411 | 1412 | if conf.csvDel: | |
| 1412 | - conf.csvDel = conf.csvDel.decode("string_escape") # e.g. '\\t' -> '\t' | ||
| 1413 | + conf.csvDel = conf.csvDel.decode("string_escape") # e.g. '\\t' -> '\t' | ||
| 1413 | 1414 | ||
| 1414 | 1415 | if conf.torPort and conf.torPort.isdigit(): | |
| 1415 | 1416 | conf.torPort = int(conf.torPort) | |
@@ -1504,7 +1505,7 @@ def _setKnowledgeBaseAttributes(flushAll=True): | |||
| 1504 | 1505 | kb.authHeader = None | |
| 1505 | 1506 | kb.bannerFp = AttribDict() | |
| 1506 | 1507 | ||
| 1507 | - kb.brute = AttribDict({"tables":[], "columns":[]}) | ||
| 1508 | + kb.brute = AttribDict({"tables": [], "columns": []}) | ||
| 1508 | 1509 | kb.bruteMode = False | |
| 1509 | 1510 | ||
| 1510 | 1511 | kb.cache = AttribDict() | |
@@ -1592,7 +1593,7 @@ def _setKnowledgeBaseAttributes(flushAll=True): | |||
| 1592 | 1593 | kb.redirectChoice = None | |
| 1593 | 1594 | kb.redirectSetCookie = None | |
| 1594 | 1595 | kb.reflectiveMechanism = True | |
| 1595 | - kb.reflectiveCounters = {REFLECTIVE_COUNTER.MISS:0, REFLECTIVE_COUNTER.HIT:0} | ||
| 1596 | + kb.reflectiveCounters = {REFLECTIVE_COUNTER.MISS: 0, REFLECTIVE_COUNTER.HIT: 0} | ||
| 1596 | 1597 | kb.responseTimes = [] | |
| 1597 | 1598 | kb.resumeValues = True | |
| 1598 | 1599 | kb.safeCharEncode = False | |
| Back | FazBrowse Home | New Git URL |
0 commit comments