Skip to content

Use as a module #3

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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
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
Binary file added .DS_Store
Binary file not shown.
103 changes: 103 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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/
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)
32 changes: 32 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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",
],
)
7 changes: 7 additions & 0 deletions wapp
Original file line number Diff line number Diff line change
@@ -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 $@
Binary file added wappalyze/.DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions wappalyze/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from Wappalyze import *
2 changes: 2 additions & 0 deletions wappalyze/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from .Wappalyze import main
main()
File renamed without changes.
28 changes: 18 additions & 10 deletions wappalyze.py → wappalyze/wappalyze.py
Original file line number Diff line number Diff line change
@@ -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()