Skip to content

Commit

Permalink
Stable Version V1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohamed Elbadry committed Aug 8, 2021
1 parent 6f7c9d4 commit cfd4138
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 25 deletions.
4 changes: 3 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sslenum"
version = "0.2.1"
version = "1.0.0"
authors = ["melbadry9 <me@melbadry9.xyz>"]
edition = "2018"
description = "SSL certificate Extractor"
Expand Down
28 changes: 17 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <me@melbadry9.xyz>
USAGE:
Expand All @@ -33,7 +33,7 @@ FLAGS:
OPTIONS:
-d, --domain <DOMAIN> Sets domain to check
-p, --port <PORT> Sets port number [default: 443]
-p, --port <PORT> Sets port number [default: 443]
-t, --threads <THREADS> Sets number of threads [default: 5]
```

Expand All @@ -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
}
```
22 changes: 10 additions & 12 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@ use threadpool::ThreadPool;

#[derive(Serialize, Deserialize, Debug)]
struct DomainData {
name: String,
hostname: String,
ip: String,
org: Vec<String>,
cn: Vec<String>,
alt_doms: Vec<String>,
alt_names: Vec<String>,
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) => {
Expand Down Expand Up @@ -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();
Expand All @@ -91,11 +93,7 @@ fn make_connection(domain: String, port: String) {
}
}

fn extract_ssl(
stream: &Result<TcpStream, std::io::Error>,
conn: &SslConnector,
domain: &str,
) -> Result<X509, ()> {
fn extract_ssl(stream: &Result<TcpStream, std::io::Error>, conn: &SslConnector, domain: &str,) -> Result<X509, ()> {
match stream {
Ok(stream) => {
let _ = stream
Expand Down Expand Up @@ -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 <me@melbadry9.xyz>")
.arg(
Arg::with_name("threads")
Expand Down

0 comments on commit cfd4138

Please sign in to comment.