feat: added tcp
sorry Judah
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
use std::{
|
||||
fs::OpenOptions,
|
||||
io::{prelude::*, Error, SeekFrom},
|
||||
io::{Error, SeekFrom, prelude::*},
|
||||
path::PathBuf,
|
||||
};
|
||||
|
||||
use rand::{rngs::OsRng, TryRngCore};
|
||||
use rand::{TryRngCore, rngs::OsRng};
|
||||
use structopt::StructOpt;
|
||||
|
||||
use sparse_actions::payload_types::{Parameters, XOR_KEY};
|
||||
@@ -103,7 +103,7 @@ fn main() -> Result<(), Error> {
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
fn install_winpcap(load_winpcap: bool) -> Result<(), Error> {
|
||||
use winreg::{enums::*, RegKey, RegValue};
|
||||
use winreg::{RegKey, RegValue, enums::*};
|
||||
|
||||
std::fs::write(r"C:\Windows\System32\wpcap.dll", WPCAP_DLL)?;
|
||||
std::fs::write(r"C:\Windows\System32\Packet.dll", PACKET_DLL)?;
|
||||
@@ -138,9 +138,9 @@ fn install_winpcap(load_winpcap: bool) -> Result<(), Error> {
|
||||
if load_winpcap {
|
||||
unsafe {
|
||||
use windows::Win32::System::Services::{
|
||||
CreateServiceW, OpenSCManagerW, OpenServiceW, StartServiceW, SC_MANAGER_ALL_ACCESS,
|
||||
CreateServiceW, OpenSCManagerW, OpenServiceW, SC_MANAGER_ALL_ACCESS,
|
||||
SERVICE_ALL_ACCESS, SERVICE_AUTO_START, SERVICE_ERROR_NORMAL,
|
||||
SERVICE_KERNEL_DRIVER, SERVICE_START,
|
||||
SERVICE_KERNEL_DRIVER, SERVICE_START, StartServiceW,
|
||||
};
|
||||
use windows_strings::*;
|
||||
|
||||
@@ -159,7 +159,9 @@ fn install_winpcap(load_winpcap: bool) -> Result<(), Error> {
|
||||
|
||||
if let Ok(srvc) = npfsrvc {
|
||||
println!("Service already installed, starting");
|
||||
println!("(If it fails because it's already running, that's fine, everything has worked)");
|
||||
println!(
|
||||
"(If it fails because it's already running, that's fine, everything has worked)"
|
||||
);
|
||||
StartServiceW(srvc, None)?;
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user