-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
31 lines (26 loc) · 1.05 KB
/
main.py
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
from arp_scan import scan
from mac_resolver import get_mac
from discord import send_to_discord
from utils import display_banner
import argparse
def main():
display_banner()
parser = argparse.ArgumentParser(description="visARP - A modular ARP tool.")
parser.add_argument("-r", "--range", help="IP range to scan (e.g., 192.168.1.0/24)", type=str)
parser.add_argument("-m", "--mac", help="Resolve MAC address for an IP", type=str)
parser.add_argument("-w", "--webhook", help="Discord webhook URL", required=True, type=str)
args = parser.parse_args()
result = ""
if args.range:
devices = scan(args.range)
result = "\n".join([f"IP: {device['ip']} - MAC: {device['mac']}" for device in devices])
elif args.mac:
mac = get_mac(args.mac)
result = f"IP: {args.mac} - MAC: {mac}" if mac else "Failed to resolve MAC address."
else:
print("No valid action specified. Use -h for help.")
return
print(result)
send_to_discord(args.webhook, result)
if __name__ == "__main__":
main()