Skip to content

Commit 869a733

Browse files
authored
add option to save the output
1 parent 0c9a103 commit 869a733

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

webtech.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,12 @@
1717
#
1818
#
1919

20-
from concurrent.futures import ThreadPoolExecutor as executor
20+
from concurrent.futures import ThreadPoolExecutor as executor # pip install futures
2121
from Wappalyzer import Wappalyzer, WebPage # pip install python-Wappalyzer
2222
import urllib3, argparse
2323

2424
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) # disable Python SSL warnings !
2525

26-
yellow = "\033[93m"
2726
green = "\033[32m"
2827
blue = "\033[34m"
2928
red = "\033[31m"
@@ -45,30 +44,37 @@
4544

4645

4746

48-
def check(ig, url):
47+
def check(out, ig, url):
4948
if not url.startswith('http'):
5049
url = 'http://' + url
5150
try:
5251
webpage = WebPage.new_from_url(url)
5352
tech = wappalyzer.analyze(webpage)
54-
print(yellow+"[+] " + str(url) + end + bold + " | " + green + ", ".join(tech) + end)
53+
print("[+] " + str(url) + " | " + green + bold + " - ".join(tech) + end)
54+
if out != 'None':
55+
with open(out, 'a') as f:
56+
f.write(url + " | " + " - ".join(tech) + "\n")
57+
f.close()
58+
5559
except Exception as e:
5660
if ig == 'True':
5761
pass
5862
else:
59-
print(red+"Error: " + end + "[ " + bold + str(url) + end + " ] | " + str(e))
63+
print(red+"Error: " + end + "[ " + bold + str(url) + end + " ] > " + str(e))
6064

6165

6266
parser = argparse.ArgumentParser()
6367
parser.add_argument("-w", "--wordlist", help="Domains List File", type=str, required=True)
6468
parser.add_argument("-t", "--thread", help="Theads Number - (Default: 10)", type=int)
6569
parser.add_argument("-i", "--ignore", help="To Ignore The Errors", action='store_true')
70+
parser.add_argument("-o", "--output", help="Save The Results To a File", type=str)
6671

6772
args = parser.parse_args()
6873

6974
links = str(args.wordlist)
7075
threads = str(args.thread)
7176
ig = str(args.ignore)
77+
out = str(args.output)
7278

7379
lines = len(open(links).readlines())
7480

@@ -77,6 +83,7 @@ def check(ig, url):
7783

7884
print(blue +"["+red+"+"+blue+"] File: " + end + links)
7985
print(blue +"["+red+"+"+blue+"] Length: " + end + str(lines))
86+
print(blue +"["+red+"+"+blue+"] Output: " + end + str(out))
8087
print(blue +"["+red+"+"+blue+"] Threads: " + end + str(threads))
8188
print(blue +"["+red+"+"+blue+"] Ignore: " + end + str(ig))
8289

@@ -85,5 +92,5 @@ def check(ig, url):
8592

8693
urls = open(links,'r')
8794
with executor(max_workers=int(threads)) as exe:
88-
[exe.submit(check, ig, url.strip('\n')) for url in urls]
95+
[exe.submit(check, out, ig, url.strip('\n')) for url in urls]
8996

0 commit comments

Comments
 (0)