Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge develop #42

Merged
merged 30 commits into from
Aug 14, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
fc26990
WIP: Add Initial Version (alpha-beta-gamma) (#1)
manmolecular Jul 14, 2020
502d2ca
add script name_check (#4)
Iandmee Jul 16, 2020
7fd9dbb
Add script: region check (#5)
sph-668 Jul 16, 2020
56ba429
add script (email_verifier) (#7)
Shas08 Jul 16, 2020
d3bbb9b
Add script to get allowed http methods. (#10)
Cravtos Jul 16, 2020
01b2b3e
Add script to calculate hash of favicon.ico for Shodan (#13)
Cravtos Jul 17, 2020
9d50918
Core fixes. Provide global variables. Update runner. Upgrade module-p…
manmolecular Jul 18, 2020
fbffe69
Awesome cookie checker (#6)
HochuOlivie Jul 22, 2020
fdb6326
Added a function for retrieving location and provider info by IP addr…
SN4KEBYTE Jul 22, 2020
e627241
Add simple server mocking test example (#20)
manmolecular Jul 22, 2020
da56467
Add tests for favicon hash (#22)
Cravtos Jul 22, 2020
df12bdf
Test allowed_methods. Modify allowed_methods. (#21)
Cravtos Jul 22, 2020
4a0424a
Fix tests timeouts (#25)
manmolecular Jul 23, 2020
7143196
Add tests defaults (#26)
manmolecular Jul 23, 2020
bd1dc3e
Boost up/improvement: Add multiprocessing CaseManager (processes, thr…
manmolecular Jul 23, 2020
65d8c70
simple email generator (#9)
Enhisir Jul 29, 2020
857c34f
Added phone number generator and normaliser script file (#11)
marinepalyan Jul 29, 2020
940416a
Get title (#23)
Iandmee Jul 29, 2020
a4e67e6
Suppress Requests keep-alive socket warnings (#33)
manmolecular Jul 29, 2020
6810c8a
Iknowwhatyoudownload (#24)
villanellex2 Jul 29, 2020
af2d085
add test_module.py in email_verifier (#29)
Shas08 Jul 29, 2020
62a4195
Fix validator keys (#35)
manmolecular Jul 29, 2020
51295c5
Develop: fixes, improvements, etc. (#36)
manmolecular Aug 3, 2020
cea1d60
Improvements - skip not applicable scripts, fix workers system (#39)
manmolecular Aug 6, 2020
a164579
Email generator fix and tests (#38)
Enhisir Aug 6, 2020
914e0a0
Add google_search module (#37)
Cravtos Aug 8, 2020
1634ac6
Fixes (#40)
manmolecular Aug 9, 2020
ef04601
Check nickname (#28)
Iandmee Aug 9, 2020
8b56d5b
Update README.md
manmolecular Aug 9, 2020
916f33f
Add Tornado-based web-server. Support REST API methods. Implement tas…
manmolecular Aug 14, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add script name_check (#4)
* Add initial WIP project version

* add check_nickname.py,
check_nickname_sync and check_nickname_async in it
add social_networks.txt

* add check_nickname.py,
check_nickname_sync and check_nickname_async in it
add social_networks.txt

* new main.py

* new base: develop
add many files

* fix inheritance in Runner

* fix check_nickname
fix social_networks.txt

* Little fixes

* Return default main value

Co-authored-by: manmolecular <regwebghost@yandex.ru>
  • Loading branch information
Iandmee and manmolecular authored Jul 16, 2020
commit 502d2ca1e7a113cb332c6df2bd2f669bc9efd143
98 changes: 98 additions & 0 deletions src/scripts/osint/check_nickname/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
#!/usr/bin/env python3

import asyncio
from pathlib import Path

import aiohttp
import requests

from src.core.base.osint import OsintRunner
from src.core.utils.response import ScriptResponse


class Defaults:
NETWORKS_LIST = "social_networks.txt"


class Networks:
def __init__(self):
with open(Path("./src/scripts/osint/check_nickname/data/social_networks.txt")) as file:
self.net = file.read().splitlines()


def check_nickname_sync(nickname: str) -> list:
"""
checks nicknames from social networks(sync)
:param nickname: just nickname :)
:return: list with links to user from social
networks which have this nickname
"""
ans = []
social = Networks().net
for site in social:
try:
url = "https://{site}{nickname}".format(site=site, nickname=nickname)
response = requests.get(url)
if response.status_code == 200:
ans.append(url)
except:
pass
return ans


async def check_nickname_async(nickname: str, social) -> list:
"""
checks nicknames from social networks(async)
:param nickname: just nickname :)
:param social: social
:return: list with links to user from social
networks which have this nickname
"""
ans = []
async with aiohttp.ClientSession() as session:
while not social.empty():
url = await social.get()
try:
async with session.get(url) as response:
if response.status == 200:
ans.append(url)
except:
pass
return ans


class Runner(OsintRunner):
def __init__(self, logger: str = __name__):
super().__init__(logger=logger)

@staticmethod
async def __run(*args, **kwargs):
try:
username = kwargs.get("username")
social = asyncio.Queue()
for site in Networks().net:
await social.put(
"https://{site}{username}".format(site=site, username=username)
)
temp_result = await asyncio.gather(
*[
asyncio.create_task(check_nickname_async(username, social))
for _ in range(10)
]
)
result = {username: []}
for sub_massive in temp_result:
for site in sub_massive:
result[username].append(site)
return ScriptResponse.success(
result=result,
message="Found {count} user accounts".format(
count=len(result[username])
),
)
except Exception as err:
return ScriptResponse.error(message=str(err))

def run(self, *args, **kwargs):
username = kwargs.get("username")
return asyncio.run(self.__run(username=username))
12 changes: 12 additions & 0 deletions src/scripts/osint/check_nickname/data/social_networks.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
twitter.com/
vk.com/
ok.ru/
instagram.com/
github.com/
reddit.com/user/
tiktok.com/@
mastodon.social/@
blackplanet.com/
flickr.com/photos/


10 changes: 10 additions & 0 deletions src/scripts/osint/check_nickname/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
aiohttp==3.6.2
async-timeout==3.0.1
attrs==19.3.0
certifi==2020.6.20
chardet==3.0.4
idna==2.10
multidict==4.7.6
requests==2.24.0
urllib3==1.25.9
yarl==1.4.2
9 changes: 5 additions & 4 deletions src/scripts/other/simple_example/__main__.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
#!/usr/bin/env python3

from src.core.base.osint import OsintRunner, PossibleKeys
from src.core.base.osint import BaseRunner, PossibleKeys
from src.core.utils.response import ScriptResponse
from src.core.utils.validators import validate_kwargs


class Runner(OsintRunner):
class Runner(BaseRunner):
"""
Basic example
"""

def __init__(self, logger: str = __name__):
"""
Re-init base class instance
Expand All @@ -25,4 +24,6 @@ def run(self, *args, **kwargs) -> ScriptResponse.success or ScriptResponse.error
:param kwargs: kwargs
:return: ScriptResponse message
"""
return ScriptResponse.success(message="Script finished")
return ScriptResponse.success(
message="Script finished"
)
Empty file added src/scripts/recon/.gitkeep
Empty file.