rename cryptoutils lib

This commit is contained in:
17ms 2024-02-21 16:29:18 +02:00
parent 030bf89a92
commit 7a40f17a57
10 changed files with 17 additions and 17 deletions

8
Cargo.lock generated
View File

@ -3,7 +3,7 @@
version = 3 version = 3
[[package]] [[package]]
name = "airborne-utils" name = "airborne-common"
version = "0.1.0" version = "0.1.0"
[[package]] [[package]]
@ -110,7 +110,7 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7"
name = "generator" name = "generator"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"airborne-utils", "airborne-common",
"clap", "clap",
"rand", "rand",
"windows-sys", "windows-sys",
@ -149,7 +149,7 @@ checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7"
name = "poc-injector" name = "poc-injector"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"airborne-utils", "airborne-common",
"lexopt", "lexopt",
"windows-sys", "windows-sys",
] ]
@ -219,7 +219,7 @@ dependencies = [
name = "reflective-loader" name = "reflective-loader"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"airborne-utils", "airborne-common",
"windows-sys", "windows-sys",
] ]

View File

@ -6,7 +6,7 @@ members = [
"payload", "payload",
"generator", "generator",
"reflective_loader", "reflective_loader",
"utils" "common"
] ]
[profile.release] [profile.release]

View File

@ -1,5 +1,5 @@
[package] [package]
name = "airborne-utils" name = "airborne-common"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"

View File

@ -6,7 +6,7 @@ edition = "2021"
[dependencies] [dependencies]
clap = { version = "4.4.18", features = ["derive"] } clap = { version = "4.4.18", features = ["derive"] }
rand = "0.8.5" rand = "0.8.5"
airborne-utils = { path = "../utils" } airborne-common = { path = "../common" }
[dependencies.windows-sys] [dependencies.windows-sys]
version = "0.52.0" version = "0.52.0"

View File

@ -3,7 +3,7 @@ use std::{
slice::from_raw_parts, slice::from_raw_parts,
}; };
use airborne_utils::calc_hash; use airborne_common::calc_hash;
use clap::{ArgAction, Parser}; use clap::{ArgAction, Parser};
use windows_sys::Win32::{ use windows_sys::Win32::{
System::Diagnostics::Debug::IMAGE_NT_HEADERS64, System::Diagnostics::Debug::IMAGE_NT_HEADERS64,
@ -50,7 +50,7 @@ fn main() {
let args = Args::parse(); let args = Args::parse();
// (bool, bool, bool) -(OR)-> u32 // (bool, bool, bool) -(OR)-> u32
let combined_flag = airborne_utils::create_u32_flag(args.no_delay, args.no_shuffle, args.ufn); let combined_flag = airborne_common::create_u32_flag(args.no_delay, args.no_shuffle, args.ufn);
// preserve the path from being dropped // preserve the path from being dropped
let output_path = args.output_path.clone(); let output_path = args.output_path.clone();
@ -97,7 +97,7 @@ fn main() {
println!("\n[+] xor'ing shellcode"); println!("\n[+] xor'ing shellcode");
let key = gen_xor_key(shellcode.len()); let key = gen_xor_key(shellcode.len());
airborne_utils::xor_cipher(&mut shellcode, &key); airborne_common::xor_cipher(&mut shellcode, &key);
let mut key_output_path = output_path.clone().into_os_string(); let mut key_output_path = output_path.clone().into_os_string();
key_output_path.push(".key"); key_output_path.push(".key");

View File

@ -5,7 +5,7 @@ edition = "2021"
[dependencies] [dependencies]
lexopt = "0.3.0" lexopt = "0.3.0"
airborne-utils = { path = "../utils" } airborne-common = { path = "../common" }
[dependencies.windows-sys] [dependencies.windows-sys]
version = "0.52.0" version = "0.52.0"

View File

@ -51,7 +51,7 @@ fn main() {
} }
println!("[+] xor'ing shellcode"); println!("[+] xor'ing shellcode");
airborne_utils::xor_cipher(&mut shellcode, &keyfile); airborne_common::xor_cipher(&mut shellcode, &keyfile);
println!("[+] injecting shellcode into {}", args.procname); println!("[+] injecting shellcode into {}", args.procname);
unsafe { unsafe {

View File

@ -7,7 +7,7 @@ edition = "2021"
crate-type = ["cdylib"] crate-type = ["cdylib"]
[dependencies] [dependencies]
airborne-utils = { path = "../utils" } airborne-common = { path = "../common" }
[dependencies.windows-sys] [dependencies.windows-sys]
version = "0.52.0" version = "0.52.0"

View File

@ -10,7 +10,7 @@ use core::{
slice::from_raw_parts, slice::from_raw_parts,
}; };
use airborne_utils::Flags; use airborne_common::Flags;
use windows_sys::{ use windows_sys::{
core::PWSTR, core::PWSTR,
Win32::{ Win32::{
@ -67,7 +67,7 @@ pub unsafe extern "system" fn loader(
_shellcode_bin: *mut c_void, _shellcode_bin: *mut c_void,
flags: u32, flags: u32,
) { ) {
let flags = airborne_utils::parse_u32_flag(flags); let flags = airborne_common::parse_u32_flag(flags);
/* /*
1.) locate the required functions and modules from exports with their hashed names 1.) locate the required functions and modules from exports with their hashed names
@ -238,7 +238,7 @@ unsafe fn get_module_ptr(module_hash: u32) -> Option<*mut u8> {
let name_slice_buf = from_raw_parts(transmute::<PWSTR, *const u8>(name_buf_ptr), name_len); let name_slice_buf = from_raw_parts(transmute::<PWSTR, *const u8>(name_buf_ptr), name_len);
// calculate the module hash and compare it // calculate the module hash and compare it
if module_hash == airborne_utils::calc_hash(name_slice_buf) { if module_hash == airborne_common::calc_hash(name_slice_buf) {
return Some((*table_entry_ptr).DllBase as _); return Some((*table_entry_ptr).DllBase as _);
} }
@ -293,7 +293,7 @@ unsafe fn get_export_addr(module_base_ptr: *mut u8, function_hash: u32) -> Optio
let name_len = get_cstr_len(name_ptr as _); let name_len = get_cstr_len(name_ptr as _);
let name_slice = from_raw_parts(name_ptr as _, name_len); let name_slice = from_raw_parts(name_ptr as _, name_len);
if function_hash == airborne_utils::calc_hash(name_slice) { if function_hash == airborne_common::calc_hash(name_slice) {
return Some(module_base_ptr as usize + funcs[ords[i as usize] as usize] as usize); return Some(module_base_ptr as usize + funcs[ords[i as usize] as usize] as usize);
} }
} }