Skip to content

Commit

Permalink
Update surfshark.rs
Browse files Browse the repository at this point in the history
updated nordvpn canary endpoint
  • Loading branch information
irishmaestro authored Nov 3, 2023
1 parent 8e383cf commit 18bea3d
Showing 1 changed file with 22 additions and 13 deletions.
35 changes: 22 additions & 13 deletions src/surfshark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@ use ansi_term::Color::{Green, Red, Yellow};
use august;

pub fn canary() {
let surfshark_banner = r#" ___ __ _ _
/ __| _ _ _ _ / _| ___ | |_ __ _ _ _ | |__
\__ \ | +| | | '_| | _| (_-< | ' \ / _` | | '_| | / /
|___/ \_,_| _|_|_ _|_|_ /__/_ |_||_| \__,_| _|_|_ |_\_\
_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|
"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-' "#;
println!("{}", surfshark_banner);
println!(";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;");
let nordvpn_banner = r#" _ _ _ __ __ ___ _ _
| \| | ___ _ _ __| | \ \ / / | _ \ | \| |
| .` | / _ \ | '_| / _` | \ V / | _/ | .` |
|_|\_| \___/ _|_|_ \__,_| _\_/_ _|_|_ |_|\_|
_|"""""|_|"""""|_|"""""|_|"""""|_| """"|_| """ |_|"""""|
"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-' "#;
println!("{}", nordvpn_banner);
println!(";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;");
println!("\n");

let url = "https://surfshark.com/warrant-canary";
// let url = "https://nordvpn.com/security-efforts/";
let url = "https://nordvpn.com/blog/nordvpn-introduces-a-warrant-canary/";
let response = reqwest::blocking::get(url).unwrap();

if response.status().is_success() {
Expand All @@ -23,25 +24,33 @@ _|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|
);
} else if response.status().is_server_error() {
println!(
"HTTP STATUS CODE: {:?}\n{}\nVISIT {} FOR FURTHER CONFIRMATION",
"HTTP STATUS CODE: {:?}\n{}\nVISIT {} FOR FURTHER CONFIRMATION.",
response.status(),
Red.bold().paint("CANARY DOWN"),
url
);
} else {
println!(
"HTTP STATUS CODE: {:?}\n{}\nVISIT {} FOR FURTHER CONFIRMATION",
"HTTP STATUS CODE: {:?}\n{}\nVISIT {} FOR FURTHER CONFIRMATION.",
response.status(),
Yellow.bold().paint("CANARY UNKNOWN"),
url
);
}

let page = scraper::Html::parse_document(&response.text().unwrap());
let div = scraper::Selector::parse("div.styles_col12__Y_5s1").unwrap();
let div = scraper::Selector::parse("div.BlogPost__content").unwrap();
let canary = page.select(&div).next().unwrap();

println!("🐤 {}", august::convert(&canary.inner_html(), 80));
let full = august::convert(&canary.inner_html(), 80);
let rm_rf_sales_pitch = full.as_str().get(0..1638);
println!(
"🐤 {}",
rm_rf_sales_pitch.unwrap_or(
"ERROR PULLING CANARY: VISIT THE FOLLOWING URL TO MANUALLY VERIFY CANARY STATUS"
)
);

println!("\n");
println!("🐤 {}", Yellow.bold().paint(url));
}

0 comments on commit 18bea3d

Please sign in to comment.