Skip to content

Commit d72907b

Browse files
committed
Initial commit
0 parents  commit d72907b

7 files changed

+188
-0
lines changed

.gitignore

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Python
2+
__pycache__/
3+
*.pyc
4+
*.pyo
5+
*.pyd
6+
*.pyz
7+
*.pyw
8+
*.pyc
9+
10+
# Virtual Environment
11+
venv/
12+
venv*/
13+
ENV/
14+
env*/
15+
.venv/
16+
.venv*/
17+
dist/
18+
build/
19+
*.egg-info/
20+
*.egg
21+
*.egg-info
22+
23+
# VS Code
24+
.vscode/
25+
.settings/
26+
*.code-workspace
27+
28+
# Logs and Databases
29+
*.log
30+
*.sqlite3
31+
*.db
32+
33+
# Environment Variables
34+
.env

CODE_OF_CONDUCT.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Contributor Code of Conduct
2+
3+
As a contributor to this project, we ask that you adhere to the following code of conduct:
4+
5+
1. Be respectful and considerate of others, regardless of their race, gender, religion, or other personal characteristics.
6+
7+
2. Avoid using derogatory or offensive language or behavior.
8+
9+
3. Stay focused on the issues at hand and avoid personal attacks or ad hominem arguments.
10+
11+
4. Be open to constructive feedback and willing to learn from others.
12+
13+
5. Respect the privacy of others and avoid sharing personal information without their consent.
14+
15+
6. Adhere to the project's guidelines and conventions for contributions.
16+
17+
7. Help create a positive and supportive community by encouraging others and offering help when needed.
18+
19+
We take violations of this code of conduct seriously, and reserve the right to remove contributors who engage in inappropriate behavior. By contributing to this project, you agree to abide by this code of conduct and help create a safe and welcoming environment for all members of the community.

CONTRIBUTING.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Contributing to Project
2+
3+
Thank you for your interest in contributing to Project! We welcome contributions from the community and appreciate any feedback or suggestions you may have.
4+
5+
## Submitting Issues
6+
7+
If you encounter any issues with Project, please submit them through the project's [GitHub Issues](https://github.com/TheWation/WebSecurityVision/issues) page. Please include as much detail as possible, including the steps to reproduce the issue and any error messages or logs.
8+
9+
## Contributing Code
10+
11+
If you would like to contribute code to Project, please follow these steps:
12+
13+
1. Fork the project repository to your own GitHub account.
14+
15+
2. Create a new branch for your changes.
16+
17+
3. Make your changes and commit them to your branch.
18+
19+
4. Push your branch to your forked repository.
20+
21+
5. Submit a pull request from your branch to the Project repository.
22+
23+
Please make sure to include a detailed description of your changes and why you think they are necessary. We also ask that you follow the project's coding standards and conventions.
24+
25+
Thank you for your contribution!

FavXHasher.py

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import argparse
2+
import mmh3
3+
import requests
4+
import codecs
5+
6+
def logo() -> str:
7+
"""Return the logo/banner."""
8+
return '''
9+
____ __ ____ ___ .___________. __ ______ .__ __.
10+
\ \ / \ / / / \ | || | / __ \ | \ | |
11+
\ \/ \/ / / ^ \ `---| |----`| | | | | | | \| |
12+
\ / / /_\ \ | | | | | | | | | . ` |
13+
\ /\ / / _____ \ | | | | | `--' | | |\ |
14+
\__/ \__/ /__/ \__\ |__| |__| \______/ |__| \__|
15+
16+
FavXHasher v1.0
17+
'''
18+
19+
def generate_favicon_hash(url: str) -> None:
20+
"""Generate hash for a given favicon URL."""
21+
try:
22+
response = requests.get(url)
23+
favicon_content = codecs.encode(response.content, "base64")
24+
favicon_hash = mmh3.hash(favicon_content)
25+
print(f'[+] Favicon Hash is: {favicon_hash}')
26+
print(f'[!] Use http.favicon.hash:{favicon_hash} on Shodan to detect potential phishing websites.')
27+
except requests.exceptions.RequestException as e:
28+
print(f"An error occurred: {e}")
29+
30+
31+
32+
class CustomArgumentParser(argparse.ArgumentParser):
33+
def format_help(self):
34+
return logo() + super().format_help()
35+
36+
def main() -> None:
37+
parser = CustomArgumentParser(description='This tool calculates the hash value of a favicon from a given URL, enabling the detection of potential phishing websites by leveraging Shodan\'s search capabilities, For more information, visit the project repository: https://github.com/TheWation/FavXHasher')
38+
parser.add_argument('-u', '--url', type=str, help='Favicon URL to generate Hash')
39+
args = parser.parse_args()
40+
41+
if args.url:
42+
print(logo())
43+
generate_favicon_hash(args.url)
44+
else:
45+
parser.print_help()
46+
47+
if __name__ == "__main__":
48+
main()

LICENSE.md

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Copyright (c) 2012-2022 Scott Chacon and others
2+
3+
Permission is hereby granted, free of charge, to any person obtaining
4+
a copy of this software and associated documentation files (the
5+
"Software"), to deal in the Software without restriction, including
6+
without limitation the rights to use, copy, modify, merge, publish,
7+
distribute, sublicense, and/or sell copies of the Software, and to
8+
permit persons to whom the Software is furnished to do so, subject to
9+
the following conditions:
10+
11+
The above copyright notice and this permission notice shall be
12+
included in all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# FavXHasher
2+
3+
[![made-with-python](http://forthebadge.com/images/badges/made-with-python.svg)](https://www.python.org/)
4+
[![built-with-love](http://forthebadge.com/images/badges/built-with-love.svg)](https://gitHub.com/TheWation/)
5+
6+
FavXHasher is a simple command-line tool designed to calculate the hash value of a favicon from a given URL. This tool can be particularly useful for detecting potential phishing websites by leveraging Shodan's search capabilities.
7+
8+
## Prerequisites
9+
10+
- Python 3.7 or later
11+
- `pip` package manager
12+
13+
## Installation
14+
15+
1. Clone this repository:
16+
17+
```bash
18+
git clone https://github.com/TheWation/FavXHasher.git
19+
cd FavXHasher
20+
```
21+
22+
2. Install the required dependencies:
23+
```
24+
pip install -r requirements.txt
25+
```
26+
27+
## Usage
28+
To use FavXHasher, simply run the script with the `-u` or `--url` option followed by the URL of the favicon you want to generate the hash for. For example:
29+
30+
```bash
31+
python FavXHasher.py -u http://example.com/favicon.ico
32+
```
33+
34+
After executing the command, FavXHasher will fetch the favicon from the provided URL, calculate its hash value, and display the result along with a tip on how to use it with Shodan to detect potential phishing sites.
35+
36+
## Disclaimer
37+
FavXHasher is provided for educational and informational purposes only. The authors do not condone or support any illegal activities that may be carried out using this tool. It is the responsibility of the user to ensure that they have appropriate authorization before using this tool on any website.
38+
39+
## License
40+
`FavXHasher` is made with ♥ by [Wation](https://github.com/TheWation) and it's released under the `MIT` license.

requirements.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
mmh3
2+
requests

0 commit comments

Comments
 (0)