Giter Site home page Giter Site logo

honeypot's Introduction

Honeypot Example

This is an example honeypot project designed to log connections and gather information about potential attackers. The honeypot captures detailed user information, including device type, device version, browser version, IP address, country, city, and geo-coordinates.

Features

  • Logs connection details for multiple protocols: HTTP, FTP, Telnet, VNC
  • Captures detailed device information using user-agent strings
  • Fetches geolocation data for connecting IP addresses
  • Provides a web dashboard for viewing logs and connection statistics
  • Gracefully shuts down upon receiving termination signals

Requirements

  • Python 3.x

  • Required Python packages (install using pip):

    pip install twisted flask matplotlib requests httpagentparser

Installation

  1. Clone the repository:

    git clone https://github.com/Dyst0rti0n/honeypot.git
    cd honeypot
  2. Install the required Python packages:

    pip install twisted flask matplotlib requests httpagentparser
  3. Initialize the database:

    python -c "import database; database.init_db()"

Usage

  1. Run the honeypot services:

    python honeypot_services.py
  2. Run the Flask web dashboard:

    python app.py
  3. Access the web dashboard:

    Open your browser and navigate to http://localhost:5000 to view the honeypot logs and connection statistics.

Project Structure

  • honeypot_services.py: Main honeypot service script.
  • database.py: Database initialization and logging functions.
  • geolocation.py: Geolocation functions to fetch country and city data.
  • app.py: Flask web application for displaying logs and statistics.
  • templates/index.html: HTML template for the Flask web dashboard.

Logging

The honeypot logs detailed information about each connection, including:

  • Timestamp
  • Protocol
  • IP address
  • Port
  • Connection details
  • User-agent string
  • Device details (type, version, browser)
  • Country and city

The logs are stored in a SQLite database (honeypot.db) and are also written to a log file (honeypot.log).

Graceful Shutdown

The Flask web application includes signal handling for graceful shutdown. It listens for SIGINT and SIGTERM signals and shuts down cleanly upon receiving these signals.

License

This project is licensed under the MIT License.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request or open an Issue to discuss improvements or new features.

honeypot's People

Contributors

dyst0rti0n avatar

Watchers

 avatar

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.