dhcps - DHCP Listener
Publicado por henrique (última atualização em 04/10/2022)
[ Hits: 3.947 ]
Homepage: naotem.com
Um scanner DHCP feito com scrapy que verifica conexões na rede e pega algumas informações com endereço MAC.
Um teste prático é iniciá-lo na sua rede e desconectar um dispositivo, como por exemplo seu celular e reconctá-lo que a magica acontece.
Nunca use para meios ilegais!
#!/bin/python3
from scapy.all import *
import time
red = "\033[1;31m"
blue = "\033[1;34m"
cyan = "\033[1;36m"
green = "\033[0;32m"
reset = "\033[0;0m"
bold = "\033[;1m"
reverse = "\033[;7m"
branco = "\033[37m"
gray = "\033[0;37m"
orange = "\033[0;49;33m"
yellow = "\033[0;49;93m"
def init():
print('-'*66)
print(yellow, """\n\n .sSSSSs. .sSSS SSSSS .sSSSSs. .sSSSSs. .sSSSSs.
SSSSSSSSSs. SSSSS SSSSS SSSSSSSSSs. SSSSSSSSSs. SSSSSSSSSs.
S SSS SSSSS S SSS SSSSS S SSS SSSSS S SSS SSSSS S SSS SSSS'
S SS SSSSS S SS SSSSS S SS SSSS' S SS SSSSS S SS
S..SS SSSSS S..SSsSSSSS S..SS S..SS SSSSS `SSSSsSSSa.
S:::S SSSSS S:::S SSSSS S:::S SSSSS S:::SsSSSSS .sSSS SSSSS
S;;;S SSSSS S;;;S SSSSS S;;;S SSSSS S;;;S S;;;S SSSSS
S%%%S SSSS' S%%%S SSSSS S%%%S SSSSS S%%%S S%%%S SSSSS
SSSSSsS;:' SSSSS SSSSS SSSSSsSSSSS SSSSS SSSSSsSSSSS\n\n""", reset)
def listen_dhcp():
# Make sure it is DHCP with the filter options
sniff(prn=print_packet, filter='udp and (port 67 or port 68)')
def print_packet(packet):
# initialize these variables to None at first
target_mac, requested_ip, hostname, vendor_id = [None] * 4
# get the MAC address of the requester
if packet.haslayer(Ether):
target_mac = packet.getlayer(Ether).src
# get the DHCP options
dhcp_options = packet[DHCP].options
for item in dhcp_options:
try:
label, value = item
except ValueError:
continue
if label == 'requested_addr':
# get the requested IP
requested_ip = value
elif label == 'hostname':
# get the hostname of the device
hostname = value.decode()
elif label == 'vendor_class_id':
# get the vendor ID
vendor_id = value.decode()
if target_mac and vendor_id and hostname and requested_ip:
# if all variables are not None, print the device details
time_now = time.strftime("[%H:%M:%S]")
print(red,f"| {time_now} : {target_mac} - {hostname} / {vendor_id} requested {requested_ip} | -**-", reset)
print(blue, '| | -**-', reset)
if __name__ == "__main__":
init()
listen_dhcp()
print('-'*66)
Scanner Wifi in Python [very simple and helpful]
Shell reverso em Python - cliente
Como extrair chaves TOTP 2FA a partir de QRCODE (Google Authenticator)
Linux em 2025: Segurança prática para o usuário
Desktop Linux em alta: novos apps, distros e privacidade marcam o sábado
IA chega ao desktop e impulsiona produtividade no mundo Linux
Novos apps de produtividade, avanços em IA e distros em ebulição agitam o universo Linux
Como instalar o repositório do DBeaver no Ubuntu
Como instalar o Plex Media Server no Ubuntu
Digitando underscore com "shift" + "barra de espaços"
Como ativar a lixeira e recuperar aquivos deletados em um servidor Linux
Como mudar o nome de dispositivos Bluetooth via linha de comando
dpkg: erro: gatilho de arquivo duplicado chamado pelo arquivo de nome (6)
Instalação não está resolvendo as dependencias (2)
Captação de áudio no zorin linux começa a diminuir com o tempo (5)
Alternativas ao Multilogin para gerenciamento de múltiplas contas/prof... (0)









