Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
RevoltSecurities authored Mar 16, 2024
1 parent bfda30c commit fce0d4c
Show file tree
Hide file tree
Showing 26 changed files with 847 additions and 0 deletions.
9 changes: 9 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
aiofiles>=23.2.1
aiohttp>=3.9.3
art>=6.1
beautifulsoup4>=4.11.1
click>=8.1.7
colorama>=0.4.4
fake_useragent>=1.2.1
Requests>=2.31.0
urllib3>=1.26.18
38 changes: 38 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
from setuptools import setup, find_packages

with open("README.md", "r") as fh:
long_description = fh.read()

setup(
name='shodanx',
version='1.0.0',
author='D.Sanjai Kumar',
author_email='bughunterz0047@gmail.com',
description='ShodanX is a tool to gather information of targets using shodan dorks⚡.',
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/sanjai-AK47/ShodanX",
packages=find_packages(),
install_requires=[
'aiofiles>=23.2.1',
'aiohttp>=3.9.1',
'art>=6.1',
'beautifulsoup4>=4.11.1',
'colorama>=0.4.6',
'click>=8.1.7',
'requests>=2.31.0',
'anyio>=4.2.0',
'fake_useragent>=1.2.1',
'urllib3>=1.26.18'
],
entry_points={
'console_scripts': [
'shodanx = shodanx.shodanx:cli'
]
},
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
)
Empty file added shodanx/__init__.py
Empty file.
Empty file added shodanx/modules/__init__.py
Empty file.
Binary file added shodanx/modules/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
47 changes: 47 additions & 0 deletions shodanx/modules/banner/banner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/usr/bin/env python3
from colorama import Fore,Back,Style
from art import *
import random
import random


red = Fore.RED

green = Fore.GREEN

magenta = Fore.MAGENTA

cyan = Fore.CYAN

mixed = Fore.RED + Fore.BLUE

blue = Fore.BLUE

yellow = Fore.YELLOW

white = Fore.WHITE

reset = Style.RESET_ALL

bold = Style.BRIGHT

colors = [ green, cyan, blue]

random_color = random.choice(colors)


def banner():

tool_name = "shodanX"

fonts = ["big", "ogre", "shadow", "script", "colossal" , "smslant", "graffiti", "slant"]
selected_font = random.choice(fonts)
banner = text2art(f"{tool_name}", font=selected_font)

banner = f"""{banner}
{bold}{white}Author : D.SanjaiKumar @CyberRevoltSecurities{reset}\n"""



return banner
Empty file.
Binary file not shown.
Binary file not shown.
167 changes: 167 additions & 0 deletions shodanx/modules/core/core.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
import aiohttp
import asyncio
import aiofiles
from colorama import Fore, Style, Back
from bs4 import XMLParsedAsHTMLWarning, MarkupResemblesLocatorWarning, BeautifulSoup
from requests.packages.urllib3.exceptions import InsecureRequestWarning
import urllib3
from fake_useragent import UserAgent
import warnings
import os

red = Fore.RED

green = Fore.GREEN

magenta = Fore.MAGENTA

cyan = Fore.CYAN

mixed = Fore.RED + Fore.BLUE

blue = Fore.BLUE

yellow = Fore.YELLOW

white = Fore.WHITE

lm = Fore.LIGHTMAGENTA_EX

reset = Style.RESET_ALL

bold = Style.BRIGHT


async def save(url, output):

try:


if output:



if os.path.isfile(output):

filename = output

elif os.path.isdir(output):

filename = os.path.join(output, f"ShodanX_results.txt")

else:

filename = output

else:


filename = "shodanX_results.txt"


async with aiofiles.open(filename, "a") as w:

await w.write(url + '\n')

except KeyboardInterrupt as e:


print(f"\n[{bold}{blue}INFO{reset}]: {bold}{white}ShodanX exits{reset}")

quit()

except asyncio.CancelledError as e:


SystemExit

async def core_request(query, facet, agents, timeout, redirects, username, output):

try:

total = []

url = f"https://www.shodan.io/search/facet?query={query}&facet={facet}"

if agents:

agent = UserAgent()

else:

agent = "ShodanX+https://github.com/sanjai-AK47/ShodanX"

headers = {'User-Agent': agent}

redirect = True if redirects else False


async with aiohttp.ClientSession() as session:

async with session.get(url, ssl=False, timeout=timeout, allow_redirects=redirect, headers=headers) as response:

responsed = await response.text()


with warnings.catch_warnings():


warnings.filterwarnings("ignore", category=UserWarning)

warnings.filterwarnings('ignore', category=XMLParsedAsHTMLWarning)

warnings.filterwarnings("ignore", category=MarkupResemblesLocatorWarning)

soup = BeautifulSoup(responsed, "lxml")

results = soup.find_all('strong')

for result in results:

total.append(result.get_text())

if len(total) == 0:

print(f"[{bold}{red}ALERT{reset}]: {bold}{white}Sorry {username} There is no data available for your queries and facet in shodan{reset}")

quit()


print(f"""[{bold}{blue}INFO{reset}]: {bold}{white}Results Found for your query and facet: {query} & facet:"{facet}"{reset}""")


for result in total:


print(f"[{bold}{blue}INFO{reset}]: {bold}{white}{result}{reset}")

await save(result, output)

print(f"[{bold}{blue}INFO{reset}]: {bold}{white}Total Results Found: {len(total)}{reset}")


except KeyboardInterrupt as e:

print(f"[{blue}INFO{reset}]: {bold}{white}ShodanX exits..{reset}")

SystemExit

except aiohttp.ClientConnectionError as e:

print(f"[{bold}{red}INFO{reset}]: {bold}{white}Client Connection Exceeds for: {url} , {username} please try again your query{reset}")

except asyncio.TimeoutError as e:

print(f"[{bold}{red}INFO{reset}]: {bold}{white}Client Timeout Exceeds for: {url}, {username} please try again your query{reset}")

except asyncio.CancelledError as e:

SystemExit

except Exception as e:

pass




Empty file.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit fce0d4c

Please sign in to comment.