mirror of
https://github.com/reiyua/Gelos80Sniff.git
synced 2026-01-20 16:27:47 +00:00
Add code to ask user for wordlist.
This commit is contained in:
parent
6d24950a85
commit
e75ce56da4
1 changed files with 10 additions and 6 deletions
|
|
@ -4,11 +4,9 @@
|
||||||
# If a machine is found to have port 80 open, it proceeds to use programs like GoBuster to check for hidden directories.
|
# If a machine is found to have port 80 open, it proceeds to use programs like GoBuster to check for hidden directories.
|
||||||
# Results are exported to a TXT file for convenience.
|
# Results are exported to a TXT file for convenience.
|
||||||
|
|
||||||
# Import required python modules
|
|
||||||
import nmap # pip install python-nmap
|
import nmap # pip install python-nmap
|
||||||
import subprocess
|
import subprocess
|
||||||
import os # Integrates with the OS for file operations
|
import os
|
||||||
import signal
|
|
||||||
|
|
||||||
# Timeout Exception Handling
|
# Timeout Exception Handling
|
||||||
class TimeoutException(Exception):
|
class TimeoutException(Exception):
|
||||||
|
|
@ -61,10 +59,10 @@ def perform_scan(ip_range):
|
||||||
|
|
||||||
|
|
||||||
# Function to run Gobuster if port 80 is open
|
# Function to run Gobuster if port 80 is open
|
||||||
def run_gobuster(ip):
|
def run_gobuster(ip, wordlist):
|
||||||
print(f"\nRunning web enumeration on {ip} (port 80)...")
|
print(f"\nRunning web enumeration on {ip} (port 80)...")
|
||||||
output_file = f"gobuster_results_{ip.replace('.', '_')}.txt"
|
output_file = f"gobuster_results_{ip.replace('.', '_')}.txt"
|
||||||
command = f"gobuster dir -u http://{ip} -w /path/to/wordlist.txt -o {output_file}"
|
command = f"gobuster dir -u http://{ip} -w {wordlist} -o {output_file}"
|
||||||
subprocess.run(command, shell=True)
|
subprocess.run(command, shell=True)
|
||||||
print(f"Enumeration complete. Results saved to {output_file}.")
|
print(f"Enumeration complete. Results saved to {output_file}.")
|
||||||
return output_file
|
return output_file
|
||||||
|
|
@ -79,6 +77,12 @@ def main():
|
||||||
else:
|
else:
|
||||||
print("Invalid IP range or connectivity issue. Please try again.")
|
print("Invalid IP range or connectivity issue. Please try again.")
|
||||||
|
|
||||||
|
# Ask the user for the location of the Gobuster wordlist
|
||||||
|
wordlist_path = input("Enter the full path to your Gobuster wordlist (e.g., /usr/share/wordlists/common.txt): ")
|
||||||
|
if not os.path.isfile(wordlist_path):
|
||||||
|
print("Invalid wordlist path. Please check the path and try again.")
|
||||||
|
return
|
||||||
|
|
||||||
# Perform network scan
|
# Perform network scan
|
||||||
scan_results = perform_scan(ip_range)
|
scan_results = perform_scan(ip_range)
|
||||||
|
|
||||||
|
|
@ -90,7 +94,7 @@ def main():
|
||||||
# Check for open port 80 and run Gobuster
|
# Check for open port 80 and run Gobuster
|
||||||
for ip, ports in scan_results.items():
|
for ip, ports in scan_results.items():
|
||||||
if 80 in ports:
|
if 80 in ports:
|
||||||
output_file = run_gobuster(ip)
|
output_file = run_gobuster(ip, wordlist_path)
|
||||||
|
|
||||||
# Offer to save results
|
# Offer to save results
|
||||||
choice = input("\nDo you want to save the Gobuster results? (yes/no): ").strip().lower()
|
choice = input("\nDo you want to save the Gobuster results? (yes/no): ").strip().lower()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue