-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
hysia
committed
Aug 25, 2018
1 parent
bd7b9aa
commit 52fc183
Showing
730 changed files
with
225,501 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,104 +1,16 @@ | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.egg-info | ||
*.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 | ||
|
||
# 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/ | ||
*.swp | ||
.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 | ||
.svn | ||
.tox | ||
.DS_Store | ||
*.sqlite3 | ||
wam/static/images/logo/ | ||
wam/packages/ | ||
wam/files/ | ||
.idea/ | ||
monitor/logs/ | ||
migrations/ | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
.spyproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Version 1.0 (2018-08-25) | ||
* init for public |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,65 @@ | ||
# wam | ||
Web App Monitor | ||
# WAM Version 1.0 | ||
|
||
### Introduction | ||
|
||
WAM is a platform powered by Python to monitor "Web App", "The dynamic network information". To a certain extent, it greatly help the security researchers save time on tracking the vulnerable code updates and industry dynamics of investment. | ||
|
||
- AM Model: This module can monitor every updates on all of apps on internet, analysising the changes to make Tag and provide mail notification; | ||
|
||
- IDM Model: This module uses Web crawler to fetch the industry dynamic information and report that to users; | ||
|
||
- VDR Model: This module manager all of application package in the history, and save the updated version of which DIFF details; | ||
|
||
### Development | ||
- Lang: Python 2.7 | ||
- Framewrok: Django 1.7.11 | ||
- UI: [Semantic-ui](http://www.semantic-ui.com/) | ||
- Database: Mysql | ||
|
||
### Models | ||
|
||
- AM (App Monitoring) | ||
- IDM (Information Dynamic Monitoring) | ||
- VDR (The Relationship Between Vulnerability And Database) | ||
|
||
#### App Monitoring | ||
|
||
#### Information Dynamic Monitoring | ||
|
||
#### The Relationship Between Vulnerability And Database | ||
|
||
--- | ||
### How to Use | ||
--- | ||
#### Step 1. Get WAM source code | ||
`git clone https://github.com/knownsec/wam.git` | ||
|
||
#### Step 2. Update settings | ||
update email server and user settings | ||
**TODO settings with dabase Storage** | ||
* `monitor/utils/local_settings.py` | ||
* `monitor/utils/email_list.py` | ||
|
||
#### Step 3. Deploy to server | ||
* **nginx** | ||
* **uwsgi** | ||
* **supervisor** | ||
|
||
Just use `wam/conf` config files to deploy your wam code | ||
|
||
#### PS. WAM with LDAP auth | ||
|
||
Essentially, need to ensure you have the necessary development libraries installed: | ||
|
||
`apt-get install libsasl2-dev python-dev libldap2-dev libssl-dev` | ||
|
||
then `pip install python-ldap` | ||
and uncomment `wam/settings.py` | ||
`AUTHENTICATION_BACKENDS` to | ||
|
||
```` | ||
AUTHENTICATION_BACKENDS = ( | ||
'wam.ldap_backend.LDAPBackend', # 如果想使LDAP 认证取消注释 | ||
'django.contrib.auth.backends.ModelBackend', | ||
) | ||
```` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Individuals | ||
|
||
* Cos https://evilcos.me | ||
* Greysign http://weibo.com/greysign | ||
* niubl http://weibo.com/2193898767 | ||
* Superhei https://twitter.com/80vul | ||
* issmall http://weibo.com/i55m411 | ||
* Ricter Z https://ricterz.me | ||
* RickGray https://rickgray.me | ||
* evi1m0 http://rm-rf.gg | ||
* Fooying http://www.fooying.com | ||
* Hysia https://poc.app | ||
* Ethan https://github.com/hxer | ||
* Sebao http://www.daimacn.com | ||
|
||
|
||
# Organizations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
server { | ||
# | ||
# set project environment variable | ||
# | ||
set $base /data/projects; | ||
set $project wam; | ||
set $env /data/envs/$project; | ||
set $statichtml $base/$project/wam/static; | ||
|
||
access_log /var/log/nginx/$project_access.log; | ||
error_log /var/log/nginx/$project_error.log; | ||
|
||
#listen 80 default_server; | ||
listen 8080; | ||
charset utf-8; | ||
root $base/$project; # project root path | ||
server_name localhost; | ||
|
||
location / { | ||
include uwsgi_params; | ||
uwsgi_param UWSGI_PYHOME $env; # python virtual environment | ||
uwsgi_param UWSGI_CHDIR $base/$project; # django project path | ||
uwsgi_param UWSGI_SCRIPT $project.wsgi; # app endpoint | ||
uwsgi_pass 127.0.0.1:8898; # you can change port in 'uwsgi.ini' file | ||
} | ||
|
||
location /static { | ||
alias $statichtml; | ||
access_log off; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
[program:wam] | ||
command = /data/envs/wam/bin/uwsgi /data/projects/wam/conf/uwsgi.ini | ||
autostart = true | ||
autorestart = true | ||
redirect_stderr = true | ||
stopsignal = QUIT | ||
stdout_logfile_maxbytes = 20MB | ||
stdoiut_logfile_backups = 20 | ||
stdout_logfile = /var/log/wam/wam.log | ||
|
||
[program:wam_app] | ||
command = /data/envs/wam/bin/python /data/projects/wam/monitor.py -t app | ||
autostart = true | ||
autorestart = true | ||
redirect_stderr = true | ||
stopsignal = QUIT | ||
stdout_logfile_maxbytes = 20MB | ||
stdoiut_logfile_backups = 20 | ||
stdout_logfile = /var/log/wam/app.log | ||
|
||
[program:wam_file] | ||
command = /data/envs/wam/bin/python /data/projects/wam/monitor.py -t file | ||
autostart = true | ||
autorestart = true | ||
redirect_stderr = true | ||
stopsignal = QUIT | ||
stdout_logfile_maxbytes = 20MB | ||
stdoiut_logfile_backups = 20 | ||
stdout_logfile = /var/log/wam/file.log | ||
|
||
; neded, ortherwise raise Error: .ini file does not include supervisord section | ||
[supervisord] | ||
logfile = /var/log/supervisord.log | ||
logfile_maxbytes = 10MB | ||
logfile_backups = 5 | ||
loglevel = info | ||
pidfile = /var/run/supervisord.pid | ||
|
||
[supervisorctl] | ||
; serverurl 必须和'unix_http_server'里面的设定匹配 | ||
serverurl = unix:///var/run/supervisor.sock | ||
|
||
[unix_http_server] | ||
file = /var/run/supervisor.sock | ||
chmod = 0777 | ||
|
||
; the below section must remain in the config file for RPC | ||
; (supervisorctl/web interface) to work, additional interfaces may be | ||
; added by defining them in separate rpcinterface: sections | ||
[rpcinterface:supervisor] | ||
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface | ||
|
||
; web manage | ||
;[inet_http_server] ; inet (TCP) server disabled by default | ||
;port=127.0.0.1:9001 ; (ip_address:port specifier, *:port for all iface) | ||
;username= ; (default is no username (open server)) | ||
;password= ; (default is no password (open server)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#site_uwsgi.ini file | ||
[uwsgi] | ||
|
||
project = wam | ||
base = /data/projects | ||
wamenv = /data/envs/wam | ||
env = PYTHONIOENCODING=UTF-8 | ||
env = LANG=en_US.utf8 | ||
# process-related settings | ||
# | ||
|
||
uid = www-data | ||
gid = www-data | ||
|
||
# master | ||
master = true | ||
|
||
# the socket | ||
socket = 127.0.0.1:8898 # port | ||
|
||
# maximum number of worker processes | ||
processes = 4 | ||
enable-threads = true | ||
|
||
# respawn processes after serving 1000 requests | ||
max-requests = 1000 | ||
|
||
# respawn processes taking more than 30 seconds | ||
harakiri = 30 | ||
|
||
post-buffering = 8192 | ||
|
||
|
||
# ... with appropriate permissions - may be needed | ||
# chmod-socket = 664 | ||
|
||
# clear environment on exit | ||
vacuum = true | ||
|
||
# | ||
# Django-related settings | ||
# | ||
|
||
# the base directory (full path) | ||
chdir = %(base)/%(project) | ||
|
||
# Django's wsgi file | ||
module = %(project).wsgi | ||
|
||
# optional path to a virtualenv (full path) | ||
home = %(wamenv) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.