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

Commit f87ee7f

Browse files
committed
PEP 8 Compliance
1 parent ec40ae1 commit f87ee7f

15 files changed

+178
-168
lines changed

.github/ISSUE_TEMPLATE/Bug_report.md

+19-20
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
1-
---
2-
name: Bug report
3-
about: Create a report to help us improve
4-
5-
---
6-
7-
**Describe the bug**
8-
A clear and concise description of what the bug is.
9-
10-
**To Reproduce**
11-
Paste here the arguments you used: `./autosqli.py ___________________`
12-
13-
**Expected behavior**
14-
A clear and concise description of what you expected to happen.
15-
16-
**Screenshots**
17-
If applicable, add screenshots to help explain your problem.
18-
19-
**Additional context**
20-
Add any other context about the problem here.
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
---
5+
6+
**Describe the bug**
7+
A clear and concise description of what the bug is.
8+
9+
**To Reproduce**
10+
Paste here the arguments you used: `./autosqli.py ___________________`
11+
12+
**Expected behavior**
13+
A clear and concise description of what you expected to happen.
14+
15+
**Screenshots**
16+
If applicable, add screenshots to help explain your problem.
17+
18+
**Additional context**
19+
Add any other context about the problem here.
+16-17
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
---
2-
name: Feature request
3-
about: Suggest an idea for this project
4-
5-
---
6-
7-
**Is your feature request related to a problem? Please describe.**
8-
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
9-
10-
**Describe the solution you'd like**
11-
A clear and concise description of what you want to happen.
12-
13-
**Describe alternatives you've considered**
14-
A clear and concise description of any alternative solutions or features you've considered.
15-
16-
**Additional context**
17-
Add any other context or screenshots about the feature request here.
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
---
5+
6+
**Is your feature request related to a problem? Please describe.**
7+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
8+
9+
**Describe the solution you'd like**
10+
A clear and concise description of what you want to happen.
11+
12+
**Describe alternatives you've considered**
13+
A clear and concise description of any alternative solutions or features you've considered.
14+
15+
**Additional context**
16+
Add any other context or screenshots about the feature request here.

README.md

+35-36
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,48 @@
1-
# AutoSQLi, **the new way script-kiddies hack websites** ( that's a joke :p )
2-
3-
## What is working right now
4-
5-
- Save System
6-
- there is a complete save system, which can resume even when your pc crashed.
7-
- technology is cool
8-
- Dorking
9-
- from the command line ( one dork ): YES
10-
- from a file: NO
11-
- from an interactive wizard: YES
12-
- Waffing
13-
- Thanks to Eku, WhatWaf now has a JSON output function.
14-
- So it's mostly finished :)
15-
- UPDATE: WhatWaf is completly working with AutoSQLi. Sqlmap is the next big step
16-
- Sqlmapping
17-
- I'll look if there is some sort of sqlmap API, because I don't wanna use `execute` this time (:
18-
- Sqlmap is cool
19-
- REPORTING:
20-
- Rest: NOPE
1+
# AutoSQLi, **the new way script-kiddies hack websites**
2+
3+
(that's a joke :p)
4+
5+
## Features
6+
7+
- Save System
8+
\- there is a complete save system, which can resume even when your pc crashed.
9+
\- technology is cool
10+
- Dorking
11+
\- from the command line ( one dork ): YES
12+
\- from a file: NO
13+
\- from an interactive wizard: YES
14+
- Waffing
15+
\- Thanks to [Ekultek](https://github.com/Ekultek), WhatWaf now has a JSON output function.
16+
\- So it's mostly finished :)
17+
\- UPDATE: WhatWaf is completly working with AutoSQLi. Sqlmap is the next big step
18+
- Sqlmapping
19+
\- I'll look if there is some sort of sqlmap API, because I don't wanna use `execute` this time (:
20+
\- Sqlmap is cool
21+
- REPORTING: YES
22+
- Rest API: NOPE
2123

2224
## TODO:
2325

24-
Could someone add a proper handling of the log? I mean, logging with different levels, cleanly ^^ ?
25-
Also, could someone add an option to translate the save ( which is in pickle format ) to a json/csv save ?
26-
Thanks :)
26+
- [ ] Log handling (logging with different levels, cleanly)
27+
- [ ] Translate output (option to translate the save, which is in pickle format, to a json/csv save)
28+
- [ ] Spellcheck (correct wrongly spelled words and conjugational errors. I'm on Neovim right now and there is no auto-spelling check)
2729

2830
## The Plan
2931

3032
This plan is a bit outdated, but it will follow this idea
3133

32-
AutoSQLi will be a python application which will, automatically, using a dork provided by the user, return a list of websites vulnerable to a SQL injection.
33-
To find vulnerable websites, the users firstly provide a dork [DOrking]( https://www.techopedia.com/definition/30938/google-dorking), which is passed to findDorks.py, which returns a list of URLs corresponding to it.
34-
Then, AutoSQLi will do some very basic checks ( TODO: MAYBE USING SQLMAP AND IT's --smart and --batch function ) to verify if the application is protected by a Waf, or if one of it's parameters is vulnerable.
35-
Sometimes, websites are protected by a Web Application Firewall, or in short, a WAF. To identify and get around of these WAFs, AutoSQLi will use WhatWaf.
34+
1. AutoSQLi will be a python application which will, automatically, using a dork provided by the user, return a list of websites vulnerable to a SQL injection.
35+
2. To find vulnerable websites, the users firstly provide a dork [DOrking](https://www.techopedia.com/definition/30938/google-dorking), which is passed to findDorks.py, which returns a list of URLs corresponding to it.
36+
3. Then, AutoSQLi will do some very basic checks ( TODO: MAYBE USING SQLMAP AND IT's --smart and --batch function ) to verify if the application is protected by a Waf, or if one of it's parameters is vulnerable.
37+
4. Sometimes, websites are protected by a Web Application Firewall, or in short, a WAF. To identify and get around of these WAFs, AutoSQLi will use WhatWaf.
38+
5. Finally, AutoSQLi will exploit the website using sqlmap, and give the choice to do whatever he wants !
3639

37-
Finally, AutoSQLi will exploit the website using sqlmap, and give the choice to do whatever he wants !
38-
39-
## Tor
40+
### Tor
4041

4142
Also, AutoSQLi should work using Tor by default. So it should check for tor availiability on startup.
4243

4344
## FAQ
45+
4446
### Cool :)
4547

4648
Yeah, I know.
@@ -49,8 +51,6 @@ Yeah, I know.
4951

5052
Yeah, I know.
5153

52-
TODO: please someone correct those wrongly spelled words and conjugational errors. I'm on Neovim right now and there is no auto-spelling check.
53-
5454
## Popularity note ( 2018-05-10 )
5555

5656
When I woke up this morning, someone said that a guy by the name of NullArray tweeted about this project. 11 stars later, it makes me want to finish it more than ever !
@@ -61,7 +61,7 @@ Friday, the 11th of May, the first pull request of this project was sent by [@iy
6161

6262
## sTaTiStIcS
6363

64-
### 2018-05-11
64+
### 2018-05-11
6565

6666
Today, we are at 15 stars, and got our first pull request. The number of cloners and unique viewers is decreasing with the time, but I noticed that someone followed a link from `web.telegram.org`. Well, those referer statistics are cool.
6767
I also finished implementing WhatWaf :)
@@ -83,10 +83,9 @@ Also, today, I was at the point of buying a HackRF One ( you know, these cards w
8383
The fact is I only have 100€ right now, and the HackRF One costs 300€. Ya.
8484
I think I'll wait. ~please buy me a HackRF One :)~
8585

86-
# Disclaimer ( because you know, every InfoSec projects should have one ) ( I may not be an InfoSec project ) ( don't be offended, please )
86+
# Disclaimer ( because you know, every InfoSec projects should have one )
8787

8888
## Don't mess up
8989

9090
This project is for demonstration purposes. Nobody should ever run AutoSQLi. Really.
91-
Hacking into DB's is fun, but you know, there are guys just like you and me who don't want to get their entire work messed up. You don't to make them scratch their hairs, na ?
92-
91+
Hacking into DB's is fun, but you know, there are guys just like you and me who don't want to get their entire work messed up. You don't to make them pull out their hairs, ya?

autosqli.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python3
22
# Adapted to the new save system
33

4-
from src import log # provides log.info/debug/warning/critical
4+
from src import log # provides log.info/debug/warning/critical
55
from src.parse_args import argument_parse # provides argument_parse()
66
# from src.save import Save # provides Save() [class]
77
from src import save
@@ -20,12 +20,12 @@ def main():
2020
args = argument_parse()
2121

2222
if args.debug:
23-
log.debug("ok boss, launching the debug mode")
23+
log.debug("Ok boss, launching in debug mode")
2424
import pdb
2525
pdb.set_trace() # XXX BREAKPOINT
2626

27-
log.info("Welcome into AutoSQLi !")
28-
log.debug("Checking save...")
27+
log.info("Welcome into AutoSQLi!")
28+
log.debug("Checking for saves...")
2929
save.saveStartup(args)
3030
log.debug("Loading save...")
3131
save.importSave()
@@ -42,11 +42,11 @@ def main():
4242
stages.nextStage(args)
4343
# backup the current state (into autosqli.save)
4444
save.writeSave() # TODO: add a time based saver
45-
log.debug("save exported")
45+
log.debug("Save exported")
4646
if save.getStage() == stages.REPORT_STAGE:
4747
break
4848

49-
log.info("Goodbye !")
49+
log.info("Goodbye!")
5050

5151

5252
if __name__ == "__main__":

src/dorkStage.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Adapted to the new save system
22
# from .target import urls_to_targets
33
from . import log
4-
from . import findDorks # provides findDorks.dorkLines(dorks)
4+
from . import findDorks # provides findDorks.dorkLines(dorks)
5+
56
# from . import save
67

78

@@ -14,8 +15,8 @@ def getDorks(args):
1415
log.critical("-f (--dork-file) and -d (--dork) are incompatible")
1516
exit(1)
1617
elif args.dorkfile is not None:
17-
exit(2) # not implemented
18-
pass # TODO: accept a dorkfile
18+
exit(2) # not implemented
19+
pass # TODO: accept a dorkfile
1920
elif args.dorkfile is None and args.dork is None:
2021
log.debug("interactively querying dork")
2122
log.info("Enter a dork:")
@@ -36,6 +37,7 @@ def dorkStage(args):
3637

3738
search_dork(dorks)
3839

40+
3941
# # convert urls to targets
4042
# targets_to_test = urls_to_targets(urls)
4143
# # append our targets to the current_save

src/execute.py

+11-6
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,20 @@ def execute(command, cwd=None, timeout=None, yes=None):
2424
for arg in pre_command:
2525
assembled_pre_command += " " + arg
2626

27-
final_command = ["bash -c {}".format(
28-
satanize_for_bash(assembled_pre_command))]
27+
final_command = [
28+
"bash -c {}".format(satanize_for_bash(assembled_pre_command))
29+
]
2930

3031
# shellmode = True if yes is not None else None
31-
import pdb; pdb.set_trace() # XXX BREAKPOINT
32+
import pdb
33+
pdb.set_trace() # XXX BREAKPOINT
3234
shellmode = True
3335
log.debug("command: {}; cwd: {}; timeout: {}; shellmode: {}".format(
3436
final_command, cwd, timeout, shellmode))
35-
result = subprocess.run(final_command, stdout=subprocess.PIPE, cwd=cwd,
36-
timeout=timeout,
37-
shell=shellmode)
37+
result = subprocess.run(
38+
final_command,
39+
stdout=subprocess.PIPE,
40+
cwd=cwd,
41+
timeout=timeout,
42+
shell=shellmode)
3843
return result.stdout.decode('utf-8')

src/findDorks.py

+16-17
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def main():
2323

2424
def dorkFromFile(filename):
2525
f = open(filename, 'r')
26-
lines = f.readlines() # read all the lines of the file into 'lines'
26+
lines = f.readlines() # read all the lines of the file into 'lines'
2727
f.close()
2828
dorkLines(lines)
2929

@@ -53,12 +53,12 @@ def dorkLines(lines):
5353

5454
# TODO: google ban handling
5555
result_clean = json.loads(result)
56-
# # try:
57-
# # result_clean = json.loads(result)
58-
# # except:
59-
# # google_ban = True
60-
# # print("Google may have banned us\
61-
# # , but don't worry, it's temporary")
56+
# # try:
57+
# # result_clean = json.loads(result)
58+
# # except:
59+
# # google_ban = True
60+
# # print("Google may have banned us\
61+
# # , but don't worry, it's temporary")
6262

6363
for x in result_clean:
6464
# url = x['url']
@@ -69,13 +69,13 @@ def dorkLines(lines):
6969
result = duckSearch(dork)
7070
result_clean = json.loads(result)
7171

72-
# # TODO: ducky ban handling
73-
# # try:
74-
# # result_clean = json.loads(result)
75-
# # except:
76-
# # duck_ban = True
77-
# # print("DuckduckGo may have banned us, \
78-
# #but don't worry, it's temporary")
72+
# # TODO: ducky ban handling
73+
# # try:
74+
# # result_clean = json.loads(result)
75+
# # except:
76+
# # duck_ban = True
77+
# # print("DuckduckGo may have banned us, \
78+
# #but don't worry, it's temporary")
7979

8080
for x in result_clean:
8181
# url = x['url']
@@ -97,9 +97,8 @@ def googleSearch(dork):
9797
def duckSearch(dork):
9898
""" dork shall be a string which contains... a dork. """
9999
""" returns the duckduckgo json response for the specified dork """
100-
return execute([ddgr_path,
101-
dork,
102-
"--unsafe", "--json", "--np", "--num", "25"])
100+
return execute(
101+
[ddgr_path, dork, "--unsafe", "--json", "--np", "--num", "25"])
103102

104103

105104
if __name__ == "__main__":

src/log.py

+5
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,22 @@
88
CRITICAL_PREFIX = colors.FAIL + colors.UNDERLINE + colors.BOLD + "[CRITICAL] "
99
WARNING_PREFIX = colors.FAIL + colors.BOLD + "[WARNING] "
1010

11+
1112
def debug(msg):
1213
print(DEBUG_PREFIX + msg + colors.ENDC)
1314

15+
1416
def info(msg):
1517
print(INFO_PREFIX + msg + colors.ENDC)
1618

19+
1720
def error(msg):
1821
print(ERROR_PREFIX + msg + colors.ENDC)
1922

23+
2024
def critical(msg):
2125
print(CRITICAL_PREFIX + msg + colors.ENDC)
2226

27+
2328
def warning(msg):
2429
print(WARNING_PREFIX + msg + colors.ENDC)

0 commit comments

Comments
 (0)