pub struct Tool {
pub base: Tool,
pub mitre: MitreTool,
}
Fields§
§base: Tool
§mitre: MitreTool
Implementations§
Source§impl Tool
impl Tool
Sourcepub fn name(&self) -> &str
pub fn name(&self) -> &str
Examples found in repository?
examples/tools.rs (line 16)
4fn main() {
5 let enterprise = attck::enterprise();
6 let mimikatz_id = "tool--afc079f3-c0ea-4096-b75d-3f05338b7f60"
7 .parse::<Id>()
8 .unwrap();
9
10 // Knowing the ID and the expected return type, request the resource from the
11 // collection.
12 let mimikatz = enterprise.get::<Tool>(&mimikatz_id).unwrap();
13
14 println!(
15 "{} {}",
16 mimikatz.name(),
17 mimikatz.description().unwrap_or("<NO DESCRIPTION>")
18 );
19}
More examples
examples/actor_lookup.rs (line 35)
6fn display_actor<'a>(actor: &Node<'a, IntrusionSet>) {
7 println!("{} ({})", actor.name(), actor.id());
8 println!("============");
9
10 if let Some(description) = actor.description() {
11 println!("{}\n", description);
12 }
13
14 let mut malwares = actor.uses_malware().peekable();
15 if malwares.peek().is_some() {
16 println!("Malware:");
17 for malware in malwares {
18 match malware.resolve() {
19 Some(malware) => {
20 println!("- {} ({})", malware.name(), malware.id());
21 }
22 None => {
23 println!("- Unknown Malware");
24 }
25 }
26 }
27 }
28
29 let mut tools = actor.uses_tools().peekable();
30 if tools.peek().is_some() {
31 println!("Tools:");
32 for tool in tools {
33 match tool.resolve() {
34 Some(tool) => {
35 println!("- {} ({})", tool.name(), tool.id());
36 }
37 None => {
38 println!("- Unknown Tool");
39 }
40 }
41 }
42 }
43}
Sourcepub fn description(&self) -> Option<&str>
pub fn description(&self) -> Option<&str>
Examples found in repository?
examples/tools.rs (line 17)
4fn main() {
5 let enterprise = attck::enterprise();
6 let mimikatz_id = "tool--afc079f3-c0ea-4096-b75d-3f05338b7f60"
7 .parse::<Id>()
8 .unwrap();
9
10 // Knowing the ID and the expected return type, request the resource from the
11 // collection.
12 let mimikatz = enterprise.get::<Tool>(&mimikatz_id).unwrap();
13
14 println!(
15 "{} {}",
16 mimikatz.name(),
17 mimikatz.description().unwrap_or("<NO DESCRIPTION>")
18 );
19}
Trait Implementations§
Source§impl AsRef<CommonProperties> for Tool
impl AsRef<CommonProperties> for Tool
Source§fn as_ref(&self) -> &CommonProperties
fn as_ref(&self) -> &CommonProperties
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl<'de> Deserialize<'de> for Tool
impl<'de> Deserialize<'de> for Tool
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Tool
impl RefUnwindSafe for Tool
impl Send for Tool
impl Sync for Tool
impl Unpin for Tool
impl UnwindSafe for Tool
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more