-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSimple-WebApp-Crawler.py
More file actions
63 lines (48 loc) · 1.55 KB
/
Simple-WebApp-Crawler.py
File metadata and controls
63 lines (48 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import requests
import re
import urllib.parse as urlparse
import argparse
def parsing_args():
parser = argparse.ArgumentParser()
parser.add_argument("-u", "--url", dest="target", help="Target URL")
options = parser.parse_args()
if not options.target:
parser.error("\n[!] Enter Target URL, Use --help for more info.")
return options
def extract_urls(target_url):
response = requests.get(target_url)
return re.findall('(?:href=")(.*?)"', str(response.content))
target_urls = []
def crawl(target_url):
urls = extract_urls(target_url)
for url in urls:
url = urlparse.urljoin(options.target, url)
if "#" in url:
url = url.split("#")[0]
if options.target in url and url not in target_urls:
target_urls.append(url)
print(url)
crawl(url)
options = parsing_args()
crawl(options.target)
'''
┌──(azab㉿kali)-[~/Python-Scripts]
└─$ python3 Simple-WebApp-Crawler.py -u http://testphp.vulnweb.com/
http://testphp.vulnweb.com/style.css
http://testphp.vulnweb.com/index.php
http://testphp.vulnweb.com/categories.php
http://testphp.vulnweb.com/artists.php
http://testphp.vulnweb.com/disclaimer.php
http://testphp.vulnweb.com/cart.php
http://testphp.vulnweb.com/guestbook.php
http://testphp.vulnweb.com/AJAX/index.php
http://testphp.vulnweb.com/styles.css
http://testphp.vulnweb.com/
http://testphp.vulnweb.com/login.php
http://testphp.vulnweb.com/signup.php
http://testphp.vulnweb.com/userinfo.php
http://testphp.vulnweb.com/privacy.php
http://testphp.vulnweb.com/Mod_Rewrite_Shop/
http://testphp.vulnweb.com/hpp/
http://testphp.vulnweb.com/?pp=12
'''