diff --git a/src/plugins/amqp/mod.rs b/src/plugins/amqp/mod.rs index 0a050ff..08231e1 100644 --- a/src/plugins/amqp/mod.rs +++ b/src/plugins/amqp/mod.rs @@ -14,7 +14,9 @@ pub(crate) mod options; const PROTOCOL_HEADER_091: &[u8] = &[b'A', b'M', b'Q', b'P', 0, 0, 9, 1]; -super::manager::register_plugin!("amqp", AMQP::new()); +super::manager::register_plugin! { + "amqp" => AMQP::new() +} #[derive(Clone)] pub(crate) struct AMQP { diff --git a/src/plugins/cmd/mod.rs b/src/plugins/cmd/mod.rs index 02b7ada..53b5a8e 100644 --- a/src/plugins/cmd/mod.rs +++ b/src/plugins/cmd/mod.rs @@ -11,7 +11,9 @@ use crate::creds::Credentials; pub(crate) mod options; -super::manager::register_plugin!("cmd", Command::new()); +super::manager::register_plugin! { + "cmd" => Command::new() +} #[derive(Clone)] pub(crate) struct Command { diff --git a/src/plugins/dns/mod.rs b/src/plugins/dns/mod.rs index 6c04be8..fb9c9bb 100644 --- a/src/plugins/dns/mod.rs +++ b/src/plugins/dns/mod.rs @@ -19,7 +19,9 @@ use super::plugin::PayloadStrategy; pub(crate) mod options; -super::manager::register_plugin!("dns", DNS::new()); +super::manager::register_plugin! { + "dns" => DNS::new() +} #[derive(Clone)] pub(crate) struct DNS { diff --git a/src/plugins/ftp/mod.rs b/src/plugins/ftp/mod.rs index 90f260d..468b075 100644 --- a/src/plugins/ftp/mod.rs +++ b/src/plugins/ftp/mod.rs @@ -11,7 +11,9 @@ use crate::Plugin; use crate::creds::Credentials; -super::manager::register_plugin!("ftp", FTP::new()); +super::manager::register_plugin! { + "ftp" => FTP::new() +} #[derive(Clone)] pub(crate) struct FTP {} diff --git a/src/plugins/http/mod.rs b/src/plugins/http/mod.rs index bc68ff7..7a07dbd 100644 --- a/src/plugins/http/mod.rs +++ b/src/plugins/http/mod.rs @@ -14,7 +14,7 @@ use crate::Options; use crate::creds::Credentials; use crate::plugins::Plugin; -use super::{manager::PluginRegistrar, plugin::PayloadStrategy}; +use super::plugin::PayloadStrategy; mod csrf; mod ntlm; @@ -28,22 +28,15 @@ const HTTP_USERNAME_VAR: &str = "{$username}"; const HTTP_PASSWORD_VAR: &str = "{$password}"; const HTTP_PAYLOAD_VAR: &str = "{$payload}"; -super::manager::register_plugin!( - "http", - HTTP::new(Strategy::Request), - "http.form", - HTTP::new(Strategy::Form), - "http.basic", - HTTP::new(Strategy::BasicAuth), - "http.ntlm1", - HTTP::new(Strategy::NLTMv1), - "http.ntlm2", - HTTP::new(Strategy::NLTMv2), - "http.enum", - HTTP::new(Strategy::Enumeration), - "http.vhost", - HTTP::new(Strategy::VHostEnum) -); +super::manager::register_plugin! { + "http" => HTTP::new(Strategy::Request), + "http.form" => HTTP::new(Strategy::Form), + "http.basic" => HTTP::new(Strategy::BasicAuth), + "http.ntlm1" => HTTP::new(Strategy::NLTMv1), + "http.ntlm2" => HTTP::new(Strategy::NLTMv2), + "http.enum" => HTTP::new(Strategy::Enumeration), + "http.vhost" => HTTP::new(Strategy::VHostEnum) +} fn method_requires_payload(method: &Method) -> bool { matches!(method, &Method::POST | &Method::PUT | &Method::PATCH) diff --git a/src/plugins/imap/mod.rs b/src/plugins/imap/mod.rs index 11b7bf7..aeaff2f 100644 --- a/src/plugins/imap/mod.rs +++ b/src/plugins/imap/mod.rs @@ -9,7 +9,9 @@ use crate::Plugin; use crate::creds::Credentials; use crate::utils; -super::manager::register_plugin!("imap", IMAP::new()); +super::manager::register_plugin! { + "imap" => IMAP::new() +} #[derive(Clone)] pub(crate) struct IMAP {} diff --git a/src/plugins/kerberos/mod.rs b/src/plugins/kerberos/mod.rs index 4517942..da9c8d9 100644 --- a/src/plugins/kerberos/mod.rs +++ b/src/plugins/kerberos/mod.rs @@ -20,7 +20,9 @@ mod transport; pub(crate) mod options; -super::manager::register_plugin!("kerberos", Kerberos::new()); +super::manager::register_plugin! { + "kerberos" => Kerberos::new() +} #[derive(Clone)] pub(crate) struct Kerberos { diff --git a/src/plugins/ldap/mod.rs b/src/plugins/ldap/mod.rs index 6593aba..6aedb63 100644 --- a/src/plugins/ldap/mod.rs +++ b/src/plugins/ldap/mod.rs @@ -12,7 +12,9 @@ use crate::utils; pub(crate) mod options; -super::manager::register_plugin!("ldap", LDAP::new()); +super::manager::register_plugin! { + "ldap" => LDAP::new() +} #[derive(Clone)] pub(crate) struct LDAP { diff --git a/src/plugins/manager.rs b/src/plugins/manager.rs index 3210c79..384dcf5 100644 --- a/src/plugins/manager.rs +++ b/src/plugins/manager.rs @@ -17,7 +17,7 @@ use super::plugin::PayloadStrategy; type Inventory = BTreeMap<&'static str, Box>; macro_rules! register_plugin { - ($($name:literal, $instance:expr),+) => { + ($($name:literal => $instance:expr),+) => { pub(super) fn register(registrar: &mut impl $crate::plugins::manager::PluginRegistrar) { $( registrar.register($name, $instance); diff --git a/src/plugins/mongodb/mod.rs b/src/plugins/mongodb/mod.rs index 62fdfd5..a559902 100644 --- a/src/plugins/mongodb/mod.rs +++ b/src/plugins/mongodb/mod.rs @@ -9,7 +9,9 @@ use crate::{utils, Options}; use crate::creds::Credentials; -super::manager::register_plugin!("mongodb", MongoDB::new()); +super::manager::register_plugin! { + "mongodb" => MongoDB::new() +} #[derive(Clone)] pub(crate) struct MongoDB {} diff --git a/src/plugins/mqtt/mod.rs b/src/plugins/mqtt/mod.rs index 0cc69fe..3ecd6ee 100644 --- a/src/plugins/mqtt/mod.rs +++ b/src/plugins/mqtt/mod.rs @@ -12,7 +12,9 @@ use crate::creds::Credentials; pub(crate) mod options; -super::manager::register_plugin!("mqtt", Mqtt::new()); +super::manager::register_plugin! { + "mqtt" => Mqtt::new() +} #[derive(Clone)] pub(crate) struct Mqtt { diff --git a/src/plugins/mssql/mod.rs b/src/plugins/mssql/mod.rs index 613062a..e1380e9 100644 --- a/src/plugins/mssql/mod.rs +++ b/src/plugins/mssql/mod.rs @@ -57,7 +57,9 @@ const MS_PACKET_LANGP: &[u8] = &[ const MS_MAX_LEN: usize = 30; -super::manager::register_plugin!("mssql", MSSQL::new()); +super::manager::register_plugin! { + "mssql" => MSSQL::new() +} #[derive(Clone)] pub(crate) struct MSSQL {} diff --git a/src/plugins/oracle/mod.rs b/src/plugins/oracle/mod.rs index 36e999a..83a3de4 100644 --- a/src/plugins/oracle/mod.rs +++ b/src/plugins/oracle/mod.rs @@ -11,7 +11,9 @@ use crate::Plugin; pub(crate) mod options; -super::manager::register_plugin!("oracle", Oracle::new()); +super::manager::register_plugin! { + "oracle" => Oracle::new() +} #[derive(Clone)] pub(crate) struct Oracle { diff --git a/src/plugins/pop3/mod.rs b/src/plugins/pop3/mod.rs index c992647..d36f54c 100644 --- a/src/plugins/pop3/mod.rs +++ b/src/plugins/pop3/mod.rs @@ -11,7 +11,9 @@ use crate::utils; pub(crate) mod options; -super::manager::register_plugin!("pop3", POP3::new()); +super::manager::register_plugin! { + "pop3" => POP3::new() +} #[derive(Clone)] pub(crate) struct POP3 { diff --git a/src/plugins/port_scanner/mod.rs b/src/plugins/port_scanner/mod.rs index 4d91825..4e038d0 100644 --- a/src/plugins/port_scanner/mod.rs +++ b/src/plugins/port_scanner/mod.rs @@ -17,7 +17,9 @@ use super::plugin::PayloadStrategy; mod grabbers; pub(crate) mod options; -super::manager::register_plugin!("port.scanner", PortScanner::new()); +super::manager::register_plugin! { + "port.scanner" => PortScanner::new() +} #[derive(Clone)] pub(crate) struct PortScanner { diff --git a/src/plugins/rdp/mod.rs b/src/plugins/rdp/mod.rs index dfa1983..8236df7 100644 --- a/src/plugins/rdp/mod.rs +++ b/src/plugins/rdp/mod.rs @@ -14,7 +14,9 @@ use crate::creds::Credentials; pub(crate) mod options; -super::manager::register_plugin!("rdp", RDP::new()); +super::manager::register_plugin! { + "rdp" => RDP::new() +} #[derive(Clone)] pub(crate) struct RDP { diff --git a/src/plugins/redis/mod.rs b/src/plugins/redis/mod.rs index 3116547..ae4d4ce 100644 --- a/src/plugins/redis/mod.rs +++ b/src/plugins/redis/mod.rs @@ -11,7 +11,9 @@ use crate::creds::Credentials; pub(crate) mod options; -super::manager::register_plugin!("redis", Redis::new()); +super::manager::register_plugin! { + "redis" => Redis::new() +} #[derive(Clone)] pub(crate) struct Redis { diff --git a/src/plugins/samba/mod.rs b/src/plugins/samba/mod.rs index 71ed2cc..574121a 100644 --- a/src/plugins/samba/mod.rs +++ b/src/plugins/samba/mod.rs @@ -19,7 +19,9 @@ lazy_static! { static ref PAVAO_LOCK: Mutex = tokio::sync::Mutex::new(true); } -super::manager::register_plugin!("smb", SMB::new()); +super::manager::register_plugin! { + "smb" => SMB::new() +} #[derive(Clone)] pub(crate) struct SMB { diff --git a/src/plugins/scylla/mod.rs b/src/plugins/scylla/mod.rs index 42d6488..62e2085 100644 --- a/src/plugins/scylla/mod.rs +++ b/src/plugins/scylla/mod.rs @@ -9,7 +9,9 @@ use crate::Plugin; use crate::creds::Credentials; -super::manager::register_plugin!("scylla", Scylla::new()); +super::manager::register_plugin! { + "scylla" => Scylla::new() +} #[derive(Clone)] pub(crate) struct Scylla {} diff --git a/src/plugins/smtp/mod.rs b/src/plugins/smtp/mod.rs index 3244de1..5e727ab 100644 --- a/src/plugins/smtp/mod.rs +++ b/src/plugins/smtp/mod.rs @@ -13,7 +13,9 @@ use crate::utils; pub(crate) mod options; -super::manager::register_plugin!("smtp", SMTP::new()); +super::manager::register_plugin! { + "smtp" => SMTP::new() +} #[derive(Clone)] pub(crate) struct SMTP { diff --git a/src/plugins/socks5/mod.rs b/src/plugins/socks5/mod.rs index 1c2d875..9f70e7a 100644 --- a/src/plugins/socks5/mod.rs +++ b/src/plugins/socks5/mod.rs @@ -11,7 +11,9 @@ use crate::creds::Credentials; pub(crate) mod options; -super::manager::register_plugin!("socks5", Socks5::new()); +super::manager::register_plugin! { + "socks5" => Socks5::new() +} #[derive(Clone)] pub(crate) struct Socks5 { diff --git a/src/plugins/sql/mod.rs b/src/plugins/sql/mod.rs index a04afa4..ae31e34 100644 --- a/src/plugins/sql/mod.rs +++ b/src/plugins/sql/mod.rs @@ -23,12 +23,10 @@ lazy_static! { HashMap::from([(Flavour::My, 3306), (Flavour::PG, 5432),]); } -super::manager::register_plugin!( - "mysql", - SQL::new(Flavour::My), - "pgsql", - SQL::new(Flavour::PG) -); +super::manager::register_plugin! { + "mysql" => SQL::new(Flavour::My), + "pgsql" => SQL::new(Flavour::PG) +} #[derive(Clone, PartialEq, Eq, Debug, Hash)] pub(crate) enum Flavour { diff --git a/src/plugins/ssh/mod.rs b/src/plugins/ssh/mod.rs index c7bd2e1..6cdbcb7 100644 --- a/src/plugins/ssh/mod.rs +++ b/src/plugins/ssh/mod.rs @@ -12,7 +12,10 @@ use crate::Plugin; pub(crate) mod options; -super::manager::register_plugin!("ssh", SSH::new(), "sftp", SSH::new()); +super::manager::register_plugin! { + "ssh" => SSH::new(), + "sftp" => SSH::new() +} #[derive(Clone)] pub(crate) struct SSH { diff --git a/src/plugins/stomp/mod.rs b/src/plugins/stomp/mod.rs index b3c87c7..e065894 100644 --- a/src/plugins/stomp/mod.rs +++ b/src/plugins/stomp/mod.rs @@ -12,7 +12,9 @@ use crate::creds::Credentials; const CONNECTED_RESPONSE: &[u8] = &[67, 79, 78, 78, 69, 67, 84, 69, 68]; -super::manager::register_plugin!("stomp", STOMP::new()); +super::manager::register_plugin! { + "stomp" => STOMP::new() +} #[derive(Clone)] pub(crate) struct STOMP {} diff --git a/src/plugins/telnet/mod.rs b/src/plugins/telnet/mod.rs index 2ec3362..bf83497 100644 --- a/src/plugins/telnet/mod.rs +++ b/src/plugins/telnet/mod.rs @@ -10,7 +10,9 @@ use crate::Plugin; pub(crate) mod options; -super::manager::register_plugin!("telnet", Telnet::new()); +super::manager::register_plugin! { + "telnet" => Telnet::new() +} #[derive(Clone)] pub(crate) struct Telnet { diff --git a/src/plugins/vnc/mod.rs b/src/plugins/vnc/mod.rs index 61b28ac..a03479a 100644 --- a/src/plugins/vnc/mod.rs +++ b/src/plugins/vnc/mod.rs @@ -11,7 +11,9 @@ use crate::creds::Credentials; use super::plugin::PayloadStrategy; -super::manager::register_plugin!("vnc", VNC::new()); +super::manager::register_plugin! { + "vnc" => VNC::new() +} #[derive(Clone)] pub(crate) struct VNC {}