From 3f5d7ee62c1b93c58fb5ea7e150ab5ef9420d496 Mon Sep 17 00:00:00 2001
From: alfredredbird <105014217+Alfredredbird@users.noreply.github.com>
Date: Wed, 1 Jan 2025 12:46:38 -0800
Subject: [PATCH] getting ready to work on adding email OSINT
---
brib.py | 62 ++++++++++++++++++++++++++++++++++++-----
config/config.ini | 2 +-
modules/modules.py | 13 +++++++++
modules/printmodules.py | 3 ++
modules/webscrape.py | 35 +++++++++++++++++++++++
sites/emailsites.json | 31 +++++++++++++++++++++
6 files changed, 138 insertions(+), 8 deletions(-)
create mode 100644 sites/emailsites.json
diff --git a/brib.py b/brib.py
index 48710f5..4eea0c5 100755
--- a/brib.py
+++ b/brib.py
@@ -4,6 +4,7 @@
import argparse
import datetime
import os
+import re
import site
import time
from configparser import ConfigParser
@@ -111,7 +112,20 @@ def run_script():
uname = input(f"{language_module.target}")
# this removes the comma and puts the usernames into a list
uname_list = [item.strip() for item in uname.split(",")]
-
+
+ email = re.match(r'^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$', uname)
+ if email:
+ print("Email OSINT isnt supported just yet.")
+ # remove exit when ready to send to full production
+ email = True
+ # email_sites = get_site_names()
+ # print(email_sites)
+ # WebScraper.email_scrape()
+ print("Quitting.....")
+ exit()
+ else:
+ pass
+
# This is where tookie-osint gathers the inputed options and then run them.
# Not all of the options execute on input.
if argument:
@@ -132,8 +146,9 @@ def run_script():
webscrape = True
else:
while test != True:
- input1 = input("⤷ ")
- if input1 != "":
+ if email != True:
+ input1 = input("⤷ ")
+ if input1 != "":
# the options follow a simple ruleset
# first you need the input ex: "-ls" then you need the function it will run ex: dirList
# lastly, you need the inputs or anything you want to pass into the function ex: [modes, input1]
@@ -272,11 +287,44 @@ def run_script():
# code to show NSFW sites
if "-N" in input1:
modes += input1
- # checks for empty input
- # it will keep printing ⤷ until -s is entered and Y is entered
- if "" in input1 and inputnum != "":
+ # checks for empty input
+ # it will keep printing ⤷ until -s is entered and Y is entered
+ if "" in input1 and inputnum != "":
+ test = True
+ inputnum = ""
+
+ else:
+ # email osint options
+ input3 = input("⤷ ")
+ if input3 != "":
+ # will add actions later
+ action = {
+ "-s": [emptyModule, []],
+ "-u": [emailinfo, [uname]],
+ }
+ valid = [key for key in action.keys()]
+ option_matched = False
+ for option in valid:
+ if option in input3:
+ args = action[option][1]
+ action[option][0](*args)
+ option_matched = True
+ break # Exit the loop if a matching option is found
+
+ if not option_matched:
+ print(f"Invalid option: '{input3}' Try --help for more information")
+ # this is the function that starts tookie-osint.
+ if "-s" in input3:
+ inputnum += "idk"
+ emailSiteName = get_site_names()
+ # this is temporary, i need to add it to the lines below
+ print(emailSiteName)
+ exit()
+
+
+ if "" in input3 and inputnum != "":
test = True
- inputnum = ""
+ inputnum = ""
if argument.all:
modes = "-a"
diff --git a/config/config.ini b/config/config.ini
index 81782c2..5a365ba 100644
--- a/config/config.ini
+++ b/config/config.ini
@@ -5,7 +5,7 @@ browser = Not Checked
firstlaunch = yes
language = en
defaultcapturepath = ./captured/
-prerelease = no
+prerelease = yes
updaterver = 2
discordwebhookurl = none
pluginfolder = plugins
diff --git a/modules/modules.py b/modules/modules.py
index 43246c0..9ea2b88 100644
--- a/modules/modules.py
+++ b/modules/modules.py
@@ -587,3 +587,16 @@ def get_local_ip():
print(f"Error: {e}")
return None
+def get_site_names(json_path="sites/emailsites.json"):
+ try:
+ with open(json_path, "r") as file:
+ data = json.load(file)
+ # Return the keys of the JSON object as a list
+ return list(data.keys())
+ except FileNotFoundError:
+ print(f"File not found: {json_path}")
+ return []
+ except json.JSONDecodeError:
+ print("Error decoding JSON.")
+ return []
+
diff --git a/modules/printmodules.py b/modules/printmodules.py
index 931436d..39db37a 100644
--- a/modules/printmodules.py
+++ b/modules/printmodules.py
@@ -250,3 +250,6 @@ def returntotookie(seconds, language_module):
def unameinfo(uname, language_module):
print(language_module.rqUname + uname)
+
+def emailinfo(uname):
+ print(uname)
diff --git a/modules/webscrape.py b/modules/webscrape.py
index 2c8b8ab..591c5d6 100644
--- a/modules/webscrape.py
+++ b/modules/webscrape.py
@@ -2,6 +2,7 @@
import os
import platform
import subprocess
+import json
from configparser import ConfigParser
from selenium import webdriver
@@ -137,4 +138,38 @@ def scrape(self, url, target_error_message, language_module):
except Exception as e:
print(f"{language_module.error11}{e}")
return None
+
+ def load_json(file_path):
+ try:
+ with open(file_path, 'r') as file:
+ return json.load(file)
+ except FileNotFoundError:
+ print(f"Error: The file '{file_path}' was not found.")
+ return None
+ except json.JSONDecodeError as e:
+ print(f"Error: Failed to parse JSON - {e}")
+ return None
+
+
+ def email_scrape():
+ # path the json file
+ json_file_path = "sites/emailsites.json"
+ data = WebScraper.load_json(json_file_path)
+ site_name = "Monkeytype"
+ if site_name not in data:
+ print(f"Site '{site_name}' not found.")
+ return None
+
+ site_data = data[site_name][0]
+ login_url = site_data.get("login")
+ error_message = site_data.get("error")
+ fields = site_data.get("feilds", {})
+ login_field = fields.get("login")
+ password_field = fields.get("password")
+
+ print(f"Login URL: {login_url}")
+ print(f"Error Message: {error_message}")
+ print(f"Login Field: {login_field}")
+ print(f"Password Field: {password_field}")
+ print("----------------------------------------------------------------")
diff --git a/sites/emailsites.json b/sites/emailsites.json
new file mode 100644
index 0000000..c127a8f
--- /dev/null
+++ b/sites/emailsites.json
@@ -0,0 +1,31 @@
+{
+ "Youtube": [
+ {
+ "site": "http://www.youtube.com",
+ "login": "http://www.youtube.com/login",
+ "error": "This page isn't available."
+ }
+ ],
+ "Monkeytype": [
+ {
+ "site": "https://monkeytype.com",
+ "login": "https://monkeytype.com/login",
+ "error": "Email/password is incorrect or your account does not have password authentication enabled.",
+ "feilds": {
+ "login": "",
+ "password": ""
+ }
+ }
+ ],
+ "Twich": [
+ {
+ "site": "https://www.twitch.tv",
+ "login": "https://www.twitch.tv/login",
+ "error": "We have disabled the ability to log in with your email address.",
+ "feilds": {
+ "login": "",
+ "password": ""
+ }
+ }
+ ]
+}