Skip to content

Commit

Permalink
Fix pado
Browse files Browse the repository at this point in the history
  • Loading branch information
fedebuonco committed Oct 20, 2024
1 parent b809ac8 commit 0c079c0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/exploit/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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<Vec<u8>>) {
Expand Down
5 changes: 3 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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...");
Expand Down

0 comments on commit 0c079c0

Please sign in to comment.