diff --git a/README.md b/README.md index fc760ca..bc6060b 100644 --- a/README.md +++ b/README.md @@ -14,12 +14,6 @@ As a pre-requesite for Harpoon, you need to install [lxml](https://lxml.de/insta You need to have [geoipupdate](https://github.com/maxmind/geoipupdate) installed and [correctly configured](https://dev.maxmind.com/geoip/geoipupdate/) to use geolocation correctly (make sure you to have `GeoLite2-Country GeoLite2-City GeoLite2-ASN` as `EditionIDs`). -If you want to use the screenshot plugin, you need phantomjs and npm installed: - -``` -npm install -g phantomjs -``` - ## Installing harpoon You can simply install the package from [pypi](https://pypi.org/project/harpoon/) with `pip install harpoon` @@ -71,7 +65,6 @@ After configuration the following plugins are available within the `harpoon` com email Gather information on an email address fullcontact Requests Full Contact API (https://www.fullcontact.com/) github Request Github information through the API - googl Requests Google url shortener API greynoise Request information from GreyNoise API (pick Community or Enterprise via api_type config) hashlookup Request CIRCL Hash Lookup db help Give help on an Harpoon command @@ -95,7 +88,6 @@ After configuration the following plugins are available within the `harpoon` com robtex Search in Robtex API (https://www.robtex.com/api/) safebrowsing Check if the given domain is in Google safe Browsing list save Save a webpage in cache platforms - screenshot Takes a screenshot of a webpage securitytrails Requests SecurityTrails database shodan Requests Shodan API spyonweb Search in SpyOnWeb through the API diff --git a/harpoon/commands/googl.py b/harpoon/commands/googl.py deleted file mode 100644 index c70835f..0000000 --- a/harpoon/commands/googl.py +++ /dev/null @@ -1,51 +0,0 @@ -#! /usr/bin/env python -import sys -import json -from harpoon.commands.base import Command -from harpoon.lib.googl import GoogleShortener - -class CommandGoogl(Command): - """ - # Goo.gl URL shortener plugin - - * Search for a hash: `harpoon googl -H 12445` - * Search for a list of hash from a file: `harpoon googl -f FILE` - """ - name = "googl" - description = "Requests Google url shortener API" - config = {'Googl': ['token']} - - def add_arguments(self, parser): - parser.add_argument('--hash', '-H', help='HASH of a link') - parser.add_argument('--file', '-f', help='File containing list of hashes') - - def run(self, conf, args, plugins): - if 'Googl' not in conf: - print('Invalid configuration file, quitting...') - sys.exit(1) - if 'token' not in conf['Googl']: - print('Invalid configuration file, quitting...') - sys.exit(1) - go = GoogleShortener(conf['Googl']['token']) - if args.hash: - print(json.dumps(go.get_analytics(args.hash), sort_keys=True, indent=4, separators=(',', ':'))) - elif args.file: - with open(args.file, 'r') as f: - data = f.read().split() - - print("Date;Status;Short URL;Long URL;Analytics;Short URL Clicks;Long URL Clicks") - for d in data: - res = go.get_analytics(d.strip()) - print("%s;%s;%s;%s;https://goo.gl/#analytics/goo.gl/%s/all_time;%s;%s" % - ( - res.get("created", ""), - res.get("status", ""), - res["id"], - res.get("longUrl", ""), - res["id"][-6:], - res.get("analytics", {}).get("allTime", {}).get("shortUrlClicks", ""), - res.get("analytics", {}).get("allTime", {}).get("longUrlClicks", ""), - ) - ) - else: - print("Please provide a file (-f) or a hash (-H)") diff --git a/harpoon/commands/screenshot.py b/harpoon/commands/screenshot.py deleted file mode 100644 index 9084289..0000000 --- a/harpoon/commands/screenshot.py +++ /dev/null @@ -1,31 +0,0 @@ -#! /usr/bin/env python -import sys -from harpoon.commands.base import Command -from selenium import webdriver - -class CommandScreenshot(Command): - """ - # Screenshot - - **Takes a screenshot of a webpage** - - `harpoon screenshot http://google.com` - """ - name = "screenshot" - description = "Takes a screenshot of a webpage" - - def add_arguments(self, parser): - parser.add_argument('URL', help='URL of the webpage') - parser.add_argument('--output', '-o', default="screenshot.png", help='Name of the screenshot image saved') - self.parser = parser - - def run(self, conf, args, plugins): - try: - driver = webdriver.PhantomJS() - driver.set_window_size(1024, 768) # set the window size that you need - driver.get(args.URL) - driver.save_screenshot(args.output) - print('Webpage %s saved in %s' % (args.URL, args.output)) - except WebDriverException: - print('Install phantomjs to use this module (npm install -g phantomjs)') - sys.exit(1) diff --git a/harpoon/lib/googl.py b/harpoon/lib/googl.py deleted file mode 100644 index de2f276..0000000 --- a/harpoon/lib/googl.py +++ /dev/null @@ -1,30 +0,0 @@ -import argparse -import json -import requests -import os -import sys -try: - import configparser as cp -except ImportError: - # python2 - import ConfigParser as cp - -class GoogleShortener(object): - def __init__(self, token): - self.host = 'https://www.googleapis.com/urlshortener/v1/url' - self.token = token - - def get_analytics(self, hash): - params = {'key': self.token, 'shortUrl': 'http://goo.gl/' + hash, 'projection': 'FULL'} - r = requests.get(self.host, params=params) - return r.json() - - def expand(self, hash): - params = {'key': self.token, 'shortUrl': 'http://goo.gl/' + hash} - r = requests.get(self.host, params=params) - return r.json() - - def shorten(self, long_url): - params = {'key': self.token, 'longUrl': long_url} - r = requests.post(self.host, data=params) - return r.json()