Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- import os
- import subprocess
- import time
- import sys
- def run_command(command):
- try:
- return subprocess.check_output(command, shell=True, text=True).strip()
- except subprocess.CalledProcessError:
- return None
- def slow_print(text, color="\033[31m"): # Red color for emphasis
- for char in text:
- sys.stdout.write(f"{color}{char}\033[0m")
- sys.stdout.flush()
- time.sleep(0.05)
- print()
- def list_wifi_networks():
- print("\nScanning for available WiFi networks...\n")
- networks = run_command("nmcli -t -f SSID dev wifi list")
- if networks:
- for idx, network in enumerate(networks.splitlines()):
- print(f"{idx + 1}: {network}")
- else:
- print("No networks found.")
- def connect_to_wifi():
- ssid = input("Enter the SSID of the network you want to connect to: ")
- password = input("Enter the password: ")
- command = f"nmcli dev wifi connect '{ssid}' password '{password}'"
- result = run_command(command)
- print("Connected successfully." if result else "Failed to connect.")
- def disconnect_wifi():
- print("\nDisconnecting WiFi...\n")
- result = run_command("nmcli con down id $(nmcli -t -f NAME con show --active)")
- print("Disconnected successfully." if result else "No active connection to disconnect.")
- def network_status():
- print("\nCurrent Network Status:\n")
- status = run_command("nmcli -t -f ACTIVE,SSID,MODE,CHAN,RATE,SIGNAL,BARS,SECURITY dev wifi list | grep '^yes'")
- if status:
- fields = status.split(':')
- print(f"SSID: {fields[1]}\nMode: {fields[2]}\nChannel: {fields[3]}\nRate: {fields[4]} Mbps\nSignal Strength: {fields[5]}%\nSignal Bars: {fields[6]}\nSecurity: {fields[7]}")
- else:
- print("No active WiFi connection.")
- local_ip = run_command("hostname -I | awk '{print $1}'")
- gateway_ip = run_command("ip route | grep default | awk '{print $3}'")
- external_ip = run_command("curl -s https://ipinfo.io/ip")
- print(f"Local IP: {local_ip}\nGateway IP: {gateway_ip}\nExternal IP: {external_ip}")
- def port_scan():
- target = input("Enter the IP address to scan: ")
- print(f"\nScanning ports on {target}...\n")
- result = run_command(f"nmap -Pn {target}")
- print(result if result else "Port scan failed or returned no results.")
- def bruteforce_wifi():
- ssid = input("Enter the SSID of the network to brute-force: ")
- wordlist = input("Enter the path to the wordlist file: ")
- print(f"\nStarting brute-force attack on {ssid}...\n")
- result = run_command(f"aircrack-ng -w {wordlist} -e {ssid} /tmp/*.cap")
- print(result if result else "Brute-force attack failed or returned no results.")
- def show_route_table():
- print("\nRoute Table and Local Network Information:\n")
- route_table = run_command("ip route")
- interfaces = run_command("ip addr")
- print(f"Route Table:\n{route_table}\n\nNetwork Interfaces:\n{interfaces}")
- def list_file_shares():
- print("\nScanning local network for file shares...\n")
- result = run_command("smbclient -L //localhost -N")
- print(result if result else "No file shares found or failed to retrieve shares.")
- def traceroute_test():
- target = input("Enter the IP address or URL for traceroute: ")
- print(f"\nTraceroute to {target}...\n")
- result = run_command(f"traceroute {target}")
- print(result if result else "Traceroute failed or returned no results.")
- def ping_test():
- target = input("Enter the IP address or URL to ping: ")
- print(f"\nPinging {target}...\n")
- result = run_command(f"ping -c 4 {target}")
- print(result if result else "Ping test failed or returned no results.")
- def main():
- slow_print("Network Configuration Menu", "\033[34m")
- while True:
- print("\nOptions:")
- print("1: List WiFi Networks")
- print("2: Connect to WiFi")
- print("3: Disconnect from WiFi")
- print("4: Show Network Status")
- print("5: Port Scan")
- print("6: WiFi Bruteforce Attack")
- print("7: Show Route Table and Network Info")
- print("8: List Active File Shares")
- print("9: Traceroute Test")
- print("10: Ping Test")
- print("11: Exit")
- choice = input("\nEnter your choice: ")
- if choice == '1':
- list_wifi_networks()
- elif choice == '2':
- connect_to_wifi()
- elif choice == '3':
- disconnect_wifi()
- elif choice == '4':
- network_status()
- elif choice == '5':
- port_scan()
- elif choice == '6':
- bruteforce_wifi()
- elif choice == '7':
- show_route_table()
- elif choice == '8':
- list_file_shares()
- elif choice == '9':
- traceroute_test()
- elif choice == '10':
- ping_test()
- elif choice == '11':
- break
- else:
- print("You picked wrong dumb ass")
- if __name__ == "__main__":
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement