From 79a86ec958a5e66abd81f850c35f3ed0139c855b Mon Sep 17 00:00:00 2001 From: fixit-py Date: Sun, 15 Oct 2023 04:37:58 -0400 Subject: [PATCH 1/6] Add new directory and file --- new_directory/new_file.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 new_directory/new_file.txt diff --git a/new_directory/new_file.txt b/new_directory/new_file.txt new file mode 100644 index 000000000..e69de29bb From 4abf31fb598771bc95de320a51b20dd801df21c4 Mon Sep 17 00:00:00 2001 From: fixit-py Date: Sun, 15 Oct 2023 04:43:17 -0400 Subject: [PATCH 2/6] Add new directory and fil --- new-directory/new_file.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 new-directory/new_file.txt diff --git a/new-directory/new_file.txt b/new-directory/new_file.txt new file mode 100644 index 000000000..e69de29bb From cb0238b383b7c2d0a3217682a99b1d99d5076ee1 Mon Sep 17 00:00:00 2001 From: fixit-py Date: Sun, 15 Oct 2023 04:47:53 -0400 Subject: [PATCH 3/6] Add new directory and file --- networkscanner/new_file.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 networkscanner/new_file.txt diff --git a/networkscanner/new_file.txt b/networkscanner/new_file.txt new file mode 100644 index 000000000..e69de29bb From 6c62d3c674c5ef8f6a1c0d1c78ad3a260f4b5812 Mon Sep 17 00:00:00 2001 From: fixit-py <142362996+fixit-py@users.noreply.github.com> Date: Sun, 15 Oct 2023 04:48:51 -0400 Subject: [PATCH 4/6] Delete new-directory directory --- new-directory/new_file.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 new-directory/new_file.txt diff --git a/new-directory/new_file.txt b/new-directory/new_file.txt deleted file mode 100644 index e69de29bb..000000000 From b617c3afe31eadccef3346c6645dd3232ee406a0 Mon Sep 17 00:00:00 2001 From: fixit-py <142362996+fixit-py@users.noreply.github.com> Date: Sun, 15 Oct 2023 04:52:21 -0400 Subject: [PATCH 5/6] added files --- networkscanner/README.md | 18 ++++++++++++ networkscanner/network_scanner.py | 48 +++++++++++++++++++++++++++++++ networkscanner/requirements.txt | 1 + 3 files changed, 67 insertions(+) create mode 100644 networkscanner/README.md create mode 100644 networkscanner/network_scanner.py create mode 100644 networkscanner/requirements.txt diff --git a/networkscanner/README.md b/networkscanner/README.md new file mode 100644 index 000000000..22e7a50ba --- /dev/null +++ b/networkscanner/README.md @@ -0,0 +1,18 @@ +# network-scanner +# usage +pip install -r requirements.txt +clone the repository with git clone https://github.com/fixit-py/network-scanner.git + +change into the directory with cd MAC-CHANGER2.0 + +give the file permission to run as an executable with chmod +x network_scanner.py + +run python network_scanner.py -r or --range "full ip range with CIDR notation" while using python2 + +run python3 network_scanner.py -r or --range "full ip range with CIDR notation" while using python3 + +replace the "full ip range with CIDR notation" with the name of your ip range +# ABOUT +This python program scans your local network for all devices connected to the network compatible with both python 2 and python 3 specify the interface name using the -r or --range from the bash terminal or cmd. this script works on both linux, MAC and windows as long as all the required external libaries are downloaded and imported +# module +scapy , optparse(argparse) diff --git a/networkscanner/network_scanner.py b/networkscanner/network_scanner.py new file mode 100644 index 000000000..03b5b81b9 --- /dev/null +++ b/networkscanner/network_scanner.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python3 +import scapy.all as scapy +import optparse + +print('############################################################################################################################################') +print('') +print(' ######## ## ## ## ## ######## ') +print(' ## ## ## ## ## ## ') +print(' ## ## ## ## ## ## ') +print(' ######## ## #### ## ## ') +print(' ## ## ## ## ## ## ') +print(' ## ## ## ## ## ## ') +print(' ## ## ## ## ## ## ') +print('') +print('############################################################################################################################################') +print('') +def get_arguments(): + parser = optparse.OptionParser() + parser.add_option('-r', "--range", dest="target", help="Target IP / IP range") + (options, argument) = parser.parse_args() + if not options.target: + parser.error("please enter an ip range") + return options + +def scan(ip): + arp_request = scapy.ARP(pdst=ip) # we create a object that represent an ARP packet and set the pdst to ip + print(arp_request.summary()) # prints the summary of what the script does + # scapy.ls(scapy.ARP()) # it the shows the list of variables we can set for a class + broadcast = scapy.Ether(dst="ff:ff:ff:ff:ff:ff") # creates an ethernet object and set the destination mac as the broadcast mac + arp_request_broadcast = broadcast/arp_request # we combine both packets into 1 + # arp_request_broadcast.show() # shows more info on each packet + # to send packets and recieve packets split into two parts the answered and unanswered and make it less verbose + answered_list = scapy.srp(arp_request_broadcast,timeout=1,verbose=False)[0] + client_list=[] + # print(answered_list.summary()) prints the summary of the sent packets + for element in answered_list: # iterates through the answered list + client_dict = {"ip": element[1].psrc, "MAC": element[1].hwsrc} + client_list.append (client_dict) + print(element[1].psrc + "\t\t" + element[1].hwsrc) # to print the source ip address and source MAC address of the packet + return client_list + +def print_result(result_list): + print ("IP\t\t\tMAC ADDRESS\n -------------------------------------------------") + for client in result_list: + print(client["ip"] + "\t\t" + client["MAC"]) +options = get_arguments() +scan_result = scan(options.target) +print_result(scan_result) diff --git a/networkscanner/requirements.txt b/networkscanner/requirements.txt new file mode 100644 index 000000000..30564abd0 --- /dev/null +++ b/networkscanner/requirements.txt @@ -0,0 +1 @@ +scapy From 122392eb002c976fb3d59aff20bc50b4fcb499ec Mon Sep 17 00:00:00 2001 From: fixit-py <142362996+fixit-py@users.noreply.github.com> Date: Sun, 15 Oct 2023 04:53:26 -0400 Subject: [PATCH 6/6] Delete new_directory directory --- new_directory/new_file.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 new_directory/new_file.txt diff --git a/new_directory/new_file.txt b/new_directory/new_file.txt deleted file mode 100644 index e69de29bb..000000000