Skip to content

Commit

Permalink
Merge branch 'ezequielpereira' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
kpcyrd committed Aug 20, 2020
2 parents 7b72bf8 + e3c797d commit f42fbb1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ pub struct Args {
pub src: SocketAddr,
/// The destination of the connection
pub dst: SocketAddr,
/// Initial seq number
pub seq: u32,
/// Initial ack number
pub ack: u32,
/// Reset the connection rather than hijacking it
#[structopt(short="r", long)]
pub reset: bool,
Expand Down
8 changes: 7 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use env_logger::Env;
use std::io::{self, Read};
use std::thread;
use structopt::StructOpt;
use std::net::SocketAddrV4;

fn main() -> Result<()> {
let arguments = Args::from_args();
Expand All @@ -27,7 +28,12 @@ fn main() -> Result<()> {
eprintln!("Waiting for SEQ/ACK to arrive from the srcip to the dstip.");
eprintln!("(To speed things up, try making some traffic between the two, /msg person asdf)");

let mut connection = net::getseqack(&arguments.interface, &arguments.src, &arguments.dst)?;
let mut connection = net::Connection::new(
SocketAddrV4::new(*arguments.src.ip(), arguments.src.port()),
SocketAddrV4::new(*arguments.dst.ip(), arguments.dst.port()),
arguments.seq,
arguments.ack,
);
eprintln!("[+] Got packet! SEQ = 0x{:x}, ACK = 0x{:x}", connection.get_seq(), connection.get_ack());

let (mut tx, _rx) = net::create_socket()?;
Expand Down

0 comments on commit f42fbb1

Please sign in to comment.