Below is the code of what is probably useless but a functional IPv6 host scanner written in Python using threading.
To perform a regular (brute force) network scans in an IPv6 Network is almost impossible and it can take over 5.000 years to finish.
This project was purely academic and I just wanted to learn about threading in Python.
This software is not recommended for general usage.....
This script will call the OS to actually perform the ping
This software receives two parameters:
a) Prefix to scan in the format 2001:db8::/64 (subnet, not host)
b) Number of simultaneous processes it can run (MAXPINGS)
One more time it was purely academic stuff but hopefully it can make your day
Finally, AFAIK nmap does not yet support IPv6 network scan.
The code was written in python3:
--- cut here ---
#!/usr/bin/python3
import threading
import sys
import ipaddress
import subprocess
import time
CURRENTPINGS=0 # Number of simultaneous ping at a time
def DOPING6(IPv6ADDRESS):
global MAXPINGS, CURRENTPINGS
CURRENTPINGS+=1
CMD="ping6 -c 3 "+str(IPv6ADDRESS) + " 2> /dev/null > /dev/null"
return_code = subprocess.call(CMD, shell=True)
if return_code == 0: #If ping was succesful
print (IPv6ADDRESS," is alive")
CURRENTPINGS-=1
def main():
global MAXPINGS, CURRENTPINGS
if len(sys.argv) != 3: #Validate how many parameters we are receiving
print(" Not enough or too many parameter")
print(" Usage: ./scanipv6.py IPv6Prefix/lenght MAXPINGS")
print(" Example: ./scanipv6.py 2001:db8::/64 20")
print(" Prefix lenght can be between 64-128")
print(" MAXPINGS corresponds to how many pings will be running at the same time")
exit()
SUBNET,MASK=sys.argv[1].split("/")
MAXPINGS=int(sys.argv[2])
for addr in ipaddress.IPv6Network(sys.argv[1]): #Let's loop for each address in the Block
ping_thread=threading.Thread(target=DOPING6,args=(addr,))
while CURRENTPINGS >= MAXPINGS: # With this while we make it possible to run max simultaneous pings
time.sleep(1) # Let's wait one second before proceeding
#print ("Interrumping...., CURRENTPINGS > MAXPINGS") #Uncomment this line just for debugging
ping_thread.start()
main()
Blog en espanol destinado a diferentes temas tecnicos principalmente en IT y Networking. Se desea cubrir Linux, DNS, DNSSEC, RPKI, BGP, Cisco, Programacion (Bash, Python, etc), Protocolos de Enrutamiento, Seguridad en Redes, VoIP.
martes, 9 de diciembre de 2014
Linux - Touchpad no funciona al primer arranque pero si al reiniciar
Situacion:
El touchpad de la laptop no funciona la primera vez que arranca la laptop/computadora pero si al reiniciar la misma
Solucion:
1. Edita el archivo /etc/default/grub (NO es grub.cfg)
2. Ubica la siguiente linea:
GRUB_CMDLINE_LINUX=" "
3. Agrega lo siguiente entre "":
i8042.nomux=1 locale=fr_FR i8042.reset
4. La linea debe quedar asi:
GRUB_CMDLINE_LINUX="i8042.nomux=1 locale=fr_FR i8042.reset"
5. Graba el archivo y sal.
6. En el terminar ejecuta:
#sudo update-grub
7. Listo, apaga y prende tu computadora.
Creditos a:
http://ubuntuforums.org/showthread.php?t=2217553
El touchpad de la laptop no funciona la primera vez que arranca la laptop/computadora pero si al reiniciar la misma
Solucion:
1. Edita el archivo /etc/default/grub (NO es grub.cfg)
2. Ubica la siguiente linea:
GRUB_CMDLINE_LINUX=" "
3. Agrega lo siguiente entre "":
i8042.nomux=1 locale=fr_FR i8042.reset
4. La linea debe quedar asi:
GRUB_CMDLINE_LINUX="i8042.nomux=1 locale=fr_FR i8042.reset"
5. Graba el archivo y sal.
6. En el terminar ejecuta:
#sudo update-grub
7. Listo, apaga y prende tu computadora.
Creditos a:
http://ubuntuforums.org/showthread.php?t=2217553
Suscribirse a:
Entradas (Atom)
Video: Revisando la nueva características AddPaths-Limit en FRR. Una mejora al tradicional AddPath de BGP
En el video recorremos y realizamos un Demo sobre el draft "Paths Limit for Multiple Paths in BGP ". Un documento que viene a se...
-
Debido al crecimiento moderado que ha tenido el presente blog se me ocurrió añadir/integrar las estadisticas de google analytics a mi blog. ...
-
Introduccion: En algunas ocasiones es necesario "bajar" o deshabilitar iptables en nuestro Linux, el procedimiento depende de...
-
Saludos, Lo primero que debemos de hacer para quitar el stacking entre los switches es desconectar los cables Stack que los unen.... Es buen...