Skip to content

dep_check.py: move from pip to setuptools #269

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 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
Forked for bugfixes:
* supports config in /etc/datasploit
* fixes requirements checking.

In the future:
* improve exception handling for tools which do not have a provided API(i.e.
auto-skip/disable)

[![ToolsWatch Best Tools](https://www.toolswatch.org/badges/toptools/2016.svg)](http://www.toolswatch.org/2017/02/2016-top-security-tools-as-voted-by-toolswatch-org-readers/)

[![Arsenal-2017-EU](https://github.com/toolswatch/badges/blob/master/arsenal/europe/2017.svg)](http://www.toolswatch.org/2017/09/black-hat-arsenal-europe-2017-lineup/)
Expand Down
4 changes: 4 additions & 0 deletions config_sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
#added to gitignore so will not be syned

#Backup in ~/Desktop/config.py_backup
# The location of this file will be checked in order:
# program $PWD, generally /usr/share/datasploit
# /etc/datasploit/
# ~/.config/datasploit/

shodan_api=""
bing_api=""
Expand Down
8 changes: 7 additions & 1 deletion datasploit.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import dep_check
dep_check.check_dependency()
Expand Down Expand Up @@ -43,6 +43,12 @@ def main(argv):
ds_dir=os.path.dirname(os.path.realpath(__file__))
config_file_path = os.path.join(ds_dir,"config.py")
config_sample_path= os.path.join(ds_dir,"config_sample.py")
# If there is a systemwide config, use that instead
if os.path.isfile('/etc/datasploit/config.py') is True:
config_file_path = '/etc/datasploit/config.py'
elif os.path.isfile(os.getenv('HOME') + '/.config/datasploit/config.py') is True:
config_file_path = os.getenv('HOME') + '/.config/datasploit/config.py'

print os.path.exists(config_file_path)
if not os.path.exists(config_file_path):
print "[+] Looks like a new setup, setting up the config file."
Expand Down
2 changes: 1 addition & 1 deletion datasploit_config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import os, subprocess, tempfile

Expand Down
21 changes: 15 additions & 6 deletions dep_check.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,29 @@
import pip
import pkg_resources
import sys

def check_dependency():
list_deps = []
missing_deps = []

with open('requirements.txt') as f:
list_deps = f.read().splitlines()
try:
with open('requirements.txt') as f:
list_deps = f.read().splitlines()
except:
print "Cannot read requirements.txt to check for missing modules, exiting..."
sys.exit()

pip_list = sorted([(i.key) for i in pip.get_installed_distributions()])
# get list of installed python packages
pip_list = []
for item in pkg_resources.working_set.entry_keys:
pip_list += pkg_resources.working_set.entry_keys[item]

for req_dep in list_deps:
if req_dep not in pip_list:
missing_deps.append(req_dep)

if missing_deps:
print "You are missing a module for Datasploit. Please install them using: "
print "pip install -r requirements.txt"
print "You are missing a module for Datasploit:"
for module in missing_deps:
print module
print "Please install them using: pip install -r requirements.txt"
sys.exit()
4 changes: 2 additions & 2 deletions docs/Writing_Modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Each of these folder houses scripts of it's own kind, i.e., scripts working on d
To write a new script for a module, there is a `template.py` located in each module directory to help you get started quickly. Following is the contents of the template.py file in the domain module:

```python
#!/usr/bin/env python
#!/usr/bin/env python2

import base
import config as cfg
Expand Down Expand Up @@ -251,4 +251,4 @@ Adding a new module is also pretty straight forward. For example, let's say we w

That's all. This configures the new mobile module to either run as a whole using the datasploit.py or mobileOsint.py file or as standalone scripts using the mobile_scriptname.py files inside the mobile folder.

The possibilities of extending dataSploit are endless. New modules and scripts are easily integrable as mentioned above. We look forward to seeing contribution from the community to help increase the capabilites of dataSploit.
The possibilities of extending dataSploit are endless. New modules and scripts are easily integrable as mentioned above. We look forward to seeing contribution from the community to help increase the capabilites of dataSploit.
2 changes: 1 addition & 1 deletion domain/domain_GooglePDF.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import base
import sys
Expand Down
2 changes: 1 addition & 1 deletion domain/domain_censys.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2
import base
import re, sys, json, time, requests
import vault
Expand Down
2 changes: 1 addition & 1 deletion domain/domain_checkpunkspider.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import base
import requests
Expand Down
2 changes: 1 addition & 1 deletion domain/domain_dnsrecords.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import base
import sys
Expand Down
2 changes: 1 addition & 1 deletion domain/domain_emailhunter.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import base
import vault
Expand Down
2 changes: 1 addition & 1 deletion domain/domain_forumsearch.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import base
import requests
Expand Down
2 changes: 1 addition & 1 deletion domain/domain_github.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import base
import vault
Expand Down
2 changes: 1 addition & 1 deletion domain/domain_googletracking.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import base
import vault
Expand Down
2 changes: 1 addition & 1 deletion domain/domain_history.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import base
import sys
Expand Down
2 changes: 1 addition & 1 deletion domain/domain_pagelinks.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import base
import sys
Expand Down
2 changes: 1 addition & 1 deletion domain/domain_pastes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import base
import vault
Expand Down
2 changes: 1 addition & 1 deletion domain/domain_shodan.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import base
import vault
Expand Down
2 changes: 1 addition & 1 deletion domain/domain_subdomains.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import base
import sys
Expand Down
2 changes: 1 addition & 1 deletion domain/domain_urlscanio.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import base
import json
Expand Down
2 changes: 1 addition & 1 deletion domain/domain_wappalyzer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import base
from Wappalyzer import Wappalyzer, WebPage
Expand Down
2 changes: 1 addition & 1 deletion domain/domain_whois.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import base
import sys
Expand Down
2 changes: 1 addition & 1 deletion domain/domain_wikileaks.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import base
import requests
Expand Down
2 changes: 1 addition & 1 deletion domain/domain_zoomeye.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import base
import requests
Expand Down
2 changes: 1 addition & 1 deletion domain/template.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import base
import vault
Expand Down
2 changes: 1 addition & 1 deletion domainOsint.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import sys
import osint_runner
Expand Down
2 changes: 1 addition & 1 deletion emailOsint.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import sys
import osint_runner
Expand Down
2 changes: 1 addition & 1 deletion emails/email_basic_checks.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import base
import vault
Expand Down
2 changes: 1 addition & 1 deletion emails/email_clearbit.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import base
import vault
Expand Down
2 changes: 1 addition & 1 deletion emails/email_fullcontact.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import base
import requests
Expand Down
2 changes: 1 addition & 1 deletion emails/email_hacked_emails.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import base
import vault
Expand Down
2 changes: 1 addition & 1 deletion emails/email_haveibeenpwned.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import base
import sys
Expand Down
2 changes: 1 addition & 1 deletion emails/email_pastes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import base
import vault
Expand Down
2 changes: 1 addition & 1 deletion emails/email_scribd.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import base
import re
Expand Down
2 changes: 1 addition & 1 deletion emails/email_slideshare.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import base
import sys
Expand Down
2 changes: 1 addition & 1 deletion emails/email_whoismind.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import base
import sys
Expand Down
2 changes: 1 addition & 1 deletion emails/template.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import base
import vault
Expand Down
2 changes: 1 addition & 1 deletion ip/ip_shodan.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import base
import vault
Expand Down
2 changes: 1 addition & 1 deletion ip/ip_virustotal.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import base
import vault
Expand Down
2 changes: 1 addition & 1 deletion ip/ip_whois.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

from ipwhois import IPWhois
import sys
Expand Down
2 changes: 1 addition & 1 deletion ip/template.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import base
import vault
Expand Down
2 changes: 1 addition & 1 deletion ipOsint.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import sys
import osint_runner
Expand Down
2 changes: 1 addition & 1 deletion username/template.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import base
import vault
Expand Down
2 changes: 1 addition & 1 deletion username/username_gitemails.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import base
import vault
Expand Down
2 changes: 1 addition & 1 deletion username/username_gitlabdetails.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2
import base
import sys
from termcolor import colored
Expand Down
2 changes: 1 addition & 1 deletion username/username_gitscrape.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import base
import vault
Expand Down
2 changes: 1 addition & 1 deletion username/username_gituserdetails.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import base
import sys
Expand Down
2 changes: 1 addition & 1 deletion username/username_keybase.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import base
import sys
Expand Down
2 changes: 1 addition & 1 deletion username/username_profilepic.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import base
import os
Expand Down
2 changes: 1 addition & 1 deletion username/username_redditdetails.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import base
import json
Expand Down
2 changes: 1 addition & 1 deletion username/username_tinder.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import base
import os
Expand Down
2 changes: 1 addition & 1 deletion username/username_traviscidetails.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

# Credits: https://github.com/int0x80/tcispy

Expand Down
2 changes: 1 addition & 1 deletion username/username_twitterdetails.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import base
import vault
Expand Down
2 changes: 1 addition & 1 deletion username/username_usernamesearch.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import base
import sys
Expand Down
2 changes: 1 addition & 1 deletion username/username_youtubedetails.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import base
import vault
Expand Down
2 changes: 1 addition & 1 deletion usernameOsint.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import sys
import osint_runner
Expand Down