You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description = "A powerful command line tool to generate relevant wordlists for password cracking. It can also generate random passwords with a good entropy."
8
12
9
13
[features]
10
14
cli = ["serde_json", "clap"]
11
15
gui = []
12
16
13
17
[dependencies]
14
-
rand = "0.8.5"
15
-
thiserror = "1.0.59"
18
+
rand = { version = "0.8.5", features = ["getrandom"], default-features = false }
19
+
thiserror = "1.0.61"
16
20
num_cpus = "1.16.0"
17
-
serde_json = { version = "1.0.116", optional = true }
18
-
indicatif = "0.17.8"
19
-
clap = { version = "4.5.4", optional = true }
21
+
serde_json = { version = "1.0.120", optional = true, features = ["std"], default-features = false }
22
+
indicatif = { version = "0.17.8", default-features = false }
23
+
clap = { version = "4.5.9", optional = true, features = ["std"], default-features = false }
Copy file name to clipboardExpand all lines: src/error.rs
+4-1Lines changed: 4 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ pub enum ArgError {
20
20
#[error("Error: missing value for {0}")]
21
21
MissingValue(String),
22
22
/// This error is raised if there isn't any configuration given by the user (for example just wordlist feature without any type of characters specified).
23
-
#[error("Error: no configuration given for argument. Please specify the mandatory parameters and at least one type of characters.\nUsage: worgenX <command> [options]\nTry 'worgenX --help' for more information.")]
23
+
#[error("Error: no configuration given for argument.\nPlease specify the mandatory parameters and at least one type of characters.\nUsage: worgenX <command> [options]\nTry 'worgenX --help' for more information.")]
24
24
MissingConfiguration,
25
25
}
26
26
@@ -52,4 +52,7 @@ pub enum SystemError {
52
52
/// This error is raised if there is a thread error.
53
53
#[error("Error: thread error\n{0}")]
54
54
ThreadError(String),
55
+
/// This error is raised if the hash algorithm is not supported.
56
+
#[error("Error: the hash algorithm `{0}` is not supported")]
println!(" -o <path>, --output <path>\t\tSave the wordlist in a text file");
544
544
println!("\n The following options are optional:");
545
545
println!(" -d, --disable-loading-bar\t\tDisable the loading bar when generating the wordlist");
546
+
println!(" -h, --hash <hash>\t\t\tHash algorithm to use for the wordlist.\n\t\t\t\t\tYou can choose between: md5, sha1, sha224, sha256, sha384, sha512,\n\t\t\t\t\tsha3-224, sha3-256, sha3-384, sha3-512, blake2b-512, blake2s-256 and whirlpool");
546
547
println!(" -t <threads>, --threads <threads>\tNumber of threads to generate the passwords\n\t\t\t\t\tBy default, the number of threads is based on the number of physical cores of the CPU");
547
548
548
549
println!("\n --- Password generation ---");
@@ -563,3 +564,71 @@ fn display_help() {
563
564
println!(" The following option is optional:");
564
565
println!(" -t <threads>, --threads <threads>\tNumber of threads to use for the CPU benchmark\n\t\t\t\t\tBy default, the number of threads is based on the number of physical cores of the CPU\n");
565
566
}
567
+
568
+
#[cfg(test)]
569
+
mod tests {
570
+
usesuper::*;
571
+
572
+
#[test]
573
+
fntest_allocate_passwd_config_cli(){
574
+
let command_context:Command = build_command_context();
575
+
let matches:ArgMatches = command_context.get_matches_from(vec!["worgenX","password","-l","-u","-n","-x","-s","10","-c","5","-o","test.txt","-j"]);
576
+
577
+
match matches.subcommand(){
578
+
Some(("password", sub_matches)) => {
579
+
let result:PasswordGenerationOptions = allocate_passwd_config_cli(sub_matches).unwrap();
0 commit comments