├── .gitattributes ├── .gitignore ├── LICENSE.md ├── README.md ├── example_output.png ├── geocode_api_keys.py ├── ratebeer.py ├── requirements.txt └── yelp_reviews.py /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | *.xml 3 | *.iml 4 | *.html 5 | *.csv 6 | geocode_api_keys* 7 | .vscode 8 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (C) 2018 Spotlight Infosec LLC 2 | 3 | This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Test scripts for OSINT 2 | 3 | These scripts pull data from several sites and then plot the locations found on a Google Map. 4 | 5 | ## Usage 6 | 7 | ### Requirements 8 | 9 | The most important requirement is __this script is written in Python 3.x__. 10 | 11 | #### Modules 12 | 13 | * bs4 14 | * geocoder 15 | * gmplot 16 | * googlemaps 17 | * requests 18 | 19 | If you have PIP installed, type: `pip3 install -r requirements.txt` from the command line and your system should install all required modules. 20 | 21 | #### Geocoding API 22 | 23 | You will need to create a file named `geocode_api_keys.py` and put the following in it: 24 | 25 | ```bash 26 | google_api_key = 'YOUR_GOOGLE_API_KEY' 27 | bing_api_key = 'YOUR_BING_API_KEY' 28 | ``` 29 | 30 | Of course this means you need to go get a valid Google Developer API key for the Geocoding 31 | (). 32 | 33 | You also can also create a Bing API key for free at . 34 | 35 | ### Help command Output 36 | 37 | #### Ratebeer.com 38 | 39 | ```bash 40 | $ python ratebeer.py -h 41 | usage: ratebeer.py [-h] -u USER 42 | 43 | Grab ratebeer user activity 44 | 45 | optional arguments: 46 | -h, --help show this help message and exit 47 | -u USER, --user USER Username to research 48 | ``` 49 | 50 | #### Yelp.com 51 | 52 | ```bash 53 | $ python yelp_reviews.py -h 54 | usage: yelp_reviews.py [-h] -u USER [--csv] 55 | 56 | Grab yelp user activity 57 | 58 | optional arguments: 59 | -h, --help show this help message and exit 60 | -u USER, --user USER Username to research 61 | --csv Output to CSV 62 | ``` 63 | 64 | ### Example Output 65 | 66 | #### Ratebeer.com 67 | 68 | ```bash 69 | $ python ratebeer.py -u 105404 70 | [ ] VENUE DATA: Requesting https://www.ratebeer.com/ajax/user/105404/place-ratings/1/1/ 71 | [ ] VENUE DATA: Requesting https://www.ratebeer.com/ajax/user/105404/place-ratings/2/2/ 72 | [ ] VENUE DATA: Requesting https://www.ratebeer.com/ajax/user/105404/place-ratings/3/3/ 73 | [ ] VENUE DATA: Requesting https://www.ratebeer.com/ajax/user/105404/place-ratings/4/4/ 74 | [ ] VENUE DATA: Requesting https://www.ratebeer.com/ajax/user/105404/place-ratings/5/5/ 75 | [ ] VENUE DATA: Requesting https://www.ratebeer.com/ajax/user/105404/place-ratings/6/6/ 76 | 77 | [ ] HTML output file named ratebeer_map_105404_1539303736.html was written to disk. 78 | ``` 79 | 80 | #### Yelp.com 81 | 82 | ```bash 83 | python yelp_reviews.py -u U4gWrMtHevbDF3Le3GBLHA 84 | [ ] VENUE DATA: Requesting https://www.yelp.com/user_details?userid=U4gWrMtHevbDF3Le3GBLHA 85 | [ ] Can Geocode with Google. 86 | [ ] VENUE DATA: Requesting https://www.yelp.com/user_details?userid=U4gWrMtHevbDF3Le3GBLHA&rec_pagestart=10 87 | [ ] Can Geocode with Google. 88 | [ ] VENUE DATA: Requesting https://www.yelp.com/user_details?userid=U4gWrMtHevbDF3Le3GBLHA&rec_pagestart=20 89 | [ ] Can Geocode with Google. 90 | [ ] VENUE DATA: Requesting https://www.yelp.com/user_details?userid=U4gWrMtHevbDF3Le3GBLHA&rec_pagestart=30 91 | 92 | [-] No review addresses found 93 | 94 | [ ] HTML output file named yelp_map_U4gWrMtHevbDF3Le3GBLHA_1539303863.html was written to disk. 95 | ``` 96 | 97 | All scripts should produce HTML output files that show the geolocated content. An example is below: 98 | ![image of sample output](example_output.png) 99 | 100 | If your web page shows "For Development Purposes Only" watermarks, you will need to edit the HTML file and add your Google API key for JavaScript Maps API. Add `key=YOUR_GOOGLE_API_KEY` to the end of the maps.googleapis.com line like this: `https://maps.googleapis.com/maps/api/js?libraries=visualization&sensor=true_or_false&key=YOUR_GOOGLE_API_KEY` 101 | 102 | ## License 103 | 104 | Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. 105 | -------------------------------------------------------------------------------- /example_output.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebBreacher/foodndrink/7e3c62cecb2d8a49ad6c4a8cc38474a28e36a9c8/example_output.png -------------------------------------------------------------------------------- /geocode_api_keys.py: -------------------------------------------------------------------------------- 1 | 2 | # You need to get one or more of these API keys from Google and Bing 3 | # The Google one may cost money. Bing is free. 4 | google_api_key = 'GOOGLE_API_KEY' 5 | bing_api_key = 'BING_API_KEY' 6 | -------------------------------------------------------------------------------- /ratebeer.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | """ 3 | Author: Micah Hoffman (@WebBreacher) 4 | Purpose: To look up a user on ratebeer.com 5 | 6 | # Test users 7 | 105404 5/5 8 | 11116 6/6 9 | """ 10 | 11 | import argparse 12 | from bs4 import BeautifulSoup 13 | import geocoder 14 | import googlemaps 15 | import gmplot 16 | import re 17 | import requests 18 | from requests.packages.urllib3.exceptions import InsecureRequestWarning 19 | import time 20 | from geocode_api_keys import * 21 | 22 | 23 | #### 24 | # Functions 25 | #### 26 | 27 | def get_mean(lst): 28 | return float(sum(lst) / len(lst)) 29 | 30 | 31 | # Parse command line input 32 | parser = argparse.ArgumentParser(description='Grab ratebeer user activity') 33 | parser.add_argument('-u', '--user', required=True, help='Username to research') 34 | args = parser.parse_args() 35 | 36 | 37 | def get_data_from_ratebeer(url): 38 | # Setting up and Making the Web Call 39 | try: 40 | user_agent = 'Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Firefox/68.0' 41 | headers = {'User-Agent': user_agent} 42 | # Make web request for that URL and don't verify SSL/TLS certs 43 | response = requests.get(url, headers=headers, verify=False) 44 | return response.text 45 | 46 | except Exception as e: 47 | print('[!] ERROR - ratebeer issue: {}'.format(str(e))) 48 | exit(1) 49 | 50 | # TODO - Get user data 51 | def get_user_data(passed_user): 52 | # Parsing user information 53 | url = 'https://www.ratebeer.com/ajax/user/{}/'.format(passed_user) 54 | print("\n[ ] USER DATA: Requesting {}".format(url)) 55 | resp = get_data_from_ratebeer(url) 56 | html_doc = BeautifulSoup(resp, "html.parser") 57 | 58 | """ TODO - Parse the content below 59 |