Merge pull request #494 from WebBreacher/main

Sync dev with main
This commit is contained in:
WebBreacher 2022-08-02 12:06:45 -05:00 committed by GitHub
commit f85c3aef07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 10148 additions and 4581 deletions

View File

@ -0,0 +1,17 @@
name: Check for Duplicate check_uri
on: push
jobs:
duplicate-url-checker:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
- name: Check for duplicate in old JSON
run: if [ $(grep "check_uri" web_accounts_list.json | cut -f4 -d'"' | uniq -D | head -1) ]; then echo "Found duplicate in web_accounts_list.json!"; exit 1; else echo "No duplicates found"; fi
shell: bash
- name: Check for duplicate in new JSON
run: if [ $(grep "uri_check" wmn-data.json | cut -f4 -d'"' | uniq -D | head -1) ]; then echo "Found duplicate in wmn-data.json!"; exit 1; else echo "No duplicates found"; fi
shell: bash

72
.github/workflows/codeql-analysis.yml vendored Normal file
View File

@ -0,0 +1,72 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
on:
push:
branches: [ "master" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "master" ]
schedule:
- cron: '17 19 * * 0'
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
steps:
- name: Checkout repository
uses: actions/checkout@v3
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
# Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2

29
.github/workflows/minify-json.yml vendored Normal file
View File

@ -0,0 +1,29 @@
on:
push:
branches: [main]
workflow_dispatch:
name: Minify JSON
jobs:
web-deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout files
uses: actions/checkout@v3
- name: Minify old JSON
uses: StefanEnsmann/Minify-JSON-Action@1.1.0
with:
input_file: web_accounts_list.json
output_file: web_accounts_list-min.json
- name: Minify new JSON
uses: StefanEnsmann/Minify-JSON-Action@1.1.0
with:
input_file: wmn-data.json
output_file: wmn-data-min.json
- name: Auto-commit to repository
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Minify source code

18
.github/workflows/validate-json.yml vendored Normal file
View File

@ -0,0 +1,18 @@
name: Validate JSON
on: [pull_request]
jobs:
verify-json-validation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Validate Old JSON
uses: docker://orrosenblatt/validate-json-action:latest
env:
INPUT_SCHEMA: /schema.json
INPUT_JSONS: /web_accounts_list.json
- name: Validate New JSON
uses: docker://orrosenblatt/validate-json-action:latest
env:
INPUT_SCHEMA: /wmn-data-schema.json
INPUT_JSONS: /wmn-data.json

View File

@ -1,84 +0,0 @@
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [whatsmyname '@' osint.ninja]. All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series of actions.
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within the community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.

128
CODE_OF_CONDUCT.md Normal file
View File

@ -0,0 +1,128 @@
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
`micah` `@` `spotlight-infosec.com`.
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series
of actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within
the community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.

View File

@ -1,5 +1,8 @@
You can contribute to the project in at least three different ways.
# Warning: These notes are currently out of date
Our project is undergoing a few changes (See #414) that impact this document. After we have completed those changes, this will be revised.
## Method 1. Non-technical
Suggest a new site to be covered by the tool.
@ -99,7 +102,7 @@ Here is an example of a site element:
"pretty_uri" : "https://github.com/{account}",
"account_existence_code" : "200",
"account_existence_string" : "login:",
"account_missing_string" : ["Not Found"],
"account_missing_string" : "Not Found",
"account_missing_code" : "404",
"known_accounts" : ["test", "webbreacher"],
"category" : "coding",

View File

@ -15,6 +15,7 @@ This repository has the unified data required to perform user and username enume
* [Recon-ng](https://github.com/lanmaster53/recon-ng) - The **Profiler Module** uses this project's JSON content.
* [sn0int](https://github.com/kpcyrd/sn0int) downloads and uses the JSON file in the [kpcyrd/whatsmyname](https://sn0int.com/r/kpcyrd/whatsmyname) module, see https://twitter.com/sn0int/status/1228046880459907073 for details and instructions.
* [WMN_screenshooter](https://github.com/swedishmike/WMN_screenshooter) a helper script that is based on `web_accounts_list_checker.py` and uses Selenium to try and grab screenshots of identified profile pages.
* [LinkScope](https://github.com/AccentuSoft/LinkScope_Client) uses this in the **Whats My Name** resolution under the **Online Identity** category.
## Content

6
SECURITY.md Normal file
View File

@ -0,0 +1,6 @@
# Security Policy
## Reporting a Vulnerability
To report a vulnerability, please create an [Issue](https://github.com/WebBreacher/WhatsMyName/issues) in this project or send
an email to `micah` `@` `spotliight-infosec.com`

View File

@ -1,4 +1,2 @@
requests
urllib3
selenium
selenium-wire
urllib3

183
schema.json Normal file
View File

@ -0,0 +1,183 @@
{
"definitions": {},
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://raw.githubusercontent.com/WebBreacher/WhatsMyName/master/schema.json",
"title": "Root",
"type": "object",
"required": [
"license",
"authors",
"categories",
"sites"
],
"properties": {
"license": {
"$id": "#root/license",
"title": "License",
"type": "array",
"default": [],
"items":{
"$id": "#root/license/items",
"title": "Items",
"type": "string",
"default": "",
"examples": [
"Copyright (C) 2022 Micah Hoffman"
],
"pattern": "^.*$"
}
},
"authors": {
"$id": "#root/authors",
"title": "Authors",
"type": "array",
"default": [],
"items":{
"$id": "#root/authors/items",
"title": "Items",
"type": "string",
"default": "",
"examples": [
"WebBreacher"
],
"pattern": "^.*$"
}
},
"categories": {
"$id": "#root/categories",
"title": "Categories",
"type": "array",
"default": [],
"items":{
"$id": "#root/categories/items",
"title": "Items",
"type": "string",
"default": "",
"examples": [
"archived"
],
"pattern": "^.*$"
}
},
"sites": {
"$id": "#root/sites",
"title": "Sites",
"type": "array",
"default": [],
"items":{
"$id": "#root/sites/items",
"title": "Items",
"type": "object",
"required": [
"name",
"check_uri",
"account_existence_code",
"account_existence_string",
"account_missing_string",
"account_missing_code",
"known_accounts",
"category",
"valid"
],
"properties": {
"name": {
"$id": "#root/sites/items/name",
"title": "Name",
"type": "string",
"default": "",
"examples": [
"101010.pl"
],
"pattern": "^.*$"
},
"check_uri": {
"$id": "#root/sites/items/check_uri",
"title": "Check_uri",
"type": "string",
"default": "",
"examples": [
"https://101010.pl/@{account}"
],
"pattern": "^.*$"
},
"account_existence_code": {
"$id": "#root/sites/items/account_existence_code",
"title": "Account_existence_code",
"type": "string",
"default": "",
"examples": [
"200"
],
"pattern": "^.*$"
},
"account_existence_string": {
"$id": "#root/sites/items/account_existence_string",
"title": "Account_existence_string",
"type": "string",
"default": "",
"examples": [
"@101010.pl"
],
"pattern": "^.*$"
},
"account_missing_string": {
"$id": "#root/sites/items/account_missing_string",
"title": "Account_missing_string",
"type": "string",
"default": "",
"examples": [
"The page you are looking for isn't here."
],
"pattern": "^.*$"
},
"account_missing_code": {
"$id": "#root/sites/items/account_missing_code",
"title": "Account_missing_code",
"type": "string",
"default": "",
"examples": [
"404"
],
"pattern": "^.*$"
},
"known_accounts": {
"$id": "#root/sites/items/known_accounts",
"title": "Known_accounts",
"type": "array",
"default": [],
"items":{
"$id": "#root/sites/items/known_accounts/items",
"title": "Items",
"type": "string",
"default": "",
"examples": [
"szekspir"
],
"pattern": "^.*$"
}
},
"category": {
"$id": "#root/sites/items/category",
"title": "Category",
"type": "string",
"default": "",
"examples": [
"social"
],
"pattern": "^.*$"
},
"valid": {
"$id": "#root/sites/items/valid",
"title": "Valid",
"type": "boolean",
"examples": [
true
],
"default": true
}
}
}
}
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -1,360 +0,0 @@
#!/usr/bin/python
'''
This script does several things:
1. It checks all the detection strings to ensure they are accurate
2. It can be used to check for a username across 1 or more sites
'''
# Todo:
# 1. CSV output
# 2. threading - https://python.tutorialink.com/selenium-threads-how-to-run-multi-threaded-browser-with-proxy-python/
# 7. Detect if username has non-url-friendly characters and would be used as subdomain
# and not run tests on sites that don't make sense
# 8. Ctrl-C chould generate output of already-checked sites both to file and to screen
# 9. Switch to Chromedriver
#- ask ff or chromedriver
#- ask for path to file
# 10. Since we are using a real browser, remove the useragent option
#
# Import Libraries
#
import argparse
#import codecs
import collections
from datetime import datetime
import json
import os
import random
import signal
import string
import sys
import threading
import time
from selenium import webdriver as wd
from seleniumwire import webdriver as wdwire
#
# Variables and Setup
#
COUNTER = collections.Counter()
debug_mode = False
running_positives = []
#user_agent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36'
# Set HTTP Header information
HEADERS = {'Accept' : 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Language' : 'en-US,en;q=0.5',
'Accept-Encoding' : 'gzip, deflate'
}
# Command line input
parser = argparse.ArgumentParser(description='This standalone script will look up a single username using the JSON file'
' and output a text file with positive results. or, if no usernames are passed to it,'
' will run a check of the JSON file for bad detection strings.')
parser.add_argument('-a', '--useragent', help='Toggle using a custom UserAgent for web calls [Default = off]', action='store_true',
default=False)
parser.add_argument('-d', '--debug', help='Enable debug output [Default = off]', action='store_true', default=False)
parser.add_argument('-f', '--firefoxdriver', help='Use the Firefox web driver instead of the Chrome one. Omit this and Chrome is used.',
action='store_true', default=False)
parser.add_argument('-i', '--inputfile', nargs='?', help='[OPTIONAL] If you want to use a JSON file other than the main one,'
' pass the file name here.')
parser.add_argument('-l', '--driverlocation', nargs='?', help='Specify the path to the Firefox or Chrome web driver binary.')
parser.add_argument('-s', '--site', nargs='*', help='If this parameter is passed the script will check only the named site'
' or list of sites.')
parser.add_argument('-u', '--username', help='If this param is passed then this script will perform the '
'lookups against the given user name instead of running checks against the JSON file.')
if os.name == 'posix':
class Colors:
RED = "\033[91m"
GREEN = "\033[92m"
YELLOW = "\033[93m"
MAGENTA = "\033[95m"
CYAN = "\033[96m"
ENDC = "\033[0m"
else:
class Colors:
RED = ''
GREEN = ''
YELLOW = ''
MAGENTA = ''
CYAN = ''
ENDC = ''
#
# Functions
#
# Colorization
def error(msg):
print(Colors.RED + '[!] ERROR! ' + msg + Colors.ENDC)
def positive(msg):
print(Colors.GREEN + '[+] ' +msg + Colors.ENDC)
def warn(msg):
print(Colors.YELLOW + '[*] WARNING. ' + msg + Colors.ENDC)
def startstop(msg):
print(Colors.CYAN + msg + Colors.ENDC)
def debug(msg):
print(Colors.MAGENTA + '[>] ' + msg + Colors.ENDC)
def negative(msg):
print('[-] ' + msg)
def neutral(msg):
print('[ ] ' + msg)
def signal_handler(*_):
error('You pressed Ctrl+C. Exiting script.')
sys.exit(130)
def web_call_response_code(location):
# Get HTTP Response Code using Selenium-wire
if firefox_driver:
driver_wire = wdwire.Firefox(driver_loc, options=driver_options)
else:
driver_wire = wdwire.Chrome(driver_loc, options=driver_options)
driver_wire.set_page_load_timeout(30)
driver_wire.get(location)
for request in driver_wire.requests:
if location in request.url:
if request.response:
if debug_mode:
debug(f'URL: {request.url}, HTTP Response Code: {request.response.status_code}')
code = request.response.status_code
driver_wire.close()
return code
def web_call_html_source(location):
# Get HTML source using Selenium for JS bypassing
if firefox_driver:
driver = wd.Firefox(driver_loc, options=driver_options)
else:
driver = wd.Chrome(driver_loc, options=driver_options)
driver.set_page_load_timeout(30)
driver.get(location)
source = driver.page_source
driver.close()
return source
def find_sites_to_check(args, data):
if args.site:
# cut the list of sites down to only the requested one
args.site = [x.lower() for x in args.site]
sites_to_check = [x for x in data['sites'] if x['name'].lower() in args.site]
if sites_to_check == 0:
error('Sorry, none of the requested site or sites were found in the list')
sys.exit(1)
sites_not_found = len(args.site) - len(sites_to_check)
if sites_not_found:
warn(f'{sites_not_found} requested sites were not found in the list')
neutral('Checking %d site(s)' % len(sites_to_check))
return sites_to_check
else:
startstop('')
neutral(f'{len(data["sites"])} sites found in file.')
return data['sites']
def check_site(site, username, if_found, if_not_found, if_neither):
url = site['check_uri'].replace("{account}", username)
try:
resp_code = web_call_response_code(url)
code_match = resp_code == int(site['account_existence_code'])
resp_html_source = web_call_html_source(url)
if site['account_existence_string']:
string_match = resp_html_source.find(site['account_existence_string']) > 0
else:
string_match = 0
if debug_mode:
if code_match:
positive(f'HTTP status (match {code_match}): {resp_code}')
else:
negative(f'HTTP status (match {code_match}): {resp_code}')
if string_match:
positive(f'HTTP response (match: {string_match}). HTML source suppressed.')
else:
negative(f'HTTP response (match: {string_match}): {resp_html_source}')
if code_match and string_match:
COUNTER['FOUND'] += 1
return if_found(url)
code_missing_match = resp_code == int(site['account_missing_code'])
string_missing_match = resp_html_source.find(site['account_missing_string']) > 0
if code_missing_match or string_missing_match:
COUNTER['NOT_FOUND'] += 1
return if_not_found(url)
COUNTER['ERROR'] += 1
return if_neither(url)
except Exception as caught:
COUNTER['ERROR'] += 1
error(f'Error when looking up {url} ({str(caught)})')
def positive_hit(url):
positive(f'User found at {url}')
running_positives.append(url)
###################
# Main
###################
def main():
startstop('--------------------------------')
startstop('')
startstop('Starting the WhatsMyName Checking Script')
startstop('')
args = parser.parse_args()
if args.debug:
global debug_mode
debug_mode = True
neutral('Debug output enabled')
if args.useragent:
HEADERS['User-Agent'] = user_agent
neutral(f'Custom UserAgent enabled. Using {user_agent}')
global firefox_driver
global driver_options
if args.firefoxdriver:
firefox_driver = True
neutral('Using the Firefox web driver')
from selenium.webdriver.firefox.options import Options
driver_options = Options()
driver_options.headless = True
else:
firefox_driver = False
neutral('Using the Chrome web driver')
from selenium.webdriver.chrome.options import Options
driver_options = Options()
driver_options.add_argument("--disable-extensions")
driver_options.add_argument("--disable-gpu")
driver_options.add_argument("--headless")
driver_options.add_argument("--window-size=1920x1080")
driver_options.add_experimental_option('excludeSwitches', ['enable-logging'])
global driver_loc
if args.driverlocation:
if os.path.exists(args.driverlocation):
neutral(f'Using the driver at {args.driverlocation}')
driver_loc = args.driverlocation
else:
error(f'There is no file at {args.driverlocation} or we do not have permission to read/execute it.')
error('This version of the checker script requires either the Firefox or Chrome driver.')
error('Please see the documentation at https://github.com/WebBreacher/WhatsMyName')
sys.exit(1)
else:
error('This version of the checker script requires either the Firefox or Chrome driver.')
error('Please see the documentation at https://github.com/WebBreacher/WhatsMyName')
sys.exit(1)
# Add this in case user presses CTRL-C
signal.signal(signal.SIGINT, signal_handler)
# Read in the JSON file
if (args.inputfile):
input_file = args.inputfile
else:
input_file = 'web_accounts_list.json'
with open(input_file) as data_file:
data = json.load(data_file)
sites_to_check = find_sites_to_check(args, data)
try:
for site in sites_to_check:
if not site['valid']:
warn(f'Skipping {site["name"]} - Marked as not valid.')
continue
# INSERT THREADING HERE?
''' x = threading.Thread(target=check_site, args=(site_, args.username), daemon=True)
threads.append(x)
for thread in threads:
thread.start()
for thread in threads:
thread.join()'''
if args.username:
check_site(site, args.username,
if_found = lambda url: positive_hit(url),
if_not_found = lambda url: negative( f'User not found at {url}'),
if_neither = lambda url: error(f'The check implementation is broken for {url}'))
else:
if args.debug:
debug(f'Checking {site["name"]}')
# Run through known accounts from the JSON
for known_account in site['known_accounts']:
check_site(site, known_account,
if_found = lambda url: positive(f' As expected, profile found at {url}'),
if_not_found = lambda url: warn( f'Profile not found at {url}'),
if_neither = lambda url: error( f'Neither conditions matched for {url}'))
# Create a random string to be used for the "nonexistent" user and see what the site does
non_existent = ''.join(random.choice(string.ascii_lowercase + string.ascii_uppercase + string.digits) for x in range(10))
check_site(site, non_existent,
if_found = lambda url: warn( f'False positive for {url} from non-existent check'),
if_not_found = lambda url: positive(f' As expected, no user found at {url} from non-existent check'),
if_neither = lambda url: error( f'Neither conditions matched for {url} from non-existent check'))
finally:
if COUNTER['FOUND'] and args.username:
startstop('')
startstop('Processing completed')
positive(f'{COUNTER["FOUND"]} sites found')
timestamp = time.strftime('%Y%m%d_%H%M%S', time.localtime())
outputfile = f'{timestamp}_{args.username}.txt'
with open(outputfile, 'w') as f:
for positive_url in sorted(running_positives):
positive(f' {positive_url}')
f.write(f'{positive_url}\n')
positive(f' The URLs where the username was found were exported to file: {outputfile}')
if COUNTER['ERROR']:
error(f'{COUNTER["ERROR"]} errors encountered')
startstop('')
startstop('Script completed')
startstop('')
startstop('--------------------------------')
startstop('')
sys.exit(2)
startstop('')
if COUNTER['FOUND'] == 0:
warn('Script completed and no positive results were found.')
else:
startstop('Script completed')
# Remove Gecko log
#if os.path.isfile('geckodriver.log'):
# os.remove('geckodriver.log')
startstop('--------------------------------')
startstop('')
if __name__ == "__main__":
# execute only if run as a script
main()

1
wmn-data-min.json Normal file

File diff suppressed because one or more lines are too long

194
wmn-data-schema.json Normal file
View File

@ -0,0 +1,194 @@
{
"definitions": {},
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://example.com/object1658520065.json",
"title": "Root",
"type": "object",
"required": [
"license",
"authors",
"categories",
"sites"
],
"properties": {
"license": {
"$id": "#root/license",
"title": "License",
"type": "array",
"default": [],
"items":{
"$id": "#root/license/items",
"title": "Items",
"type": "string",
"default": "",
"examples": [
"Copyright (C) 2022 Micah Hoffman"
],
"pattern": "^.*$"
}
},
"authors": {
"$id": "#root/authors",
"title": "Authors",
"type": "array",
"default": [],
"items":{
"$id": "#root/authors/items",
"title": "Items",
"type": "string",
"default": "",
"examples": [
"WebBreacher"
],
"pattern": "^.*$"
}
},
"categories": {
"$id": "#root/categories",
"title": "Categories",
"type": "array",
"default": [],
"items":{
"$id": "#root/categories/items",
"title": "Items",
"type": "string",
"default": "",
"examples": [
"archived"
],
"pattern": "^.*$"
}
},
"sites": {
"$id": "#root/sites",
"title": "Sites",
"type": "array",
"default": [],
"items":{
"$id": "#root/sites/items",
"title": "Items",
"type": "object",
"required": [
"name",
"uri_check",
"post_body",
"e_code",
"e_string",
"m_string",
"m_code",
"known",
"cat",
"valid"
],
"properties": {
"name": {
"$id": "#root/sites/items/name",
"title": "Name",
"type": "string",
"default": "",
"examples": [
"101010.pl"
],
"pattern": "^.*$"
},
"uri_check": {
"$id": "#root/sites/items/uri_check",
"title": "Uri_check",
"type": "string",
"default": "",
"examples": [
"https://101010.pl/@{account}"
],
"pattern": "^.*$"
},
"post_body": {
"$id": "#root/sites/items/post_body",
"title": "Post_body",
"type": "string",
"default": "",
"examples": [
""
],
"pattern": "^.*$"
},
"e_code": {
"$id": "#root/sites/items/e_code",
"title": "E_code",
"type": "string",
"default": "",
"examples": [
"200"
],
"pattern": "^.*$"
},
"e_string": {
"$id": "#root/sites/items/e_string",
"title": "E_string",
"type": "string",
"default": "",
"examples": [
"@101010.pl"
],
"pattern": "^.*$"
},
"m_string": {
"$id": "#root/sites/items/m_string",
"title": "M_string",
"type": "string",
"default": "",
"examples": [
"The page you are looking for isn't here."
],
"pattern": "^.*$"
},
"m_code": {
"$id": "#root/sites/items/m_code",
"title": "M_code",
"type": "string",
"default": "",
"examples": [
"404"
],
"pattern": "^.*$"
},
"known": {
"$id": "#root/sites/items/known",
"title": "Known",
"type": "array",
"default": [],
"items":{
"$id": "#root/sites/items/known/items",
"title": "Items",
"type": "string",
"default": "",
"examples": [
"szekspir"
],
"pattern": "^.*$"
}
},
"cat": {
"$id": "#root/sites/items/cat",
"title": "Cat",
"type": "string",
"default": "",
"examples": [
"social"
],
"pattern": "^.*$"
},
"valid": {
"$id": "#root/sites/items/valid",
"title": "Valid",
"type": "boolean",
"examples": [
true
],
"default": true
}
}
}
}
}
}

5306
wmn-data.json Normal file

File diff suppressed because it is too large Load Diff