diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..04a7446 Binary files /dev/null and b/.DS_Store differ diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..457d704 --- /dev/null +++ b/.gitignore @@ -0,0 +1,103 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST +kickdomain/provider/config.py +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# pyenv +.python-version + +# celery beat schedule file +celerybeat-schedule + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ \ No newline at end of file diff --git a/README.md b/README.md index 9597353..7547ce5 100644 --- a/README.md +++ b/README.md @@ -6,3 +6,20 @@ Run: ## Running the script To run the script, the following command is to be used: `python wappalyze.py` + + +Install from pip + +pip install wappalyze + +# Usage + +wapp -u google.com + +# Use as a module + +import wappalyze + +result = wappalyze.analyze('google.com') + +print(result) \ No newline at end of file diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..74858fe --- /dev/null +++ b/setup.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +import setuptools,os + +with open("README.md", "r") as fh: + long_description = fh.read() +thelibFolder = os.path.dirname(os.path.realpath(__file__)) +requirementPath = thelibFolder + '/requirements.txt' +install_requires = [] # Examples: ["gunicorn", "docutils>=0.3", "lxml==0.5a7"] +if os.path.isfile(requirementPath): + with open(requirementPath) as f: + install_requires = f.read().splitlines() +setuptools.setup( + name="wappalyze", + version="1.6", + author="Shaddy Garg", + author_email="shaddygarg1@gmail.com", + description="Framework Identifier tool", + long_description=long_description, + long_description_content_type="text/markdown", + url="https://github.com/shaddygarg/framework-identifier", + packages=setuptools.find_packages(), + package_dir={'wappalyze': 'wappalyze'}, + package_data={'wappalyze': ['apps.json']}, + install_requires=install_requires, + scripts=['wapp'], + classifiers=[ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + ], +) diff --git a/wapp b/wapp new file mode 100644 index 0000000..be1accf --- /dev/null +++ b/wapp @@ -0,0 +1,7 @@ +#!/bin/bash + +if [ $# -le 0 ]; then + echo "use from command line as : $ wapp -u targetdomain" + exit -1 +fi +python -m wappalyze $@ \ No newline at end of file diff --git a/wappalyze/.DS_Store b/wappalyze/.DS_Store new file mode 100644 index 0000000..fd5c91b Binary files /dev/null and b/wappalyze/.DS_Store differ diff --git a/wappalyze/__init__.py b/wappalyze/__init__.py new file mode 100644 index 0000000..5091c86 --- /dev/null +++ b/wappalyze/__init__.py @@ -0,0 +1 @@ +from Wappalyze import * \ No newline at end of file diff --git a/wappalyze/__main__.py b/wappalyze/__main__.py new file mode 100644 index 0000000..5514282 --- /dev/null +++ b/wappalyze/__main__.py @@ -0,0 +1,2 @@ +from .Wappalyze import main +main() diff --git a/data/apps.json b/wappalyze/apps.json similarity index 100% rename from data/apps.json rename to wappalyze/apps.json diff --git a/wappalyze.py b/wappalyze/wappalyze.py similarity index 87% rename from wappalyze.py rename to wappalyze/wappalyze.py index 48b0569..e7bfc10 100644 --- a/wappalyze.py +++ b/wappalyze/wappalyze.py @@ -1,13 +1,17 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- import json -import re +import re,argparse,os import warnings import pkg_resources import requests from bs4 import BeautifulSoup - - +BASE_DIRECTORY = os.path.split(__file__)[0] +app_path = os.path.join(BASE_DIRECTORY,"apps.json") def _parse_webpage(url): webpage={} + if not url.startswith('http'): + url='http://'+url response = requests.get(url) webpage['url'] = response.url webpage['headers'] = response.headers @@ -108,10 +112,10 @@ def __get_implied_apps(detect, apps): return all_implied_apps -def analyze(): - url = raw_input('Enter the URL: ') +def analyze(target): + url = target webpage = _parse_webpage(url) - obj = json.loads(pkg_resources.resource_string(__name__, "data/apps.json")) + obj = json.loads(pkg_resources.resource_string(__name__, "apps.json")) apps = obj['apps'] detected = [] for app_name, app in apps.items(): @@ -130,10 +134,14 @@ def analyze(): inv_map[v].append(k) return inv_map - -if __name__ == '__main__': - printing = analyze() +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("-u", "--url", required=True,help="Please enter target Url") + args = vars(ap.parse_args()) + printing = analyze(args['url']) for x in printing.items(): string = '\nCategory: '+str(x[0])+'\nFrameworks :'+','.join(x[1]) - print string + print(string) +if __name__ == '__main__': + main()