Giter Site home page Giter Site logo

network-scanner's Introduction

network-scanner

Simple network scanner built with Scapy for Python

Usage

Perform either an ARP scan or TCP scan.

  • An ARP scan will send ARP requests to all devices on the local network, and collect the ARP replies to discover IP address to MAC address mappings.
  • A TCP scan will send TCP SYN packets to all specified ports, and collect the SYN+ACK replies to discover which ports are open.

If you are on a UNIX-based system, please run the script as root (use sudo).

usage: scanner.py [-h] {ARP,TCP} ...

positional arguments:
  {ARP,TCP}   Command to perform.
    ARP       Perform a network scan using ARP requests.
    TCP       Perform a TCP scan using SYN packets.

optional arguments:
  -h, --help  show this help message and exit

ARP Scan

Either an IP address or IP address range can be used. For example, python3 scanner.py ARP 192.168.2.1/24 scans all IP addresses in the 192.168.2.0/24 subnet.

usage: scanner.py ARP [-h] IP

positional arguments:
  IP          An IP address (e.g. 192.168.1.1) or address range (e.g.
              192.168.1.1/24) to scan.

optional arguments:
  -h, --help  show this help message and exit

TCP Scan

Either specific ports or a range of ports can be used. For example, python3 scanner.py TCP 192.168.2.1 --range 0 1000 scans all ports from 0 to 1000.

usage: scanner.py TCP [-h] [--range] IP ports [ports ...]

positional arguments:
  IP          An IP address or hostname to target.
  ports       Ports to scan, delimited by spaces. When --range is specified,
              scan a range of ports. Otherwise, scan individual ports.

optional arguments:
  -h, --help  show this help message and exit
  --range     Specify a range of ports. When this option is specified, <ports>
              should be given as <low_port> <high_port>.

Common Errors

If you receive AttributeError: 'L2bpfSocket' object has no attribute 'ins', you likely need to run the script as root (use sudo). See https://stackoverflow.com/questions/55881295/l3packetsocket-object-has-no-attribute-ins-when-using-send-command

network-scanner's People

Contributors

zeyu2001 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.