Skip to content

Commit acb6f5f

Browse files
better bruteforce tool, debug tqdm loading bar, better handle of error while getting proxy
1 parent d0fbf6f commit acb6f5f

File tree

5 files changed

+3730
-9941
lines changed

5 files changed

+3730
-9941
lines changed

default_configuration.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ Proxy :
44
activate: true
55
file: null #path to file, one proxy per line
66
links:
7-
https://raw.githubusercontent.com/mertguvencli/http-proxy-list/main/proxy-list/data.txt : "http"
87
https://raw.githubusercontent.com/TheSpeedX/PROXY-List/master/http.txt : "http"
98
https://raw.githubusercontent.com/monosans/proxy-list/main/proxies/http.txt: "http"
109
https://raw.githubusercontent.com/TheSpeedX/SOCKS-List/master/socks5.txt : "socks"

lib/configuration.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,16 @@ def load(self):
106106
logger.info("[*] Info: Proxy activated")
107107
# logger.info("[*] Testing proxy...")
108108
for link, type in self.config["Proxy"]["links"].items():
109-
for line in requests.get(link).text.splitlines():
110-
if type == "http":
111-
self.http_proxy.append(line)
112-
elif type == "https":
113-
self.https_proxy.append(line)
114-
elif type == "socks":
115-
self.socks_proxy.append(line)
109+
try :
110+
for line in requests.get(link).text.splitlines():
111+
if type == "http":
112+
self.http_proxy.append(line)
113+
elif type == "https":
114+
self.https_proxy.append(line)
115+
elif type == "socks":
116+
self.socks_proxy.append(line)
117+
except:
118+
logger.warning("[!] Warning: {} returned an error".format(link))
116119
# self.check_proxy()
117120

118121
def is_in_scope(self, to_test: str, mode: str):

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"version": "V3.1.2",
2+
"version": "V3.1.3",
33
"configuration_file_version": "2.0.1"
44
}

tools/AS_scan/brute_subs.py

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,41 @@
66
import lib.generics as gen
77
import lib.custom_logger as custom_logger
88
import time
9-
9+
import uuid
1010
logger = custom_logger.logger
1111

12+
ips = set()
13+
def is_wildcard(fqdn: str) -> bool:
14+
"""
15+
Checks if the fqdn is a wildcard.
1216
17+
:param fqdn: A string representing the fully qualified domain name.
18+
:return: A boolean indicating if the fqdn is a wildcard.
19+
"""
20+
try:
21+
random_subdomain = str(uuid.uuid4())
22+
answer = dns.resolver.resolve(random_subdomain + "." + fqdn)
23+
if answer:
24+
# Test 100 random subdomains and store the ips inside ips set
25+
for i in range(100):
26+
random_subdomain = str(uuid.uuid4())
27+
answer = dns.resolver.resolve(random_subdomain + "." + fqdn)
28+
if answer:
29+
ips.add(str(answer[0]))
30+
return True
31+
else:
32+
return False
33+
34+
except:
35+
return False
1336
def resolve_and_store(
1437
resolver: dns.resolver.Resolver,
1538
subdomain: str,
1639
fqdn: str,
1740
config: gen.configuration,
1841
res: result,
1942
pbar: tqdm,
43+
wildcard: bool = False,
2044
) -> None:
2145
"""
2246
Resolves the subdomain and stores the result inside res.result.
@@ -31,14 +55,15 @@ def resolve_and_store(
3155
try:
3256
answer = resolver.resolve(subdomain + "." + fqdn)
3357
ip = str(answer[0])
58+
if ip in ips and wildcard:
59+
return
3460
name = str(answer.qname)
3561
ip = ip_lib.ip(ip, config)
3662
res.add_fqdn(ip, name)
37-
# simulate some work being done
38-
time.sleep(0.1)
39-
pbar.update(1)
4063
except:
4164
pass
65+
finally:
66+
pbar.update(1)
4267

4368

4469
def main(config: gen.configuration, res: result, name: str) -> result:
@@ -63,6 +88,11 @@ def main(config: gen.configuration, res: result, name: str) -> result:
6388
logger.info("[*] Skipping brute_subs")
6489
return
6590
logger.info(f"[*] Bruteforcing subdomains for {name}")
91+
wildcard = False
92+
if is_wildcard(name):
93+
logger.info(f"[*] {name} is a wildcard")
94+
wildcard = True
95+
6696
# get wordlist inside tools/worldlists
6797
wordlist = f"tools/wordlists/{this_tool_config['wordlist_name']}"
6898
# get resolver inside tools/resolvers
@@ -82,7 +112,7 @@ def main(config: gen.configuration, res: result, name: str) -> result:
82112
with tqdm(total=len(subdomains), leave=False) as pbar:
83113
futures = [
84114
executor.submit(
85-
resolve_and_store, resolver, subdomain, fqdn, config, res, pbar
115+
resolve_and_store, resolver, subdomain, fqdn, config, res, pbar, wildcard
86116
)
87117
for subdomain in subdomains
88118
]

0 commit comments

Comments
 (0)