Git Product home page Git Product logo

flipkart-incubator / watchdog Goto Github PK

View Code? Open in Web Editor NEW
410.0 30.0 103.0 28.87 MB

Watchdog - A Comprehensive Security Scanning and a Vulnerability Management Tool.

License: Apache License 2.0

PHP 5.53% CSS 4.76% HTML 6.62% JavaScript 21.61% Python 60.98% Shell 0.42% Ruby 0.08%
security-tools security security-vulnerability security-testing vulnerability-management vulnerability-assessment pentest-tool penetration-testing-framework cve-databases cve-search

watchdog's Introduction

Watchdog  Tweet

Watchdog

Github Release Version Python Version License Github Release Version Follow Watchdog on Twitter

Tool Description


Watchog is an integration of open source security tools aimed to provide a holistic security view for a given domain/IP. The way Watchdog is built, it can be used by product security teams, red teams and also by bug bounty hunters to get a 360° view of any Internet property it scans. Given a list of domains/IP's it has the capability to perform a network scan, feed the output to open source web app scanners like Google's skip-fish and wapiti, perform tech stack analysis and determine if the stack has any known CVE’s.

Watchdog is designed considering the use case necessary to know all open services and its corresponding technologies for the endpoints you own, exposed over the Internet. As a company grows, it’s foot-prints grow on the World Wide Web leaving it's product security team with herculean task of maintaining an inventory of all the services and technologies exposed. This becomes further crucial at the event of a zero-day outbreak for a particular protocol or a third party product which might affect public endpoints of the company

WatchDog has the ability to scan all endpoints and perform technology version analysis on the services it detects and map this information with it’s rich CVE database maintained and updated locally.

Scan Engine:


  • Nmap
  • Skipfish
  • Wapiti
  • BuiltWith
  • Phantalyzer
  • Wappalyzer

Databases and collections:


Watchdog installs a local copy of CVE database which is a collection of following DB's :

  • cves (Common Vulnerabilities and Exposure items) - source NVD NIST
  • cpe (Common Platform Enumeration items) - source NVD NIST
  • cwe (Common Weakness Enumeration items) - source NVD NIST
  • capec (Common Attack Pattern Enumeration and Classification) - source NVD NIST
  • ranking (ranking rules per group) - local cve-search
  • d2sec (Exploitation reference from D2 Elliot Web Exploitation Framework) - source d2sec.com
  • MITRE Reference Key/Maps - source MITRE reference Key/Maps
  • ms - (Microsoft Bulletin (Security Vulnerabilities and Bulletin)) - source Microsoft
  • exploitdb (Offensive Security - Exploit Database) - source offensive security
  • info (metadata of each collection like last-modified) - local cve-search
  • via4 VIA4CVE cross-references.

What happens when you run watchdog:


Test domain: www.scanthis.com

Watchdog will perform following task on this domain:

a. Scan the domain to find visible open ports.

{e.g. output}
* 80  [Apache httpd 2.4.7 ((Debian))]
* 443 [Apache httpd 2.4.7 ((Debian))]
* 22  [OpenSSH 5.8p1_hpn13v10 (FreeBSD 20110102; protocol 2.0)]
* 21  [ProFTPD 1.3.3e]
* 993 [Plesk Courier imapd]

b. Perform tech-stack fingerprinting and identify all front-end and service level technologies running.

* jquery [1.8.1]
* php [5.5.9]
* twitter bootstrap [2.3]
* font awesome [**]
* google analytics [**]
* piwik []

c. Map the tech-stack versions with known vulnerabilities found in the master CVE database.

* [e.g. jquery 1.8.1 version has multiple CVE's - CVE-2012-6708, CVE-2015-9251]
* [e.g. php 5.5.9 version has multiple CVE's - CVE-2016-4073, CVE-2015-8835]
* [e.g. apache 2.4.7 version has multiple CVE's - CVE-2017-7679, CVE-2014-0226]

d. If step 1 detects any http services running [80/443] it will go ahead and perform a web application security scanning with wapiti and Skipfish.

f. Once the scan is complete the data will get populated on Watchdog’s UI which can be found at http://localhost/index.php

Installing Watchdog:


Quick Installation Video Link

Prerequisites & Softwares

- Ubuntu 16.04+

Install PyV8:

Incase of any issues while installing, follow the below steps (workaround for Ubuntu 16+)

$ export LC_ALL=C
$ cd /tmp
$ pip install -e git://github.com/brokenseal/PyV8-OS-X#egg=pyv8
$ git clone https://github.com/emmetio/pyv8-binaries.git
$ unzip pyv8-binaries/pyv8-linux64.zip (or unzip appropriate zip file based on kernel version)
$ mv *PyV8* src/pyv8/pyv8/.

Clone Watchdog repository

$ git clone https://github.com/flipkart-incubator/watchdog.git
$ cd watchdog

Update the subdomains.txt file with your target subdomains

scanme.nmap.org
testphp.vulnweb.com

Run the installation script below

$ sudo chmod +x install.sh
$ sudo ./install.sh
* During installation, script prompts for web root directory. 
  Default directory /var/www/html will be taken automatically if not provided explicitly with-in 10 secs

Scanning with Watchdog:

  • Watchdog can be run using following command:
$ sudo python run.py

root@projectWatchdog:/watchdog# python run.py
usage: run.py [-h] [-c] [-iA INVENTORY_APPEND] [-iR INVENTORY_REPLACE]
              [-u {install,map,update}] [-s]

optional arguments:
  -h, --help            show this help message and exit
  -c, --config          to configure db structure
  -iA INVENTORY_APPEND, --inventory-append INVENTORY_APPEND
                        to append target to IP Inventory
  -iR INVENTORY_REPLACE, --inventory-replace INVENTORY_REPLACE
                        to replace targets in IP Inventory
  -u {install,map,update}, --updateCVEs {install,map,update}
                        to configure or update CVE database
  -s, --start           to start scanning engine

Configuring CVE-DB

a. Install cve-db using below command (Required to run at least once)

$sudo python run.py -u install

b. Map cves with cpes using below command [Required to run at-least once. The first run generally takes around 30~45 mins for the entire db to get populated. Recommended time: minimum 30mins]

$sudo python run.py -u map

c. Update the DB by using below command (optional / can run this once a month)

$sudo python run.py -u update

Adding new domains to the scan database:

Update the scan database with subdomains.txt file with new domains/IP's and run below commands

$ sudo python run.py -iA subdomains.txt (for appending targets to existing inventory)

$ sudo python run.py -iR subdomains.txt (for replacing targets in existing inventory)

Start Scanning:


$ sudo python run.py -s 

Frontend can be accessed from http://localhost/index.php (or replace localhost with your web server address)

Dashboard Screenshots


alt text

alt text

alt text

alt text

Future Enhancements


  • The next release of watchdog will also support code scanning. Given a organisation's github link it will perform vulnerability analysis mapping with CVE database.
  • More tools to get added to the external scanning engine.

Contribution:


Lead Developer

Project Lead

Project Team

Credits


watchdog's People

Contributors

mohangcsm avatar paralax avatar prajal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

watchdog's Issues

Wapiti error during scan

Traceback (most recent call last):
File "/usr/bin/wapiti", line 11, in
load_entry_point('wapiti3==3.0.1', 'console_scripts', 'wapiti')()
File "/usr/lib/python3/dist-packages/wapitiCore/main/wapiti.py", line 1002, in wapiti_main
wap.attack()
File "/usr/lib/python3/dist-packages/wapitiCore/main/wapiti.py", line 445, in attack
self.report_gen.generate_report(self.output_file)
File "/usr/lib/python3/dist-packages/wapitiCore/report/htmlreportgenerator.py", line 57, in generate_report
copytree(os.path.join(self.BASE_DIR, self.REPORT_DIR, subdir), os.path.join(output_path, subdir))
File "/usr/lib/python3.6/shutil.py", line 315, in copytree
names = os.listdir(src)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/lib/python3/dist-packages/wapitiCore/report_template/js'

run.py only scanning the open ports

Hi,

After the watchdog setup has been done it is scanning only for the open ports it is not finding the cve and cpe the database of this has been populated already.attaching the screenshot

root@ubuntu:/watchdog# python run.py -u update
python3 Tools/cve-search-master/sbin/db_updater.py
INFO:root:Starting cve
Preparing [##################################################] 621/621
INFO:root:cve has 857 elements (0 update)
INFO:root:Starting cpe
Not modified
INFO:root:cpe has 166181 elements (0 update)
INFO:root:Starting cwe
Not modified
INFO:root:cwe has 722 elements (0 update)
INFO:root:Starting capec
Not modified
INFO:root:capec has 463 elements (0 update)
INFO:root:Starting via4
Redis server not running on localhost:6379
INFO:root:via4 has 110830 elements (0 update)
INFO:root:Starting ensureindex
[+]Success to create index id on cpe
[+]Success to create index id on cpeother
[+]Success to create index id on cves
[+]Success to create index vulnerable_configuration on cves
[+]Success to create index Modified on cves
[+]Success to create index [('summary', 'text')] on cves
[+]Success to create index id on via4
[+]Success to create index id on mgmt_whitelist
[+]Success to create index id on mgmt_blacklist
[+]Success to create index related_weakness on capec
INFO:root:
[-] No plugin loader file!
root@ubuntu:
/watchdog# python run.py -s
Total IPs in database: 2
starting portscan
nmap -n -Pn -A --open -oG - 45.33.32.156 | grep Ports
starting portscan
nmap -n -Pn -A --open -oG - 176.28.50.165 | grep Ports
root@ubuntu:~/watchdog#

ImportError: No module named wappalyzer

Traceback (most recent call last):
File "run.py", line 5, in
from start_scans import start_scan
File "/home/---/watchdog/start_scans.py", line 7, in
from findTechnology import technologyScan
File "/home/---/watchdog/findTechnology.py", line 1, in
from wappalyzer import Wappalyzer
ImportError: No module named wappalyzer

Not able to run

ubuntu@ip-172-31-45-76:~/watchdog$ sudo python run.py -h
Traceback (most recent call last):
File "run.py", line 4, in
from fillInventory import fill_Inventory
File "/home/ubuntu/watchdog/fillInventory.py", line 2, in
from mongo_connection import mongo_client
File "/home/ubuntu/watchdog/mongo_connection.py", line 1, in
from pymongo import MongoClient
ImportError: No module named pymongo

getting error during scan run time

Issues with updating false positive: 'NoneType' object is not iterable
jquery with version {'false_positive': '0', 'version': '', 'cves': []}
Issues with updating false positive: 'NoneType' object is not iterable
twitter bootstrap with version {'false_positive': '0', 'version': '', 'cves': []}
Issues with updating false positive: 'NoneType' object is not iterable
font awesome with version {'false_positive': '0', 'version': '', 'cves': []}
Issues with updating false positive: 'NoneType' object is not iterable
react with version {'false_positive': '0', 'version': '', 'cves': []}
Issues with updating false positive: 'NoneType' object is not iterable
google tag manager with version {'false_positive': '0', 'version': '', 'cves': []}
Issues with updating false positive: 'NoneType' object is not iterable
apache with version {'false_positive': '0', 'version': '', 'cves': []}
Issues with updating false positive: 'NoneType' object is not iterable
highcharts with version {'false_positive': '0', 'version': '', 'cves': []}

blank results

I have install watchdog and I run it against the two test sites given in the github instructions. I get a blank page with the titles but no results at the end.

Tool Inclusion Request

  • hydra (with a very tightly curated list of credentials no more than say 10-50, it is a vuln scanner after all)
  • nikto
  • wpscan
  • sqlmap (bonus points for being coded in python)
  • sslyze (bonus points for being coded in python)
  • joomscan
  • drupwn (bonus points for being coded in python)
  • snmpcheck

run.py gives me the following errors

import-im6.q16: unable to open X server ' @ error/import.c/ImportImageCommand/360. import-im6.q16: unable to open X server ' @ error/import.c/ImportImageCommand/360.
import-im6.q16: unable to open X server ' @ error/import.c/ImportImageCommand/360. from: too many arguments from: too many arguments from: too many arguments from: too many arguments ./run.py: line 9: syntax error near unexpected token ('
./run.py: line 9: `def main(argv):'

error wapiti when run scan

hi every time i run a new scan i've that error :

Traceback (most recent call last):
  File "/usr/local/bin/wapiti", line 4, in <module>
    __import__('pkg_resources').run_script('wapiti==2.3.0', 'wapiti')
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 719, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 1504, in run_script
    exec(code, namespace, namespace)
  File "/usr/local/lib/python2.7/dist-packages/wapiti-2.3.0-py2.7.egg/EGG-INFO/scripts/wapiti", line 471, in <module>
    wap.attack()
  File "/usr/local/lib/python2.7/dist-packages/wapiti-2.3.0-py2.7.egg/EGG-INFO/scripts/wapiti", line 207, in attack
    self.__initAttacks()
  File "/usr/local/lib/python2.7/dist-packages/wapiti-2.3.0-py2.7.egg/EGG-INFO/scripts/wapiti", line 128, in __initAttacks
    mod_instance = getattr(mod, mod_name)(self.http_engine, self.reportGen)
  File "/usr/local/lib/python2.7/dist-packages/wapiti-2.3.0-py2.7.egg/wapitiCore/attack/mod_nikto.py", line 78, in __init__
    resp = self.HTTP.send(nikto_req)
  File "/usr/local/lib/python2.7/dist-packages/wapiti-2.3.0-py2.7.egg/wapitiCore/net/HTTP.py", line 508, in send
    verify=self.verify_ssl)
  File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 521, in get
    return self.request('GET', url, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/requests/adapters.py", line 508, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='cirt.net', port=80): Max retries exceeded with url: /nikto/UPDATES/2.1.5/db_tests (Caused by ReadTimeoutError("HTTPConnectionPool(host='cirt.net', port=80): Read timed out. (read timeout=1)",))

how can i fix?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.