From cd3503546725b8a1d90b26455e13558f571eaeea Mon Sep 17 00:00:00 2001 From: cosmic-zip <36008397+cosmic-zip@users.noreply.github.com> Date: Mon, 13 Jan 2025 16:28:12 -0300 Subject: [PATCH 01/15] Updated meta search --- witchcraft/src/core/consts.rs | 1 + witchcraft/src/modules/osint/meta_search.rs | 92 ++++++++++++--------- 2 files changed, 52 insertions(+), 41 deletions(-) diff --git a/witchcraft/src/core/consts.rs b/witchcraft/src/core/consts.rs index 9e72e703..e4807b73 100644 --- a/witchcraft/src/core/consts.rs +++ b/witchcraft/src/core/consts.rs @@ -1,3 +1,4 @@ +pub const SW_DEBUG: bool = false; pub const TONK: &str = "@@"; pub const SPLIT_II: &str = "--"; pub const SPLIT_I: &str = "-"; diff --git a/witchcraft/src/modules/osint/meta_search.rs b/witchcraft/src/modules/osint/meta_search.rs index 30c381a7..ca982a3d 100644 --- a/witchcraft/src/modules/osint/meta_search.rs +++ b/witchcraft/src/modules/osint/meta_search.rs @@ -1,3 +1,4 @@ +use crate::core::consts::SW_DEBUG; use crate::core::core::*; use headless_chrome::{Browser, LaunchOptionsBuilder}; use reqwest::blocking::Client; @@ -28,41 +29,7 @@ pub fn read_json_file(file_path: &str) -> OsintDatabase { data } -pub fn exec_meta_search(data: OsintEntry, keyword: &str) { - fn filter(data: OsintEntry, content: String, keyword: &str) { - let mut positive_found: Vec = Vec::new(); - let mut negative_found: Vec = Vec::new(); - - if data.match_negative.is_empty() { - raise("Negative patterns can't be empty!", "fail"); - } - - for ps in &data.match_positive { - if content.to_lowercase().contains(&ps.to_lowercase()) { - positive_found.push(ps.to_string()); - } - } - - for ng in &data.match_negative { - if content.to_lowercase().contains(&ng.to_lowercase()) { - negative_found.push(ng.to_string()); - } - } - - if negative_found.is_empty() { - let key = data.url.replace("@@keyword", keyword); - raise(&format!("Found! :: {}", key), "good"); - raise("Adicional information", "none"); - raise(&format!("\t Category: {}", data.category), "none"); - raise(&format!("\t Global rank: {}", data.global_rank), "none"); - raise(&format!("\t Country: {}", data.country), "none"); - raise(&format!("\t Is nsfw: {}\n", data.nsfw), "none"); - } - } - - let url = &data.url.replace("@@keyword", &keyword); - - let client = Client::new(); +fn grep_page_content(url: String) -> String { let browser = Browser::new( LaunchOptionsBuilder::default() .headless(true) @@ -81,7 +48,7 @@ pub fn exec_meta_search(data: OsintEntry, keyword: &str) { &format!("Failed to navigate to URL: {}", err.to_string()), "fail", ); - return; + return String::new(); } } @@ -89,11 +56,11 @@ pub fn exec_meta_search(data: OsintEntry, keyword: &str) { Ok(_) => {} Err(err) => { raise(&format!("exec_meta_search :: {}", err.to_string()), "fail"); - return; + return String::new(); } } - match tab.wait_for_element_with_custom_timeout("body", Duration::from_secs(30)) { + match tab.wait_for_element_with_custom_timeout("body", Duration::from_secs(15)) { Ok(_element) => { // element.click().unwrap(); // Example action } @@ -102,20 +69,63 @@ pub fn exec_meta_search(data: OsintEntry, keyword: &str) { &format!("Element was not found within timeout: {}", err.to_string()), "fail", ); - return; + return String::new(); } } let content = tab.get_content().unwrap(); + return content; +} + +pub fn exec_meta_search(data: OsintEntry, keyword: &str) { + fn filter(data: OsintEntry, content: String, keyword: &str) { + let mut positive_found: Vec = Vec::new(); + let mut negative_found: Vec = Vec::new(); + + if data.match_negative.is_empty() { + raise("Negative patterns can't be empty!", "fail"); + } + + for ps in &data.match_positive { + if content.to_lowercase().contains(&ps.to_lowercase()) { + positive_found.push(ps.to_string()); + } + } + + for ng in &data.match_negative { + if content.to_lowercase().contains(&ng.to_lowercase()) { + negative_found.push(ng.to_string()); + } + } + + if negative_found.is_empty() { + let key = data.url.replace("@@keyword", keyword); + raise(&format!("Found! :: {}", key), "good"); + raise("Adicional information", "none"); + raise(&format!("\t Category: {}", data.category), "none"); + raise(&format!("\t Global rank: {}", data.global_rank), "none"); + raise(&format!("\t Country: {}", data.country), "none"); + raise(&format!("\t Is nsfw: {}\n", data.nsfw), "none"); + } + } + + let url = &data.url.replace("@@keyword", &keyword); + let client = Client::new(); match client.get(url).send() { Ok(res) => { - if res.status().as_u16() == 200 || res.status().as_u16() == 404 { + if res.status().as_u16() == 200 { + let content = grep_page_content(url.to_string()); filter(data, content, keyword); } } Err(err) => { - raise(&format!("exec_meta_search :: {}", err.to_string()), "fail"); + if SW_DEBUG { + raise( + &format!("exec_meta_search :: URL :: {} \n {}", url, err.to_string()), + "fail", + ); + } return; } } From b0ac272a3c7df4c559792557c06c04f9fb8958e2 Mon Sep 17 00:00:00 2001 From: cosmic-zip <36008397+cosmic-zip@users.noreply.github.com> Date: Mon, 13 Jan 2025 16:28:26 -0300 Subject: [PATCH 02/15] Updated the spellbook --- spellbook/archive/dataset/db.json | 10 +++++----- spellbook/archive/osint/osintdb.json | 4 +++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/spellbook/archive/dataset/db.json b/spellbook/archive/dataset/db.json index 94d47804..0bff802f 100644 --- a/spellbook/archive/dataset/db.json +++ b/spellbook/archive/dataset/db.json @@ -383,27 +383,27 @@ { "name": "search.ans", "description": "Search ans for ipv4 and ipv6", - "command": "search.ans --ip ip_address" + "command": "search.ans @@ip ip_address" }, { "name": "search.geoloc", "description": "Geolocation search for coordinates", - "command": "search.geoloc --ip ip_address" + "command": "search.geoloc @@ip ip_address" }, { "name": "search.proxy", "description": "Search proxy for IP routing", - "command": "search.proxy --ip ip_address" + "command": "search.proxy @@ip ip_address" }, { "name": "search.ipscore", "description": "IP scoring for security (CIN score)", - "command": "search.ipscore --ip ip_address" + "command": "search.ipscore @@ip ip_address" }, { "name": "search.meta", "description": "Social media profile search in over 1000 platforms", - "command": "search.social --keyword nickname" + "command": "search.social @@keyword nickname" }, { "name": "view.applogs", diff --git a/spellbook/archive/osint/osintdb.json b/spellbook/archive/osint/osintdb.json index fcc3f7e2..cf21097e 100644 --- a/spellbook/archive/osint/osintdb.json +++ b/spellbook/archive/osint/osintdb.json @@ -11001,7 +11001,9 @@ "country": "United States", "nsfw": "false", "match_positive": [], - "match_negative": [] + "match_negative": [ + "Sign in to" + ] }, { "url": "https://@@keyword.svbtle.com/", From 3dad6dd015d4a7de9c01506cdbd9fb7ee4f33246 Mon Sep 17 00:00:00 2001 From: cosmic-zip <36008397+cosmic-zip@users.noreply.github.com> Date: Thu, 16 Jan 2025 02:45:39 -0300 Subject: [PATCH 03/15] Added and fixed dataset/db.json sections, evilpages/default/index.html --- spellbook/archive/dataset/db.json | 198 +++++++++++++++--- spellbook/archive/dataset/sort.py | 2 +- .../archive/evilpages/default/index.html | 17 +- spellbook/archive/scripts/installer.sh | 3 +- 4 files changed, 173 insertions(+), 47 deletions(-) diff --git a/spellbook/archive/dataset/db.json b/spellbook/archive/dataset/db.json index 0bff802f..4c85d719 100644 --- a/spellbook/archive/dataset/db.json +++ b/spellbook/archive/dataset/db.json @@ -1,5 +1,15 @@ { "general": [ + { + "name": "a", + "description": "🟠 Section A", + "command": "" + }, + { + "name": "b", + "description": "🟠 Section B", + "command": "" + }, { "name": "backup.amazon_dynamodb", "description": "Amazon DynamoDB backup", @@ -110,6 +120,11 @@ "description": "Lists Bluetooth devices and their status.", "command": "rfkill list" }, + { + "name": "c", + "description": "🟠 Section C", + "command": "" + }, { "name": "capture.all", "description": "Capture all packets on a specified network interface.", @@ -155,6 +170,11 @@ "description": "Crack ZIP file encryption using Hashcat", "command": "hashcat -m 13600 -a 0 @@file @@wordlist" }, + { + "name": "d", + "description": "🟠 Section D", + "command": "" + }, { "name": "disk.dump", "description": "Create a disk dump from a specified input device to an output file.", @@ -175,6 +195,16 @@ "description": "Send and X number of get requests without data", "command": "dos.spam @@domain @@times" }, + { + "name": "e", + "description": "🟠 Section E", + "command": "" + }, + { + "name": "f", + "description": "🟠 Section F", + "command": "" + }, { "name": "fhide.embed", "description": "Hides a file within a cover image or audio file using Steghide.", @@ -205,11 +235,6 @@ "description": "lsof alias", "command": "lsof @@file" }, - { - "name": "file.str", - "description": "Strings alias", - "command": "strings @@file" - }, { "name": "file.clean.meta", "description": "Removes all metadata from an image to protect privacy", @@ -240,6 +265,11 @@ "description": "Extracts and displays all metadata from an image file using exiftool.", "command": "exiftool @@file" }, + { + "name": "file.str", + "description": "Strings alias", + "command": "strings @@file" + }, { "name": "firewall.drop.bigger", "description": "Drop all outcome port bigger than expecified port", @@ -266,9 +296,44 @@ "command": "ftp @@address" }, { - "name": "qrcode", - "description": "Create a QR code from the provided data.", - "command": "qrcode @@data" + "name": "g", + "description": "🟠 Section G", + "command": "" + }, + { + "name": "h", + "description": "🟠 Section H", + "command": "" + }, + { + "name": "i", + "description": "🟠 Section I", + "command": "" + }, + { + "name": "j", + "description": "🟠 Section J", + "command": "" + }, + { + "name": "k", + "description": "🟠 Section K", + "command": "" + }, + { + "name": "l", + "description": "🟠 Section L", + "command": "" + }, + { + "name": "m", + "description": "🟠 Section M", + "command": "" + }, + { + "name": "maidz", + "description": "An cute cat girl tells you basic system information like neofetch", + "command": "maidz" }, { "name": "map.auth", @@ -320,6 +385,11 @@ "description": "Check for specific known vulnerabilities and generally only report results if they are found.", "command": "nmap -T3 -D RND:8 --script vuln @@target" }, + { + "name": "n", + "description": "🟠 Section N", + "command": "" + }, { "name": "nuke.file", "description": "Securely overwrites and deletes a file seven times, then removes it from the filesystem to prevent data recovery.", @@ -335,11 +405,66 @@ "description": "Securely overwrites and deletes the /var/logs", "command": "sudo find /var/log -type f -exec shred -u {} \\;" }, + { + "name": "o", + "description": "🟠 Section O", + "command": "" + }, + { + "name": "p", + "description": "🟠 Section P", + "command": "" + }, + { + "name": "q", + "description": "🟠 Section Q", + "command": "" + }, + { + "name": "qrcode", + "description": "Create a QR code from the provided data.", + "command": "qrcode @@data" + }, + { + "name": "r", + "description": "🟠 Section R", + "command": "" + }, + { + "name": "s", + "description": "🟠 Section S", + "command": "" + }, { "name": "scp.copy", "description": "Creates a directory named 'out' and copies files from a specified folder to a remote host via SCP.", "command": "mkdir out && scp -P @@port @@folder/* hostuser@@@ip:./out/" }, + { + "name": "search.ans", + "description": "Search ans for ipv4 and ipv6", + "command": "search.ans @@ip ip_address" + }, + { + "name": "search.geoloc", + "description": "Geolocation search for coordinates", + "command": "search.geoloc @@ip ip_address" + }, + { + "name": "search.ipscore", + "description": "IP scoring for security (CIN score)", + "command": "search.ipscore @@ip ip_address" + }, + { + "name": "search.meta", + "description": "Social media profile search in over 1000 platforms", + "command": "search.social @@keyword nickname" + }, + { + "name": "search.proxy", + "description": "Search proxy for IP routing", + "command": "search.proxy @@ip ip_address" + }, { "name": "self.setup", "description": "Setup and install witch_craft", @@ -370,40 +495,25 @@ "description": "Sends a POST request with JSON data containing a 'main' field and a message field specified by @@message to a specified domain.", "command": "curl -X POST -H \"Content-Type: application/json\" -d '{\"main\": \"somename\", \"@@message\": \"somemsg\"}' @@domain" }, + { + "name": "t", + "description": "🟠 Section T", + "command": "" + }, { "name": "tldr", "description": "The tldr command is a collection of community-maintained help pages for command-line tools from the tldr-pages project, that aims to be a simpler, more approachable complement to traditional man pages.", "command": "tldr @@page" }, { - "name": "maidz", - "description": "An cute cat girl tells you basic system information like neofetch", - "command": "maidz" - }, - { - "name": "search.ans", - "description": "Search ans for ipv4 and ipv6", - "command": "search.ans @@ip ip_address" - }, - { - "name": "search.geoloc", - "description": "Geolocation search for coordinates", - "command": "search.geoloc @@ip ip_address" - }, - { - "name": "search.proxy", - "description": "Search proxy for IP routing", - "command": "search.proxy @@ip ip_address" - }, - { - "name": "search.ipscore", - "description": "IP scoring for security (CIN score)", - "command": "search.ipscore @@ip ip_address" + "name": "u", + "description": "🟠 Section U", + "command": "" }, { - "name": "search.meta", - "description": "Social media profile search in over 1000 platforms", - "command": "search.social @@keyword nickname" + "name": "v", + "description": "🟠 Section V", + "command": "" }, { "name": "view.applogs", @@ -455,10 +565,30 @@ "description": "wtmp: Records all user logins and logouts.", "command": "last -n 1000" }, + { + "name": "w", + "description": "🟠 Section W", + "command": "" + }, { "name": "web.download", "description": "Full website downloader", "command": "wget --recursive -U 'Mozilla/5.0 (X11; Linux x86_64; rv:130.0) Gecko/20100101 Firefox/130.0' --page-requisites --html-extension --convert-links --restrict-file-names=windows --random-wait --wait=@@wait --limit-rate=200k --tries=inf --domains example.com --no-parent @@url" + }, + { + "name": "x", + "description": "🟠 Section X", + "command": "" + }, + { + "name": "y", + "description": "🟠 Section Y", + "command": "" + }, + { + "name": "z", + "description": "🟠 Section Z", + "command": "" } ] } diff --git a/spellbook/archive/dataset/sort.py b/spellbook/archive/dataset/sort.py index 56e22d74..e4d50c42 100644 --- a/spellbook/archive/dataset/sort.py +++ b/spellbook/archive/dataset/sort.py @@ -15,4 +15,4 @@ with open('db.json', 'w') as outfile: - json.dump({"general": ordered_general}, outfile, indent=2) + json.dump({"general": ordered_general}, outfile, indent=4) diff --git a/spellbook/archive/evilpages/default/index.html b/spellbook/archive/evilpages/default/index.html index 5b4daf97..72580dfb 100644 --- a/spellbook/archive/evilpages/default/index.html +++ b/spellbook/archive/evilpages/default/index.html @@ -1,6 +1,6 @@ Login 10 @@ -29,16 +29,16 @@

Login #10