Apprentissage et manipulation des chaînes de caractères Python et étude de la distinction fondamentale avec les chaînes binaires.
Étude de la structure et des fonctions de la bibliothèque Scapy. Réalisation d'exercices de sniffing de paquets IPv4 et IPv6 pour extraire et afficher les données des protocoles ARP et Neighbor Discovery.
Analyse de fichiers de capture Wireshark pour récupérer des informations sensibles dissimulées dans les trames et organisation de l'affichage pour l'utilisateur final.
Interception de données en temps réel par sniffing réseau. Focus sur la vulnérabilité des protocoles non-chiffrés tels que FTP, TELNET et HTTP pour l'extraction d'identifiants.
Script Python : Récupération des données Telnet
# Extrait : Sniffer Telnet
def sniff_function(trame):
global port, src_ip, dst_ip, syn, syn_ack, ack, handshake, stop_sniffing, handshake_detected, telnet
if trame.haslayer('TCP') and trame.haslayer('IP'):
if trame.haslayer('TCP'):
if trame['TCP'].dport == port and trame['TCP'].flags & 0x02:
syn = True
src_ip = trame['IP'].src
dst_ip = trame['IP'].dst
if trame['TCP'].sport == port and trame['TCP'].flags & 0x12:
syn_ack = True
if trame['TCP'].dport == port and trame['TCP'].flags & 0x10:
ack = True
if trame.haslayer('TCP') and trame.haslayer(Raw):
data = trame[Raw].load
if len(data) >= 2 and data[0] == 0xFF and data[1] in [0xFB, 0xFC, 0xFD, 0xFE]:
telnet = True
if syn and syn_ack and ack and telnet and not handshake_detected:
print("[✓] Connexion Telnet detectée !\n")
handshake_detected = True
Script Python : Récupération des données HTTP
# Extrait : Sniffer HTTP
def sniff_function(trame):
global port, syn, syn_ack, ack, handshake_detected, http, fin_client, fin_server, stop
if trame.haslayer('TCP') and trame.haslayer('IP'):
#Detecter ouverture de connexion
if trame['TCP'].dport == port and trame['TCP'].flags & 0x02:
syn = True
if trame['TCP'].sport == port and trame['TCP'].flags & 0x12:
syn_ack = True
if trame['TCP'].dport == port and trame['TCP'].flags & 0x10:
ack = True
#Detecter fin de connexion
if trame['TCP'].dport == port and 'F' in trame['TCP'].flags:
fin_client = True
if trame['TCP'].sport == port and 'F' in trame['TCP'].flags:
fin_server = True
#Detected méthode HTTP
if trame.haslayer('TCP') and trame.haslayer('Raw'):
data = trame['Raw'].load
if len(data) > 2 and data[0] == 0x47 and data[1] == 0x45 and data[2] == 0x54:
http = True
print("[✓] GET HTTP detecté !\n")
if syn and syn_ack and ack and http:
http = False
find_info(trame)
if fin_server and fin_client:
stop = True
print("\n[-] Connexion fermée")
Accéder au dépôt complet :
github.com/0xProx1m4/SAE-204