Open
Conversation
komenda
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@KoMeNdA
#!/usr/bin/env python
-- coding:utf-8 --
-----------------------------------------
Atlas - Quick SQLMap Tamper Suggester
by M'hamed ("m4ll0k") Outaadi
-----------------------------------------
import re
import sys
import getopt
from lib.ragent import *
from lib.params import *
from lib.request import *
from lib.printer import *
from urllib.parse import urlsplit
from humanfriendly.tables import format_pretty_table as pretty
class Process(Request,Params):
# -- processor
def init(self,url:str,method:str,data:str,kwargs:dict)->None:
self.url = url
self.data = data
self.kwargs = kwargs
self.headers = kwargs.get('headers')
self.method = method.lower()
self.verbose = kwargs['verbose']
self.payload = kwargs['payload']
# --
Request.init(self,kwargs)
Params.init(self,url,kwargs['payload'].replace(' ','%20'),data,kwargs['headers'])
class Parse(object):
def init(self,url:str)->None:
if 'http' in url or 'https' in url:
self.host = urlsplit(url).netloc
self.path = urlsplit(url).path
class atlas(object):
def usage(self,=False)->None:
def p_usage()->None:
usage = "Usage: {name} [OPTIONS]\n\n".format(name=sys.argv[0])
usage += "\t-u --url\t\tTarget URL (e.g: http://test.com/index.php?id=1)\n"
usage += "\t-p --payload\t\tSet Payload (SQLMap payload return 4xx-5xx code)\n"
usage += "\t-d --dbms\t\tSet DBMS: mysql,mssql,..etc (more quick!)\n"
usage += "\t-m --method\t\tSet method: POST or GET\n"
usage += "\t-C --concat\t\tConcatenate different tampers ("tamper1,tamper2,..")\n"
usage += "\t-g --get-tampers\tGet list of all tampers\n"
usage += "\t-H --headers\t\tSet headers values (support curl method)\n"
usage += "\t-D --data\t\tSet post data (e.g: --data="id=1..")\n"
usage += "\t-a --agent\t\tSet HTTP User agent (e.g: --agent="string..")\n"
usage += "\t-c --cookie\t\tSet HTTP Cookie (e.g: --cookie="string..")\n"
usage += "\t-r --random-agent\tSet a random HTTP User agent\n"
usage += "\t-A --allow-redirect\tAllow target URL redirect\n"
usage += "\t-t --timeout\t\tSet timeout (e.g: --timeout="5")\n"
usage += "\t-v --verbose\t\tShow more information\n"
usage += "\t-h --help\t\tShow this help and exit\n"
return usage
self.banner()
print(p_usage())
if():sys.exit(0)
def waf_identify(headers:dict,content:str,code:int)->bool:
# -- waf
path = os.path.join(os.path.abspath('.'),'waf')
for file in listdir(path):
file = file.split('.py')[0]
import("waf.%s"%file)
waf = sys.modules['waf.%s'%file]
waf = waf.dict[file]
wf = waf(headers,str(content),code)
if(wf):
info2('WAF/IPS/IDS identified as: \033[1;38m%s\033[0m'%wf)
return True
def listdir(path:str)->list:
py_files = []
for file in os.listdir(path):
if file.endswith('.py')and not file == 'init.py':
py_files.append(file)
return py_files
def tamper_importer(dbms:str)->list:
# -- tampers
tampers = []
path = os.path.join(os.path.abspath('.'),'tamper')
for file in listdir(path):
file = file.split('.py')[0]
import("tamper.%s"%file)
tamper = sys.modules['tamper.%s'%file]
tamper = tamper.dict[file]
if tamper not in tampers:
if dbms == 'all':
tampers.append(tamper)
elif dbms in tamper.name:
tampers.append(tamper)
return tampers
try:
atlas().main()
except KeyboardInterrupt as e:
warn('User quit!!',1)
macAddress-file (1).csv