Update network scan & add arp scan

This commit is contained in:
Manuel Vergara 2024-01-28 19:38:36 +01:00
parent 222649cd8d
commit 4890661532
3 changed files with 44 additions and 1 deletions

View File

@ -0,0 +1,43 @@
# /usr/bin/env python3
"""
Escaner de red ARP
"""
import scapy.all as scapy
import argparse
def get_arguments():
parser = argparse.ArgumentParser(description='Escaner de red ARP')
parser.add_argument(
'-t', '--target',
required=True, dest='target',
help='Host / IP range. ex: 192.168.1.1 or 192.168.1.0/24'
)
args = parser.parse_args()
return args.target
def scan(ip):
arp_packet = scapy.ARP(pdst=ip)
broadcast_packet = scapy.Ether(dst='ff:ff:ff:ff:ff:ff')
arp_packet = broadcast_packet/arp_packet # / es un operador de composición
answered, unanswered = scapy.srp(arp_packet, timeout=1, verbose=False)
response = answered.summary()
if response:
print(response)
def main():
target = get_arguments()
scan(target)
if __name__ == '__main__':
main()

View File

@ -27,4 +27,4 @@ Quizá encuentres aquí cosas que no están en el vídeo, o viceversa, son apunt
| 11. [Chat cifrado con E2E](./11_chat_cifrado_E2E/) | | 11. [Chat cifrado con E2E](./11_chat_cifrado_E2E/) |
| 12. [Escaner de puertos](./12_escaner_puertos/) | | 12. [Escaner de puertos](./12_escaner_puertos/) |
| 13. [Cambiador de MAC](./13_cambiar_mac_address/) | | 13. [Cambiador de MAC](./13_cambiar_mac_address/) |
| 14. [Escaner de red ICMP](./14_escaner_red_ICMP/) | | 14. [Escaner de red](./14_escaneres_red/) |