https://github.com/bengabay11/networks
Python Network Operations for Humans
https://github.com/bengabay11/networks
arp-spoofing networking ping port-scanning python scapy socket traceroute
Last synced: 4 days ago
JSON representation
Python Network Operations for Humans
- Host: GitHub
- URL: https://github.com/bengabay11/networks
- Owner: bengabay11
- License: mit
- Created: 2019-06-09T15:42:30.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-12-22T20:50:47.000Z (over 6 years ago)
- Last Synced: 2025-02-22T05:18:44.856Z (over 1 year ago)
- Topics: arp-spoofing, networking, ping, port-scanning, python, scapy, socket, traceroute
- Language: Python
- Homepage:
- Size: 46.9 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# networks
Python Network Operations for Humans
## Table of contents
1. [networks](#networks)
2. [Table of contents](#table-of-contents)
4. [Examples](#examples)
* [Traceroute](#traceroute)
* [Arp Spoofing](#arp-spoofing)
* [Port Scanning](#port-scanning)
* [Ping](#ping)
### Traceroute
Perform trace to the given host.
```pycon
>>> import networks
>>> stations = networks.trace("www.google.com", max_hops=20, timeout=5)
>>> stations
['192.168.1.1', '0.0.0.0', None, '172.18.9.214', '172.17.3.118', None, None, '209.85.241.75', '172.217.18.100']
```
### Arp Spoofing
Perform arp spoofing attack on the given target.
```pycon
>>> import networks
>>> target = "192.168.1.40"
>>> gateway = "192.168.1.1"
>>> networks.arp_spoofing(target, gateway, interval=1, timeout=120)
```
### Port Scanning
Perform port scanning on the given target.
```pycon
>>> import networks
>>> ports = networks.port_scanning("192.168.1.40", min_port=78, max_port=81, timeout=30)
>>> ports
{78: False, 79: False, 80: True, 81: False}
```
### Ping
Send ICMP packets to the given host.
```pycon
>>> import networks
>>> host_up = networks.ping("www.google.com", count=5, ttl=30, timeout=5)
>>> host_up
True
```
### Hosts in segment
get hosts inside a given segment.
```pycon
>>> import networks
>>> hosts = networks.get_hosts_in_segment("192.168.1.0")
>>> hosts
['192.168.1.1', '192.168.1.40', '192.168.1.23']
```