diff --git a/witch_craft/src/core/core.rs b/witch_craft/src/core/core.rs index 86f265c..9ce4a76 100644 --- a/witch_craft/src/core/core.rs +++ b/witch_craft/src/core/core.rs @@ -5,6 +5,7 @@ use crate::core::structs::DataSet; use chrono; use colored::*; use regex::Regex; +use reqwest::blocking::Client; use std::env; use std::fs; use std::net::IpAddr; @@ -71,7 +72,7 @@ pub fn raise(arg: &str, warning_type: &str) -> String { let formatted_output = format!("{} {}", out.to_uppercase(), arg); - println!("\n{}\n", formatted_output.bold()); + println!("{}", formatted_output.bold()); formatted_output } diff --git a/witch_craft/src/modules/osint/lookup.rs b/witch_craft/src/modules/osint/lookup.rs index 6267ff5..04df9fa 100644 --- a/witch_craft/src/modules/osint/lookup.rs +++ b/witch_craft/src/modules/osint/lookup.rs @@ -1,3 +1,5 @@ +use reqwest::blocking::Client; + use crate::core::core::*; pub fn search_ans(argsv: &[String]) -> i32 { @@ -80,3 +82,105 @@ pub fn search_proxy(argsv: &[String]) -> i32 { } return 0; } + +pub fn cinsscore(argsv: &[String]) -> i32 { + let ip = search_value("ip", argsv); + let file = read_file_to_lines("/var/witch_craft/witch_spells/osint/ci-badguys.txt"); + + for line in file { + if line.as_str().contains(&ip) { + raise(&format!("IP found :: {}", line), "warning"); + return 255; + } + } + + raise("Nothing found, must be legit UwU", "message"); + return 0; +} + +pub fn social_links(argsv: &[String]) -> i32 { + let keyword = search_value("keyword", argsv); + // name - url - filter + let social_links = [ + ("youtube", "https://www.youtube.com/@@@keyword", ""), + ("gitlab", "https://gitlab.com/@@keyword", ""), + ("github", "https://github.com/@@keyword", ""), + ("bitbucket", "https://bitbucket.org/@@keyword", ""), + ( + "facebook", + "https://facebook.com/@@keyword", + "This content isn't available right now", + ), + ("slideshare", "https://slideshare.net/@@keyword", ""), + ( + "linkedin.corp", + "https://linkedin.com/company/@@keyword", + "", + ), + ("linkedin.user", "https://linkedin.com/in/@@keyword", ""), + ("myspace", "https://myspace.com/@@keyword", ""), + ( + "instagram", + "https://instagram.com/@@keyword", + "Sorry, this page isn't available.", + ), + ( + "medium", + "https://medium.com/@@@keyword", + "Out of nothing, something.", + ), + ( + "twitch", + "https://twitch.tv/@@keyword", + "Sorry. Unless you've got a time machine, that content is unavailable.", + ), + ("mastodon", "https://mastodon.social/@@@keyword", ""), + ( + "bsky", + "https://bsky.app/profile/@@keyword", + "Error: handle must be a valid handle", + ), + ("reddit", "https://www.reddit.com/user/@@keyword", ""), + ( + "twitter", + "https://www.x.com/@@keyword", + "This account doesn’t exist", + ), + ( + "xvideos", + "https://www.xvideos.com/profiles/@@keyword", + "THIS PROFILE DOESN'T EXIST !", + ), + ]; + + for item in social_links { + let client = Client::new(); + let url = item.1.replace("@@keyword", &keyword); + + match client.get(&url).send() { + Ok(res) => { + if res.status().as_u16() == 200 { + if item.2.is_empty() { + raise( + &format!("Found! {} {} at {}", &keyword, item.0, &url), + "done", + ); + } else { + if res.text().unwrap().contains(item.2) == false { + raise( + &format!("Found! {} {} at {}", &keyword, item.0, &url), + "done", + ); + } + } + } + } + Err(err) => { + eprintln!("{:?}", err); + return 0; + } + } + } + + return 0; +} diff --git a/witch_craft/src/modules/osint/osint.rs b/witch_craft/src/modules/osint/osint.rs index eecfdca..cef3f42 100644 --- a/witch_craft/src/modules/osint/osint.rs +++ b/witch_craft/src/modules/osint/osint.rs @@ -6,5 +6,7 @@ pub fn api() -> Closure { ("search.ans", search_ans), ("search.geoloc", search_geoloc), ("search.proxy", search_proxy), + ("search.ipscore", cinsscore), + ("search.social", social_links), ] }