From cfd4138c98ea216d127f7d0af0705b1d19704d63 Mon Sep 17 00:00:00 2001 From: Mohamed Elbadry Date: Sun, 8 Aug 2021 17:21:27 +0200 Subject: [PATCH] Stable Version V1.0 --- Cargo.lock | 4 +++- Cargo.toml | 2 +- README.md | 28 +++++++++++++++++----------- src/main.rs | 22 ++++++++++------------ 4 files changed, 31 insertions(+), 25 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ea12a80..aa5976e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,5 +1,7 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +version = 3 + [[package]] name = "addr" version = "0.14.0" @@ -763,7 +765,7 @@ dependencies = [ [[package]] name = "sslenum" -version = "0.2.1" +version = "1.0.0" dependencies = [ "addr", "clap", diff --git a/Cargo.toml b/Cargo.toml index eb62781..d2341ce 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sslenum" -version = "0.2.1" +version = "1.0.0" authors = ["melbadry9 "] edition = "2018" description = "SSL certificate Extractor" diff --git a/README.md b/README.md index 6ee24bd..f123463 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ cargo install --path . - Help ```txt -SSLEnum [SSL Data Enumeration] 0.2.1 +SSLEnum [SSL Data Enumeration] 1.0.0 Mohamed Elbadry USAGE: @@ -33,7 +33,7 @@ FLAGS: OPTIONS: -d, --domain Sets domain to check - -p, --port Sets port number [default: 443] + -p, --port Sets port number [default: 443] -t, --threads Sets number of threads [default: 5] ``` @@ -44,21 +44,27 @@ cat subdomains.list | sslenum -t 5 -p 443 - Output ```json -melbadry9@localhost:/test$ sslenum -d hackerone.com | jq +melbadry9@localhost:/test$ sslenum -d example.com | jq { - "name": "hackerone.com", + "hostname": "example.com", + "ip": "93.184.216.34", "org": [ - "HackerOne Inc." + "Internet Corporation for Assigned Names and Numbers" ], "cn": [ - "hackerone.com" + "www.example.org" ], - "alt_doms": [ - "hackerone.com", - "www.hackerone.com", - "api.hackerone.com" + "alt_names": [ + "www.example.org", + "example.com", + "example.edu", + "example.net", + "example.org", + "www.example.com", + "www.example.edu", + "www.example.net" ], - "dangling": false + "dangling": true } ``` diff --git a/src/main.rs b/src/main.rs index 71501d0..10976a5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,16 +13,17 @@ use threadpool::ThreadPool; #[derive(Serialize, Deserialize, Debug)] struct DomainData { - name: String, + hostname: String, + ip: String, org: Vec, cn: Vec, - alt_doms: Vec, + alt_names: Vec, dangling: bool, } impl DomainData { fn check_dangling(self: &mut Self) { - let domain = List.parse_dns_name(self.name.as_str()).unwrap(); + let domain = List.parse_dns_name(self.hostname.as_str()).unwrap(); let host = List.parse_dns_name(self.cn[0].as_str()); match host { Ok(host) => { @@ -67,13 +68,14 @@ fn make_connection(domain: String, port: String) { Ok(ex_cert) => { let cn = get_value("cn", &ex_cert); let org = get_value("org", &ex_cert); - let alt_doms = get_value("doms", &ex_cert); + let alt_names = get_value("doms", &ex_cert); let mut ch_domain = DomainData { - name: tmp_dom.to_string(), + hostname: tmp_dom.to_string(), + ip: ip.ip().to_string(), org, cn, - alt_doms, + alt_names, dangling: false, }; ch_domain.check_dangling(); @@ -91,11 +93,7 @@ fn make_connection(domain: String, port: String) { } } -fn extract_ssl( - stream: &Result, - conn: &SslConnector, - domain: &str, -) -> Result { +fn extract_ssl(stream: &Result, conn: &SslConnector, domain: &str,) -> Result { match stream { Ok(stream) => { let _ = stream @@ -180,7 +178,7 @@ fn main() { openssl_probe::init_ssl_cert_env_vars(); let args = App::new("SSLEnum [SSL Data Enumeration]") - .version("0.2.1") + .version("1.0.0") .author("Mohamed Elbadry ") .arg( Arg::with_name("threads")