Skip to content

Commit

Permalink
Added partial web osint tool
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmic-zip committed Oct 20, 2024
1 parent 8479977 commit 32d29e2
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 1 deletion.
3 changes: 2 additions & 1 deletion witch_craft/src/core/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
}

Expand Down
104 changes: 104 additions & 0 deletions witch_craft/src/modules/osint/lookup.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use reqwest::blocking::Client;

use crate::core::core::*;

pub fn search_ans(argsv: &[String]) -> i32 {
Expand Down Expand Up @@ -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;
}
2 changes: 2 additions & 0 deletions witch_craft/src/modules/osint/osint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
]
}

0 comments on commit 32d29e2

Please sign in to comment.