Astra

Astra User Guide

Last Updated: May 15, 2025
Version: 1.1

Introduction

Welcome to the Astra User Guide! Astra is an open-source network scanning tool designed for security researchers, network administrators, and enthusiasts. Built with Python, Astra allows you to scan IP ranges, resolve domains to IPs, and identify open ports with a high degree of flexibility. Unlike many tools, Astra operates locally without third-party API dependencies, offering users control, privacy, and customization.

Why Astra?

In a landscape filled with network scanning tools, Astra stands out by:

This guide will walk you through installing, configuring, and using Astra effectively.

System Requirements

Installation

Follow these steps to set up Astra on your system:

  1. Clone the Repository:
    • Open a terminal and run:
      git clone https://github.com/bhaweshchaudhary/Astra.git
      cd astra
      
  2. Set Up a Virtual Environment:
    • Create and activate a virtual environment to isolate dependencies:
      python3 -m venv venv
      source venv/bin/activate  # On Windows: venv\Scripts\activate
      
  3. Install Dependencies:
    • Install required packages listed in requirements.txt:
      pip install -r requirements.txt
      
  4. (Optional) Configure Settings:
    • Create a config file at ~/.astra/config.json to set defaults:
      {
        "api_token": "",  // Leave empty unless using ipinfo.io (optional feature)
        "default_ports": "22,80,443,8080,8443",
        "default_timeout": 1.0
      }
      
    • This step is optional but recommended for frequent use.
  5. Verify Installation:
    • Run python3 astra.py -h to display the help message and confirm the tool is working.

Usage

Astra is operated via the command line. Below are detailed instructions on how to use it, including command options and examples.

Basic Command Structure

python3 astra.py [org] [options]

Command-Line Options

Run python3 astra.py -h for the latest options. As of v1.1, the following are available:

Usage Examples

  1. Scan a Domain with Default Settings:
    • Scan all ports for apple.com:
      python3 astra.py apple.com --verbose
      
    • Expected output includes resolved IPs, live hosts, and open ports.
  2. Scan a Domain with Limited Ports and IPs:
    • Scan the first 1,000 ports for facebook.com with a maximum of 100 IPs:
      python3 astra.py facebook.com --first-1000 --max-ips 100 --timeout 2.0 --verbose
      
    • Adjusts timeout to 2 seconds for slower networks.
  3. Scan a CIDR Range:
    • Scan the first 2 IPs of 17.44.246.0/23 with the first 300 ports:
      python3 astra.py --cidr 17.44.246.0/23 --first-300 --first-2-per-cidr --verbose
      
    • Limits scanning to the first two IPs in the CIDR range.
  4. Scan Multiple CIDR Ranges:
    • Scan the first 2 IPs of two CIDR ranges:
      python3 astra.py --cidr 17.44.246.0/23,17.44.248.0/23 --first-300 --first-2-per-cidr --verbose
      
    • Processes multiple ranges in one command.
  5. Save Results to a File:
    • Scan apple.com and save results in JSON:
      python3 astra.py apple.com --first-1000 --output results.json --verbose
      
    • Results are saved to results.json for later analysis.

Output Interpretation

Configuration

Troubleshooting

Frequently Asked Questions (FAQs)

  1. Is Astra free?
    • Yes, Astra is open-source under the MIT License.
  2. Can I scan any network?
    • No, scanning requires explicit permission. Unauthorized scanning is illegal.
  3. Why only TCP scanning?
    • Current version supports TCP only. UDP support is planned (see DEVELOPER.md).
  4. How do I contribute?
    • Follow the guidelines in DEVELOPER.md.
  5. What if I encounter bugs?
    • Report issues on the GitHub repository with steps to reproduce.

Best Practices

Limitations

Getting Help

License

Astra is released under the MIT License. See the LICENSE file for details.

Acknowledgments


Note: Astra is for ethical use only. Unauthorized network scanning is illegal and may result in legal consequences. Ensure compliance with all applicable laws and obtain permission before use.