Skip to content

Commit

Permalink
Added Bufferover API to sources.
Browse files Browse the repository at this point in the history
  • Loading branch information
Edu4rdSHL committed Sep 4, 2019
1 parent c9487a7 commit c61f319
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ struct ResponseDataSpyse {
records: Vec<SubdomainsSpyse>,
}

#[derive(Deserialize, PartialEq, PartialOrd, Ord, Eq)]
#[allow(non_snake_case)]
struct SubdomainsBufferover {
FDNS_A: Vec<String>,
}

lazy_static! {
static ref RNUM: String = rand::thread_rng().gen_range(0, 10000).to_string();
}
Expand Down Expand Up @@ -105,6 +111,7 @@ pub fn get_subdomains(
&spyse_access_token,
]
.concat();
let ct_api_url_bufferover = ["http://dns.bufferover.run/dns?q=", &target, "&rt=5"].concat();

if facebook_access_token.is_empty() {
let findomain_fb_tokens = [
Expand All @@ -128,6 +135,7 @@ pub fn get_subdomains(
get_sublist3r_subdomains(&ct_api_url_sublist3r, &with_proxy, &proxy),
get_facebook_subdomains(&ct_api_url_fb, &with_proxy, &proxy),
get_spyse_subdomains(&ct_api_url_spyse, &with_proxy, &proxy),
get_bufferover_subdomains(&ct_api_url_bufferover, &with_proxy, &proxy),
];

let all_subdomains_vec = all_subdomains.into_iter().fold(None, concat_options);
Expand Down Expand Up @@ -155,6 +163,7 @@ pub fn get_subdomains(
get_sublist3r_subdomains(&ct_api_url_sublist3r, &with_proxy, &proxy),
get_facebook_subdomains(&ct_api_url_fb, &with_proxy, &proxy),
get_spyse_subdomains(&ct_api_url_spyse, &with_proxy, &proxy),
get_bufferover_subdomains(&ct_api_url_bufferover, &with_proxy, &proxy),
];

let all_subdomains_vec = all_subdomains.into_iter().fold(None, concat_options);
Expand Down Expand Up @@ -408,6 +417,36 @@ fn get_spyse_subdomains(
}
}

fn get_bufferover_subdomains(
ct_api_url_bufferover: &str,
with_proxy: &str,
proxy: &str,
) -> Option<Vec<String>> {
let client = return_client(&with_proxy, &proxy).unwrap();
println!("Searching in the Bufferover API... 🔍");
match client.get(ct_api_url_bufferover).send() {
Ok(mut ct_data_bufferover) => match ct_data_bufferover.json::<SubdomainsBufferover>() {
Ok(bufferover_json) => Some(
bufferover_json
.FDNS_A
.iter()
.map(|sub| sub.split(","))
.flatten()
.map(str::to_owned)
.collect(),
),
Err(e) => {
check_json_errors(e, "Bufferover");
None
}
},
Err(e) => {
check_request_errors(e, "Bufferover");
None
}
}
}

fn check_request_errors(error: reqwest::Error, api: &str) {
if error.is_timeout() {
println!(
Expand Down

0 comments on commit c61f319

Please sign in to comment.