Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,899 changes: 1,242 additions & 657 deletions Cargo.lock

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ edition = "2018"
#hlua-badtouch = { path="../hlua/hlua" }
hlua-badtouch = "0.4.2"
log = "0.4"
env_logger = "0.9"
env_logger = "0.10"
pbr = "1.0"
threadpool = "1.7"
colored = "2"
humantime = "2"
structopt = "0.3"
clap = { version = "4", features = ["derive"] }
clap_complete = "4.4.4"
anyhow = "1"
time = "0.3"
atty = "0.2"
rand = "0.8"
getch = "0.3"
toml = "0.5"
nix = "0.23"
toml = "0.8"
nix = "0.27"
serde = { version="1.0", features=["derive"] }
serde_json = "1.0"
bufstream = "0.1.3"
Expand All @@ -39,18 +39,18 @@ sha2 = "0.10"
sha3 = "0.10"
digest = "0.10"
hmac = "0.12"
base64 = "0.13"
bcrypt = "0.12"
data-encoding = "2.5.0"
bcrypt = "0.15"

reqwest = { version="0.11", features=["blocking", "json"] }
mysql = "22"
ldap3 = "0.10"
mysql = "24"
ldap3 = "0.11"
kuchiki = "0.8"
dirs = "4"
dirs = "5"
num-format = "0.4.0"

[target."cfg(unix)".dependencies]
termios = "0.3"

[target.'cfg(target_os="linux")'.dependencies]
rlimit = "0.7"
rlimit = "0.10"
2 changes: 1 addition & 1 deletion ci/smtp/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM debian:stretch
FROM debian:bookworm
RUN apt-get update -qq \
&& apt-get install -yq opensmtpd
RUN echo "foo" > /etc/mailname
Expand Down
2 changes: 1 addition & 1 deletion examples/load-creds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fn main() -> Result<()> {

let start = Instant::now();

let creds = authoscope::utils::load_combolist(&path)
let creds = authoscope::utils::load_combolist(path)
.context("Failed to load creds")?;

let elapsed = start.elapsed();
Expand Down
54 changes: 25 additions & 29 deletions src/args.rs
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
use crate::errors::*;
use std::io::stdout;
use clap::{ArgAction, CommandFactory, Parser};
use clap_complete::Shell;
use std::path::PathBuf;
use structopt::StructOpt;
use structopt::clap::{AppSettings, Shell};

#[derive(Debug, StructOpt)]
#[structopt(global_settings = &[AppSettings::ColoredHelp])]
#[derive(Debug, Parser)]
#[command(version)]
pub struct Args {
/// Verbose output
#[structopt(short="v", long="verbose",
global=true, parse(from_occurrences))]
#[arg(short, long, global = true, action(ArgAction::Count))]
pub verbose: u8,
/// Concurrent workers
#[structopt(short = "n", long = "workers", default_value = "16")]
#[arg(short = 'n', long, default_value = "16")]
pub workers: usize,
/// Write results to file
#[structopt(short = "o", long = "output")]
#[arg(short = 'o', long = "output")]
pub output: Option<String>,
#[structopt(subcommand)]
#[clap(subcommand)]
pub subcommand: SubCommand,
}

#[derive(Debug, StructOpt)]
#[derive(Debug, Parser)]
pub enum SubCommand {
/// For each user try every password from a dictionary/wordlist
Dict(Dict),
Expand All @@ -36,36 +35,36 @@ pub enum SubCommand {
Completions(Completions),
}

#[derive(Debug, StructOpt)]
#[derive(Debug, Parser)]
pub struct Dict {
/// Username list path
pub users_path: PathBuf,
/// Password list path
pub passwords_path: PathBuf,
/// Scripts to run
#[structopt(required=true)]
#[arg(required=true)]
pub scripts: Vec<String>,
}

#[derive(Debug, StructOpt)]
#[derive(Debug, Parser)]
pub struct Combo {
/// Path to combolist
pub path: PathBuf,
/// Scripts to run
#[structopt(required=true)]
#[arg(required=true)]
pub scripts: Vec<String>,
}

#[derive(Debug, StructOpt)]
#[derive(Debug, Parser)]
pub struct Enum {
/// Username list path
pub users: String,
/// Scripts to run
#[structopt(required=true)]
#[arg(required=true)]
pub scripts: Vec<String>,
}

#[derive(Debug, StructOpt)]
#[derive(Debug, Parser)]
pub struct Run {
/// Script to run
pub script: String,
Expand All @@ -74,35 +73,32 @@ pub struct Run {
/// Password to test
pub password: Option<String>,
/// Set the exitcode to 2 if the credentials are invalid
#[structopt(short = "x", long = "exitcode")]
#[arg(short = 'x', long)]
pub exitcode: bool,
}

#[derive(Debug, StructOpt)]
#[derive(Debug, Parser)]
pub struct Fsck {
/// Do not show invalid lines
#[structopt(short = "q", long = "quiet")]
#[arg(short = 'q', long)]
pub quiet: bool,
/// Do not show valid lines
#[structopt(short = "s", long = "silent")]
#[arg(short = 's', long)]
pub silent: bool,
/// Require one colon per line
#[structopt(short = "c", long = "colon")]
#[arg(short = 'c', long = "colon")]
pub require_colon: bool,
/// Files to read
pub paths: Vec<String>,
}

/// Generate shell completions
#[derive(Debug, StructOpt)]
#[derive(Debug, Parser)]
pub struct Completions {
#[structopt(possible_values=&Shell::variants())]
pub shell: Shell,
}

impl Completions {
pub fn gen(&self) -> Result<()> {
Args::clap().gen_completions_to("authoscope", self.shell, &mut stdout());
Ok(())
}
pub fn gen_completions(args: &Completions) -> Result<()> {
clap_complete::generate(args.shell, &mut Args::command(), "authoscope", &mut stdout());
Ok(())
}
Loading