Skip to content

bengabay11/networks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

92 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

networks

Python Network Operations for Humans

Table of contents

  1. networks
  2. Table of contents
  3. Examples

Examples

Traceroute

Perform trace to the given host.

>>> 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.

>>> 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.

>>> 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.

>>> 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.

>>> 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']