Git Product home page Git Product logo

fav-up's Introduction

Fav-up

Lookups for real IP starting from the favicon icon and using Shodan.

img img2

Installation

  • pip3 install -r requirements.txt
  • Shodan API key (not the free one)

Usage

CLI

First define how you pass the API key:

  • -k or --key to pass the key to the stdin
  • -kf or --key-file to pass the filename which get the key from
  • -sc or --shodan-cli to get the key from Shodan CLI (if you initialized it)

As of now, this tool can be used in three different ways:

  • -ff or --favicon-file: you store locally a favicon icon which you want to lookup
  • -fu or --favicon-url: you don't store locally the favicon icon, but you know the exact url where it resides
  • -w or --web: you don't know the URL of the favicon icon, but you still know that's there
  • -fh or --favicon-hash: you know the hash and want to search the entire internet.

You can specify input files which may contain urls to domain, to favicon icons, or simply locations of locally stored icons:

  • -fl, --favicon-list: the file contains the full path of all the icons which you want to lookup
  • -ul, --url-list: the file contains the full URL of all the icons which you want to lookup
  • -wl, --web-list: the contains all the domains which you want to lookup

You can also save the results to a CSV/JSON file:

  • -o, --output: specify the output and the format, e.g.: results.csv will save to a CSV file (the type is automatically recognized by the extension of the output file)

Examples

Favicon-file

python3 favUp.py --favicon-file favicon.ico -sc

Favicon-url

python3 favUp.py --favicon-url https://domain.behind.cloudflare/assets/favicon.ico -sc

Web

python3 favUp.py --web domain.behind.cloudflare -sc

Module

from favUp import FavUp

f = FavUp()          
f.shodanCLI = True
f.web = "domain.behind.cloudflare"
f.show = True 
f.run()

for result in f.faviconsList:
    print(f"Real-IP: {result['found_ips']}")
    print(f"Hash: {result['favhash']}")

All attributes

Variable Type
FavUp.show bool
FavUp.key str
FavUp.keyFile str
FavUp.shodanCLI bool
FavUp.faviconFile str
FavUp.faviconURL str
FavUp.web str
FavUp.shodan Shodan class
FavUp.faviconsList list[dict]

FavUp.faviconsList stores all the results, the key fields depend by the type of the lookup you want to do.

In case of --favicon-file or --favicon-list:

  • favhash stores the hash of the favicon icon
  • file stores the path

In case of --favicon-url or --url-list:

  • favhash stores the hash of the favicon icon
  • url stores the URL of the favicon icon
  • domain stores the domain name
  • maskIP stores the "fake" IP (e.g. the Cloudflare one)
  • maskISP store the ISP name associated to the maskIP

In case of --web or --web-list:

  • favhash stores the hash of the favicon icon
  • domain stores the domain name
  • maskIP stores the "fake" IP (e.g. the Cloudflare one)
  • maskISP store the ISP name associated to the maskIP

(in this case the URL of the favicon icon is returned by the href attribute of <link rel='icon'> HTML element)

If, while searching for the favicon icon, nothing useful is found, not-found will be returned.

In all three cases, found_ips field is added for every checked entry. If no IP(s) have been found, not-found will be returned.

Compatibility

At least python3.6 is required due to spicy syntax.

Feedback/Suggestion

Feel free to open any issue, your feedback and suggestions are always welcome <3

Publications

Unveiling IPs behind Cloudflare by @noneprivacy

Disclaimer

This tool is for educational purposes only. The authors and contributors don't take any responsibility for the misuse of this tool. Use It At Your Own Risk!

Credits

Conceived by Francesco Poldi noneprivacy, build with Aan Wahyu Petruknisme

stanley_HAL told me how Shodan calculates the favicon hash.

What is Murmur3?

More about Murmur3 and Shodan

fav-up's People

Contributors

3xyz avatar aancw avatar khanhthuan1995 avatar pielco11 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

fav-up's Issues

got an unexpected keyword argument 'use_external_data'

I'm getting following error

python favUp.py

Traceback (most recent call last):
  File "/root/Tools/fav-up/favUp.py", line 299, in <module>
    FavUpApp = FavUp(show=True)
  File "/root/Tools/fav-up/favUp.py", line 43, in __init__
    self.ua = UserAgent(use_external_data=True, cache_path=self.ua_json_location)
TypeError: FakeUserAgent.__init__() got an unexpected keyword argument 'use_external_data'

all from requirements folder is installed and using Python 3.10.12

shodan.exception.APIError: Invalid API key

root@dsfsf7:/home/mohammed_sec2010/fav-up# python3 favUp.py --favicon-url https://www.zxzxzxzx.com/assets/favicon.ico
Mask-IP: xx.xxx.x.x.x
Mask-ISP: CLOUDFLARENET
Favicon Hash: 1ccccccccccc
Traceback (most recent call last):
File "favUp.py", line 51, in
Traceback (most recent call last):
File "favUp.py", line 51, in
shodanSearch(favhash)
File "favUp.py", line 28, in shodanSearch
results = shodan.search(f"http.favicon.hash:{favhash}")
File "/usr/local/lib/python3.7/site-packages/shodan/client.py", line 498, in search
return self._request('/shodan/host/search', args)
File "/usr/local/lib/python3.7/site-packages/shodan/client.py", line 321, in _request
raise APIError(error)
shodan.exception.APIError: Invalid API key

shodan.exception.APIError: Please upgrade your API plan to use filters or paging.

It is giving me,

Mask-IP: 104.26.15.225
Mask-ISP: CLOUDFLARENET
Favicon Hash: -1690082520
Traceback (most recent call last):
  File "main.py", line 47, in <module>
    shodanSearch(favhash)
  File "main.py", line 31, in shodanSearch
    results = shodan.search(f"http.favicon.hash:{favhash}")
  File "/home/runner/.local/share/virtualenvs/python3/lib/python3.7/site-packages/shodan/client.py", line 498, in search
    return self._request('/shodan/host/search', args)
  File "/home/runner/.local/share/virtualenvs/python3/lib/python3.7/site-packages/shodan/client.py", line 321, in _request
    raise APIError(error)
shodan.exception.APIError: Please upgrade your API plan to use filters or paging.

I don't have any paid membership

Do I need a paid membership in order to use this?

Modules suggestion

https://www.criminalip.io/ - Criminal IP is a specialized Cyber Threat Intelligence (CTI) search engine that allows users to search for various security-related information such as malicious IP addresses, domains, banners, etc. It can be widely integrated

it doesn't work on routers for some reason.

shodan generates a different hash than the tool does and also the modems doesn't use the fav.icon direct url but

a custom one like images/banner.ico

or even gifs

so what's the work around ?

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.