Git Product home page Git Product logo

bot-detection-2022's Introduction

Traffic Analyzer CLI Tool

This tool analyzes website traffic logs to identify Google bots, bad bot traffic, and human traffic. It uses various signals to differentiate between legitimate and illegitimate traffic.

Features

  • Identify Google bot traffic: Detects legitimate Google bots based on user agent strings, IP addresses, and other signals.
  • Identify bad bot traffic: Detects known bad bots, fake Google bots, and the use of libraries and net tools based on user agent strings and other signals.
  • Identify human traffic: Filters out bot traffic to identify human traffic.

Installation

  1. Clone the repository or download the script.
  2. Ensure you have Python 3.x installed.
  3. Install required dependencies using pip:
    pip install pandas requests

Usage

Run the script from the command line with the appropriate arguments:

python traffic_analyzer.py <file> [options]

Arguments

  • <file>: The CSV file containing the logs to analyze.

Options

  • --googlebot: Identify Google bot traffic.
  • --badbot: Identify bad bot traffic.
  • --human: Identify human traffic.

Examples

Identify Google bot traffic:

python traffic_analyzer.py logs_analyst.csv --googlebot

Identify bad bot traffic:

python traffic_analyzer.py logs_analyst.csv --badbot

Identify human traffic:

python traffic_analyzer.py logs_analyst.csv --human

Signals Used

Google Bot Signals

  1. User agent: Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)
  2. IP address: Starts with 66.249.
  3. apiIpAutonomousSystemOrganization: Contains GOOGLE
  4. JavaScript WebGL Renderer, WebDriver, and Hardware Concurrency: Null or NaN
  5. apiEndpoint: Must be http
  6. fingerprintAccept: Contains text/html

Bad Bot Signals

  • Known bad bots: Identified using an external list of bad user agents.
  • Fake Google bots: User agent contains Googlebot, but the IP address does not belong to Google.
  • Libraries and net tools: User agent strings like curl, python-requests, PostmanRuntime.
  • Path traversal attacks: URLs containing "/../"

Human Traffic Signals

  • Negative of bot signals
  • User agent strings that do not match known bad bots, libraries, and net tools
  • URLs that do not contain path traversal patterns

License

This project is licensed under the MIT License.

bot-detection-2022's People

Contributors

cutekernel 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.