-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebrecon.py
More file actions
94 lines (79 loc) · 3.72 KB
/
webrecon.py
File metadata and controls
94 lines (79 loc) · 3.72 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/usr/bin/env python3
"""
╦ ╦╔═╗╔╗ ╦═╗╔═╗╔═╗╔═╗╔╗╔
║║║║╣ ╠╩╗╠╦╝║╣ ║ ║ ║║║║
╚╩╝╚═╝╚═╝╩╚═╚═╝╚═╝╚═╝╝╚╝
Web Application Fingerprinter v1.0
Author: Ankush (ahirankush771)
GitHub: https://github.com/ahirankush771/WebRecon
"""
import sys
import argparse
import json
import os
from datetime import datetime
from modules.fingerprint import Fingerprinter
from modules.dirscan import DirScanner
from modules.sslinfo import SSLChecker
from modules.headers import HeaderAnalyzer
from modules.reporter import Reporter
BANNER = """
\033[92m
╦ ╦╔═╗╔╗ ╦═╗╔═╗╔═╗╔═╗╔╗╔
║║║║╣ ╠╩╗╠╦╝║╣ ║ ║ ║║║║
╚╩╝╚═╝╚═╝╩╚═╚═╝╚═╝╚═╝╝╚╝
\033[0m
\033[90m Web App Fingerprinter v1.0 | by ahirankush771\033[0m
\033[90m GitHub: github.com/ahirankush771/WebRecon\033[0m
"""
def parse_args():
parser = argparse.ArgumentParser(
description="WebRecon - Web Application Fingerprinter",
formatter_class=argparse.RawTextHelpFormatter
)
parser.add_argument("target", help="Target URL (e.g. https://example.com)")
parser.add_argument("-d", "--dirscan", action="store_true", help="Enable directory brute force")
parser.add_argument("-s", "--ssl", action="store_true", help="Check SSL certificate info")
parser.add_argument("-w", "--wordlist", default="wordlists/common.txt", help="Custom wordlist path")
parser.add_argument("-o", "--output", choices=["json", "txt", "html"], default="txt", help="Output format")
parser.add_argument("-t", "--threads", type=int, default=10, help="Number of threads (default: 10)")
parser.add_argument("--timeout", type=int, default=5, help="Request timeout in seconds")
parser.add_argument("-v", "--verbose", action="store_true", help="Verbose output")
return parser.parse_args()
def main():
print(BANNER)
args = parse_args()
target = args.target
if not target.startswith(("http://", "https://")):
target = "https://" + target
print(f"\033[92m[*]\033[0m Target : {target}")
print(f"\033[92m[*]\033[0m Start Time : {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}")
print(f"\033[92m[*]\033[0m Threads : {args.threads}")
print("\033[90m" + "─" * 55 + "\033[0m\n")
results = {"target": target, "timestamp": datetime.now().isoformat(), "modules": {}}
# Module 1: Tech Stack Fingerprinting
print("\033[93m[MODULE 1]\033[0m Tech Stack Fingerprinting...")
fp = Fingerprinter(target, timeout=args.timeout, verbose=args.verbose)
results["modules"]["fingerprint"] = fp.run()
# Module 2: Header Analysis
print("\n\033[93m[MODULE 2]\033[0m Security Header Analysis...")
ha = HeaderAnalyzer(target, timeout=args.timeout)
results["modules"]["headers"] = ha.run()
# Module 3: SSL Info (optional)
if args.ssl:
print("\n\033[93m[MODULE 3]\033[0m SSL Certificate Check...")
ssl = SSLChecker(target)
results["modules"]["ssl"] = ssl.run()
# Module 4: Directory Scan (optional)
if args.dirscan:
print(f"\n\033[93m[MODULE 4]\033[0m Directory Brute Force (wordlist: {args.wordlist})...")
ds = DirScanner(target, wordlist=args.wordlist, threads=args.threads, timeout=args.timeout)
results["modules"]["dirscan"] = ds.run()
# Generate Report
print("\n\033[90m" + "─" * 55 + "\033[0m")
reporter = Reporter(results, output_format=args.output)
output_file = reporter.save()
print(f"\n\033[92m[✓]\033[0m Report saved → \033[92m{output_file}\033[0m")
print(f"\033[92m[✓]\033[0m Scan complete!\033[0m\n")
if __name__ == "__main__":
main()