Skip to content

Commit

Permalink
getting ready to work on adding email OSINT
Browse files Browse the repository at this point in the history
  • Loading branch information
Alfredredbird committed Jan 1, 2025
1 parent 8de2f13 commit 3f5d7ee
Show file tree
Hide file tree
Showing 6 changed files with 138 additions and 8 deletions.
62 changes: 55 additions & 7 deletions brib.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import argparse
import datetime
import os
import re
import site
import time
from configparser import ConfigParser
Expand Down Expand Up @@ -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:
Expand All @@ -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]
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion config/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ browser = Not Checked
firstlaunch = yes
language = en
defaultcapturepath = ./captured/
prerelease = no
prerelease = yes
updaterver = 2
discordwebhookurl = none
pluginfolder = plugins
Expand Down
13 changes: 13 additions & 0 deletions modules/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 []

3 changes: 3 additions & 0 deletions modules/printmodules.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,3 +250,6 @@ def returntotookie(seconds, language_module):

def unameinfo(uname, language_module):
print(language_module.rqUname + uname)

def emailinfo(uname):
print(uname)
35 changes: 35 additions & 0 deletions modules/webscrape.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import os
import platform
import subprocess
import json
from configparser import ConfigParser

from selenium import webdriver
Expand Down Expand Up @@ -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("----------------------------------------------------------------")

31 changes: 31 additions & 0 deletions sites/emailsites.json
Original file line number Diff line number Diff line change
@@ -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": "<input name=\"current-email\" type=\"email\" placeholder=\"email\" autocomplete=\"current-email\">",
"password": "<input name=\"current-password\" type=\"password\" placeholder=\"password\" autocomplete=\"current-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": "<input id=\"login-username\" aria-label=\"Enter your username\" type=\"text\" class=\"ScInputBase-sc-vu7u7d-0 ScInput-sc-19xfhag-0 gNGlOQ jsKSYr InjectLayout-sc-1i43xsx-0 eRDdjS tw-input\" autocapitalize=\"off\" autocorrect=\"off\" autocomplete=\"username\" data-a-target=\"tw-input\" value=\"\">",
"password": "<input id=\"password-input\" aria-label=\"Enter your password\" type=\"password\" class=\"ScInputBase-sc-vu7u7d-0 ScInput-sc-19xfhag-0 iXwnY jsKSYr InjectLayout-sc-1i43xsx-0 eRDdjS tw-input tw-input--password\" autocapitalize=\"off\" autocorrect=\"off\" autocomplete=\"current-password\" data-a-target=\"tw-input\" spellcheck=\"false\" value=\"\">"
}
}
]
}

0 comments on commit 3f5d7ee

Please sign in to comment.