├── LICENSE ├── README.md └── src ├── main.py └── requirements.txt /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 William F 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # carview 2 | OSINT license plate data by scraping lookup site(s) 3 | 4 | ![Preview](https://camo.githubusercontent.com/09fbfb1aac3816f4dd677cb6caafbf4d4e54401fc01f53ba0486938a69fd4176/68747470733a2f2f692e6962622e636f2f4e4e37627173442f707265772e706e67) 5 | 6 | ## Setup 7 | ``` 8 | git clone https://github.com/willuhm-js/carview 9 | cd carview/src 10 | pip install -r requirements.txt 11 | python main.py 12 | ``` 13 | -------------------------------------------------------------------------------- /src/main.py: -------------------------------------------------------------------------------- 1 | import requests 2 | from bs4 import BeautifulSoup as bs 3 | #HEADER = '\033[95m' 4 | # OKBLUE = '\033[94m' 5 | # OKGREEN = '\033[92m' 6 | # WARNING = '\033[93m' 7 | # FAIL = '\033[91m' 8 | # ENDC = '\033[0m' 9 | # BOLD = '\033[1m' 10 | # UNDERLINE = '\033[4m' 11 | try: 12 | print(""" 13 | 14 | \033[94m _ \033[0m 15 | \033[94m ___ __ _ _ ____ _(_) _____ __ \033[0m 16 | \033[94m / __/ _` | '__\ \ / / |/ _ \ \ /\ / / \033[0m 17 | | (_| (_| | | \ V /| | __/\ V V / 18 | \033[92m \___\__,_|_| \_/ |_|\___| \_/\_/ \033[0m 19 | 20 | """) 21 | 22 | oplate = input("\033[1mLicense Plate: \033[0m") 23 | dplate = oplate.upper() 24 | plate = "".join(oplate.split(" ")) 25 | state = input("\033[1mState: \033[0m") 26 | state = state.upper() 27 | 28 | print("\n\033[93mSearching...\033[0m") 29 | 30 | URL = "https://findbyplate.com/US/"+state+"/"+plate+"/" 31 | 32 | page = requests.get(URL, verify=True) 33 | soupPage = bs(page.content, 'html.parser') 34 | mayresults = soupPage.find("h2", {"class": "vehicle-modal"}) 35 | mayraw = mayresults.prettify().split("\n")[1] 36 | may = mayraw[1:len(mayraw)] 37 | 38 | year = may[0:4] 39 | model = may[5:len(may)] 40 | 41 | countryResults = soupPage.find("div", {"data-title": "PlantCountry"}) 42 | countryResultsraw = countryResults.prettify().split("\n")[1] 43 | 44 | country = countryResultsraw[1:len(countryResultsraw)] 45 | 46 | countryResults = soupPage.find("div", {"data-title": "PlantCity"}) 47 | countryResultsraw = countryResults.prettify().split("\n")[1] 48 | city = countryResultsraw[1:len(countryResultsraw)] 49 | 50 | vtypeResults = soupPage.find("div", {"data-title": "VehicleType"}) 51 | vtyperaw = vtypeResults.prettify().split("\n")[1] 52 | type = vtyperaw[1:len(vtyperaw)] 53 | location = city + ", " + country 54 | 55 | print("\033[92mDone!\033[0m\n") 56 | 57 | print("\033[1mModel:\033[0m \033[1mYear:\033[0m" + " " * 7 + "\033[1mVehicle Type:\033[0m") 58 | print(model + " " * (20 - len(model)) + year + " " + type) 59 | print("\n\033[1mPlate Number:\033[0m \033[1mState:\033[0m \033[1mPlant Location:\033[0m") 60 | print(dplate + " " * (20 - len(dplate)) + state + " " + location) 61 | except KeyboardInterrupt: 62 | print("\n\033[91mExiting...\033[0m") 63 | except AttributeError: 64 | print("\033[91mVehicle Not Found\033[0m") 65 | except: 66 | print("\033[91mError Found, please contact developer\033[0m") 67 | raise; 68 | -------------------------------------------------------------------------------- /src/requirements.txt: -------------------------------------------------------------------------------- 1 | requests 2 | beautifulsoup4 3 | --------------------------------------------------------------------------------