Skip to content

Commit

Permalink
some little changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ugomeguerditchian committed Aug 3, 2023
1 parent 2b1aa08 commit 9b21dff
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 65 deletions.
4 changes: 2 additions & 2 deletions default_configuration.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dev_mode: false
version: "2.0.0"
Proxy :
activate: false
activate: true
file: null #path to file, one proxy per line
links:
https://raw.githubusercontent.com/mertguvencli/http-proxy-list/main/proxy-list/data.txt : "http"
Expand Down Expand Up @@ -76,7 +76,7 @@ TOOLS :
workers: 3000
wordlist_name: "n0kovo_subdomains_tiny.txt"
resolver_name: "resolvers.txt"
recursive: true
recursive: false #if activated will try to get subs from subs founds in recursive scan WARNING : this can take a lot of time dependings on the number of subs found and wordlist size
after_AS_scan:
ports_scanner:
file: "ports_scanner"
Expand Down
60 changes: 0 additions & 60 deletions lib/domain.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
import requests

# from libs import result_parser as rp
import json
import socket
import threading
from lib.handler import handler
from dns import resolver
import lib.custom_logger as custom_logger
Expand Down Expand Up @@ -98,57 +92,3 @@ def get_ip(self):
return ip[0].to_text()
except:
return "Dead"


def from_wordlist(domain, wordlist_chunks):
# wordlist is Subdomain.txt
# open the file

# test all the subdomains like {subdomain}.{domain}
subdomains = []
for line in wordlist_chunks:
if "*" in line:
pass
# delete the \n
line = line.replace("\r", "")
# loaading percentage
print(
f"{domain}\tWordlist testing : {str(round(wordlist_chunks.index(line) / len(wordlist_chunks) * 100, 2))}% ",
end="\r",
)
request_to_test = line.strip() + "." + domain
try:
socket.gethostbyname(request_to_test)
# if the connection is successful, add the subdomain to the list
subdomains.append(request_to_test)
except:
pass
return subdomains


def divide_chunks(l, n):
# looping till length l
for i in range(0, len(l), n):
yield l[i : i + n]


def from_wordlist_thread(domain, thread_number, wordlist):
with open(wordlist, "r") as file:
# read all the lines
lines = file.readlines()
# delete all \n
lines = [line.replace("\n", "") for line in lines]
ranges = list(divide_chunks(lines, len(lines) // thread_number))
subdomains = []
threads = []
for i in ranges:
t = threading.Thread(target=lambda: subdomains.append(from_wordlist(domain, i)))
threads.append(t)
t.start()
for i in threads:
i.join()
final_subdomains = []
for i in subdomains:
final_subdomains += i
final_subdomains = rp.delete_occurences(final_subdomains)
return final_subdomains
3 changes: 2 additions & 1 deletion lib/generics.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def fqdn_scanner(
with ThreadPoolExecutor(max_workers=config.api_max_workers) as executor:
futures_get_subs = []
futures_domain_recursive = {}
for ip in tqdm(res.result, desc=f"Scanning level {i+1}", ncols=100):
for ip in res.result :
if config.is_there_scope() and not config.is_in_scope(
str(ip.ip), mode="IPs"
):
Expand Down Expand Up @@ -226,6 +226,7 @@ def check_update(config: configuration):
repo = git.Repo(".")
repo.remotes.origin.pull()
logger.info("Update successful")
exit(1)
elif answer.lower() == "n":
pass
else:
Expand Down
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def main():
required=False,
default=False,
type=str,
help="Resume a scan from the json export and to a tool (the last one to have finished), split with a ':' (ex: --resume exports/mydomain/date.json:nuclei) You can also use --resume exports/mydomain/date.json:export to just generate the html report",
help="Resume a scan from the json export. You can specify a tool (the last one to have finished), split with a ':' (ex: --resume exports/mydomain/date.json:nuclei) You can also use --resume exports/mydomain/date.json:export to just generate the html report",
)
args = argpars.parse_args()
if not args.domain and not args.network and not args.ip and not args.resume:
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "V3.1.0",
"configuration_file_version": "2.0.0",
"last_update": "03/08/2023 16:48:03"
"last_update": "03/08/2023 16:54:58"
}

0 comments on commit 9b21dff

Please sign in to comment.