Skip to content
This repository was archived by the owner on Apr 17, 2021. It is now read-only.

Commit 9de081d

Browse files
committed
Spliting sqlmap_stage.py into multiple files
1 parent 1622f75 commit 9de081d

File tree

3 files changed

+53
-49
lines changed

3 files changed

+53
-49
lines changed

autosqli/sqlmap_options.py

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# From AutoSQLi
2+
3+
BASE_SQLMAP_OPTIONS = {
4+
# Stealthization
5+
'random_agent': True,
6+
7+
# Optimization
8+
'keep_alive': True,
9+
'threads': 4,
10+
11+
# Injection
12+
'risk': 2, # Setted risk to two because we are risky peoples.
13+
'text-only': True, # Comparing with images is weird and takes bandwitch.
14+
15+
# Technique
16+
'time-sec': 15, # Setted time-sec to 15 to avoid latency problems
17+
18+
# General
19+
'batch': True,
20+
'output-dir': 'sqlmap_results',
21+
'tamper': '', # Is modified with get_options_for_target
22+
'forms': True,
23+
24+
# Misc
25+
'skip-waf': True,
26+
'beep': True, # Beeps if an injection is found
27+
'smart': True, # This flag aborts the scan is results are negatives
28+
}

autosqli/sqlmap_stage.py

+3-49
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,7 @@
11
# From AutoSQLi
22
from autosqli import save
33
from autosqli import sqlmap_interface
4-
from autosqli import log
5-
6-
BASE_SQLMAP_OPTIONS = {
7-
# Stealthization
8-
'random_agent': True,
9-
10-
# Optimization
11-
'keep_alive': True,
12-
'threads': 4,
13-
14-
# Injection
15-
'risk': 2, # Setted risk to two because we are risky peoples.
16-
'text-only': True, # Comparing with images is weird and takes bandwitch.
17-
18-
# Technique
19-
'time-sec': 15, # Setted time-sec to 15 to avoid latency problems
20-
21-
# General
22-
'batch': True,
23-
'output-dir': 'sqlmap_results',
24-
'tamper': '', # Is modified with get_options_for_target
25-
'forms': True,
26-
27-
# Misc
28-
'skip-waf': True,
29-
'beep': True, # Beeps if an injection is found
30-
'smart': True, # This flag aborts the scan is results are negatives
31-
}
32-
33-
34-
def get_options_for_target(target):
35-
""" return a customized set of sqlmap options for a target ( tampers ) """
36-
# FIXME: to debug :)
37-
tampers_string = ''
38-
tampers = target.get_tampers_paths()
39-
options = BASE_SQLMAP_OPTIONS
40-
41-
for tamper in tampers:
42-
tampers.remove(tamper)
43-
tampers_string.append("{}{}".format(
44-
tampers,
45-
',' if len(tampers == 0)
46-
))
47-
48-
49-
options['tamper'] = tampers_string
50-
51-
return options
4+
from autosqli import tamper_engine
525

536

547
def sqlmap_stage(args):
@@ -61,6 +14,7 @@ def sqlmap_stage(args):
6114
break
6215
else:
6316
sqlmapped_target = sqlmap_interface.\
64-
sqlmap_target(target, get_options_for_target(target))
17+
sqlmap_target(target, tamper_engine.
18+
get_options_for_target(target))
6519

6620
save.update_target(sqlmapped_target)

autosqli/tamper_engine.py

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# From AutoSQLi
2+
from autosqli import sqlmap_options
3+
4+
5+
def get_options_for_target(target):
6+
""" return a customized set of sqlmap options for a target ( tampers ) """
7+
# FIXME: to debug :)
8+
tampers_string = ''
9+
tampers = target.get_tampers_paths()
10+
options = sqlmap_options.BASE_SQLMAP_OPTIONS
11+
12+
for tamper in tampers:
13+
tampers.remove(tamper)
14+
tampers_string.append("{}{}".format(
15+
tampers,
16+
',' if len(tampers == 0) else None
17+
)
18+
)
19+
20+
options['tamper'] = tampers_string
21+
22+
return options

0 commit comments

Comments
 (0)