Skip to content

hsjafari/zombi-scan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

RabbitMQ-based TCP Port Scanner

This project implements a distributed TCP port scanner using RabbitMQ for task distribution and result collection. It consists of a server (task manager) that distributes scanning tasks to workers via RabbitMQ queues and collects the results.

flowchart LR
  subgraph Server[Server / Task Manager]
    R[Read targets file]
    E[Enqueue each target]
    C[Collect results]
    O[Print to stdout]
  end

  subgraph Broker[RabbitMQ]
    Q1[(scan_task)]
    Q2[(scan_result)]
  end

  subgraph Workers[Workers]
    subgraph W1[Worker 1]
      W1c[Consume task]
      W1s[Attempt TCP connect]
      W1p[Publish result]
    end
    subgraph W2[Worker 2]
      W2c[Consume task]
      W2s[Attempt TCP connect]
      W2p[Publish result]
    end
    subgraph W3[Worker 3]
      W3c[Consume task]
      W3s[Attempt TCP connect]
      W3p[Publish result]
    end
  end

  T[targets.txt] --> R --> E --> Q1
  Q1 --> W1c
  Q1 --> W2c
  Q1 --> W3c
  W1c --> W1s --> W1p --> Q2
  W2c --> W2s --> W2p --> Q2
  W3c --> W3s --> W3p --> Q2
  Q2 --> C --> O

Loading

Features

  • Distributes port scanning tasks using RabbitMQ message queues
  • Collects and displays results from workers
  • Supports batch task submission from a file
  • Configurable output file for results

Requirements

  • Python 3.x
  • pika (Python RabbitMQ client)
  • RabbitMQ server running and accessible

Setup

  1. Install dependencies:

    pip install pika
  2. Configure RabbitMQ credentials:

    • Edit server.py and replace USERNAME and PASSWORD with your RabbitMQ credentials.
  3. Start RabbitMQ server (if not already running):

    sudo systemctl start rabbitmq-server

Usage

1. Prepare a target file

Create a text file (e.g., targets.txt) with each line containing an ip:port pair:

192.168.1.1:80
10.0.0.2:22

2. Run the server (task manager)

python server.py -f targets.txt -o results.txt
  • -f/--file: Path to the file containing the list of ip:port targets (one per line)
  • -o/--output: Path to the output file for results (currently not written to, see below)

3. Worker(s)

You need to implement and run worker(s) that consume tasks from the scan_task queue and publish results to the scan_result queue. (This repository currently provides only the server/task manager.)

How It Works

  • The server reads the target list and submits each as a task to the scan_task queue.
  • Workers (not included here) pick up tasks, perform the scan, and send results to the scan_result queue.
  • The server collects and prints results as they arrive.

Notes

  • The output file specified with -o is not currently written to; results are printed to stdout. You can extend the code to write results to the file as needed.
  • Make sure RabbitMQ is running and accessible with the credentials you provide.

License

MIT License

About

port scan using rabbitmq

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages