mythic/lib.rs
1//! # mythic-c2
2//!
3//! Mythic C2 agent protocol library — message encoding/decoding,
4//! AES-256-CBC-HMAC encryption, and transport abstraction.
5//!
6//! `#![no_std]` compatible with `alloc`, suitable for embedded agent binaries.
7//!
8//! ## Quick Example
9//!
10//! ```no_run
11//! use mythic::{C2Transport, MythicAgent, MythicError};
12//! use uuid::Uuid;
13//!
14//! # struct HttpC2;
15//! # impl C2Transport for HttpC2 {
16//! # fn checkin(&self, p: &str) -> Result<String, MythicError> { Ok(String::new()) }
17//! # fn get_tasking(&self, p: &str) -> Result<String, MythicError> { Ok(String::new()) }
18//! # fn post_response(&self, p: &str) -> Result<String, MythicError> { Ok(String::new()) }
19//! # }
20//! let c2 = HttpC2;
21//! let payload_uuid = Uuid::parse_str("aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee").unwrap();
22//!
23//! let agent = MythicAgent::easy_checkin(
24//! payload_uuid,
25//! &c2,
26//! vec!["10.0.0.1".into()],
27//! Some("linux".into()),
28//! Some("root".into()),
29//! Some("web01".into()),
30//! Some(1337),
31//! Some("x86_64".into()),
32//! None, None, None, None, None, None,
33//! )
34//! .unwrap();
35//!
36//! println!("callback UUID: {}", agent.callback_uuid());
37//! ```
38
39#![no_std]
40
41extern crate alloc;
42
43pub mod agent;
44pub mod error;
45pub mod protocol;
46pub mod transport;
47
48pub use agent::MythicAgent;
49pub use error::{MythicError, MythicResult};
50pub use protocol::*;
51pub use transport::C2Transport;