Skip to content

Commit 662954d

Browse files
authored
Merge pull request #61 from knassar702/v0.9.3
V0.9.3
2 parents 912ad21 + a186bfd commit 662954d

File tree

15 files changed

+229
-82
lines changed

15 files changed

+229
-82
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,4 +141,8 @@ cython_debug/
141141

142142
.vscode
143143
*.out
144+
# TESTING
145+
urls.out
146+
run_tool.sh
144147
data.json
148+
demo*

Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM python:3.9-slim
2+
WORKDIR /scant3r
3+
COPY . .
4+
RUN pip install --no-cache-dir .
5+
ENTRYPOINT ["scant3r"]
6+
CMD ["-h"]

README.md

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -37,42 +37,27 @@
3737

3838
### What's this?
3939
this is a module-based web automation tool that I made for saving my scripting
40-
time by providing some utilises that everybody needs in his automation script
41-
instead of focusing on ( logger, parsers, output function , cmd args, multi-threading) ,
40+
time by providing some utilizes that every web pentester needs in his automation script
41+
instead of focusing on ( logger, parsers, output function, cmd args, multi-threading),
4242
just write the logic of your scanning idea with scant3r utils without caring
43-
about these things, you can find callback/parsing/logging utils and output functions, Also we will adding Restful API soon <br>
44-
what if you need to add new Command option to scant3r for your script? <br>
45-
easy without writing any code just open `conf/opts.yaml` file and you will find all options of scant3r so you can change and add what you want;D
46-
47-
48-
```yaml
49-
# conf/opts.yaml
50-
exit_after:
51-
- option:
52-
- '-e' # SHORT
53-
- "--exit-after" # LONG
54-
- type: int # TYPE OF VALUE
55-
- default: 500 # DEFAULT
56-
- save_content: true # SHOUD I SAVE THE CONTENT OF THIS OPTION ?
57-
- help: "Exit after get this number of errors" # HELP MESSAGE
58-
- exec: "dict_args['exit_after'] = int(value)" # HOW TO SAVE IT IN OPTS DICT
59-
```
43+
about these things, you can find callback/parsing/logging utils and output functions, Also we will add Restful API soon <br>
44+
what if you need to add a new Command option to scant3r for your script? <br>
45+
easy without writing any code just open the `conf/opts.YAML file and you will find all options of scant3r so you can change and add what you want;D
46+
6047

6148
### why should I use it ?
62-
the short answer is to save your time, you as a security guy you don't need to
49+
the short answer is to save your time, as a security guy you don't need to
6350
learn more about " how to write a perfect CLI script " you just need to
6451
understand the logic of your script <br> if you need to write something like SSRF
6552
CVE scanner, instead of searching "How can I call interact.sh", "how to fix this
6653
code issue", "how can I parse this' <br> and after getting the answer you will get
6754
some cool errors in your code and you will find yourself needing more time to
68-
search and fix these bugs
69-
70-
![image](.src/sweaty-sweaty-speedrunner.gif)
55+
search and fix these bugs <br>
7156

72-
you as a security guy this is a waste of time for you, so this project will help to
57+
this is a waste of time for you, so this project will help to
7358
save more and more, just take a look at the examples modules and read the
7459
official documentation (unavailable yet), or just open an issue with a
75-
Feature request and we will write your script by our hands
60+
Feature request and we will write your script with our hands
7661

7762
### Modules
7863

@@ -81,6 +66,7 @@ this the modules we providing for our community for you need new module open an
8166

8267
| module | Short description |
8368
| :------------- | :------------- |
69+
| **xss** | xss scanner for the ( ATTR_NAME, ATTR_VALUE , Comments, TAG_NAME ) |
8470
| **req_callback** | Finds Out-of-band Resources parameters |
8571
| **ssti** | Finds Server-side Template injection |
8672
| **firebase** | checks for public firebase databases (write/read) permission |
@@ -148,9 +134,14 @@ wiki: https://github.com/knassar702/scant3r/wiki
148134
```
149135
150136
137+
### Start
138+
```bash
139+
$ echo "http://testphp.vulnweb.com/listproducts.php?cat=1" | scant3r -m all
140+
```
141+
151142
## TODO-Features
152143
* [ ] Restful API
153-
* [ ] re-write the core utils in Rust by using pyo3
144+
* [ ] re-write the core utils in Rust by using pyo3
154145
* [ ] Command line Modules ( with yaml file )
155146
* [ ] Custom scanning map
156147
* [ ] Selenium Modules

scant3r/conf/logo.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
[/yellow][green]/___/\__/\_,_/_//_/\__/____/_/[/green]
66

77
[bold green][+][/bold green] Coded by: Khaled Nassar @knassar702
8-
[bold green][+][/bold green] Version: 0.9.2
8+
[bold green][+][/bold green] Version: 0.9.3

scant3r/conf/opts.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ callback_time:
1818
- save_content: true
1919
- help: "Callback timeout"
2020
- exec: "dict_args['callback_time'] = int(value)"
21+
2122
convert_body:
2223
- option:
2324
- "-c"
@@ -105,7 +106,7 @@ methods:
105106
- '-M'
106107
- '--method'
107108
- type: string
108-
- default: 'GET,POST'
109+
- default: 'GET'
109110
- save_content: true
110111
- help: 'Methods Allowed on your target'
111112
- exec: |

scant3r/core/data.py

Lines changed: 90 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,42 +6,114 @@
66
base_dir = Path(__file__).resolve().parent.parent
77

88
# interact.sh public servers
9-
INTERACT_SERVERS = [
9+
INTERACT_SERVERS = (
1010
"interact.sh",
1111
"oast.pro",
1212
"oast.live",
1313
"oast.site",
1414
"oast.online",
1515
"oast.me",
16-
]
17-
16+
)
1817
LOGGING_FORMAT = "%(name)-12s: %(levelname)-8s %(message)s"
1918
LOGGING_FILE = os.path.join(Path.home(), ".scant3r.log")
2019
CLEAR_LOGGING_FILE = True
2120

2221

2322
# ENABLED Modules ( after using `-m all` option)
24-
ENABLED_MODS = ["ssti", "firebase", "req_callback"]
23+
ENABLED_MODS = ("ssti", "firebase", "req_callback", "xss")
2524

2625
# CLI
2726
LOGO = open(f"{base_dir}/conf/logo.txt", "r").read()
2827
console = Console()
2928
FIREBASE_URL = "https://%s.firebaseio.com"
3029

31-
# PAYLOADS
32-
SQLI_PAYLOADS = Path(f"{base_dir}/db/txt/sqli.txt").read_text().splitlines()
33-
SQL_ERRORS = Path(f"{base_dir}/db/txt/sqli_errors.txt").read_text().splitlines()
30+
# SQLI PAYLOADS
31+
SQLI_PAYLOADS = tuple(Path(f"{base_dir}/db/txt/sqli.txt").read_text().splitlines())
32+
SQL_ERRORS = tuple(Path(f"{base_dir}/db/txt/sqli_errors.txt").read_text().splitlines())
33+
34+
PATH_TRAVERSAL = tuple(
35+
Path(f"{base_dir}/db/txt/traversal.txt").read_text().splitlines()
36+
)
37+
TLD = tuple(Path(f"{base_dir}/db/txt/tld.txt").read_text().splitlines())
38+
39+
# RCE PAYLOADS
40+
RCE_PAYLOADS_PWD = tuple(Path(f"{base_dir}/db/txt/pwd.txt").read_text().splitlines())
41+
RCE_PAYLOADS_PASSWD = tuple(
42+
Path(f"{base_dir}/db/txt/passwd.txt").read_text().splitlines()
43+
)
44+
45+
SSTI = tuple(Path(f"{base_dir}/db/txt/ssti.txt").read_text().splitlines())
46+
SSRF_PARAMS = tuple(
47+
Path(f"{base_dir}/db/txt/ssrf_parameters.txt").read_text().splitlines()
48+
)
49+
50+
# XSS WORDLIST
51+
XSS_JS_FUNC = tuple(Path(f"{base_dir}/db/txt/js_func.txt").read_text().splitlines())
52+
XSS_JS_VALUE = tuple(Path(f"{base_dir}/db/txt/js_value.txt").read_text().splitlines())
53+
54+
XSS_TAGS = tuple(Path(f"{base_dir}/db/txt/xss.txt").read_text().splitlines())
55+
XSS_ATTR = tuple(Path(f"{base_dir}/db/txt/xss_attr.txt").read_text().splitlines())
3456

35-
PATH_TRAVERSAL = Path(f"{base_dir}/db/txt/traversal.txt").read_text().splitlines()
36-
TLD = Path(f"{base_dir}/db/txt/tld.txt").read_text().splitlines()
57+
CSP_LIST = (
58+
".doubleclick.net",
59+
".googleadservices.com",
60+
"cse.google.com",
61+
"accounts.google.com",
62+
"*.google.com",
63+
"www.blogger.com",
64+
"*.blogger.com",
65+
"translate.yandex.net",
66+
"api-metrika.yandex.ru",
67+
"api.vk.comm",
68+
"*.vk.com",
69+
"*.yandex.ru",
70+
"*.yandex.net",
71+
"app-sjint.marketo.com",
72+
"app-e.marketo.com",
73+
"*.marketo.com",
74+
"detector.alicdn.com",
75+
"suggest.taobao.com",
76+
"ount.tbcdn.cn",
77+
"bebezoo.1688.com",
78+
"wb.amap.com",
79+
"a.sm.cn",
80+
"api.m.sm.cn",
81+
"*.taobao.com",
82+
"*.tbcdn.cn",
83+
"*.1688.com",
84+
"*.amap.com",
85+
"*.sm.cn",
86+
"mkto.uber.com",
87+
"*.uber.com",
88+
"ads.yap.yahoo.com",
89+
"mempf.yahoo.co.jp",
90+
"suggest-shop.yahooapis.jp",
91+
"www.aol.com",
92+
"df-webservices.comet.aol.com",
93+
"api.cmi.aol.com",
94+
"ui.comet.aol.com",
95+
"portal.pf.aol.com",
96+
"*.yahoo.com",
97+
"*.yahoo.jp",
98+
"*.yahooapis.jp",
99+
"*.aol.com",
100+
"search.twitter.com",
101+
"*.twitter.com",
102+
"twitter.com",
103+
"ajax.googleapis.com",
104+
"*.googleapis.com",
105+
)
37106

38-
RCE_PAYLOADS_PWD = Path(f"{base_dir}/db/txt/pwd.txt").read_text().splitlines()
39-
RCE_PAYLOADS_PASSWD = Path(f"{base_dir}/db/txt/passwd.txt").read_text().splitlines()
40107

41-
SSTI = Path(f"{base_dir}/db/txt/ssti.txt").read_text().splitlines()
42-
SSRF_PARAMS = Path(f"{base_dir}/db/txt/ssrf_parameters.txt").read_text().splitlines()
43-
XSS_JS_FUNC = Path(f"{base_dir}/db/txt/js_func.txt").read_text().splitlines()
44-
XSS_JS_VALUE = Path(f"{base_dir}/db/txt/js_value.txt").read_text().splitlines()
45-
XSS_TAGS = Path(f"{base_dir}/db/txt/xss.txt").read_text().splitlines()
46-
XSS_ATTR = Path(f"{base_dir}/db/txt/xss_attr.txt").read_text().splitlines()
47-
# BLIND_XSS_PAYLOADS = Path(f"{base_dir}/db/txt/bxss.txt", "r").read_text().splitlines()
108+
BLOCK_CONTENT_TYPE = (
109+
"application/json",
110+
"application/javascript",
111+
"text/javascript",
112+
"text/plain",
113+
"text/css",
114+
"image/jpeg",
115+
"image/png",
116+
"image/bmp",
117+
"image/gif",
118+
"application/rss+xml",
119+
)

scant3r/core/utils.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ def random_str(num: int) -> str:
1616
geCr15
1717
"""
1818
num = int(num)
19-
return "".join(
20-
random.choice(string.ascii_uppercase + string.digits) for _ in range(num)
21-
)
19+
return "".join(random.choice(string.ascii_uppercase) for _ in range(num))
2220

2321

2422
# Print the request in the console. Arg the request. Return a string. Empty string if no request

scant3r/db/txt/js_func.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
1+
parent['con'+'firm']
2+
parent['prom'+'pt']
3+
parent['ale'+'rt']
4+
globalThis[(+{}+[])[+!![]]+(![]+[])[!+[]+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(!![]+[])[+!![]]+(!![]+[])[+[]]]
15
alert
6+
prompt
7+
confirm
8+
this[/*foo*/'alert'/*bar*/]
9+
this[/*foo*/'print'/*bar*/]
10+
window[/*foo*/'confirm'/*bar*/]
11+
self[/*foo*/'prompt'/*bar*/]
12+
window['ale'+'rt']

scant3r/db/txt/js_value.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
42
1+
1
2+
33
3+
(+{}+[])[+!![]]
4+
/XSS/.source

scant3r/db/txt/xss.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,7 @@
22
">ScanT3r<svg/onload=confirm(/ScanT3r/)>web"
33
"><img src=x OnMouseEnter=(confirm)(1)>ScanT3r
44
"><div onpointermove="alert(45)">MOVE HERE</div>'
5+
<iMg src=a oNerrOr=$JS_FUNC$($JS_CMD$)>
6+
<img src=x onerror=$JS_FUNC$`$JS_CMD$`>
7+
<svg/onload=$JS_FUNC$`$JS_CMD$`>
58
<x/oncopy=brrrr>

0 commit comments

Comments
 (0)