Skip to content

VHackenstance/network_scanner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Network Scanner

Goal: Discover all clients on the same Network:

This script requires root privileges.

Run ifconfig locally and select the ip you want to test range for

To run the script please provide arguments in the following format. From the command line, inside the "Change_Mac" Project Folder, run.

python[#] network_scanner.py -i [IPRANGE] [IPRANGE/SUBNET]

eg, $ python network_scanner.py -i 192.168.1.254/24

OR, $ python network_scanner.py --iprange 192.168.1.254/24

Network Scanner Algorithm:

  1. Create ARP request directed to broadcast MAC asking for IP.

    /24 shows clients in the full range

  2. Send packet and receive result.
  3. Parse the response
  4. Print Result

Script Versions

There are three versions of the script

  1. utils: contains separate functions, executed in network_scanner.py, to demonstrate the relationships, and reduce a single outcome to a functional components.
  2. network_scanner_single_function: what it says on the box
  3. network_scanner_uncommented: the bare bones, what you should use if you want to make this script part of your project.

ISSUE 1: This script has to be run by sudo.

Because srp makes socket access requests only a root user can do

$ sudo python(#) network_scanner.py

SOLUTION: Introduced code snippet to cancel script if sudo is not used.

ISSUE 2: ARP requests are logged.

Solution (Needs to be implemented)

import logging

logging.getLogger("scapy").setLevel(logging.CRITICAL)

## This ensures Scapy does not print warnings or informational messages.

Use before running scapy functions like sniff() or sent() ##

Python Dictionaries

Are JavaScript JSON

About

Broadcast to an IP Range, specified by the User, and return the MAC Address and the IP Address of all Clients on the Network

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages