Skip to content

Commit

Permalink
Reimplemented Debug Flag Feature - Enhanced functionality and perform…
Browse files Browse the repository at this point in the history
…ance with a new approach to handling debug flags. (#51)

This pull request includes several improvements to the Maid Runner software. Firstly, I have re-implemented the Debug Flag feature for enhanced functionality and improved performance. Secondly, I have fixed an issue related to malware hash extensions. Thirdly, I have removed unnecessary verbosity from mac lookup operations. Finally, I have addressed issues with scanner_auto_map by fixing invalid ports and delays. These changes collectively contribute to a more efficient and effective Maid Runner experience for our users.
  • Loading branch information
cosmic-zip authored Dec 22, 2023
1 parent 56e40e9 commit 2bc50e7
Show file tree
Hide file tree
Showing 12 changed files with 68 additions and 37 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -297,3 +297,16 @@ Date: seg 27 nov 2023 17:08:28 -03
→ Fixed logger result return for improved reliability.
→ Removed old cybersecurity policy.
→ Removed old documentation.

Version 0.13.9

Date: sex 22 dez 2023 20:14:37 -03

→ Reimplemented Debug Flag Feature
→ Fix malware hash extension
→ Remove unnecessary verbosity from mac lookup
→ Fix scanner_automap invalid ports and delays.
→ Fixed small bugs in the debugger:|, Fixed manual page.
→ Update warning section
→ Partial update
→ Update firewall unit tests.
4 changes: 3 additions & 1 deletion MANPAGE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## MaidRunnerCLI

# Deprecated

**NAME**

MaidRunner - Maid Runner is a versatile task automation software
Expand Down Expand Up @@ -46,7 +48,7 @@
--debug Optional value for debug can be true
or false

--lookup_reverse_engineering Lookup basic reverse engineering
--lookup_re Lookup basic reverse engineering
--sample File to be analyzed
--type Type of analysis:

Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ for its operation.

<center>
<b>
🚨 Important Notice: The usage instructions for Maid Runner have
been relocated!
🚨 Important Notice: Use maid_runner our maid_runner --help instead MANPAGE
</b>
</center>

Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sudo chown -R $(whoami):$(whoami) /var/maid

echo && echo "Uncompress files"
7z x /var/maid/maid_lists/malware/malware.csv.7z.001 -o/var/maid/maid_lists/general/
mv /var/maid/maid_lists/general/full.csv /var/maid/maid_lists/general/malware_hash.bin
mv /var/maid/maid_lists/general/full.csv /var/maid/maid_lists/general/malware_hash.config

echo && echo "SNAP Setup"
sudo apt install snapd -y
Expand Down
2 changes: 1 addition & 1 deletion maid_lists/embedded/config.meow
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ MOEW TABLES = "tables.config"
MEOW TLDS = "tlds.config"
MOEW USER_NAMES = "user_names.config"
MOEW XSS_PAYLOAD_LIST = "xss-payload-list.config"

MEOW MALWARE_HASH = "malware_hash.config"

# REPORTS AND SESSIONS

Expand Down
2 changes: 1 addition & 1 deletion maid_runner/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ license = "GPL-v3"
description = "Maid Runner is a versatile task automation software designed to serve as the foundation for various cyber security modules."
readme = "../README.md"
homepage = "https://github.com/th3Maid/MaidRunner"
version = "0.13.0"
version = "0.13.9"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
9 changes: 5 additions & 4 deletions maid_runner/src/core/manual.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ LOOKUP
--path MAC lookup file or use --path default
--debug Optional value for debug can be true or false
--lookup_reverse_engineering Lookup basic reverse engineering
--lookup_re Lookup basic reverse engineering
--sample File to be analyzed
--type Type of analysis:
┌────────────────┬──────────────────────────────────────────┐
Expand Down Expand Up @@ -174,16 +174,17 @@ WEB SCANNER
--scanner_auto_nmap Advanced NMAP automation and custom binds
--target Setup target ip or dns can be 172.16.0.1 or example.com
--delay Setup an delay interval to avoid detection by IDS
--delay Setup an delay interval to avoid detection by IDS,
Options are: fast, slow and paranoid
--ports Setup ports to be scanned
┌────────────────┬──────────────────────────────────────────┐
│ PORT │ DESCRIPTION │
├────────────────┼──────────────────────────────────────────┤
│ all │ Search for possible open ports │
│ auto │ Use an list of the most common │
-p 80,443 │ Search for 80 and 443 │
-p 80-1337 │ Search from 80 to 1337 │
│ 80,443 │ Search for 80 and 443 │
│ 80-1337 │ Search from 80 to 1337 │
└────────────────┴──────────────────────────────────────────┘
--type Setup the nmap scanner technic
Expand Down
15 changes: 10 additions & 5 deletions maid_runner/src/core/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,15 @@ pub fn system_command_exec(command: ProcessInit) -> bool {
}
}

println!(
"🔖 status: {} \n🚧 STDOUT: {}\n🚧 STDERR: {}\n",
status, stdout, stderr,
);
if command.debug == true {
println!(
"🔖 status: {}\n🚧 stdout:\n{}\n🚧 stderr:\n{}\n",
status, stdout, stderr,
);
} else {
println!("{}", stdout);
}

return true;
}
Err(err) => {
Expand Down Expand Up @@ -226,7 +231,7 @@ pub fn find_all_matching_lines(file_path: &str, pattern: &str) -> Result<Vec<Str

match logger(data) {
Ok(_result) => {
standard_messages("saved", "Log saved", "", "cute");
// standard_messages("saved", "Log saved", "", "cute");
}
Err(_err) => println!("Error"),
}
Expand Down
4 changes: 2 additions & 2 deletions maid_runner/src/modules/lookup/lookup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub fn lookup_mac_address(mac_address: LookupMacAddress, debug: bool) -> bool {
standard_messages("debug", "Lookup mac address", &message, "cute");
}

standard_messages("falged", "Lookup mac address", "", "cute");
// standard_messages("falged", "Lookup mac address", "", "cute");

match find_all_matching_lines(&file, mac_address.vendor_mac) {
Ok(result) => {
Expand Down Expand Up @@ -143,7 +143,7 @@ pub fn shell_lookup(system_input: &mut Vec<String>) -> bool {
lookup_exif_metadata(instance, debug)
}

"--lookup_reverse_engineering" => {
"--lookup_re" | "" => {
let debug = take_system_args_debug(take_system_args(system_input, "--debug"));
let instance = LookupGenericPathOpType {
sample_path: &take_system_args(system_input, "--sample"),
Expand Down
8 changes: 4 additions & 4 deletions maid_runner/src/modules/scanner/scanner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,11 @@ pub fn scanner_auto_nmap(source: ScannerWebAutoNmap, debug: bool) -> bool {
let mut sport: &str = "";

if "fast" == source.delay {
stime = "T4";
stime = "-T4";
} else if "slow" == source.delay {
stime = "T2";
stime = "-T2";
} else if "paranoid" == source.delay {
stime = "T0";
stime = "-T0";
} else {
standard_messages(
"warning",
Expand Down Expand Up @@ -208,7 +208,7 @@ pub fn scanner_auto_nmap(source: ScannerWebAutoNmap, debug: bool) -> bool {
if source.ports == "auto" {
sport = NMAP_PORTS;
} else if source.ports == "all" {
sport = "-p-";
sport = "p1-65535";
} else {
}
sport = source.ports;
Expand Down
41 changes: 26 additions & 15 deletions maid_runner/src/test/test_firewall.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,48 @@ use super::*;
use crate::modules::firewall::firewall_structs::*;
use crate::*;

// #[test]
// fn test_firewall_preset() {
// let debug = true;
// let option = "hardned";
// let output = firewall_preset(option, debug);
// assert_eq!(output, true);
// }

#[test]
fn test_firewall_preset() {
fn test_firewall_rules_ssh() {
let debug = true;
let option = "hardned";
let output = firewall_preset(option, debug);
let command = NfTableRule {
protocol: "tcp",
action: "accept",
port: "22",
};

let output = firewall(command, debug);

assert_eq!(output, true);
}

#[test]
fn test_firewall_rules_ssh() {
fn test_firewall_rules_port_8000_tcp() {
let debug = true;
let command = SimpleRule {
table: "ACCEPT",
chain: "INPUT",
let command = NfTableRule {
protocol: "tcp",
destination_port: "22",
action: "accept",
port: "8000",
};

let output = firewall(command, debug);

assert_eq!(output, true);
}

#[test]
fn test_firewall_rules_port_8000() {
fn test_firewall_rules_port_8000_udp() {
let debug = true;
let command = SimpleRule {
table: "ACCEPT",
chain: "INPUT",
protocol: "tcp",
destination_port: "8000",
let command = NfTableRule {
protocol: "udp",
action: "accept",
port: "8000",
};

let output = firewall(command, debug);
Expand Down
2 changes: 1 addition & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: maid-runner
base: core22
version: '0.13.0'
version: '0.13.9'
summary: Maid Runner is a companion for cyber security tasks.
description: |
Maid Runner is a versatile task automation software designed to serve as the foundation for various cyber security modules. It provides capabilities for tasks such as forensic research, OSINT (Open Source Intelligence), scanning, backup and copying, intrusion testing of applications and APIs, and more.
Expand Down

0 comments on commit 2bc50e7

Please sign in to comment.