fix: fixing revshell example and its routes

This commit is contained in:
Andrew Rioux
2023-05-12 01:16:52 -04:00
parent 4123175eda
commit 5ab43a10fe
4 changed files with 30 additions and 9 deletions

View File

@@ -1,4 +1,4 @@
use std::{collections::HashMap, io::prelude::*, net::Ipv4Addr};
use std::{collections::HashMap, net::Ipv4Addr};
use anyhow::anyhow;
use tokio::time::{interval, Duration};
@@ -9,12 +9,7 @@ use pcap_sys::packets::*;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
print!("Please enter the target IP (found with `docker-compose exec examples_revshell_server ip a`, e.x. 172.19.0.2): ");
std::io::stdout().flush()?;
let stdin = std::io::stdin();
let mut target = String::new();
stdin.read_line(&mut target)?;
let target = target.trim().parse::<Ipv4Addr>()?;
let target = std::env::args().skip(1).next().ok_or(anyhow!("could not get target IP"))?.parse::<Ipv4Addr>()?;
let (ifname, src_mac, dst_mac, srcip) = {
let socket = netlink::Socket::new()?;