Full Code of bee-san/RustScan for AI

master 487acbe38282 cached
55 files
262.3 KB
83.6k tokens
154 symbols
1 requests
Download .txt
Showing preview only (277K chars total). Download the full file or copy to clipboard to get everything.
Repository: bee-san/RustScan
Branch: master
Commit: 487acbe38282
Files: 55
Total size: 262.3 KB

Directory structure:
gitextract_zfz_ha5m/

├── .SRCINFO
├── .all-contributorsrc
├── .dockerignore
├── .github/
│   ├── FUNDING.yml
│   ├── ISSUE_TEMPLATE/
│   │   ├── bug_report.md
│   │   └── feature_request.md
│   ├── config.yml
│   ├── dependabot.yml
│   ├── release-drafter.yml
│   └── workflows/
│       ├── build.yml
│       ├── dependabot.yml
│       ├── mlc_config.json
│       └── test.yml
├── .gitignore
├── .gitmodules
├── .travis.yml
├── CODE_OF_CONDUCT.md
├── Cargo.toml
├── LICENSE
├── Makefile
├── README.md
├── benches/
│   └── benchmark_portscan.rs
├── build.rs
├── config.toml
├── contributing.Dockerfile
├── contributing.md
├── fixtures/
│   ├── .rustscan_scripts/
│   │   ├── test_script.pl
│   │   ├── test_script.py
│   │   ├── test_script.sh
│   │   ├── test_script.txt
│   │   └── test_script_invalid_headers.txt
│   ├── .rustscan_scripts.toml
│   ├── empty_hosts.txt
│   ├── hosts.txt
│   ├── naughty_strings.txt
│   └── test_rustscan_scripts.toml
├── justfile
├── nmap-payloads
├── pictures/
│   ├── accessible.yml
│   ├── fast.yml
│   ├── newfast.yml
│   └── nice.yml
├── release.sh
├── src/
│   ├── address.rs
│   ├── benchmark/
│   │   └── mod.rs
│   ├── input.rs
│   ├── lib.rs
│   ├── main.rs
│   ├── port_strategy/
│   │   ├── mod.rs
│   │   └── range_iterator.rs
│   ├── scanner/
│   │   ├── mod.rs
│   │   └── socket_iterator.rs
│   ├── scripts/
│   │   └── mod.rs
│   └── tui.rs
└── tests/
    └── timelimits.rs

================================================
FILE CONTENTS
================================================

================================================
FILE: .SRCINFO
================================================
pkgbase = rustscan-bin
	pkgdesc = Faster Nmap Scanning with Rust
	pkgver = 1.1.0
	pkgrel = 1
	url = https://github.com/rustscan/rustscan
	arch = x86_64
	license = MIT
	depends = rustup
	provides = rustscan

pkgname = rustscan-bin



================================================
FILE: .all-contributorsrc
================================================
{
  "files": [
    "README.md"
  ],
  "imageSize": 100,
  "commit": false,
  "contributors": [
    {
      "login": "brandonskerritt",
      "name": "Brandon",
      "avatar_url": "https://avatars3.githubusercontent.com/u/10378052?v=4",
      "profile": "https://skerritt.blog",
      "contributions": [
        "infra",
        "test",
        "code",
        "design"
      ]
    },
    {
      "login": "SakiiR",
      "name": "SakiiR",
      "avatar_url": "https://avatars1.githubusercontent.com/u/9950578?v=4",
      "profile": "https://sakiir.ovh",
      "contributions": [
        "code",
        "bug"
      ]
    },
    {
      "login": "smackhack",
      "name": "smackhack",
      "avatar_url": "https://avatars2.githubusercontent.com/u/48143394?v=4",
      "profile": "https://github.com/smackhack",
      "contributions": [
        "ideas",
        "example"
      ]
    },
    {
      "login": "bernardoamc",
      "name": "Bernardo Araujo",
      "avatar_url": "https://avatars0.githubusercontent.com/u/428984?v=4",
      "profile": "http://bernardoamc.github.io/",
      "contributions": [
        "code",
        "bug",
        "design"
      ]
    },
    {
      "login": "Isona",
      "name": "Izzy Whistlecroft",
      "avatar_url": "https://avatars2.githubusercontent.com/u/11759523?v=4",
      "profile": "https://github.com/Isona",
      "contributions": [
        "bug"
      ]
    },
    {
      "login": "imlonghao",
      "name": "imlonghao",
      "avatar_url": "https://avatars1.githubusercontent.com/u/4951333?v=4",
      "profile": "https://imlonghao.com",
      "contributions": [
        "bug",
        "maintenance"
      ]
    },
    {
      "login": "royharoush",
      "name": "royharoush",
      "avatar_url": "https://avatars3.githubusercontent.com/u/8113056?v=4",
      "profile": "https://github.com/royharoush",
      "contributions": [
        "ideas",
        "design"
      ]
    },
    {
      "login": "Atul9",
      "name": "Atul Bhosale",
      "avatar_url": "https://avatars1.githubusercontent.com/u/3390330?v=4",
      "profile": "https://github.com/Atul9",
      "contributions": [
        "code"
      ]
    },
    {
      "login": "TGotwig",
      "name": "Thomas Gotwig",
      "avatar_url": "https://avatars0.githubusercontent.com/u/30773779?v=4",
      "profile": "https://tgotwig.me",
      "contributions": [
        "platform"
      ]
    },
    {
      "login": "remigourdon",
      "name": "Rémi Gourdon",
      "avatar_url": "https://avatars3.githubusercontent.com/u/2874133?v=4",
      "profile": "https://github.com/remigourdon",
      "contributions": [
        "doc",
        "code"
      ]
    },
    {
      "login": "cmnatic",
      "name": "Ben (CMNatic)",
      "avatar_url": "https://avatars3.githubusercontent.com/u/4163116?v=4",
      "profile": "https://cmnatic.co.uk",
      "contributions": [
        "code",
        "doc",
        "design"
      ]
    },
    {
      "login": "Ferryistaken",
      "name": "Alessandro Ferrari",
      "avatar_url": "https://avatars3.githubusercontent.com/u/47927670?v=4",
      "profile": "https://github.com/Ferryistaken",
      "contributions": [
        "content"
      ]
    },
    {
      "login": "Phenomite",
      "name": "Phenomite",
      "avatar_url": "https://avatars2.githubusercontent.com/u/8285537?v=4",
      "profile": "https://github.com/Phenomite",
      "contributions": [
        "content"
      ]
    },
    {
      "login": "SuperSandro2000",
      "name": "Sandro",
      "avatar_url": "https://avatars2.githubusercontent.com/u/7258858?v=4",
      "profile": "https://supersandro.de/",
      "contributions": [
        "content",
        "bug",
        "code"
      ]
    },
    {
      "login": "caass",
      "name": "Cass",
      "avatar_url": "https://avatars2.githubusercontent.com/u/25358963?v=4",
      "profile": "https://swag.lgbt",
      "contributions": [
        "platform",
        "code",
        "bug"
      ]
    },
    {
      "login": "niklasmohrin",
      "name": "Niklas Mohrin",
      "avatar_url": "https://avatars0.githubusercontent.com/u/47574893?v=4",
      "profile": "https://github.com/niklasmohrin",
      "contributions": [
        "doc",
        "code",
        "bug"
      ]
    },
    {
      "login": "tim77",
      "name": "Artem Polishchuk",
      "avatar_url": "https://avatars0.githubusercontent.com/u/5614476?v=4",
      "profile": "https://liberapay.com/Artem4/",
      "contributions": [
        "platform"
      ]
    },
    {
      "login": "buermarc",
      "name": "buermarc",
      "avatar_url": "https://avatars2.githubusercontent.com/u/44375277?v=4",
      "profile": "https://github.com/buermarc",
      "contributions": [
        "code"
      ]
    },
    {
      "login": "bergabman",
      "name": "bergabman",
      "avatar_url": "https://avatars1.githubusercontent.com/u/44554109?v=4",
      "profile": "https://github.com/bergabman",
      "contributions": [
        "code",
        "bug",
        "design"
      ]
    },
    {
      "login": "dmitris",
      "name": "Dmitry Savintsev",
      "avatar_url": "https://avatars0.githubusercontent.com/u/31205?v=4",
      "profile": "https://github.com/dmitris",
      "contributions": [
        "code"
      ]
    },
    {
      "login": "bofh69",
      "name": "Sebastian Andersson",
      "avatar_url": "https://avatars3.githubusercontent.com/u/1444315?v=4",
      "profile": "https://github.com/bofh69",
      "contributions": [
        "code"
      ]
    },
    {
      "login": "mattcorbin",
      "name": "Matt Corbin",
      "avatar_url": "https://avatars3.githubusercontent.com/u/6537765?v=4",
      "profile": "https://github.com/mattcorbin",
      "contributions": [
        "code"
      ]
    },
    {
      "login": "rootsploit",
      "name": "RootSploit",
      "avatar_url": "https://avatars2.githubusercontent.com/u/67270834?v=4",
      "profile": "http://rootsploit.com",
      "contributions": [
        "blog"
      ]
    },
    {
      "login": "eiffel-fl",
      "name": "eiffel-fl",
      "avatar_url": "https://avatars2.githubusercontent.com/u/12171754?v=4",
      "profile": "https://github.com/eiffel-fl",
      "contributions": [
        "code"
      ]
    },
    {
      "login": "u5surf",
      "name": "Y.Horie",
      "avatar_url": "https://avatars1.githubusercontent.com/u/14180225?v=4",
      "profile": "https://github.com/u5surf",
      "contributions": [
        "code"
      ]
    },
    {
      "login": "okrplay",
      "name": "Oskar",
      "avatar_url": "https://avatars3.githubusercontent.com/u/32576280?v=4",
      "profile": "https://github.com/okrplay",
      "contributions": [
        "code",
        "test"
      ]
    }
  ],
  "contributorsPerLine": 7,
  "projectName": "RustScan",
  "projectOwner": "RustScan",
  "repoType": "github",
  "repoHost": "https://github.com",
  "skipCi": true
}


================================================
FILE: .dockerignore
================================================
.git
Dockerfile


================================================
FILE: .github/FUNDING.yml
================================================
github: bee-san


================================================
FILE: .github/ISSUE_TEMPLATE/bug_report.md
================================================
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

IMPORTANT: If you do not fill this out, your issue will be automatically closed.

As of November 2024, RustScan no longer offiically supports any packages other than `cargo`. If you have an issue with Docker or a `.deb`, please bring it up with whoever created it :)

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
 - OS: [e.g. iOS]
 - Browser [e.g. chrome, safari]
 - Version [e.g. 22]

**Smartphone (please complete the following information):**
 - Device: [e.g. iPhone6]
 - OS: [e.g. iOS8.1]
 - Browser [e.g. stock browser, safari]
 - Version [e.g. 22]

**Additional context**
Add any other context about the problem here.


================================================
FILE: .github/ISSUE_TEMPLATE/feature_request.md
================================================
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.


================================================
FILE: .github/config.yml
================================================
todo:
  keyword: "// TODO"


================================================
FILE: .github/dependabot.yml
================================================
version: 2
updates:
- package-ecosystem: "github-actions"
  directory: "/"
  schedule:
    interval: "daily"
- package-ecosystem: "docker"
  directory: "/"
  schedule:
    interval: "daily"
- package-ecosystem: cargo
  directory: "/"
  schedule:
    interval: daily
  open-pull-requests-limit: 10
  ignore:
  - dependency-name: anyhow
    versions:
    - 1.0.38
    - 1.0.39
  - dependency-name: serde
    versions:
    - 1.0.123
  - dependency-name: futures
    versions:
    - 0.3.12
  - dependency-name: rlimit
    versions:
    - 0.5.3


================================================
FILE: .github/release-drafter.yml
================================================
template: |
  ## What’s Changed

  $CHANGES


================================================
FILE: .github/workflows/build.yml
================================================
name: CD Pipeline

on: [push]

jobs:
  build-nix:
    env:
      IN_PIPELINE: true
    runs-on: ${{ matrix.os }}
    if: github.ref == 'refs/heads/master'
    strategy:
      matrix:
        type: [ubuntu-x64, ubuntu-x86, armv7, aarch64]
        include:
          - type: ubuntu-x64
            os: ubuntu-latest
            target: x86_64-unknown-linux-musl
            name: x86_64-linux-rustscan
            path: target/x86_64-unknown-linux-musl/release/rustscan
            pkg_config_path: /usr/lib/x86_64-linux-gnu/pkgconfig
          - type: ubuntu-x86
            os: ubuntu-latest
            target: i686-unknown-linux-musl
            name: x86-linux-rustscan
            path: target/i686-unknown-linux-musl/release/rustscan
            pkg_config_path: /usr/lib/i686-linux-gnu/pkgconfig
          - type: armv7
            os: ubuntu-latest
            target: armv7-unknown-linux-gnueabihf
            name: armv7-linux-rustscan
            path: target/armv7-unknown-linux-gnueabihf/release/rustscan
            pkg_config_path: /usr/lib/x86_64-linux-gnu/pkgconfig
          - type: aarch64
            os: ubuntu-latest
            target: aarch64-unknown-linux-gnu
            name: aarch64-linux-rustscan
            path: target/aarch64-unknown-linux-gnu/release/rustscan
            pkg_config_path: /usr/lib/x86_64-linux-gnu/pkgconfig
    steps:
      - uses: actions/checkout@v4
      - name: Cache cargo & target directories
        uses: Swatinem/rust-cache@v2
      - name: Build binary
        uses: houseabsolute/actions-rust-cross@v0
        with:
          command: build
          target: ${{ matrix.target }}
          args: "--locked --release"
          strip: true
          toolchain: stable
      - name: Build tar.gz for homebrew installs
        if: matrix.type == 'ubuntu-x64'
        run: |
          tar czf ${{ matrix.name }}.tar.gz -C target/x86_64-unknown-linux-musl/release rustscan
      - uses: actions/upload-artifact@v4
        with:
          name: ${{ matrix.name }}
          path: ${{ matrix.path }}
      - uses: actions/upload-artifact@v4
        if: matrix.type == 'ubuntu-x64'
        with:
          name: ${{ matrix.name }}.tar.gz
          path: ${{ matrix.name }}.tar.gz
  build-deb:
    needs: [build-nix]
    runs-on: ubuntu-latest
    env:
      IN_PIPELINE: true
    steps:
      - uses: actions/checkout@v4
      - name: Install cargo-deb
        run: cargo install -f cargo-deb
      - uses: awalsh128/cache-apt-pkgs-action@v1
        with:
          packages: musl-tools # provides musl-gcc
          version: 1.0
      - name: Install musl toolchain
        run: rustup target add x86_64-unknown-linux-musl
      - name: Deb Build
        run: cargo deb --target=x86_64-unknown-linux-musl
      - name: Upload Deb Artifact
        uses: actions/upload-artifact@v4
        with:
          name: rustscan.deb
          path: ./target/x86_64-unknown-linux-musl/debian/*

  build-macos:
    env:
      IN_PIPELINE: true
    runs-on: macos-latest
    if: github.ref == 'refs/heads/master'
    steps:
      - uses: actions/checkout@v4
      - name: Cache cargo & target directories
        uses: Swatinem/rust-cache@v2
      - name: Build binary
        uses: houseabsolute/actions-rust-cross@v0
        with:
          command: build
          target: x86_64-apple-darwin
          args: "--locked --release"
          strip: true
          toolchain: stable
      - name: Build tar.gz for homebrew installs
        run: |
          tar czf x86_64-macos-rustscan.tar.gz -C target/x86_64-apple-darwin/release rustscan
      - uses: actions/upload-artifact@v4
        with:
          name: x86_64-macos-rustscan
          path: target/x86_64-apple-darwin/release/rustscan
      - uses: actions/upload-artifact@v4
        with:
          name: x86_64-macos-rustscan.tar.gz
          path: x86_64-macos-rustscan.tar.gz
  
  build-macos-aarch64:
    env:
      IN_PIPELINE: true
    runs-on: macos-latest
    if: github.ref == 'refs/heads/master'
    steps:
      - uses: actions/checkout@v4
      - name: Cache cargo & target directories
        uses: Swatinem/rust-cache@v2
      - name: Build binary
        uses: houseabsolute/actions-rust-cross@v0
        with:
          command: build
          target: aarch64-apple-darwin
          args: "--locked --release"
          strip: true
          toolchain: stable
      - name: Build tar.gz for homebrew installs
        run: |
          tar czf aarch64-macos-rustscan.tar.gz -C target/aarch64-apple-darwin/release rustscan
      - uses: actions/upload-artifact@v4
        with:
          name: aarch64-macos-rustscan
          path: target/aarch64-apple-darwin/release/rustscan
      - uses: actions/upload-artifact@v4
        with:
          name: aarch64-macos-rustscan.tar.gz
          path: aarch64-macos-rustscan.tar.gz

  build-windows:
    env:
      IN_PIPELINE: true
    runs-on: ${{ matrix.os }}
    if: github.ref == 'refs/heads/master'
    strategy:
      matrix:
        type: [windows-x64, windows-x86]
        include:
          - type: windows-x64
            os: windows-latest
            target: x86_64-pc-windows-msvc
            name: x86_64-windows-rustscan.exe
            path: target\x86_64-pc-windows-msvc\release\rustscan.exe
          - type: windows-x86
            os: windows-latest
            target: i686-pc-windows-msvc
            name: x86-windows-rustscan.exe
            path: target\i686-pc-windows-msvc\release\rustscan.exe
    steps:
      - uses: actions/checkout@v4
      - name: Cache cargo & target directories
        uses: Swatinem/rust-cache@v2
      - name: Build binary
        uses: houseabsolute/actions-rust-cross@v0
        with:
          command: build
          target:  ${{ matrix.target }}
          args: "--locked --release"
          strip: true
          toolchain: stable
      - uses: actions/upload-artifact@v4
        with:
          name: ${{ matrix.name }}
          path: ${{ matrix.path }}


================================================
FILE: .github/workflows/dependabot.yml
================================================
name: Dependabot Auto-Merge

jobs:
  dependabot:
    runs-on: ubuntu-latest
    if: ${{ github.actor == 'dependabot[bot]' }}
    steps:
      - name: Enable auto-merge for Dependabot PRs
        run: |
          gh pr review --approve "$PR_URL"
          gh pr merge --auto --merge "$PR_URL"
        env:
          PR_URL: ${{ github.event.pull_request.html_url }}
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


================================================
FILE: .github/workflows/mlc_config.json
================================================
{
    "_comment": "Config for markdown-link-check. Resolves issue #540.",
    "ignorePatterns": [
      {
        "pattern": "^https://github.com/RustScan/RustScan/workflows/Continuous%20integration/badge.svg"
      },
      {
        "pattern": "^https://crates.io/crates/rustscan/"
      },
      {
        "pattern": "^https://bees.substack.com/p/making-hacking-accessible"
      }
    ]
  }

================================================
FILE: .github/workflows/test.yml
================================================
name: Test
on:
  pull_request:
    branches: [master]
  push:
    branches:
      - master
jobs:
  test:
    name: Test Suite
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
        rust: [stable]
    runs-on: ${{ matrix.os }}
    steps:
      - name: Checkout sources
        uses: actions/checkout@v4

      - name: Install stable toolchain
        uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: ${{ matrix.rust }}
          override: true

      - uses: taiki-e/install-action@nextest
      - uses: Swatinem/rust-cache@v2

      - name: Install Just
        uses: extractions/setup-just@v2

      - name: Run just
        run: just test


================================================
FILE: .gitignore
================================================
# Generated by Cargo
# will have compiled files and executables
/target/
# generated file by build.rs for mapping nmap-payloads to rust
src/generated.rs

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html

# These are backup files generated by rustfmt
**/*.rs.bk


#Added by cargo

/target

# Created by https://www.toptal.com/developers/gitignore/api/rust,archlinuxpackages
# Edit at https://www.toptal.com/developers/gitignore?templates=rust,archlinuxpackages

### ArchLinuxPackages ###
*.tar
*.tar.*
*.jar
*.exe
*.msi
*.zip
*.tgz
*.log
*.log.*
*.sig

pkg/

### Rust ###
# Generated by Cargo
# will have compiled files and executables
/target/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html

# These are backup files generated by rustfmt
**/*.rs.bk

# End of https://www.toptal.com/developers/gitignore/api/rust,archlinuxpackages
*.deb


# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn.  Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

.idea/*
.idea
.idea*

settings.json


================================================
FILE: .gitmodules
================================================
[submodule "src/rustscan_scripting_engine"]
	path = src/rustscan_scripting_engine
	url = https://github.com/RustScan/rustscan_scripting_engine


================================================
FILE: .travis.yml
================================================
language: rust
os:
- linux
- osx
arch:
- amd64
- arm64
services:
- docker
before_install:
- rustup component add rustfmt
rust:
- stable
- beta
jobs:
  fast_finish: true
script:
- cargo build
- cargo test
- "ulimit -n 5000; cargo test timelimits:: -- --ignored --test-threads=1 --show-output"
- cargo fmt -- --check
after_failure:
- wget https://raw.githubusercontent.com/DiscordHooks/travis-ci-discord-webhook/master/send.sh
- chmod +x send.sh
- "./send.sh failure $WEBHOOK_URL"
after_success: |
  if [ -n "${GITHUB_TOKEN}" ]; then
    [ "${TRAVIS_BRANCH} " = master ] &&
    [ "${TRAVIS_PULL_REQUEST}" = false ] &&
    cargo doc &&
    echo "<meta http-equiv=refresh content=0;url=rustscan/index.html>" > target/doc/index.html &&
    sudo pip install ghp-import &&
    ghp-import -n target/doc &&
    git push -fq https://${GITHUB_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages
  fi
env:
  global:
    secure: Gf24LG7Hr3Q0drWyPrvISTL35Z57DxdS/wIOo7v+ZdauzY3Qjvv3Lh4TY//C4sdN0g1CLj4yjg7LQOqF4XRdh2Qah7JZPv/i2B5uz9nwjTsoRzmmMWML9VtfT1u53nSFqsNeXbvpmoNG9rfMXcoiyd+Lv+EgniHphDEBlXvS9n9KMcpOi1F2x7bsH0EK37wQYKMTpCCd5TPUPdZou7BJNiZS3ikRLpTRFF7uIN4gYtRH9kU5uBSphWgnJ6eBm2ItzZcUPOgrjAoF4RkmZAzGG4idDh1Qkf3No3nZwT3U5NSk8h7owtJ4oADlRgYqYKCB4YcC9cAKCJgDsyMlKKMkEyagvw1seFnBLCY3ljsW4EklpVEZ0rVqZOx4pTkIaxIxytLTC9pHmdDSnhdhFknOcVAQQWjg+nAZfD07QUeAqUdr0i/vxQoZitvbNY0znzEarycE1waKvwlkiB4gt385U1CBfYldydnOnRKkdtLNrCLClu13HU0djmSXMhojQJhTuNxTHtZAf5fKcWIWwkVbNZ5MNKYjQh4rKufqW3o1iHphB8dfAGsDEPv0RQMtVbu6H4+clCouLkFlxHOIrrOJ5SXQ8cIATPhnJR7y4cSDdRaN0DRLRjeLAIKlbOGBtNuFC+BftocaTY5qN42aKAMqQcT30ycfiLuRVJNiQJ5pkto=


================================================
FILE: CODE_OF_CONDUCT.md
================================================
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

- The use of sexualized language or imagery and unwelcome sexual attention or
  advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic
  address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a
  professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at our discord via a private message to any of the owners. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the Contributor Covenant homepage, version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

homepage: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq


================================================
FILE: Cargo.toml
================================================
[package]
name = "rustscan"
version = "2.4.1"
authors = ["Autumn <autumn@skerritt.blog>"]
edition = "2018"
description = "Faster Nmap Scanning with Rust"
homepage = "https://github.com/rustscan/rustscan"
repository = "https://github.com/rustscan/rustscan"
license = "GPL-3.0-only"
keywords = ["port", "scanning", "nmap"]
categories = ["command-line-utilities"]
readme = "README.md"
exclude = [
    ".github/*",
    "pictures/*",
    "rustscan-debbuilder/*",
]

[dependencies]
clap = { version = "4.6.0", features = ["derive", "wrap_help"] }
colored = "3.1.1"
async-std = "1.13.2"
futures = "0.3"
rlimit = "0.11.0"
log = "0.4.29"
env_logger = "0.11.9"
anstream = "=1.0.0"
dirs = "6.0.0"
gcd = "2.0.1"
rand = "0.10.0"
colorful = "0.3.2"
ansi_term = "0.12.1"
toml = "1.0.6"
serde = "1.0.124"
serde_derive = "1.0.116"
cidr-utils = "0.6.2"
itertools = "0.14.0"
hickory-resolver = { version = "0.24.3", features = ["dns-over-rustls"] }
anyhow = "1.0.40"
text_placeholder = { version = "0.5", features = ["struct_context"] }
once_cell = "1.21.4"

[dev-dependencies]
parameterized = "2.0.0"
wait-timeout = "0.2"
criterion = { version = "0.8", features = ["html_reports"] }

[package.metadata.deb]
depends = "$auto, nmap"
section = "rust"

[profile.release]
lto = true
panic = 'abort'
strip = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[[bin]]
name = "rustscan"
path = "src/main.rs"

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ["cfg(tarpaulin_include)"] }

[[bench]]
name = "benchmark_portscan"
harness = false


================================================
FILE: LICENSE
================================================
                    GNU GENERAL PUBLIC LICENSE
                       Version 3, 29 June 2007

 Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

                            Preamble

  The GNU General Public License is a free, copyleft license for
software and other kinds of works.

  The licenses for most software and other practical works are designed
to take away your freedom to share and change the works.  By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.  We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors.  You can apply it to
your programs, too.

  When we speak of free software, we are referring to freedom, not
price.  Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.

  To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights.  Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.

  For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received.  You must make sure that they, too, receive
or can get the source code.  And you must show them these terms so they
know their rights.

  Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.

  For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software.  For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.

  Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so.  This is fundamentally incompatible with the aim of
protecting users' freedom to change the software.  The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable.  Therefore, we
have designed this version of the GPL to prohibit the practice for those
products.  If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.

  Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary.  To prevent this, the GPL assures that
patents cannot be used to render the program non-free.

  The precise terms and conditions for copying, distribution and
modification follow.

                       TERMS AND CONDITIONS

  0. Definitions.

  "This License" refers to version 3 of the GNU General Public License.

  "Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.

  "The Program" refers to any copyrightable work licensed under this
License.  Each licensee is addressed as "you".  "Licensees" and
"recipients" may be individuals or organizations.

  To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy.  The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.

  A "covered work" means either the unmodified Program or a work based
on the Program.

  To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy.  Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.

  To "convey" a work means any kind of propagation that enables other
parties to make or receive copies.  Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.

  An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License.  If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.

  1. Source Code.

  The "source code" for a work means the preferred form of the work
for making modifications to it.  "Object code" means any non-source
form of a work.

  A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.

  The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form.  A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.

  The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities.  However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work.  For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.

  The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.

  The Corresponding Source for a work in source code form is that
same work.

  2. Basic Permissions.

  All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met.  This License explicitly affirms your unlimited
permission to run the unmodified Program.  The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work.  This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.

  You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force.  You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright.  Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.

  Conveying under any other circumstances is permitted solely under
the conditions stated below.  Sublicensing is not allowed; section 10
makes it unnecessary.

  3. Protecting Users' Legal Rights From Anti-Circumvention Law.

  No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.

  When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.

  4. Conveying Verbatim Copies.

  You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.

  You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.

  5. Conveying Modified Source Versions.

  You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:

    a) The work must carry prominent notices stating that you modified
    it, and giving a relevant date.

    b) The work must carry prominent notices stating that it is
    released under this License and any conditions added under section
    7.  This requirement modifies the requirement in section 4 to
    "keep intact all notices".

    c) You must license the entire work, as a whole, under this
    License to anyone who comes into possession of a copy.  This
    License will therefore apply, along with any applicable section 7
    additional terms, to the whole of the work, and all its parts,
    regardless of how they are packaged.  This License gives no
    permission to license the work in any other way, but it does not
    invalidate such permission if you have separately received it.

    d) If the work has interactive user interfaces, each must display
    Appropriate Legal Notices; however, if the Program has interactive
    interfaces that do not display Appropriate Legal Notices, your
    work need not make them do so.

  A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit.  Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.

  6. Conveying Non-Source Forms.

  You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:

    a) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by the
    Corresponding Source fixed on a durable physical medium
    customarily used for software interchange.

    b) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by a
    written offer, valid for at least three years and valid for as
    long as you offer spare parts or customer support for that product
    model, to give anyone who possesses the object code either (1) a
    copy of the Corresponding Source for all the software in the
    product that is covered by this License, on a durable physical
    medium customarily used for software interchange, for a price no
    more than your reasonable cost of physically performing this
    conveying of source, or (2) access to copy the
    Corresponding Source from a network server at no charge.

    c) Convey individual copies of the object code with a copy of the
    written offer to provide the Corresponding Source.  This
    alternative is allowed only occasionally and noncommercially, and
    only if you received the object code with such an offer, in accord
    with subsection 6b.

    d) Convey the object code by offering access from a designated
    place (gratis or for a charge), and offer equivalent access to the
    Corresponding Source in the same way through the same place at no
    further charge.  You need not require recipients to copy the
    Corresponding Source along with the object code.  If the place to
    copy the object code is a network server, the Corresponding Source
    may be on a different server (operated by you or a third party)
    that supports equivalent copying facilities, provided you maintain
    clear directions next to the object code saying where to find the
    Corresponding Source.  Regardless of what server hosts the
    Corresponding Source, you remain obligated to ensure that it is
    available for as long as needed to satisfy these requirements.

    e) Convey the object code using peer-to-peer transmission, provided
    you inform other peers where the object code and Corresponding
    Source of the work are being offered to the general public at no
    charge under subsection 6d.

  A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.

  A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling.  In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage.  For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product.  A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.

  "Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source.  The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.

  If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information.  But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).

  The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed.  Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.

  Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.

  7. Additional Terms.

  "Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law.  If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.

  When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it.  (Additional permissions may be written to require their own
removal in certain cases when you modify the work.)  You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.

  Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:

    a) Disclaiming warranty or limiting liability differently from the
    terms of sections 15 and 16 of this License; or

    b) Requiring preservation of specified reasonable legal notices or
    author attributions in that material or in the Appropriate Legal
    Notices displayed by works containing it; or

    c) Prohibiting misrepresentation of the origin of that material, or
    requiring that modified versions of such material be marked in
    reasonable ways as different from the original version; or

    d) Limiting the use for publicity purposes of names of licensors or
    authors of the material; or

    e) Declining to grant rights under trademark law for use of some
    trade names, trademarks, or service marks; or

    f) Requiring indemnification of licensors and authors of that
    material by anyone who conveys the material (or modified versions of
    it) with contractual assumptions of liability to the recipient, for
    any liability that these contractual assumptions directly impose on
    those licensors and authors.

  All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10.  If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term.  If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.

  If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.

  Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.

  8. Termination.

  You may not propagate or modify a covered work except as expressly
provided under this License.  Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).

  However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.

  Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.

  Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License.  If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.

  9. Acceptance Not Required for Having Copies.

  You are not required to accept this License in order to receive or
run a copy of the Program.  Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance.  However,
nothing other than this License grants you permission to propagate or
modify any covered work.  These actions infringe copyright if you do
not accept this License.  Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.

  10. Automatic Licensing of Downstream Recipients.

  Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License.  You are not responsible
for enforcing compliance by third parties with this License.

  An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations.  If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.

  You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License.  For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.

  11. Patents.

  A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based.  The
work thus licensed is called the contributor's "contributor version".

  A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version.  For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.

  Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.

  In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement).  To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.

  If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients.  "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.

  If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.

  A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License.  You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.

  Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.

  12. No Surrender of Others' Freedom.

  If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License.  If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all.  For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.

  13. Use with the GNU Affero General Public License.

  Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work.  The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.

  14. Revised Versions of this License.

  The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time.  Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

  Each version is given a distinguishing version number.  If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation.  If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.

  If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.

  Later license versions may give you additional or different
permissions.  However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.

  15. Disclaimer of Warranty.

  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

  16. Limitation of Liability.

  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.

  17. Interpretation of Sections 15 and 16.

  If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.

                     END OF TERMS AND CONDITIONS

            How to Apply These Terms to Your New Programs

  If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.

  To do so, attach the following notices to the program.  It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) <year>  <name of author>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

  If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:

    <program>  Copyright (C) <year>  <name of author>
    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
    This is free software, and you are welcome to redistribute it
    under certain conditions; type `show c' for details.

The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License.  Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".

  You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.

  The GNU General Public License does not permit incorporating your program
into proprietary programs.  If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library.  If this is what you want to do, use the GNU Lesser General
Public License instead of this License.  But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.


================================================
FILE: Makefile
================================================
install:
	cargo install cross

build:
	make build-linux
	make build-mac

	make shasum

build-linux:
	@echo 'Building for Linux... 🐧'
	cross build --release --target=x86_64-unknown-linux-musl
	mkdir -p target/release-archives && tar -C target/x86_64-unknown-linux-musl/release -czf target/release-archives/rustscan-linux.tar.gz rustscan

build-mac:
	@echo 'Building for MacOS... 🍏'
	cross build --release --target=x86_64-apple-darwin
	mkdir -p target/release-archives && tar -C target/x86_64-apple-darwin/release -czf target/release-archives/rustscan-mac.tar.gz rustscan

shasum:
	shasum -a 256 target/release-archives/rustscan-*.tar.gz


================================================
FILE: README.md
================================================
<div align="center" markdown="1">

➡️ [Discord][discord] | [Installation Guide][toc-install] | [Usage Guide][usage-guide] ⬅️

<img src="pictures/rustscan.png" height=400px width=400px>

<!--<u>**The Modern Port Scanner.**</u>-->
**Fast, smart, effective.**

![Arch Linux package][badge-1] ![Built with Rust][badge-2] ![GitHub All Releases][badge-3] ![Crates.io][badge-4] ![Discord][badge-5] ![Actions][badge-6]

</div>

# 🤔 What is this?

![fast][speed-1]

The Modern Port Scanner. **Find ports quickly (3 seconds at its fastest)**. Run scripts through our scripting engine (Python, Lua, Shell supported).

# 🛠️ Installation

You can install RustScan's binary from our [releases page](https://github.com/RustScan/RustScan/releases).

We would prefer you to install with a package manager so it is tested and works for your system.

RustScan is in many repositories already. Install it with whatever tools you wish:

[![Packaging status](https://repology.org/badge/vertical-allrepos/rustscan.svg)](https://repology.org/project/rustscan/versions)

RustScan only officially supports Cargo installations, if you want to use that please install Rust and then `cargo install rustscan`

Example installations include:

MacOS:

```
  brew install rustscan
```

Arch:

```
  pacman -S rustscan
```

# ✨ Features

- Scans all 65k ports in **3 seconds**.
- Full scripting engine support. Automatically pipe results into Nmap, or use our scripts (or write your own) to do whatever you want.
- Adaptive learning. RustScan improves the more you use it. No bloated machine learning here, just basic maths.
- The usuals you would expect. IPv6, CIDR, file input and more.
- Automatically pipes ports into Nmap.

## ‼️ Important Links

|         <!--Installation Guide-->          |          <!--Documentation-->          |       <!--Discord-->        |
| :----------------------------------------: | :------------------------------------: | :-------------------------: |
| :book: [Installation Guide][toc-install] | :books: [Documentation][links-table-2] | :parrot: [Discord][discord] |

## 🙋 Table of Contents

- 📖 [Installation Guide][toc-install]
- 🐋 [Docker Usage][toc-docker-usage]
- 🦜 [Discord][discord]
- 🤸 [Usage][usage-1]

# 🔭 Why RustScan?

RustScan is a modern take on the port scanner. Sleek & fast. All while providing extensive extendability to you.

Not to mention RustScan uses Adaptive Learning to improve itself over time, making it the best port scanner for **you**.

## 🧋 Speed

![fast][speed-1]

Speed is guaranteed via RustScan. However, if you want to run a slow scan due to stealth, that is possible too.

Firstly, let's talk code.

We have tests that check to see if RustScan is significantly slower than the previous version. If it is, the continuous integration fails, and we can't commit code to master unless we make it faster.

[HyperFine][speed-2] is used to monitor RustScan's performance over time to answer the question, "Are we getting faster? Are we getting slower?".

Every pull request is reviewed by **one** person, but more often than not, **two** people review it. We test it manually and ensure the code doesn't negatively affect performance.

[Read more here][speed-3].

## ⚙️ Extensible

![scripts][extensible-1]

### _RustScan piping results into the custom Python script_

RustScan has a new scripting engine that allows anyone to write scripts in most languages. Python, Lua, and Shell are all supported.

Want to take your found ports and pipe them into Nmap for further analysis? That's possible. Want to run `smb-enum` if SMB is found open? Possible.

The possibilities are endless -- and you can write scripts in whatever language you feel comfortable with.

[Read more here][extensible-2].

## 🌊 Adaptive

![adaptive][adaptive-1]

### _RustScan automatically fine-tunes itself to match the host OS_

RustScan has a cool set of features called "Adaptive Learning". These features "learn" about the environment you are scanning and how _you_ use RustScan to **improve itself over time**.

We use this umbrella term for any feature that fits this criterion. The list constantly changes, so [check out our wiki for more information][adaptive-learning].

## 👩‍🦯 Accessible

![fast][accessible-1]

RustScan is one of the first penetration testing tools that aims to be entirely accessible.

[Most penetration testing tools are not accessible][accessible-2], which negatively affects the whole industry.

RustScan has continuous integration testing that aims to ensure it is accessible, and we are constantly working on ways to improve our accessibility and ensure _everyone_ can use RustScan.

# 🤸 Usage

We have 2 usage guides. [Basic Usage][usage-1] and [Things you may want to do][usage-2].

We also have documentation about our config file [here][config-file-here].

# 🎪 Community

[Contributing][community-1] Read this to learn how.

## Contributors ✨

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->

[![All Contributors](https://img.shields.io/badge/all_contributors-26-orange.svg?style=flat-square)](#contributors-)

<!-- ALL-CONTRIBUTORS-BADGE:END -->

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
  <tr>
    <td align="center"><a href="https://skerritt.blog"><img src="https://avatars3.githubusercontent.com/u/10378052?v=4" width="100px;" alt=""/><br /><sub><b>Bee</b></sub></a><br /><a href="#infra-beeskerritt" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="https://github.com/RustScan/RustScan/commits?author=beeskerritt" title="Tests">⚠️</a> <a href="https://github.com/RustScan/RustScan/commits?author=beesan" title="Code">💻</a> <a href="#design-beeskerritt" title="Design">🎨</a></td>
    <td align="center"><a href="https://sakiir.ovh"><img src="https://avatars1.githubusercontent.com/u/9950578?v=4" width="100px;" alt=""/><br /><sub><b>SakiiR</b></sub></a><br /><a href="https://github.com/RustScan/RustScan/commits?author=SakiiR" title="Code">💻</a> <a href="https://github.com/RustScan/RustScan/issues?q=author%3ASakiiR" title="Bug reports">🐛</a></td>
    <td align="center"><a href="https://github.com/smackhack"><img src="https://avatars2.githubusercontent.com/u/48143394?v=4" width="100px;" alt=""/><br /><sub><b>smackhack</b></sub></a><br /><a href="#ideas-smackhack" title="Ideas, Planning, & Feedback">🤔</a> <a href="#example-smackhack" title="Examples">💡</a></td>
    <td align="center"><a href="http://bernardoamc.github.io/"><img src="https://avatars0.githubusercontent.com/u/428984?v=4" width="100px;" alt=""/><br /><sub><b>Bernardo Araujo</b></sub></a><br /><a href="https://github.com/RustScan/RustScan/commits?author=bernardoamc" title="Code">💻</a> <a href="https://github.com/RustScan/RustScan/issues?q=author%3Abernardoamc" title="Bug reports">🐛</a> <a href="#design-bernardoamc" title="Design">🎨</a></td>
    <td align="center"><a href="https://github.com/Isona"><img src="https://avatars2.githubusercontent.com/u/11759523?v=4" width="100px;" alt=""/><br /><sub><b>Izzy Whistlecroft</b></sub></a><br /><a href="https://github.com/RustScan/RustScan/issues?q=author%3AIsona" title="Bug reports">🐛</a></td>
    <td align="center"><a href="https://imlonghao.com"><img src="https://avatars1.githubusercontent.com/u/4951333?v=4" width="100px;" alt=""/><br /><sub><b>imlonghao</b></sub></a><br /><a href="https://github.com/RustScan/RustScan/issues?q=author%3Aimlonghao" title="Bug reports">🐛</a> <a href="#maintenance-imlonghao" title="Maintenance">🚧</a></td>
    <td align="center"><a href="https://github.com/royharoush"><img src="https://avatars3.githubusercontent.com/u/8113056?v=4" width="100px;" alt=""/><br /><sub><b>royharoush</b></sub></a><br /><a href="#ideas-royharoush" title="Ideas, Planning, & Feedback">🤔</a> <a href="#design-royharoush" title="Design">🎨</a></td>
  </tr>
  <tr>
    <td align="center"><a href="https://github.com/Atul9"><img src="https://avatars1.githubusercontent.com/u/3390330?v=4" width="100px;" alt=""/><br /><sub><b>Atul Bhosale</b></sub></a><br /><a href="https://github.com/RustScan/RustScan/commits?author=Atul9" title="Code">💻</a></td>
    <td align="center"><a href="https://tgotwig.dev"><img src="https://avatars0.githubusercontent.com/u/30773779?v=4" width="100px;" alt=""/><br /><sub><b>Thomas Gotwig</b></sub></a><br /><a href="#platform-TGotwig" title="Packaging/porting to new platform">📦</a></td>
    <td align="center"><a href="https://github.com/remigourdon"><img src="https://avatars3.githubusercontent.com/u/2874133?v=4" width="100px;" alt=""/><br /><sub><b>Rémi Gourdon</b></sub></a><br /><a href="https://github.com/RustScan/RustScan/commits?author=remigourdon" title="Documentation">📖</a> <a href="https://github.com/RustScan/RustScan/commits?author=remigourdon" title="Code">💻</a></td>
    <td align="center"><a href="https://cmnatic.co.uk"><img src="https://avatars3.githubusercontent.com/u/4163116?v=4" width="100px;" alt=""/><br /><sub><b>Ben (CMNatic)</b></sub></a><br /><a href="https://github.com/RustScan/RustScan/commits?author=cmnatic" title="Code">💻</a> <a href="https://github.com/RustScan/RustScan/commits?author=cmnatic" title="Documentation">📖</a> <a href="#design-cmnatic" title="Design">🎨</a></td>
    <td align="center"><a href="https://github.com/Ferryistaken"><img src="https://avatars3.githubusercontent.com/u/47927670?v=4" width="100px;" alt=""/><br /><sub><b>Alessandro Ferrari</b></sub></a><br /><a href="#content-Ferryistaken" title="Content">🖋</a></td>
    <td align="center"><a href="https://github.com/Phenomite"><img src="https://avatars2.githubusercontent.com/u/8285537?v=4" width="100px;" alt=""/><br /><sub><b>Phenomite</b></sub></a><br /><a href="#content-Phenomite" title="Content">🖋</a></td>
    <td align="center"><a href="https://supersandro.de/"><img src="https://avatars2.githubusercontent.com/u/7258858?v=4" width="100px;" alt=""/><br /><sub><b>Sandro</b></sub></a><br /><a href="#content-SuperSandro2000" title="Content">🖋</a> <a href="https://github.com/RustScan/RustScan/issues?q=author%3ASuperSandro2000" title="Bug reports">🐛</a> <a href="https://github.com/RustScan/RustScan/commits?author=SuperSandro2000" title="Code">💻</a></td>
  </tr>
  <tr>
    <td align="center"><a href="https://swag.lgbt"><img src="https://avatars2.githubusercontent.com/u/25358963?v=4" width="100px;" alt=""/><br /><sub><b>Cass</b></sub></a><br /><a href="#platform-caass" title="Packaging/porting to new platform">📦</a> <a href="https://github.com/RustScan/RustScan/commits?author=caass" title="Code">💻</a> <a href="https://github.com/RustScan/RustScan/issues?q=author%3Acaass" title="Bug reports">🐛</a></td>
    <td align="center"><a href="https://github.com/niklasmohrin"><img src="https://avatars0.githubusercontent.com/u/47574893?v=4" width="100px;" alt=""/><br /><sub><b>Niklas Mohrin</b></sub></a><br /><a href="https://github.com/RustScan/RustScan/commits?author=niklasmohrin" title="Documentation">📖</a> <a href="https://github.com/RustScan/RustScan/commits?author=niklasmohrin" title="Code">💻</a> <a href="https://github.com/RustScan/RustScan/issues?q=author%3Aniklasmohrin" title="Bug reports">🐛</a></td>
    <td align="center"><a href="https://liberapay.com/Artem4/"><img src="https://avatars0.githubusercontent.com/u/5614476?v=4" width="100px;" alt=""/><br /><sub><b>Artem Polishchuk</b></sub></a><br /><a href="#platform-tim77" title="Packaging/porting to new platform">📦</a></td>
    <td align="center"><a href="https://github.com/buermarc"><img src="https://avatars2.githubusercontent.com/u/44375277?v=4" width="100px;" alt=""/><br /><sub><b>buermarc</b></sub></a><br /><a href="https://github.com/RustScan/RustScan/commits?author=buermarc" title="Code">💻</a></td>
    <td align="center"><a href="https://github.com/bergabman"><img src="https://avatars1.githubusercontent.com/u/44554109?v=4" width="100px;" alt=""/><br /><sub><b>bergabman</b></sub></a><br /><a href="https://github.com/RustScan/RustScan/commits?author=bergabman" title="Code">💻</a> <a href="https://github.com/RustScan/RustScan/issues?q=author%3Abergabman" title="Bug reports">🐛</a> <a href="#design-bergabman" title="Design">🎨</a></td>
    <td align="center"><a href="https://github.com/dmitris"><img src="https://avatars0.githubusercontent.com/u/31205?v=4" width="100px;" alt=""/><br /><sub><b>Dmitry Savintsev</b></sub></a><br /><a href="https://github.com/RustScan/RustScan/commits?author=dmitris" title="Code">💻</a></td>
    <td align="center"><a href="https://github.com/bofh69"><img src="https://avatars3.githubusercontent.com/u/1444315?v=4" width="100px;" alt=""/><br /><sub><b>Sebastian Andersson</b></sub></a><br /><a href="https://github.com/RustScan/RustScan/commits?author=bofh69" title="Code">💻</a></td>
  </tr>
  <tr>
    <td align="center"><a href="https://github.com/mattcorbin"><img src="https://avatars3.githubusercontent.com/u/6537765?v=4" width="100px;" alt=""/><br /><sub><b>Matt Corbin</b></sub></a><br /><a href="https://github.com/RustScan/RustScan/commits?author=mattcorbin" title="Code">💻</a></td>
    <td align="center"><a href="http://rootsploit.com"><img src="https://avatars2.githubusercontent.com/u/67270834?v=4" width="100px;" alt=""/><br /><sub><b>RootSploit</b></sub></a><br /><a href="#blog-rootsploit" title="Blogposts">📝</a></td>
    <td align="center"><a href="https://github.com/eiffel-fl"><img src="https://avatars2.githubusercontent.com/u/12171754?v=4" width="100px;" alt=""/><br /><sub><b>eiffel-fl</b></sub></a><br /><a href="https://github.com/RustScan/RustScan/commits?author=eiffel-fl" title="Code">💻</a></td>
    <td align="center"><a href="https://github.com/u5surf"><img src="https://avatars1.githubusercontent.com/u/14180225?v=4" width="100px;" alt=""/><br /><sub><b>Y.Horie</b></sub></a><br /><a href="https://github.com/RustScan/RustScan/commits?author=u5surf" title="Code">💻</a></td>
    <td align="center"><a href="https://github.com/okrplay"><img src="https://avatars3.githubusercontent.com/u/32576280?v=4" width="100px;" alt=""/><br /><sub><b>Oskar</b></sub></a><br /><a href="https://github.com/RustScan/RustScan/commits?author=okrplay" title="Code">💻</a> <a href="https://github.com/RustScan/RustScan/commits?author=okrplay" title="Tests">⚠️</a></td>
  </tr>
</table>

<!-- markdownlint-enable -->
<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!

<!--Links-->

[Docker]: https://hub.docker.com/r/cmnatic/rustscan "This is the recommended distribution of rustscan"
[kali]: https://github.com/RustScan/RustScan/wiki/Installation-Guide#%EF%B8%8F-debian--kali "Read the install guide"
[Kali/Debian]: https://github.com/RustScan/RustScan/releases "Kali Debian"
[Arch-Linux]: https://archlinux.org/packages/extra/x86_64/rustscan/ "Arch Linux installation of Rustscan"
[Homebrew]: https://formulae.brew.sh/formula/rustscan "Homebrew install of Rustscan"
[usage-1]: https://github.com/RustScan/RustScan/wiki/Usage "Basic Usage of Rustscan"
[usage-0]: https://github.com/RustScan/RustScan/wiki/Installation-Guide#docker-whale "Use Docker Rustscan"
[config-file-here]: https://github.com/RustScan/RustScan/wiki/Config-File "RustScan Configuration File"
[usage-2]: https://github.com/RustScan/RustScan/wiki/Things-you-may-want-to-do-with-RustScan-but-don't-understand-how "Things you may want to do with rustscan but don't know how"
[community-1]: https://github.com/RustScan/RustScan/wiki/Contributing "Learn how to contribute"
[distributions-1]: https://software.opensuse.org/package/rustscan?search_term=rustscan "Open Suse rustscan distribution"
[distributions-2]: https://copr.fedorainfracloud.org/coprs/atim/rustscan/ "Rustscan in Fedora"
[repology-1]: https://repology.org/project/rustscan/versions "Packaging Status"
[install-1]: https://github.com/RustScan/RustScan/wiki/Installation-Guide "Installation guide"
[accessible-2]: https://bees.substack.com/p/making-hacking-accessible "Making Hacking Accessible"
[extensible-2]: https://github.com/RustScan/RustScan/wiki/RustScan-Scripting-Engine "Scripting Engine"
[speed-2]: https://github.com/sharkdp/hyperfine "Hyperfine"
[speed-3]: https://github.com/RustScan/RustScan/wiki/Increasing-Speed-&-Accuracy "Increasing Speed & Accuracy"
[toc-community]: https://github.com/RustScan/RustScan#-community "Community"
[links-table-1]: https://github.com/RustScan/RustScan#-full-installation-guide "Full installation guide"
[links-table-2]: https://github.com/bee-san/RustScan/wiki "Rustscan"
[discord]: http://discord.skerritt.blog "Discord blog"
[toc-install]: https://github.com/RustScan/RustScan/wiki/Installation-Guide "Installation Guide Wiki"
[toc-docker-usage]: https://github.com/RustScan/RustScan/wiki/Installation-Guide#docker- "Docker Installation Guide Wiki"
[usage-guide]: https://github.com/RustScan/RustScan#-usage
[adaptive-learning]: https://github.com/RustScan/RustScan/wiki/Adaptive-Learning "Adaptive Learning"

<!--Pictures-->

[DockerPic]: https://github.com/RustScan/RustScan/blob/master/pictures/docker.png?raw=true "Docker install"
[Kali1]: https://github.com/RustScan/RustScan/blob/master/pictures/kali.png?raw=true "Kali Picture"
[Arch]: https://github.com/RustScan/RustScan/blob/master/pictures/arch.png?raw=true "Arch Linux"
[Apple]: https://raw.githubusercontent.com/RustScan/RustScan/master/pictures/apple.png?size "Apple"
[rustscan-svg]: https://repology.org/badge/vertical-allrepos/rustscan.svg "Picture of rustscan repology"
[accessible-1]: pictures/accessible.gif "Fast"
[adaptive-1]: pictures/adaptive.gif "Adaptive"
[extensible-1]: pictures/scripts.gif "Scripts"
[speed-1]: pictures/fast.gif "Speed"
[badge-1]: https://img.shields.io/archlinux/v/extra/x86_64/rustscan?style=plastic&logo=archlinux&link=https%3A%2F%2Farchlinux.org%2Fpackages%2Fextra%2Fx86_64%2Frustscan%2F
[badge-2]: https://img.shields.io/badge/Built%20with-Rust-Purple
[badge-3]: https://img.shields.io/github/downloads/rustscan/rustscan/total?label=GitHub%20Downloads
[badge-4]: https://img.shields.io/crates/d/rustscan?label=Cargo%20Downloads
[badge-5]: https://img.shields.io/discord/754001738184392704
[badge-6]: https://github.com/RustScan/RustScan/actions/workflows/build.yml/badge.svg?branch=master


================================================
FILE: benches/benchmark_portscan.rs
================================================
use async_std::task::block_on;
use criterion::{criterion_group, criterion_main, Criterion};
use rustscan::input::{Opts, PortRange, ScanOrder};
use rustscan::port_strategy::PortStrategy;
use rustscan::scanner::Scanner;
use std::hint::black_box;
use std::net::IpAddr;
use std::time::Duration;

fn portscan_tcp(scanner: &Scanner) {
    let _scan_result = block_on(scanner.run());
}

fn portscan_udp(scanner: &Scanner) {
    let _scan_result = block_on(scanner.run());
}

fn bench_address() {
    let _addrs = ["127.0.0.1".parse::<IpAddr>().unwrap()];
}

fn bench_port_strategy() {
    let range = PortRange {
        start: 1,
        end: 1_000,
    };
    let _strategy = PortStrategy::pick(&Some(range.clone()), None, ScanOrder::Serial);
}

fn bench_address_parsing() {
    let opts = Opts {
        addresses: vec![
            "127.0.0.1".to_owned(),
            "10.2.0.1".to_owned(),
            "192.168.0.0/24".to_owned(),
        ],
        exclude_addresses: Some(vec![
            "10.0.0.0/8".to_owned(),
            "172.16.0.0/12".to_owned(),
            "192.168.0.0/16".to_owned(),
            "172.16.0.1".to_owned(),
        ]),
        ..Default::default()
    };
    let _ips = rustscan::address::parse_addresses(&opts);
}

fn criterion_benchmark(c: &mut Criterion) {
    let addrs = vec!["127.0.0.1".parse::<IpAddr>().unwrap()];
    let range = PortRange {
        start: 1,
        end: 1_000,
    };
    let strategy_tcp = PortStrategy::pick(&Some(range.clone()), None, ScanOrder::Serial);
    let strategy_udp = PortStrategy::pick(&Some(range.clone()), None, ScanOrder::Serial);

    let scanner_tcp = Scanner::new(
        &addrs,
        10,
        Duration::from_millis(10),
        1,
        false,
        strategy_tcp,
        true,
        vec![],
        false,
    );

    c.bench_function("portscan tcp", |b| {
        b.iter(|| portscan_tcp(black_box(&scanner_tcp)))
    });

    let scanner_udp = Scanner::new(
        &addrs,
        10,
        Duration::from_millis(10),
        1,
        false,
        strategy_udp,
        true,
        vec![],
        true,
    );

    let mut udp_group = c.benchmark_group("portscan udp");
    udp_group.measurement_time(Duration::from_secs(20));
    udp_group.bench_function("portscan udp", |b| {
        b.iter(|| portscan_udp(black_box(&scanner_udp)))
    });
    udp_group.finish();

    // Benching helper functions
    c.bench_function("parse address", |b| b.iter(bench_address));

    c.bench_function("port strategy", |b| b.iter(bench_port_strategy));

    let mut address_group = c.benchmark_group("address parsing");
    address_group.measurement_time(Duration::from_secs(10));
    address_group.bench_function("parse addresses with exclusions", |b| {
        b.iter(bench_address_parsing)
    });
    address_group.finish();
}

criterion_group!(benches, criterion_benchmark);
criterion_main!(benches);


================================================
FILE: build.rs
================================================
use std::collections::BTreeMap;
use std::fs::{self, File};

use std::env;
use std::io::{BufReader, Read};
use std::path::PathBuf;
use std::process::Command;

// Reads in a file with payloads based on port
pub fn main() {
    let mut file_path = env::current_dir().expect("cant find curr dir");
    file_path.push("./nmap-payloads");

    let mut data = String::new();
    let file = File::open(&file_path).expect("File not found.");
    let mut file_buf = BufReader::new(file);
    file_buf
        .read_to_string(&mut data)
        .expect("unable to read file");

    let mut fp_map: BTreeMap<i32, String> = BTreeMap::new();

    let mut count = 0;
    let mut capturing = false;
    let mut curr = String::new();

    for line in data.trim().split('\n') {
        if line.contains('#') || line.is_empty() {
            continue;
        }

        if line.starts_with("udp") {
            if !curr.is_empty() {
                fp_map.insert(count, curr);
                curr = String::new();
            }
            capturing = true;
            count += 1;
        }

        if capturing {
            if !curr.is_empty() {
                curr.push(' ');
            }
            curr.push_str(line);
        }
    }

    let pb_linenr = ports_v(&fp_map);
    let payb_linenr = payloads_v(&fp_map);
    let map = port_payload_map(pb_linenr, payb_linenr);

    generate_code(map);
}

/// Generates a file called Generated.rs and calls cargo fmt from the command line
///
/// # Arguments
///
/// * `port_payload_map` - A BTreeMap mapping port numbers to payload data
fn generate_code(port_payload_map: BTreeMap<Vec<u16>, Vec<u8>>) {
    let dest_path = PathBuf::from("src/generated.rs");

    let mut generated_code = String::new();
    generated_code.push_str("use std::collections::BTreeMap;\n");
    generated_code.push_str("use once_cell::sync::Lazy;\n\n");

    generated_code.push_str("fn generated_data() -> BTreeMap<Vec<u16>, Vec<u8>> {\n");
    generated_code.push_str("    let mut map = BTreeMap::new();\n");

    for (ports, payloads) in port_payload_map {
        generated_code.push_str("    map.insert(vec![");
        generated_code.push_str(
            &ports
                .iter()
                .map(|&p| p.to_string())
                .collect::<Vec<_>>()
                .join(","),
        );
        generated_code.push_str("], vec![");
        generated_code.push_str(
            &payloads
                .iter()
                .map(|&p| p.to_string())
                .collect::<Vec<_>>()
                .join(","),
        );
        generated_code.push_str("]);\n");
    }

    generated_code.push_str("    map\n");
    generated_code.push_str("}\n\n");

    generated_code.push_str(
        "static PARSED_DATA: Lazy<BTreeMap<Vec<u16>, Vec<u8>>> = Lazy::new(generated_data);\n",
    );
    generated_code.push_str("pub fn get_parsed_data() -> &'static BTreeMap<Vec<u16>, Vec<u8>> {\n");
    generated_code.push_str("    &PARSED_DATA\n");
    generated_code.push_str("}\n");

    fs::write(dest_path, generated_code).unwrap();

    // format the generated code
    Command::new("cargo")
        .arg("fmt")
        .arg("--all")
        .output()
        .expect("Failed to execute cargo fmt");
}

/// Creates a BTreeMap of line numbers mapped to a Vec<u16> of ports
///
/// # Arguments
///
/// * `fp_map` - A BTreeMap containing the parsed file data
///
/// # Returns
///
/// A BTreeMap where keys are line numbers and values are vectors of ports
fn ports_v(fp_map: &BTreeMap<i32, String>) -> BTreeMap<i32, Vec<u16>> {
    let mut pb_linenr: BTreeMap<i32, Vec<u16>> = BTreeMap::new();
    let mut port_list: Vec<u16> = Vec::new();

    for (&line_nr, ports) in fp_map {
        if ports.contains("udp ") {
            let remain = &ports[4..];
            let mut start = remain.split(' ');

            let ports = start.next().unwrap();
            let port_segments: Vec<&str> = ports.split(',').collect();

            for segment in port_segments {
                if segment.contains('-') {
                    let range: Vec<&str> = segment.trim().split('-').collect();
                    let start = range[0].parse::<u16>().unwrap();
                    let end = range[1].parse::<u16>().unwrap();

                    for port in start..end {
                        port_list.push(port);
                    }
                } else if !segment.is_empty() {
                    match segment.parse::<u16>() {
                        Ok(port) => port_list.push(port),
                        Err(_) => println!("Error parsing port: {segment}"),
                    }
                }
            }
        }

        pb_linenr.insert(line_nr, port_list.clone());
        port_list.clear();
    }

    pb_linenr
}

/// Parses out the Payloads into a BTreeMap of line numbers mapped to vectors of payload bytes
///
/// # Arguments
///
/// * `fp_map` - A BTreeMap containing the parsed file data
///
/// # Returns
///
/// A BTreeMap where keys are line numbers and values are vectors of payload bytes
fn payloads_v(fp_map: &BTreeMap<i32, String>) -> BTreeMap<i32, Vec<u8>> {
    let mut payb_linenr: BTreeMap<i32, Vec<u8>> = BTreeMap::new();

    for (&line_nr, data) in fp_map {
        if data.contains('\"') {
            let start = data.find('\"').expect("payload opening \" not found");
            let payloads = &data[start + 1..];
            payb_linenr.insert(line_nr, parser(payloads.trim()));
        }
    }

    payb_linenr
}

/// Converts a hexadecimal string to a Vec<u8>
///
/// # Arguments
///
/// * `payload` - A string slice containing the hexadecimal payload
///
/// # Returns
///
/// A vector of bytes representing the decoded payload
fn parser(payload: &str) -> Vec<u8> {
    let payload = payload.trim_matches('"');
    let mut tmp_str = String::new();
    let mut bytes: Vec<u8> = Vec::new();

    for (idx, char) in payload.chars().enumerate() {
        if char == '\\' && payload.chars().nth(idx + 1) == Some('x') {
            continue;
        } else if char.is_ascii_hexdigit() {
            tmp_str.push(char);
            if tmp_str.len() == 2 {
                bytes.push(u8::from_str_radix(&tmp_str, 16).unwrap());
                tmp_str.clear();
            }
        }
    }

    bytes
}

/// Combines the ports BTreeMap and the Payloads BTreeMap
///
/// # Arguments
///
/// * `pb_linenr` - A BTreeMap mapping line numbers to vectors of ports
/// * `payb_linenr` - A BTreeMap mapping line numbers to vectors of payload bytes
///
/// # Returns
///
/// A BTreeMap mapping vectors of ports to vectors of payload bytes
fn port_payload_map(
    pb_linenr: BTreeMap<i32, Vec<u16>>,
    payb_linenr: BTreeMap<i32, Vec<u8>>,
) -> BTreeMap<Vec<u16>, Vec<u8>> {
    let mut ppm_fin: BTreeMap<Vec<u16>, Vec<u8>> = BTreeMap::new();

    for (port_linenr, ports) in pb_linenr {
        for (pay_linenr, payloads) in &payb_linenr {
            if pay_linenr == &port_linenr {
                ppm_fin.insert(ports.to_vec(), payloads.to_vec());
            }
        }
    }

    ppm_fin
}


================================================
FILE: config.toml
================================================
ip="127.0.0.1"

# The hashmap of {ports: {1:1}}
[ports]
1 = 1
3 = 1
4 = 1
6 = 1
7 = 1
9 = 1
13 = 1
17 = 1
19 = 1
20 = 1
21 = 1
22 = 1
23 = 1
24 = 1
25 = 1
26 = 1
30 = 1
32 = 1
33 = 1
37 = 1
42 = 1
43 = 1
49 = 1
53 = 1
70 = 1
79 = 1
80 = 1
81 = 1
82 = 1
83 = 1
84 = 1
85 = 1
88 = 1
89 = 1
90 = 1
99 = 1
100 = 1
106 = 1
109 = 1
110 = 1
111 = 1
113 = 1
119 = 1
125 = 1
135 = 1
139 = 1
143 = 1
144 = 1
146 = 1
161 = 1
163 = 1
179 = 1
199 = 1
211 = 1
212 = 1
222 = 1
254 = 1
255 = 1
256 = 1
259 = 1
264 = 1
280 = 1
301 = 1
306 = 1
311 = 1
340 = 1
366 = 1
389 = 1
406 = 1
407 = 1
416 = 1
417 = 1
425 = 1
427 = 1
443 = 1
444 = 1
445 = 1
458 = 1
464 = 1
465 = 1
481 = 1
497 = 1
500 = 1
512 = 1
513 = 1
514 = 1
515 = 1
524 = 1
541 = 1
543 = 1
544 = 1
545 = 1
548 = 1
554 = 1
555 = 1
563 = 1
587 = 1
593 = 1
616 = 1
617 = 1
625 = 1
631 = 1
636 = 1
646 = 1
648 = 1
666 = 1
667 = 1
668 = 1
683 = 1
687 = 1
691 = 1
700 = 1
705 = 1
711 = 1
714 = 1
720 = 1
722 = 1
726 = 1
749 = 1
765 = 1
777 = 1
783 = 1
787 = 1
800 = 1
801 = 1
808 = 1
843 = 1
873 = 1
880 = 1
888 = 1
898 = 1
900 = 1
901 = 1
902 = 1
903 = 1
911 = 1
912 = 1
981 = 1
987 = 1
990 = 1
992 = 1
993 = 1
995 = 1
999 = 1
1000 = 1
1001 = 1
1002 = 1
1007 = 1
1009 = 1
1010 = 1
1011 = 1
1021 = 1
1022 = 1
1023 = 1
1024 = 1
1025 = 1
1026 = 1
1027 = 1
1028 = 1
1029 = 1
1030 = 1
1031 = 1
1032 = 1
1033 = 1
1034 = 1
1035 = 1
1036 = 1
1037 = 1
1038 = 1
1039 = 1
1040 = 1
1041 = 1
1042 = 1
1043 = 1
1044 = 1
1045 = 1
1046 = 1
1047 = 1
1048 = 1
1049 = 1
1050 = 1
1051 = 1
1052 = 1
1053 = 1
1054 = 1
1055 = 1
1056 = 1
1057 = 1
1058 = 1
1059 = 1
1060 = 1
1061 = 1
1062 = 1
1063 = 1
1064 = 1
1065 = 1
1066 = 1
1067 = 1
1068 = 1
1069 = 1
1070 = 1
1071 = 1
1072 = 1
1073 = 1
1074 = 1
1075 = 1
1076 = 1
1077 = 1
1078 = 1
1079 = 1
1080 = 1
1081 = 1
1082 = 1
1083 = 1
1084 = 1
1085 = 1
1086 = 1
1087 = 1
1088 = 1
1089 = 1
1090 = 1
1091 = 1
1092 = 1
1093 = 1
1094 = 1
1095 = 1
1096 = 1
1097 = 1
1098 = 1
1099 = 1
1100 = 1
1102 = 1
1104 = 1
1105 = 1
1106 = 1
1107 = 1
1108 = 1
1110 = 1
1111 = 1
1112 = 1
1113 = 1
1114 = 1
1117 = 1
1119 = 1
1121 = 1
1122 = 1
1123 = 1
1124 = 1
1126 = 1
1130 = 1
1131 = 1
1132 = 1
1137 = 1
1138 = 1
1141 = 1
1145 = 1
1147 = 1
1148 = 1
1149 = 1
1151 = 1
1152 = 1
1154 = 1
1163 = 1
1164 = 1
1165 = 1
1166 = 1
1169 = 1
1174 = 1
1175 = 1
1183 = 1
1185 = 1
1186 = 1
1187 = 1
1192 = 1
1198 = 1
1199 = 1
1201 = 1
1213 = 1
1216 = 1
1217 = 1
1218 = 1
1233 = 1
1234 = 1
1236 = 1
1244 = 1
1247 = 1
1248 = 1
1259 = 1
1271 = 1
1272 = 1
1277 = 1
1287 = 1
1296 = 1
1300 = 1
1301 = 1
1309 = 1
1310 = 1
1311 = 1
1322 = 1
1328 = 1
1334 = 1
1352 = 1
1417 = 1
1433 = 1
1434 = 1
1443 = 1
1455 = 1
1461 = 1
1494 = 1
1500 = 1
1501 = 1
1503 = 1
1521 = 1
1524 = 1
1533 = 1
1556 = 1
1580 = 1
1583 = 1
1594 = 1
1600 = 1
1641 = 1
1658 = 1
1666 = 1
1687 = 1
1688 = 1
1700 = 1
1717 = 1
1718 = 1
1719 = 1
1720 = 1
1721 = 1
1723 = 1
1755 = 1
1761 = 1
1782 = 1
1783 = 1
1801 = 1
1805 = 1
1812 = 1
1839 = 1
1840 = 1
1862 = 1
1863 = 1
1864 = 1
1875 = 1
1900 = 1
1914 = 1
1935 = 1
1947 = 1
1971 = 1
1972 = 1
1974 = 1
1984 = 1
1998 = 1
1999 = 1
2000 = 1
2001 = 1
2002 = 1
2003 = 1
2004 = 1
2005 = 1
2006 = 1
2007 = 1
2008 = 1
2009 = 1
2010 = 1
2013 = 1
2020 = 1
2021 = 1
2022 = 1
2030 = 1
2033 = 1
2034 = 1
2035 = 1
2038 = 1
2040 = 1
2041 = 1
2042 = 1
2043 = 1
2045 = 1
2046 = 1
2047 = 1
2048 = 1
2049 = 1
2065 = 1
2068 = 1
2099 = 1
2100 = 1
2103 = 1
2105 = 1
2106 = 1
2107 = 1
2111 = 1
2119 = 1
2121 = 1
2126 = 1
2135 = 1
2144 = 1
2160 = 1
2161 = 1
2170 = 1
2179 = 1
2190 = 1
2191 = 1
2196 = 1
2200 = 1
2222 = 1
2251 = 1
2260 = 1
2288 = 1
2301 = 1
2323 = 1
2366 = 1
2381 = 1
2382 = 1
2383 = 1
2393 = 1
2394 = 1
2399 = 1
2401 = 1
2492 = 1
2500 = 1
2522 = 1
2525 = 1
2557 = 1
2601 = 1
2602 = 1
2604 = 1
2605 = 1
2607 = 1
2608 = 1
2638 = 1
2701 = 1
2702 = 1
2710 = 1
2717 = 1
2718 = 1
2725 = 1
2800 = 1
2809 = 1
2811 = 1
2869 = 1
2875 = 1
2909 = 1
2910 = 1
2920 = 1
2967 = 1
2968 = 1
2998 = 1
3000 = 1
3001 = 1
3003 = 1
3005 = 1
3006 = 1
3007 = 1
3011 = 1
3013 = 1
3017 = 1
3030 = 1
3031 = 1
3052 = 1
3071 = 1
3077 = 1
3128 = 1
3168 = 1
3211 = 1
3221 = 1
3260 = 1
3261 = 1
3268 = 1
3269 = 1
3283 = 1
3300 = 1
3301 = 1
3306 = 1
3322 = 1
3323 = 1
3324 = 1
3325 = 1
3333 = 1
3351 = 1
3367 = 1
3369 = 1
3370 = 1
3371 = 1
3372 = 1
3389 = 1
3390 = 1
3404 = 1
3476 = 1
3493 = 1
3517 = 1
3527 = 1
3546 = 1
3551 = 1
3580 = 1
3659 = 1
3689 = 1
3690 = 1
3703 = 1
3737 = 1
3766 = 1
3784 = 1
3800 = 1
3801 = 1
3809 = 1
3814 = 1
3826 = 1
3827 = 1
3828 = 1
3851 = 1
3869 = 1
3871 = 1
3878 = 1
3880 = 1
3889 = 1
3905 = 1
3914 = 1
3918 = 1
3920 = 1
3945 = 1
3971 = 1
3986 = 1
3995 = 1
3998 = 1
4000 = 1
4001 = 1
4002 = 1
4003 = 1
4004 = 1
4005 = 1
4006 = 1
4045 = 1
4111 = 1
4125 = 1
4126 = 1
4129 = 1
4224 = 1
4242 = 1
4279 = 1
4321 = 1
4343 = 1
4443 = 1
4444 = 1
4445 = 1
4446 = 1
4449 = 1
4550 = 1
4567 = 1
4662 = 1
4848 = 1
4899 = 1
4900 = 1
4998 = 1
5000 = 1
5001 = 1
5002 = 1
5003 = 1
5004 = 1
5009 = 1
5030 = 1
5033 = 1
5050 = 1
5051 = 1
5054 = 1
5060 = 1
5061 = 1
5080 = 1
5087 = 1
5100 = 1
5101 = 1
5102 = 1
5120 = 1
5190 = 1
5200 = 1
5214 = 1
5221 = 1
5222 = 1
5225 = 1
5226 = 1
5269 = 1
5280 = 1
5298 = 1
5357 = 1
5405 = 1
5414 = 1
5431 = 1
5432 = 1
5440 = 1
5500 = 1
5510 = 1
5544 = 1
5550 = 1
5555 = 1
5560 = 1
5566 = 1
5631 = 1
5633 = 1
5666 = 1
5678 = 1
5679 = 1
5718 = 1
5730 = 1
5800 = 1
5801 = 1
5802 = 1
5810 = 1
5811 = 1
5815 = 1
5822 = 1
5825 = 1
5850 = 1
5859 = 1
5862 = 1
5877 = 1
5900 = 1
5901 = 1
5902 = 1
5903 = 1
5904 = 1
5906 = 1
5907 = 1
5910 = 1
5911 = 1
5915 = 1
5922 = 1
5925 = 1
5950 = 1
5952 = 1
5959 = 1
5960 = 1
5961 = 1
5962 = 1
5963 = 1
5987 = 1
5988 = 1
5989 = 1
5998 = 1
5999 = 1
6000 = 1
6001 = 1
6002 = 1
6003 = 1
6004 = 1
6005 = 1
6006 = 1
6007 = 1
6009 = 1
6025 = 1
6059 = 1
6100 = 1
6101 = 1
6106 = 1
6112 = 1
6123 = 1
6129 = 1
6156 = 1
6346 = 1
6389 = 1
6502 = 1
6510 = 1
6543 = 1
6547 = 1
6565 = 1
6566 = 1
6567 = 1
6580 = 1
6646 = 1
6666 = 1
6667 = 1
6668 = 1
6669 = 1
6689 = 1
6692 = 1
6699 = 1
6779 = 1
6788 = 1
6789 = 1
6792 = 1
6839 = 1
6881 = 1
6901 = 1
6969 = 1
7000 = 1
7001 = 1
7002 = 1
7004 = 1
7007 = 1
7019 = 1
7025 = 1
7070 = 1
7100 = 1
7103 = 1
7106 = 1
7200 = 1
7201 = 1
7402 = 1
7435 = 1
7443 = 1
7496 = 1
7512 = 1
7625 = 1
7627 = 1
7676 = 1
7741 = 1
7777 = 1
7778 = 1
7800 = 1
7911 = 1
7920 = 1
7921 = 1
7937 = 1
7938 = 1
7999 = 1
8000 = 1
8001 = 1
8002 = 1
8007 = 1
8008 = 1
8009 = 1
8010 = 1
8011 = 1
8021 = 1
8022 = 1
8031 = 1
8042 = 1
8045 = 1
8080 = 1
8081 = 1
8082 = 1
8083 = 1
8084 = 1
8085 = 1
8086 = 1
8087 = 1
8088 = 1
8089 = 1
8090 = 1
8093 = 1
8099 = 1
8100 = 1
8180 = 1
8181 = 1
8192 = 1
8193 = 1
8194 = 1
8200 = 1
8222 = 1
8254 = 1
8290 = 1
8291 = 1
8292 = 1
8300 = 1
8333 = 1
8383 = 1
8400 = 1
8402 = 1
8443 = 1
8500 = 1
8600 = 1
8649 = 1
8651 = 1
8652 = 1
8654 = 1
8701 = 1
8800 = 1
8873 = 1
8888 = 1
8899 = 1
8994 = 1
9000 = 1
9001 = 1
9002 = 1
9003 = 1
9009 = 1
9010 = 1
9011 = 1
9040 = 1
9050 = 1
9071 = 1
9080 = 1
9081 = 1
9090 = 1
9091 = 1
9099 = 1
9100 = 1
9101 = 1
9102 = 1
9103 = 1
9110 = 1
9111 = 1
9200 = 1
9207 = 1
9220 = 1
9290 = 1
9415 = 1
9418 = 1
9485 = 1
9500 = 1
9502 = 1
9503 = 1
9535 = 1
9575 = 1
9593 = 1
9594 = 1
9595 = 1
9618 = 1
9666 = 1
9876 = 1
9877 = 1
9878 = 1
9898 = 1
9900 = 1
9917 = 1
9929 = 1
9943 = 1
9944 = 1
9968 = 1
9998 = 1
9999 = 1
10000 = 1
10001 = 1
10002 = 1
10003 = 1
10004 = 1
10009 = 1
10010 = 1
10012 = 1
10024 = 1
10025 = 1
10082 = 1
10180 = 1
10215 = 1
10243 = 1
10566 = 1
10616 = 1
10617 = 1
10621 = 1
10626 = 1
10628 = 1
10629 = 1
10778 = 1
11110 = 1
11111 = 1
11967 = 1
12000 = 1
12174 = 1
12265 = 1
12345 = 1
13456 = 1
13722 = 1
13782 = 1
13783 = 1
14000 = 1
14238 = 1
14441 = 1
14442 = 1
15000 = 1
15002 = 1
15003 = 1
15004 = 1
15660 = 1
15742 = 1
16000 = 1
16001 = 1
16012 = 1
16016 = 1
16018 = 1
16080 = 1
16113 = 1
16992 = 1
16993 = 1
17877 = 1
17988 = 1
18040 = 1
18101 = 1
18988 = 1
19101 = 1
19283 = 1
19315 = 1
19350 = 1
19780 = 1
19801 = 1
19842 = 1
20000 = 1
20005 = 1
20031 = 1
20221 = 1
20222 = 1
20828 = 1
21571 = 1
22939 = 1
23502 = 1
24444 = 1
24800 = 1
25734 = 1
25735 = 1
26214 = 1
27000 = 1
27352 = 1
27353 = 1
27355 = 1
27356 = 1
27715 = 1
28201 = 1
30000 = 1
30718 = 1
30951 = 1
31038 = 1
31337 = 1
32768 = 1
32769 = 1
32770 = 1
32771 = 1
32772 = 1
32773 = 1
32774 = 1
32775 = 1
32776 = 1
32777 = 1
32778 = 1
32779 = 1
32780 = 1
32781 = 1
32782 = 1
32783 = 1
32784 = 1
32785 = 1
33354 = 1
33899 = 1
34571 = 1
34572 = 1
34573 = 1
35500 = 1
38292 = 1
40193 = 1
40911 = 1
41511 = 1
42510 = 1
44176 = 1
44442 = 1
44443 = 1
44501 = 1
45100 = 1
48080 = 1
49152 = 1
49153 = 1
49154 = 1
49155 = 1
49156 = 1
49157 = 1
49158 = 1
49159 = 1
49160 = 1
49161 = 1
49163 = 1
49165 = 1
49167 = 1
49175 = 1
49176 = 1
49400 = 1
49999 = 1
50000 = 1
50001 = 1
50002 = 1
50003 = 1
50006 = 1
50300 = 1
50389 = 1
50500 = 1
50636 = 1
50800 = 1
51103 = 1
51493 = 1
52673 = 1
52822 = 1
52848 = 1
52869 = 1
54045 = 1
54328 = 1
55055 = 1
55056 = 1
55555 = 1
55600 = 1
56737 = 1
56738 = 1
57294 = 1
57797 = 1
58080 = 1
60020 = 1
60443 = 1
61532 = 1
61900 = 1
62078 = 1
63331 = 1
64623 = 1
64680 = 1
65000 = 1
65129 = 1
65389 = 1


================================================
FILE: contributing.Dockerfile
================================================
# Dockerfile for RustScan development environment
# Provides a containerized setup with Rust, nmap, and development tools
FROM rust
# Install nmap first.
RUN apt-get update -qy && apt-get install -qy nmap
# Then install rustfmt for code formatting and clippy for linting.
RUN rustup component add rustfmt clippy

================================================
FILE: contributing.md
================================================
Howdy Space Cow-Person 🤠🌌

RustScan is always looking for contributors. Whether that's spelling mistakes or major changes, your help is **wanted** and welcomed here.

Before contributing, read our [code of conduct](https://github.com/RustScan/RustScan/blob/master/CODE_OF_CONDUCT.md).

TL;DR if you abuse members of our community you will be **perma-banned** with no chance to get unbanned. No warnings either. 🤗

RustScan has 2 major labels for GitHub issues you should look at:

- Good First issue
  These are issues for newcomers to open source!
  [https://github.com/RustScan/RustScan/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22](https://github.com/RustScan/RustScan/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22)
- Help wanted
  These are issues that aren't really for newcomers, but we could still do with help!
  [https://github.com/RustScan/RustScan/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22+label%3A%22help+wanted%22](https://github.com/RustScan/RustScan/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22+label%3A%22help+wanted%22)

If you want to, solve the issue or comment on the issue for help.

The flow for contributing to open source software is:

- Fork the repo
- Make changes
- Pull request to the repo

And then comment on the issue that you've done.

RustScan also has some `// TODO`'s in the codebase, which are meant more for the core team but we wouldn't say no to help with these issues.

If you have any feature suggestions or bugs, leave a GitHub issue. We welcome any and all support :D

## Rewarding you

I cannot pay you :-( But, I can place your GitHub profile on the README under `#Contributors` as a thank you! :)

## Contributing development environment

To ease contribution to RustScan, you can use the `contributing.Dockerfile` to create a Docker image ready to build and play with RustScan.
To build it you just need to run:

```bash
you@home:~/RustScan$ docker build -t rustscan_contributing -f contributing.Dockerfile
```

Then you need to run the container with a volume so it can access, _with read and write permissions_, to RustScan files:

```bash
you@home:~/RustScan$ docker run -ti --rm -v "$PWD":/rustscan -w /rustscan rustscan_contributing bash
```

You can now modify RustScan files with your favorite editor, once you want to compile and test your modifications, type the following in the container prompt:

```bash
root@container:/rustscan# cargo build
```

You are now ready to use RustScan:

```bash
root@container:/rustscan# cargo run -- -b 2000 -t 5000 -a 127.0.0.1
```

You can also format, lint with `clippy` and test the code with the following commands:

```bash
root@container:/rustscan# cargo fmt
root@container:/rustscan# cargo clippy
root@container:/rustscan# cargo test
```


================================================
FILE: fixtures/.rustscan_scripts/test_script.pl
================================================
#!/usr/bin/perl
#tags = ["core_approved", "example",]
#developer = [ "example", "https://example.org" ]
#ports_separator = ","
#call_format = "perl {{script}} {{ip}} {{port}}"

# Sriptfile parser stops at the first blank line with parsing.
# This script will run itself as an argument with the system installed perl interpreter, ports will be concatenated with "," .
# Unused field: trigger_port = "80"
# get total arg passed to this script
my $total = $#ARGV + 1;
my $counter = 1;
 
# get script name
my $scriptname = $0;
 
print "Total args passed to $scriptname : $total\n";
 
# Use loop to print all args stored in an array called @ARGV
foreach my $a(@ARGV) {
	print "Arg # $counter : $a\n";
	$counter++;
}

================================================
FILE: fixtures/.rustscan_scripts/test_script.py
================================================
#!/usr/bin/python3
#tags = ["core_approved", "example",]
#developer = [ "example", "https://example.org" ]
#trigger_port = "80"
#call_format = "python3 {{script}} {{ip}} {{port}}"

# Sriptfile parser stops at the first blank line with parsing.
# This script will run itself as an argument with the system installed python interpreter, only scanning port 80.
# Unused filed: ports_separator = ","

import sys

print('Python script ran with arguments', str(sys.argv))

================================================
FILE: fixtures/.rustscan_scripts/test_script.sh
================================================
#!/bin/bash 
#tags = ["core_approved", "example",]
#developer = [ "example", "https://example.org" ]
#ports_separator = ","
#call_format = "bash {{script}} {{ip}} {{port}}"

# Sriptfile parser stops at the first blank line with parsing.
# This script will run itself as an argument with the system installed bash interpreter, scanning all ports concatenated with "," .
# Unused filed: trigger_port = "80"

# print all arguments passed to the script
echo $@

================================================
FILE: fixtures/.rustscan_scripts/test_script.txt
================================================
#!intentional_blank_line
#tags = ["core_approved", "example"]
#developer = [ "example", "https://example.org" ]
#ports_separator = ","
#call_format = "nmap -vvv -p {{port}} {{ip}}"

# Scriptfile parser stops at the first blank line with parsing.
# This script will run the system installed nmap, ports will be concatenated with "," .
# Unused field: trigger_port = "80"

================================================
FILE: fixtures/.rustscan_scripts/test_script_invalid_headers.txt
================================================
#!intentional_blank_line
#tags = "core_approved"
#developer = [ "example", "https://example.org" ]
#ports_separator = ","
#call_format = "nmap -vvv -p {{port}} {{ip}}"

# tags has to be an array, thus this file won't be parsed

================================================
FILE: fixtures/.rustscan_scripts.toml
================================================
tags = ["core_approved", "example"]
ports = ["80", "443", "8080"]
developer = ["example", "https://example.org"]
directory = "fixtures/.rustscan_scripts" 

================================================
FILE: fixtures/empty_hosts.txt
================================================


================================================
FILE: fixtures/hosts.txt
================================================
127.0.0.1
google.com
example.com
66666666666666.666666666666666666.66666666666666666.6666666666
....
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.radiatorFixtures

================================================
FILE: fixtures/naughty_strings.txt
================================================
# https://github.com/minimaxir/big-list-of-naughty-strings


­؀؁؂؃؄؅؜۝܏᠎​‌‍‎‏‪‫‬‭‮⁠⁡⁢⁣⁤⁦⁧⁨⁩𑂽𛲠𛲡𛲢𛲣𝅳𝅴𝅵𝅶𝅷𝅸𝅹𝅺󠀁󠀠󠀡󠀢󠀣󠀤󠀥󠀦󠀧󠀨󠀩󠀪󠀫󠀬󠀭󠀮󠀯󠀰󠀱󠀲󠀳󠀴󠀵󠀶󠀷󠀸󠀹󠀺󠀻󠀼󠀽󠀾󠀿󠁀󠁁󠁂󠁃󠁄󠁅󠁆󠁇󠁈󠁉󠁊󠁋󠁌󠁍󠁎󠁏󠁐󠁑󠁒󠁓󠁔󠁕󠁖󠁗󠁘󠁙󠁚󠁛󠁜󠁝󠁞󠁟󠁠󠁡󠁢󠁣󠁤󠁥󠁦󠁧󠁨󠁩󠁪󠁫󠁬󠁭󠁮󠁯󠁰󠁱󠁲󠁳󠁴󠁵󠁶󠁷󠁸󠁹󠁺󠁻󠁼󠁽󠁾󠁿

Ω≈ç√∫˜µ≤≥÷
åß∂ƒ©˙∆˚¬…æ
œ∑´®†¥¨ˆøπ“‘
¡™£¢∞§¶•ªº–≠
¸˛Ç◊ı˜Â¯˘¿
ÅÍÎÏ˝ÓÔÒÚÆ☃
Œ„´‰ˇÁ¨ˆØ∏”’
`⁄€‹›fifl‡°·‚—±
⅛⅜⅝⅞
ЁЂЃЄЅІЇЈЉЊЋЌЍЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя
٠١٢٣٤٥٦٧٨٩



⁰⁴⁵
₀₁₂
⁰⁴⁵₀₁₂
ด้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็ ด้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็ ด้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็

田中さんにあげて下さい
パーティーへ行かないか
和製漢語
部落格
사회과학원 어학연구소
찦차를 타고 온 펲시맨과 쑛다리 똠방각하
社會科學院語學研究所
울란바토르
𠜎𠜱𠝹𠱓𠱸𠲖𠳏
𝐓𝐡𝐞 𝐪𝐮𝐢𝐜𝐤 𝐛𝐫𝐨𝐰𝐧 𝐟𝐨𝐱 𝐣𝐮𝐦𝐩𝐬 𝐨𝐯𝐞𝐫 𝐭𝐡𝐞 𝐥𝐚𝐳𝐲 𝐝𝐨𝐠
𝕿𝖍𝖊 𝖖𝖚𝖎𝖈𝖐 𝖇𝖗𝖔𝖜𝖓 𝖋𝖔𝖝 𝖏𝖚𝖒𝖕𝖘 𝖔𝖛𝖊𝖗 𝖙𝖍𝖊 𝖑𝖆𝖟𝖞 𝖉𝖔𝖌
𝑻𝒉𝒆 𝒒𝒖𝒊𝒄𝒌 𝒃𝒓𝒐𝒘𝒏 𝒇𝒐𝒙 𝒋𝒖𝒎𝒑𝒔 𝒐𝒗𝒆𝒓 𝒕𝒉𝒆 𝒍𝒂𝒛𝒚 𝒅𝒐𝒈
𝓣𝓱𝓮 𝓺𝓾𝓲𝓬𝓴 𝓫𝓻𝓸𝔀𝓷 𝓯𝓸𝔁 𝓳𝓾𝓶𝓹𝓼 𝓸𝓿𝓮𝓻 𝓽𝓱𝓮 𝓵𝓪𝔃𝔂 𝓭𝓸𝓰
𝕋𝕙𝕖 𝕢𝕦𝕚𝕔𝕜 𝕓𝕣𝕠𝕨𝕟 𝕗𝕠𝕩 𝕛𝕦𝕞𝕡𝕤 𝕠𝕧𝕖𝕣 𝕥𝕙𝕖 𝕝𝕒𝕫𝕪 𝕕𝕠𝕘
𝚃𝚑𝚎 𝚚𝚞𝚒𝚌𝚔 𝚋𝚛𝚘𝚠𝚗 𝚏𝚘𝚡 𝚓𝚞𝚖𝚙𝚜 𝚘𝚟𝚎𝚛 𝚝𝚑𝚎 𝚕𝚊𝚣𝚢 𝚍𝚘𝚐
⒯⒣⒠ ⒬⒰⒤⒞⒦ ⒝⒭⒪⒲⒩ ⒡⒪⒳ ⒥⒰⒨⒫⒮ ⒪⒱⒠⒭ ⒯⒣⒠ ⒧⒜⒵⒴ ⒟⒪⒢

ثم نفس سقطت وبالتحديد،, جزيرتي باستخدام أن دنو. إذ هنا؟ الستار وتنصيب كان. أهّل ايطاليا، بريطانيا-فرنسا قد أخذ. سليمان، إتفاقية بين ما, يذكر الحدود أي بعد, معاملة بولندا، الإطلاق عل إيو.

================================================
FILE: fixtures/test_rustscan_scripts.toml
================================================
# Test/Example ScriptConfig file

# Tags to filter on scripts. Only scripts containing all these tags will run.
tags = ["core_approved", "example"]

# If it's present then only those scripts will run which has a tag ports = "80". Not yet implemented.
#
# ex.:
# ports = ["80"]
# ports = ["80","81","8080"]
ports = ["80"]

# Only this developer(s) scripts to run. Not yet implemented.
developer = ["example"]

================================================
FILE: justfile
================================================
test:
    cargo test
    cargo clippy -- --deny warnings
    cargo clippy --tests -- --deny warnings
    cargo fmt --check
    cargo doc --workspace --all-features --no-deps --document-private-items

fix:
    cargo fmt
    cargo clippy --fix

# release only runs if test runs
release: test
    git checkout master
    git pull
    cargo generate-lockfile
    cargo publish 
    git push


================================================
FILE: nmap-payloads
================================================
# Nmap nmap payload database -*- mode: fundamental; -*-
# $Id$
#
# These payloads are sent with every host discovery or port scan probe
# by default. This database should only include payloads that are
# unlikely to crash services, trip IDS alerts, or change state on the
# server. The idea behind these is to evoke a response using a payload.
# Some of them are taken from nmap-service-probes.
#
# This collection of data is (C) 1996-2022 by Nmap Software LLC.  It
# is distributed under the Nmap Public Source license as provided in
# the LICENSE file of the source distribution or at
# https://nmap.org/npsl/.  Note that this free license does not allow
# incorporation of Nmap or its data files within proprietary
# software. We sell a separate Nmap OEM for that as described
# (including pricing) at https://nmap.org/npsl/.
#
# Each entry begins with a protocol (only "udp" is supported) followed
# by a comma-separated list of ports, followed by one or more quoted
# strings containing the payload. These elements may be broken across
# several lines. For future expansion, additional keywords may follow
# the payload data. Any data following one of these keywords must be on
# the same line as the keyword so that unknown keywords can be ignored
# by the parser. Currently this file contains some entries with the
# "source" keyword to specify a desired source port, but it is not
# honored by Nmap.
#
# Multiple payloads may be defined for a single protocol and port, in
# which case they will be all be sent concurrently. There is a limit
# of 255 payloads per port.
#
# Lines longer than 1024 characters will be ignored.
#
# Example:
# udp 1234 "payloaddatapayloaddata"
#   "payloaddatapayloaddata"
# source 5678

# GenericLines. Use for the echo service.
udp 7 "\x0D\x0A\x0D\x0A"
# DNSStatusRequest
# Sent for TFTP (69) as well due to its ability to provoke an error response
udp 53,69,5353,26198 "\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00"
# DNS VER
udp 53,5353,26198
  "\x77\x77\x01\x00\x00"
  "\x01\x00\x00\x00\x00\x00\x00\x07version\x04bind\x00\x00\x10\x00\x03"

# DHCP INFORM
udp 67
  "\x01\x01\x06\x00"
  "\x01\x23\x45\x67\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00"
  "\x00\x00\x00\x00\x00\x00\x00\x00\x0e\x35\xd4\xd8\x51\x00\x00\x00\x00"
  "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
  "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
  "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
  "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
  "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
  "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
  "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
  "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
  "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
  "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
  "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
  "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x63\x82\x53\x63\x35\x01"
  "\x08\xff"

# TFTP GET
udp 69 "\x00\x01r7tftp.txt\x00octet\x00"

# QUIC packet with unsupported version Q999
# Also found on 443, but need to check whether DTLS or QUIC is more prevalent
udp 80 "\r12345678Q999\x00"
# RPCCheck
udp 111
  "\x72\xFE\x1D\x13\x00\x00\x00\x00\x00\x00\x00\x02\x00\x01\x86\xA0"
  "\x00\x01\x97\x7C\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
  "\x00\x00\x00\x00\x00\x00\x00\x00"
# ONCRPC CALL
udp 111,2049,4045,32768-65535
  "\x3e\xec\xe3\xca\x00\x00\x00\x00\x00\x00\x00\x02\x00"
  "\xbc\x61\x4e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
  "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
# NTPRequest
udp 123
  "\xE3\x00\x04\xFA\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00"
  "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
  "\x00\x00\x00\x00\x00\x00\x00\x00\xC5\x4F\x23\x4B\x71\xB1\x52\xF3"
# NTP REQ
udp 123
  "\xd9\x00\x0a\xfa\x00\x00\x00"
  "\x00\x00\x01\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
  "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc6"
  "\xf1\x5e\xdb\x78\x00\x00\x00"
# DCERPC CALL
udp 135,1025-1199
  "\x05\x00\x0b\x03\x10\x00\x00\x00\x48\x00"
  "\x00\x00\x01\x00\x00\x00\xb8\x10\xb8\x10\x00\x00\x00\x00\x01\x00\x00"
  "\x00\x00\x00\x01\x00\x01\x23\x45\x67\x89\xab\xcd\xef\x01\x23\x45\x67"
  "\x89\xab\xcd\xef\xe7\x03\x00\x00\xfe\xdc\xba\x98\x76\x54\x32\x10\x01"
  "\x23\x45\x67\x89\xab\xcd\xef\xe7\x03\x00\x00"
# NBTStat
udp 137
  "\x80\xF0\x00\x10\x00\x01\x00\x00\x00\x00\x00\x00"
  "\x20CKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\x00\x00\x21\x00\x01"
# CIFS NS NAME QUERY UC
udp 137
  "\x01\x91\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00"
  "\x20CKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\x00\x00\x21\x00\x01"
# CIFS NS NAME QUERY BC
udp 137
  "\x01\x91\x00\x10\x00\x01\x00\x00\x00\x00\x00\x00"
  "\x20CKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\x00\x00\x21\x00\x01"
# SNMPv3GetRequest
udp 161,260,3401
  "\x30\x3A\x02\x01\x03\x30\x0F\x02\x02\x4A\x69\x02\x03\x00\xFF\xE3"
  "\x04\x01\x04\x02\x01\x03\x04\x10\x30\x0E\x04\x00\x02\x01\x00\x02"
  "\x01\x00\x04\x00\x04\x00\x04\x00\x30\x12\x04\x00\x04\x00\xA0\x0C"
  "\x02\x02\x37\xF0\x02\x01\x00\x02\x01\x00\x30\x00"
# SNMP PUBLIC WALK
udp 161,260,3401
  "\x30\x1f\x02\x01\x00\x04\x06public\xa1\x12\x02\x01\x00\x02"
  "\x01\x00\x02\x01\x00\x30\x07\x30\x05\x06\x01\x00\x05\x00"

# Sqlping - disabled because it trips a Snort rule with SID 2049
# ("MS-SQL ping attempt").
# udp 1434 "\x02"

# xdmcp - X Display Manager Control Protocol. Version 1, packet type
# Query (2), no authorization names. We expect a Willing or Unwilling
# packet in reply.
# http://cgit.freedesktop.org/xorg/doc/xorg-docs/plain/hardcopy/XDMCP/xdmcp.PS.gz
udp 177 "\x00\x01\x00\x02\x00\x01\x00"

# Connectionless LDAP - used by Microsoft Active Directory
udp 389
  "\x30\x84\x00\x00\x00\x2d\x02\x01\x07\x63\x84\x00\x00\x00\x24\x04\x00"
  "\x0a\x01\x00\x0a\x01\x00\x02\x01\x00\x02\x01\x64\x01\x01\x00\x87\x0b"
  "objectClass0\x84\x00\x00\x00\x00"


# svrloc
udp 427
  "\x02\x01\x00\x006 \x00\x00\x00\x00\x00\x01\x00\x02en\x00\x00\x00\x15"
  "service:service-agent\x00\x07default\x00\x00\x00\x00"

# DTLS
udp 443,853,3391,4433,4740,5349,5684,5868,6514,6636,8232,10161,10162,12346,12446,12546,12646,12746,12846,12946,13046
  # DTLS 1.0, length 52
  "\x16\xfe\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x36"
  # ClientHello, length 40, sequence 0, offset 0
  "\x01\x00\x00\x2a\x00\x00\x00\x00\x00\x00\x00\x2a"
  # DTLS 1.2
  "\xfe\xfd"
  # Random
  "\x00\x00\x00\x00\x7c\x77\x40\x1e\x8a\xc8\x22\xa0\xa0\x18\xff\x93"
  "\x08\xca\xac\x0a\x64\x2f\xc9\x22\x64\xbc\x08\xa8\x16\x89\x19\x3f"
  # Session id length 0, cookie length 0
  "\x00\x00"
  # Cipher suites, mandatory TLS_RSA_WITH_AES_128_CBC_SHA
  "\x00\x02\x00\x2f"
  # Compressors (NULL)
  "\x01\x00"

# Internet Key Exchange version 1, phase 1 Main Mode. We offer every
# combination of (DES, 3DES) and (MD5, SHA) in the hope that one of them will
# be acceptable. Because we use a fixed cookie, we set the association lifetime
# to 1 second to reduce the chance that repeated probes will look like
# retransmissions (and therefore not get a response). This payload comes from
#   ike-scan --lifetime 1 --cookie 0011223344556677 --trans=5,2,1,2 --trans=5,1,1,2 --trans=1,2,1,2 --trans=1,1,1,2
# We expect another phase 1 message in response. This payload works better with
# a source port of 500 or a randomized initiator cookie.
udp 500
  # Initiator cookie 0x0011223344556677, responder cookie 0x0000000000000000.
  "\x00\x11\x22\x33\x44\x55\x66\x77\x00\x00\x00\x00\x00\x00\x00\x00"
  # Version 1, Main Mode, flags 0x00, message ID 0x00000000, length 192.
  "\x01\x10\x02\x00\x00\x00\x00\x00\x00\x00\x00\xC0"
  # Security Association payload, length 164, IPSEC, IDENTITY.
  "\x00\x00\x00\xA4\x00\x00\x00\x01\x00\x00\x00\x01"
  # Proposal 1, length 152, ISAKMP, 4 transforms.
  "\x00\x00\x00\x98\x01\x01\x00\x04"
  # Transform 1, 3DES-CBC, SHA, PSK, group 2.
  "\x03\x00\x00\x24\x01\x01\x00\x00\x80\x01\x00\x05\x80\x02\x00\x02"
  "\x80\x03\x00\x01\x80\x04\x00\x02"
  "\x80\x0B\x00\x01\x00\x0C\x00\x04\x00\x00\x00\x01"
  # Transform 2, 3DES-CBC, MD5, PSK, group 2.
  "\x03\x00\x00\x24\x02\x01\x00\x00\x80\x01\x00\x05\x80\x02\x00\x01"
  "\x80\x03\x00\x01\x80\x04\x00\x02"
  "\x80\x0B\x00\x01\x00\x0C\x00\x04\x00\x00\x00\x01"
  # Transform 3, DES-CBC, SHA, PSK, group 2.
  "\x03\x00\x00\x24\x03\x01\x00\x00\x80\x01\x00\x01\x80\x02\x00\x02"
  "\x80\x03\x00\x01\x80\x04\x00\x02"
  "\x80\x0B\x00\x01\x00\x0C\x00\x04\x00\x00\x00\x01"
  # Transform 4, DES-CBC, MD5, PSK, group 2.
  "\x00\x00\x00\x24\x04\x01\x00\x00\x80\x01\x00\x01\x80\x02\x00\x01"
  "\x80\x03\x00\x01\x80\x04\x00\x02"
  "\x80\x0B\x00\x01\x00\x0C\x00\x04\x00\x00\x00\x01"
# IPSEC START
udp 500,4500
  "\x31\x27\xfc"
  "\xb0\x38\x10\x9e\x89\x00\x00\x00\x00\x00\x00\x00\x00\x01\x10\x02\x00"
  "\x00\x00\x00\x00\x00\x00\x00\xcc\x0d\x00\x00\x5c\x00\x00\x00\x01\x00"
  "\x00\x00\x01\x00\x00\x00\x50\x01\x01\x00\x02\x03\x00\x00\x24\x01\x01"
  "\x00\x00\x80\x01\x00\x05\x80\x02\x00\x02\x80\x04\x00\x02\x80\x03\x00"
  "\x03\x80\x0b\x00\x01\x00\x0c\x00\x04\x00\x00\x0e\x10\x00\x00\x00\x24"
  "\x02\x01\x00\x00\x80\x01\x00\x05\x80\x02\x00\x01\x80\x04\x00\x02\x80"
  "\x03\x00\x03\x80\x0b\x00\x01\x00\x0c\x00\x04\x00\x00\x0e\x10\x0d\x00"
  "\x00\x18\x1e\x2b\x51\x69\x05\x99\x1c\x7d\x7c\x96\xfc\xbf\xb5\x87\xe4"
  "\x61\x00\x00\x00\x04\x0d\x00\x00\x14\x40\x48\xb7\xd5\x6e\xbc\xe8\x85"
  "\x25\xe7\xde\x7f\x00\xd6\xc2\xd3\x0d\x00\x00\x14\x90\xcb\x80\x91\x3e"
  "\xbb\x69\x6e\x08\x63\x81\xb5\xec\x42\x7b\x1f\x00\x00\x00\x14\x26\x24"
  "\x4d\x38\xed\xdb\x61\xb3\x17\x2a\x36\xe3\xd0\xcf\xb8\x19"

# Routing Information Protocol version 1. Special-case request for the entire
# routing table (address family 0, address 0.0.0.0, metric 16). RFC 1058,
# section 3.4.1.
udp 520
  "\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
  "\x00\x00\x00\x00\x00\x00\x00\x10"

# RMCP ASF ping
udp 623
  "\x06\x00\xff\x06" # RMCP version 6, sequence 0xff, normal RMCP class ASF
  "\x00\x00\x11\xbe" # IAN ASF code 4542
  "\x80\x00\x00\x00" # payload-less ASF presence ping

# IPMI
# RMCP Get Channel Auth Capabilities
udp 623
  "\x06\x00\xff\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x20\x18"
  "\xc8\x81\x00\x38\x8e\x04\xb5"

# serialnumberd. This service runs on Mac OS X Server. This probe
# requests the serial number of another server. In response we expect a
# packet starting with "SNRESPS:", followed by some data whose purpose
# is not known.
udp 626 "SNQUERY: 127.0.0.1:AAAAAA:xsvr"

# OpenVPN P_CONTROL_HARD_RESET_CLIENT_V2
# Byte 0; 0x38 opcode
# Byte 1-8: Session ID, random
# Byte 9: Message packet-id array length (0)
# Byte 10-13: Message packet-id (0)
udp 1194 "8d\xc1x\x01\xb8\x9b\xcb\x8f\0\0\0\0\0"
# OpenVPN when in PKI mode and without the "HMAC Firewall" setting enabled
# (tls-auth) should respond to the following probe, which is
# 0x38<8 random bytes><4 null bytes>
udp 1194
  "\x38\x01\x02\x03\x04\x05\x06\x07\x08\x00\x00\x00\x00"

# Citrix MetaFrame application browser service
# Original idea from http://sh0dan.org/oldfiles/hackingcitrix.html
# Payload contents copied from Wireshark capture of Citrix Program
# Neighborhood client application.  The application uses this payload to
# locate Citrix servers on the local network.  Response to this probe is
# a 48 byte UDP payload as shown here:
#
# 0000   30 00 02 31 02 fd a8 e3 02 00 06 44 c0 a8 80 55
# 0010   00 00 00 00 00 00 00 00 00 00 00 00 02 00 06 44
# 0020   c0 a8 80 56 00 00 00 00 00 00 00 00 00 00 00 00
#
# The first 12 bytes appear to be the same in all responses.
#
# Bytes 0x00 appears to be a packet length field
# Bytes 0x0C - 0x0F are the IP address of the server
# Bytes 0x10 - 0x13 may vary, 0x14 - 0x1F do not appear to
# Bytes 0x20 - 0x23 are the IP address of the primary system in a server farm
#                   configuration
# Bytes 0x24 - 0x27 can vary, 0x28 - 0x2F do not appear to
udp 1604
  "\x1e\x00\x01\x30\x02\xfd\xa8\xe3\x00\x00\x00\x00\x00\x00\x00\x00"
  "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"

# RADIUS Access-Request. This is a degenerate packet with no username or
# password; we expect an Access-Reject in response. The Identifier and Request
# Authenticator are both 0. It was generated by running
#   echo 'User-Password = ""' | radclient <ip> auth ""
# and then manually stripping out the password.
#
# Section 2 of the RFC says "A request from a client for which the
# RADIUS server does not have a shared secret MUST be silently
# discarded." So this payload only works when the server is configured
# (or misconfigured) to know the scanning machine as a client.
#
# RFC 2865: "The early deployment of RADIUS was done using UDP port
# number 1645, which conflicts with the "datametrics" service. The
# officially assigned port number for RADIUS is 1812.
udp 1645,1812
  "\x01\x00\x00\x14"
  "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"

# L2TP ICRQ
udp 1701
  "\xc8\x02"
  "\x00\x3c\x00\x00\x00\x00\x00\x00\x00\x00\x80\x08\x00\x00\x00\x00\x00"
  "\x01\x80\x08\x00\x00\x00\x02\x01\x00\x80\x0e\x00\x00\x00\x07"
  "nxp-scan\x80\x0a\x00\x00\x00\x03\x00\x00\x00\x03\x80"
  "\x08\x00\x00\x00\x09\x00\x00"

# UPNP MSEARCH
udp 1900
  "M-SEARCH * HTTP/1.1\r\nHost: 239.255.255.250:1900\r\n"
  "Man: \"ssdp:discover\"\r\nMX: 5\r\nST: ssdp:all\r\n\r\n"

# NFS version 2, RFC 1831. XID 0x00000000, program 100003 (NFS), procedure
# NFSPROC_NULL (does nothing, see section 2.2.1), null authentication (see
# section 9.1).
udp 2049
  "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x01\x86\xA3"
  "\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
  "\x00\x00\x00\x00\x00\x00\x00\x00"

# GPRS Tunneling Protocol (GTP)
udp 2123,2152
# GTPv1, protocol 1
"\x32"
# EchoRequest
"\x01"
# message length
"\x00\x04"
# Tunnel endpoint identifier
"\x00\x00\x42\x00"
# sequence number
"\x13\x37"
# N-PDU number
"\x00"
# next extension header type
"\x00"

# GPRS Tunneling Protocol (GTP) "prime" v2
# This same packet can be used for GTP v2 on ports 2123 and 2152 if you change
# the first byte from \x4e to \x40
udp 3386
# GTP'v2
"\x4e"
# EchoRequest
"\x01"
# message length
"\x00\x04"
# sequence number
"\xde\xfe\xc8\x00"

# Freelancer game server status query
# http://sourceforge.net/projects/gameq/
# (relevant files: games.ini, packets.ini, freelancer.php)
udp 2302 "\x00\x02\xf1\x26\x01\x26\xf0\x90\xa6\xf0\x26\x57\x4e\xac\xa0\xec\xf8\x68\xe4\x8d\x21"

# Apple Remote Desktop (ARD)
udp 3283 "\0\x14\0\x01\x03"

# STUN Binding request, see RFC 5389 Section 6
# message type = 0x001, Binding (see Section 18.1)
# message length = 0
# magic cookie = 0x2112a442
# transaction ID = "\x00"*12
udp 3478 "\x00\x01\x00\x00\x21\x12\xa4\x42\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"

# Sun Service Tag Discovery protocol (stdiscover)
# http://arc.opensolaris.org/caselog/PSARC/2006/638/stdiscover_protocolv2.pdf
# Would work better with a varying cookie; the second and later sends of this
# probe will be interpreted as resends by the server and will be ignored.
udp 6481 "[PROBE] 0000"

# NAT-PMP external IP address request. See section 3.2 of
# http://files.dns-sd.org/draft-cheshire-nat-pmp.txt.
udp 5351 "\x00\x00"

# DNS Service Discovery (DNS-SD) service query, as used in Zeroconf.
# Transaction ID 0x0000, flags 0x0000, 1 question: PTR query for
# _services._dns-sd._udp.local. If the remote host supports DNS-SD it will send
# back a list of all its services. This is the same as a packet capture of
#   dns-sd -B _services._dns-sd._udp .
# See section 9 of
# http://files.dns-sd.org/draft-cheshire-dnsext-dns-sd.txt.
# This first probe is a QU probe, meaning a unicast response is desired
udp 5353
  "\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00"
  "\x09_services\x07_dns-sd\x04_udp\x05local\x00\x00\x0C\x80\x01"
# This second probe is a QM probe, meaning a unicast response is desired
udp 5353
  "\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00"
  "\x09_services\x07_dns-sd\x04_udp\x05local\x00\x00\x0C\x00\x01"

# PCANY STATUS
udp 5632 "ST"

# CoAP GET .well-known/core
udp 5683 "@\x01\x01\xce\xbb.well-known\x04core"

# UT2K PING
udp 7777 "None\x00"

# Ubiquiti Discovery Service - v1
udp 10001 "\x01\x00\x00\x00"

# Amanda backup service noop request. I think that this does nothing on the
# server but only asks it to send back its feature list. In reply we expect an
# ACK or (more likely) an ERROR. I couldn't find good online documentation of
# the Amanda network protocol. There is parsing code in the Amanda source at
# common-src/security-util.c. This is based on a packet capture of
#   amcheck <config> <host>
udp 10080
  "Amanda 2.6 REQ HANDLE 000-00000000 SEQ 0\n"
  "SERVICE noop\n"

# VxWorks Wind River Debugger
udp 17185
# Random XID
"\x00\x00\x00\x00"
# RPC version 2 procedure call
"\x00\x00\x00\x00\x00\x00\x00\x02"
# WDB version 1
"\x55\x55\x55\x55\x00\x00\x00\x01"
# WDB_TARGET_PING
"\x00\x00\x00\x00"
# RPC Auth NULL
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
# Checksum
"\xff\xff\x55\x13"
# WDB wrapper (length and sequence number)
"\x00\x00\x00\x30\x00\x00\x00\x01"
# Empty data?
"\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00"
# VXWORKS DEBUG (alternative?)
udp 17185
  "\x72\x37\x72\x37\x00\x00\x00"
  "\x00\x00\x00\x00\x02\x55\x55\x55\x55\x00\x00\x00\x01\x00\x00\x00\x01"
  "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff"
  "\xff\x55\x10\x00\x00\x00\x3c\x00\x00\x00\x03\x00\x00\x00\x02\x00\x00"
  "\x00\x00\x00\x00\x00\x00"

# Quake 2 and Quake 3 game servers (and servers of derived games like Nexuiz).
# Gets game information from the server (see probe responses in
# nmap-service-probes). These services typically run on a base port or a
# few numbers higher.
# Quake 2. Typical ports: 27910-27914.
udp 27910-27914 "\xff\xff\xff\xffstatus"
# Quake 3. Typical ports:
# 26000-26004: Nexuiz
# 27960-27964: Various games
# 30720-30724: Tremulous
# 44400: Warsow
udp 26000-26004,27960-27964,30720-30724,44400 "\xff\xff\xff\xffgetstatus"

# Murmur 1.2.X (Mumble server)
# UDP ping. "abcdefgh" is an identifier. See
# http://mumble.sourceforge.net/Protocol.
udp 64738 "\x00\x00\x00\x00abcdefgh"

# Ventrilo 2.1.2+
# UDP general status request (encrypted).
# See http://aluigi.altervista.org/papers.htm#ventrilo
udp 3784
"\x01\xe7\xe5\x75\x31\xa3\x17\x0b\x21\xcf\xbf\x2b\x99\x4e\xdd\x19\xac\xde\x08\x5f\x8b\x24\x0a\x11\x19\xb6\x73\x6f\xad\x28\x13\xd2\x0a\xb9\x12\x75"

# Kademlia (kad) as used by various P2P applications.  Send a Kademlia ping
# 4665, 4666, 4672, 6429: eDonkey/eMule and variants
udp 4665,4666,4672,6429 "\xE4\x60"

# TeamSpeak 2
# UDP login request
# See http://wiki.wireshark.org/TeamSpeak2
udp 8767
"\xf4\xbe\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x002x\xba\x85\tTeamSpeak\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\nWindows XP\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00 \x00<\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08nickname\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"

# TS3INIT1
udp 9987
"TS3INIT1\x00\x65\x00\x00\x88\x0a\x39\x7b\x0f\x00\x5b\x55\x72\xef\xdc\x78\x32\x6b\x00\x00\x00\x00\x00\x00\x00\x00"

# TeamSpeak 3
# UDP login request (encrypted)
# http://seclists.org/nmap-dev/2013/q3/72
udp 9987
"\x05\xca\x7f\x16\x9c\x11\xf9\x89\x00\x00\x00\x00\x02\x9d\x74\x8b\x45\xaa\x7b\xef\xb9\x9e\xfe\xad\x08\x19\xba\xcf\x41\xe0\x16\xa2\x32\x6c\xf3\xcf\xf4\x8e\x3c\x44\x83\xc8\x8d\x51\x45\x6f\x90\x95\x23\x3e\x00\x97\x2b\x1c\x71\xb2\x4e\xc0\x61\xf1\xd7\x6f\xc5\x7e\xf6\x48\x52\xbf\x82\x6a\xa2\x3b\x65\xaa\x18\x7a\x17\x38\xc3\x81\x27\xc3\x47\xfc\xa7\x35\xba\xfc\x0f\x9d\x9d\x72\x24\x9d\xfc\x02\x17\x6d\x6b\xb1\x2d\x72\xc6\xe3\x17\x1c\x95\xd9\x69\x99\x57\xce\xdd\xdf\x05\xdc\x03\x94\x56\x04\x3a\x14\xe5\xad\x9a\x2b\x14\x30\x3a\x23\xa3\x25\xad\xe8\xe6\x39\x8a\x85\x2a\xc6\xdf\xe5\x5d\x2d\xa0\x2f\x5d\x9c\xd7\x2b\x24\xfb\xb0\x9c\xc2\xba\x89\xb4\x1b\x17\xa2\xb6"

# Memcached
# version request (shorter response than stats)
# https://github.com/memcached/memcached/blob/master/doc/protocol.txt
udp 11211
"\0\x01\0\0\0\x01\0\0version\r\n"

# Steam, typically using a port in 27015-27030.  Send a "Source Engine query"
udp 27015-27030
  "\xff\xff\xff\xffTSource Engine Query\x00"

# TRIN00 UNIX PING
udp 27444 "png l44adsl"

# BO PING
udp 31337
  "\xce\x63\xd1\xd2\x16\xe7\x13\xcf\x38"
  "\xa5\xa5\x86\xb2\x75\x4b\x99\xaa\x32\x58"

# TRIN00 WIN PING
udp 34555 "png []..Ks"

# Beckhoff ADS discovery request
# https://github.com/ONE75/adsclient/blob/master/src/AdsClient.Finder/DeviceFinder.cs#L49-L64
udp 48899
"\x03\x66\x14\x71\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01\x01\x10\x27\x00\x00\x00\x00"


================================================
FILE: pictures/accessible.yml
================================================
# The configurations that used for the recording, feel free to edit them
config:

  # Specify a command to be executed
  # like `/bin/bash -l`, `ls`, or any other commands
  # the default is bash for Linux
  # or powershell.exe for Windows
  command: zsh
  
  # Specify the current working directory path
  # the default is the current working directory path
  cwd: /home/bee/Documents/RustScan
  
  # Export additional ENV variables
  env:
    recording: true
  
  # Explicitly set the number of columns
  # or use `auto` to take the current
  # number of columns of your shell
  cols: 107
  
  # Explicitly set the number of rows
  # or use `auto` to take the current
  # number of rows of your shell
  rows: 43
  
  # Amount of times to repeat GIF
  # If value is -1, play once
  # If value is 0, loop indefinitely
  # If value is a positive number, loop n times
  repeat: 0
  
  # Quality
  # 1 - 100
  quality: 100
  
  # Delay between frames in ms
  # If the value is `auto` use the actual recording delays
  frameDelay: auto
  
  # Maximum delay between frames in ms
  # Ignored if the `frameDelay` isn't set to `auto`
  # Set to `auto` to prevent limiting the max idle time
  maxIdleTime: 2000
  
  # The surrounding frame box
  # The `type` can be null, window, floating, or solid`
  # To hide the title use the value null
  # Don't forget to add a backgroundColor style with a null as type
  frameBox:
    type: floating
    title: Terminalizer
    style:
      border: 0px black solid
      # boxShadow: none
      # margin: 0px
  
  # Add a watermark image to the rendered gif
  # You need to specify an absolute path for
  # the image on your machine or a URL, and you can also
  # add your own CSS styles
  watermark:
    imagePath: null
    style:
      position: absolute
      right: 15px
      bottom: 15px
      width: 100px
      opacity: 0.9
  
  # Cursor style can be one of
  # `block`, `underline`, or `bar`
  cursorStyle: block
  
  # Font family
  # You can use any font that is installed on your machine
  # in CSS-like syntax
  fontFamily: "Monaco, Lucida Console, Ubuntu Mono, Monospace"
  
  # The size of the font
  fontSize: 12
  
  # The height of lines
  lineHeight: 1
  
  # The spacing between letters
  letterSpacing: 0
  
  # Theme
  theme:
    background: "transparent"
    foreground: "#afafaf"
    cursor: "#c7c7c7"
    black: "#232628"
    red: "#fc4384"
    green: "#b3e33b"
    yellow: "#ffa727"
    blue: "#75dff2"
    magenta: "#ae89fe"
    cyan: "#708387"
    white: "#d5d5d0"
    brightBlack: "#626566"
    brightRed: "#ff7fac"
    brightGreen: "#c8ed71"
    brightYellow: "#ebdf86"
    brightBlue: "#75dff2"
    brightMagenta: "#ae89fe"
    brightCyan: "#b1c6ca"
    brightWhite: "#f9f9f4"
  
# Records, feel free to edit them
records:
  - delay: 436
    content: "\e[1m\e[7m%\e[27m\e[1m\e[0m                                                                                                          \r \r\e]2;bee@beehive:~/Documents/RustScan\a\e]1;..ents/RustScan\a"
  - delay: 162
    content: "\r\e[0m\e[27m\e[24m\e[J\r\n\e[1m\e[0m\e[1m\e[36mRustScan\e[0m\e[36m\e[39m\e[1m \e[0m\e[1mon \e[0m\e[1m\e[37m\e[1m\e[37m\e[0m\e[37m\e[1m\e[37m\e[35m master\e[0m\e[35m\e[39m\e[1m\e[0m\e[1m\e[0m\e[1m\e[31m [?]\e[0m\e[31m\e[39m\e[1m\e[0m\e[0m\e[39m\e[1m \e[0m\e[1mis \e[0m\e[1m\e[31m\U0001F4E6 vrustscan:1.10.0\e[0m\e[31m\e[39m\e[1m \e[0m\e[1mvia \e[0m\e[1m\e[31m\U0001D5E5 v1.46.0\e[0m\e[31m\e[39m\e[1m \e[0m\r\n\e[1m\e[0m\e[1m\e[32m➜ \e[0m\e[32m\e[39m\e[1m\e[0m\e[K\e[?1h\e=\e[?2004h"
  - delay: 471
    content: "r\brustscan 127.0.0.1 --accessible --no-nmap --ulimit 5000\e[55D\e[7mr\e[7mu\e[7ms\e[7mt\e[7ms\e[7mc\e[7ma\e[7mn\e[7m \e[7m1\e[7m2\e[7m7\e[7m.\e[7m0\e[7m.\e[7m0\e[7m.\e[7m1\e[7m \e[7m-\e[7m-\e[7ma\e[7mc\e[7mc\e[7me\e[7ms\e[7ms\e[7mi\e[7mb\e[7ml\e[7me\e[7m \e[7m-\e[7m-\e[7mn\e[7mo\e[7m-\e[7mn\e[7mm\e[7ma\e[7mp\e[7m \e[7m-\e[7m-\e[7mu\e[7ml\e[7mi\e[7mm\e[7mi\e[7mt\e[7m \e[7m5\e[7m0\e[7m0\e[7m0\e[27m"
  - delay: 269
    content: "\e[55D\e[27mr\e[27mu\e[27ms\e[27mt\e[27ms\e[27mc\e[27ma\e[27mn\e[27m \e[27m1\e[27m2\e[27m7\e[27m.\e[27m0\e[27m.\e[27m0\e[27m.\e[27m1\e[27m \e[27m-\e[27m-\e[27ma\e[27mc\e[27mc\e[27me\e[27ms\e[27ms\e[27mi\e[27mb\e[27ml\e[27me\e[27m \e[27m-\e[27m-\e[27mn\e[27mo\e[27m-\e[27mn\e[27mm\e[27ma\e[27mp\e[27m \e[27m-\e[27m-\e[27mu\e[27ml\e[27mi\e[27mm\e[27mi\e[27mt\e[27m \e[27m5\e[27m0\e[27m0\e[27m0\e[?1l\e>\e[?2004l\r\r\n\e]2;rustscan 127.0.0.1 --accessible --no-nmap --ulimit 5000\a\e]1;rustscan\aAutomatically increasing ulimit value to 5000.\r\n"
  - delay: 1536
    content: "Open 127.0.0.1:38602\r\n"
  - delay: 395
    content: "Open 127.0.0.1:50078\r\n"
  - delay: 450
    content: "127.0.0.1 -> [38602,50078]\r\n\e[1m\e[7m%\e[27m\e[1m\e[0m                                                                                                          \r \r\e]2;bee@beehive:~/Documents/RustScan\a\e]1;..ents/RustScan\a"
  - delay: 143
    content: "\r\e[0m\e[27m\e[24m\e[J\r\n\e[1m\e[0m\e[1m\e[36mRustScan\e[0m\e[36m\e[39m\e[1m \e[0m\e[1mon \e[0m\e[1m\e[37m\e[1m\e[37m\e[0m\e[37m\e[1m\e[37m\e[35m master\e[0m\e[35m\e[39m\e[1m\e[0m\e[1m\e[0m\e[1m\e[31m [?]\e[0m\e[31m\e[39m\e[1m\e[0m\e[0m\e[39m\e[1m \e[0m\e[1mis \e[0m\e[1m\e[31m\U0001F4E6 vrustscan:1.10.0\e[0m\e[31m\e[39m\e[1m \e[0m\e[1mvia \e[0m\e[1m\e[31m\U0001D5E5 v1.46.0\e[0m\e[31m\e[39m\e[1m \e[0m\e[1mtook \e[0m\e[1m\e[33m2s\e[0m\e[33m\e[39m\e[1m \e[0m\r\n\e[1m\e[0m\e[1m\e[32m➜ \e[0m\e[32m\e[39m\e[1m\e[0m\e[K\e[?1h\e=\e[?2004h"
  - delay: 563
    content: "\e[?2004l\r\r\n"


================================================
FILE: pictures/fast.yml
================================================
# The configurations that used for the recording, feel free to edit them
config:

  # Specify a command to be executed
  # like `/bin/bash -l`, `ls`, or any other commands
  # the default is bash for Linux
  # or powershell.exe for Windows
  command: zsh 
  
  # Specify the current working directory path
  # the default is the current working directory path
  cwd: /home/bee/Documents/RustScan
  
  # Export additional ENV variables
  env:
    recording: true
  
  # Explicitly set the number of columns
  # or use `auto` to take the current
  # number of columns of your shell
  cols: 105
  
  # Explicitly set the number of rows
  # or use `auto` to take the current
  # number of rows of your shell
  rows: 34
  
  # Amount of times to repeat GIF
  # If value is -1, play once
  # If value is 0, loop indefinitely
  # If value is a positive number, loop n times
  repeat: 0
  
  # Quality
  # 1 - 100
  quality: 100
  
  # Delay between frames in ms
  # If the value is `auto` use the actual recording delays
  frameDelay: auto
  
  # Maximum delay between frames in ms
  # Ignored if the `frameDelay` isn't set to `auto`
  # Set to `auto` to prevent limiting the max idle time
  maxIdleTime: auto
  
  # The surrounding frame box
  # The `type` can be null, window, floating, or solid`
  # To hide the title use the value null
  # Don't forget to add a backgroundColor style with a null as type
  frameBox:
    type: floating
    title: Terminalizer
    style:
      border: 0px black solid
      # boxShadow: none
      # margin: 0px
  
  # Add a watermark image to the rendered gif
  # You need to specify an absolute path for
  # the image on your machine or a URL, and you can also
  # add your own CSS styles
  watermark:
    imagePath: null
    style:
      position: absolute
      right: 15px
      bottom: 15px
      width: 100px
      opacity: 0.9
  
  # Cursor style can be one of
  # `block`, `underline`, or `bar`
  cursorStyle: block
  
  # Font family
  # You can use any font that is installed on your machine
  # in CSS-like syntax
  fontFamily: "Monaco, Lucida Console, Ubuntu Mono, Monospace"
  
  # The size of the font
  fontSize: 12
  
  # The height of lines
  lineHeight: 1
  
  # The spacing between letters
  letterSpacing: 0
  
  # Theme
  theme:
    background: "transparent"
    foreground: "#afafaf"
    cursor: "#c7c7c7"
    black: "#232628"
    red: "#fc4384"
    green: "#b3e33b"
    yellow: "#ffa727"
    blue: "#75dff2"
    magenta: "#ae89fe"
    cyan: "#708387"
    white: "#d5d5d0"
    brightBlack: "#626566"
    brightRed: "#ff7fac"
    brightGreen: "#c8ed71"
    brightYellow: "#ebdf86"
    brightBlue: "#75dff2"
    brightMagenta: "#ae89fe"
    brightCyan: "#b1c6ca"
    brightWhite: "#f9f9f4"
  
# Records, feel free to edit them
records:
  - delay: 815
    content: "\e[1m\e[7m%\e[27m\e[1m\e[0m                                                                                                        \r \r\e]2;..ents/RustScan\a"
  - delay: 178
    content: "\r\e[0m\e[27m\e[24m\e[J\r\n\e[1m\e[0m\e[1m\e[36mRustScan\e[0m\e[36m\e[39m\e[1m \e[0m\e[1mon \e[0m\e[1m\e[37m\e[1m\e[37m\e[0m\e[37m\e[1m\e[37m\e[35m asyncMaster\e[0m\e[35m\e[39m\e[1m\e[0m\e[1m\e[0m\e[1m\e[31m [$!?]\e[0m\e[31m\e[39m\e[1m\e[0m\e[0m\e[39m\e[1m \e[0m\e[1mis \e[0m\e[1m\e[31m\U0001F4E6 vrustscan:1.0.1\e[0m\e[31m\e[39m\e[1m \e[0m\e[1mvia \e[0m\e[1m\e[31m\U0001D5E5 v1.45.0\e[0m\e[31m\e[39m\e[1m \e[0m\r\n\e[1m\e[0m\e[1m\e[32m➜ \e[0m\e[32m\e[39m\e[1m\e[0m\e[K\e[?1h\e=\e[?2004h"
  - delay: 406
    content: "\e[32mc\e[39m\e[90margo build --release && ./target/release/rustscan 127.0.0.1\e[39m\e[59D"
  - delay: 137
    content: "\b\e[1m\e[31mc\e[1m\e[31ma\e[0m\e[39m"
  - delay: 72
    content: "\b\b\e[1m\e[31mc\e[1m\e[31ma\e[1m\e[31mr\e[0m\e[39m"
  - delay: 203
    content: "\b\b\b\e[0m\e[32mc\e[0m\e[32ma\e[0m\e[32mr\e[32mg\e[32mo\e[39m\e[39m \e[39mb\e[39mu\e[39mi\e[39ml\e[39md\e[39m \e[39m-\e[39m-\e[39mr\e[39me\e[39ml\e[39me\e[39ma\e[39ms\e[39me\e[39m \e[39m&\e[39m&\e[39m \e[32m.\e[32m/\e[32mt\e[32ma\e[32mr\e[32mg\e[32me\e[32mt\e[32m/\e[32mr\e[32me\e[32ml\e[32me\e[32ma\e[32ms\e[32me\e[32m/\e[32mr\e[32mu\e[32ms\e[32mt\e[32ms\e[32mc\e[32ma\e[32mn\e[39m\e[39m \e[39m1\e[39m2\e[39m7\e[39m.\e[39m0\e[39m.\e[39m0\e[39m.\e[39m1"
  - delay: 145
    content: "\e[?1l\e>"
  - delay: 7
    content: "\e[?2004l\r\r\n\e]2;cargo\a"
  - delay: 37
    content: "\e[0m\e[0m\e[1m\e[36m    Building\e[0m [====================================================>    ] 87/92: futures-executor, smol \r\e[0m\e[0m\e[1m\e[36m    Building\e[0m [======================================================>  ] 89/92: futures, async-std     \r\e[0m\e[0m\e[1m\e[36m    Building\e[0m [======================================================>  ] 90/92: async-std              \r\e[0m\e[0m\e[1m\e[36m    Building\e[0m [=======================================================> ] 91/92: rustscan(bin)          \r\e[K\e[0m\e[1m\e[33mwarning\e[0m\e[0m\e[1m: unreachable expression\e[0m\r\n\e[0m   \e[0m\e[0m\e[1m\e[38;5;12m--> \e[0m\e[0msrc/main.rs:193:13\e[0m\r\n\e[0m    \e[0m\e[0m\e[1m\e[38;5;12m|\e[0m\r\n\e[0m\e[1m\e[38;5;12m192\e[0m\e[0m \e[0m\e[0m\e[1m\e[38;5;12m| \e[0m\e[0m            panic!(\"Unable to convert to socket address\");\e[0m\r\n\e[0m    \e[0m\e[0m\e[1m\e[38;5;12m| \e[0m\e[0m            \e[0m\e[0m\e[1m\e[38;5;12m----------------------------------------------\e[0m\e[0m \e[0m\e[0m\e[1m\e[38;5;12many code following this expression is unreachable\e[0m\r\n\e[0m\e[1m\e[38;5;12m193\e[0m\e[0m \e[0m\e[0m\e[1m\e[38;5;12m| \e[0m\e[0m            Err(io::Error::new(io::ErrorKind::Other, e.to_string()))\e[0m\r\n\e[0m    \e[0m\e[0m\e[1m\e[38;5;12m| \e[0m\e[0m            \e[0m\e[0m\e[1m\e[33m^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\e[0m\e[0m \e[0m\e[0m\e[1m\e[33munreachable expression\e[0m\r\n\e[0m    \e[0m\e[0m\e[1m\e[38;5;12m|\e[0m\r\n\e[0m    \e[0m\e[0m\e[1m\e[38;5;12m= \e[0m\e[0m\e[1mnote\e[0m\e[0m: `#[warn(unreachable_code)]` on by default\e[0m\r\n\r\n\e[0m\e[1m\e[33mwarning\e[0m\e[0m\e[1m: unused variable: `x`\e[0m\r\n\e[0m  \e[0m\e[0m\e[1m\e[38;5;12m--> \e[0m\e[0msrc/main.rs:57:14\e[0m\r\n\e[0m   \e[0m\e[0m\e[1m\e[38;5;12m|\e[0m\r\n\e[0m\e[1m\e[38;5;12m57\e[0m\e[0m \e[0m\e[0m\e[1m\e[38;5;12m| \e[0m\e[0m        Some(x) => {\e[0m\r\n\e[0m   \e[0m\e[0m\e[1m\e[38;5;12m| \e[0m\e[0m             \e[0m\e[0m\e[1m\e[33m^\e[0m\e[0m \e[0m\e[0m\e[1m\e[33mhelp: if this is intentional, prefix it with an underscore: `_x`\e[0m\r\n\e[0m   \e[0m\e[0m\e[1m\e[38;5;12m|\e[0m\r\n\e[0m   \e[0m\e[0m\e[1m\e[38;5;12m= \e[0m\e[0m\e[1mnote\e[0m\e[0m: `#[warn(unused_variables)]` on by default\e[0m\r\n\r\n\e[0m\e[1m\e[33mwarning\e[0m\e[0m\e[1m: 2 warnings emitted\e[0m\r\n\r\n\e[0m\e[0m\e[1m\e[32m    Finished\e[0m release [optimized] target(s) in 0.03s\r\n\e[32m\r\n     _____           _    _____                 \r\n    |  __ \\         | |  / ____|                \r\n    | |__) |   _ ___| |_| (___   ___ __ _ _ __  \r\n    |  _  / | | / __| __|\\___ \\ / __/ _` | '_ \\ \r\n    | | \\ \\ |_| \\__ \\ |_ ____) | (_| (_| | | | |\r\n    |_|  \\_\\__,_|___/\\__|_____/ \\___\\__,_|_| |_|\r\n    Faster nmap scanning with rust.\e[0m \r\n \e[31mAutomated Decryption Tool - https://github.com/ciphey/ciphey\e[0m \r\n \e[32mCreator https://github.com/brandonskerritt\e[0m\r\n"
  - delay: 326
    content: "Open \e[35m53\e[0m\r\nOpen \e[35m631\e[0m\r\n"
  - delay: 6
    content: "Open \e[35m1716\e[0m\r\n"
  - delay: 1138
    content: "Open \e[35m46624\e[0m\r\n"
  - delay: 156
    content: "Open \e[35m52880\e[0m\r\n"
  - delay: 146
    content: "\e[34mStarting nmap.\e[0m\r\n\e[1m\e[7m%\e[27m\e[1m\e[0m                                                                                                        \r \r\e]2;..ents/RustScan\a"
  - delay: 9
    content: "Starting Nmap 7.80 ( https://nmap.org ) at 2020-07-22 22:12 BST\r\n"
  - delay: 153
    content: "\r\e[0m\e[27m\e[24m\e[J\r\n\e[1m\e[0m\e[1m\e[36mRustScan\e[0m\e[36m\e[39m\e[1m \e[0m\e[1mon \e[0m\e[1m\e[37m\e[1m\e[37m\e[0m\e[37m\e[1m\e[37m\e[35m asyncMaster\e[0m\e[35m\e[39m\e[1m\e[0m\e[1m\e[0m\e[1m\e[31m [$!?]\e[0m\e[31m\e[39m\e[1m\e[0m\e[0m\e[39m\e[1m \e[0m\e[1mis \e[0m\e[1m\e[31m\U0001F4E6 vrustscan:1.0.1\e[0m\e[31m\e[39m\e[1m \e[0m\e[1mvia \e[0m\e[1m\e[31m\U0001D5E5 v1.45.0\e[0m\e[31m\e[39m\e[1m \e[0m\r\n\e[1m\e[0m\e[1m\e[32m➜ \e[0m\e[32m\e[39m\e[1m\e[0m\e[K\e[?1h\e=\e[?2004h"
  - delay: 119
    content: "NSE: Loaded 151 scripts for scanning.\r\nNSE: Script Pre-scanning.\r\nNSE: Starting runlevel 1 (of 3) scan.\r\nInitiating NSE at 22:12\r\nCompleted NSE at 22:12, 0.00s elapsed\r\nNSE: Starting runlevel 2 (of 3) scan.\r\nInitiating NSE at 22:12\r\nCompleted NSE at 22:12, 0.00s elapsed\r\nNSE: Starting runlevel 3 (of 3) scan.\r\nInitiating NSE at 22:12\r\nCompleted NSE at 22:12, 0.00s elapsed\r\n"
  - delay: 21
    content: "Initiating Ping Scan at 22:12\r\nScanning 127.0.0.1 [2 ports]\r\nCompleted Ping Scan at 22:12, 0.00s elapsed (1 total hosts)\r\nInitiating Connect Scan at 22:12\r\nScanning localhost (127.0.0.1) [5 ports]\r\nDiscovered open port 53/tcp on 127.0.0.1\r\nDiscovered open port 46624/tcp on 127.0.0.1\r\nDiscovered open port 1716/tcp on 127.0.0.1\r\nDiscovered open port 631/tcp on 127.0.0.1\r\nCompleted Connect Scan at 22:12, 0.00s elapsed (5 total ports)\r\n"
  - delay: 52
    content: "Initiating Service scan at 22:12\r\nScanning 4 services on localhost (127.0.0.1)\r\n"
  - delay: 105
    content: "\e[?2004l\r\r\n\e[1m\e[7m%\e[27m\e[1m\e[0m                                                                                                        \r \r\e]2;..ents/RustScan\a"
  - delay: 158
    content: "\r\e[0m\e[27m\e[24m\e[J\r\n\e[1m\e[0m\e[1m\e[36mRustScan\e[0m\e[36m\e[39m\e[1m \e[0m\e[1mon \e[0m\e[1m\e[37m\e[1m\e[37m\e[0m\e[37m\e[1m\e[37m\e[35m asyncMaster\e[0m\e[35m\e[39m\e[1m\e[0m\e[1m\e[0m\e[1m\e[31m [$!?]\e[0m\e[31m\e[39m\e[1m\e[0m\e[0m\e[39m\e[1m \e[0m\e[1mis \e[0m\e[1m\e[31m\U0001F4E6 vrustscan:1.0.1\e[0m\e[31m\e[39m\e[1m \e[0m\e[1mvia \e[0m\e[1m\e[31m\U0001D5E5 v1.45.0\e[0m\e[31m\e[39m\e[1m \e[0m\r\n\e[1m\e[0m\e[1m\e[31m➜ \e[0m\e[31m\e[39m\e[1m\e[0m\e[K\e[?1h\e=\e[?2004h"
  - delay: 1332
    content: "\e[?2004l\r\r\n"


================================================
FILE: pictures/newfast.yml
================================================
# The configurations that used for the recording, feel free to edit them
config:

  # Specify a command to be executed
  # like `/bin/bash -l`, `ls`, or any other commands
  # the default is bash for Linux
  # or powershell.exe for Windows
  command: zsh 
  
  # Specify the current working directory path
  # the default is the current working directory path
  cwd: /home/bee/Documents/RustScan
  
  # Export additional ENV variables
  env:
    recording: true
  
  # Explicitly set the number of columns
  # or use `auto` to take the current
  # number of columns of your shell
  cols: 235
  
  # Explicitly set the number of rows
  # or use `auto` to take the current
  # number of rows of your shell
  rows: 31
  
  # Amount of times to repeat GIF
  # If value is -1, play once
  # If value is 0, loop indefinitely
  # If value is a positive number, loop n times
  repeat: 0
  
  # Quality
  # 1 - 100
  quality: 100
  
  # Delay between frames in ms
  # If the value is `auto` use the actual recording delays
  frameDelay: auto
  
  # Maximum delay between frames in ms
  # Ignored if the `frameDelay` isn't set to `auto`
  # Set to `auto` to prevent limiting the max idle time
  maxIdleTime: auto
  
  # The surrounding frame box
  # The `type` can be null, window, floating, or solid`
  # To hide the title use the value null
  # Don't forget to add a backgroundColor style with a null as type
  frameBox:
    type: floating
    title: Terminalizer
    style:
      border: 0px black solid
      # boxShadow: none
      # margin: 0px
  
  # Add a watermark image to the rendered gif
  # You need to specify an absolute path for
  # the image on your machine or a URL, and you can also
  # add your own CSS styles
  watermark:
    imagePath: null
    style:
      position: absolute
      right: 15px
      bottom: 15px
      width: 100px
      opacity: 0.9
  
  # Cursor style can be one of
  # `block`, `underline`, or `bar`
  cursorStyle: block
  
  # Font family
  # You can use any font that is installed on your machine
  # in CSS-like syntax
  fontFamily: "Monaco, Lucida Console, Ubuntu Mono, Monospace"
  
  # The size of the font
  fontSize: 12
  
  # The height of lines
  lineHeight: 1
  
  # The spacing between letters
  letterSpacing: 0
  
  # Theme
  theme:
    background: "transparent"
    foreground: "#afafaf"
    cursor: "#c7c7c7"
    black: "#232628"
    red: "#fc4384"
    green: "#b3e33b"
    yellow: "#ffa727"
    blue: "#75dff2"
    magenta: "#ae89fe"
    cyan: "#708387"
    white: "#d5d5d0"
    brightBlack: "#626566"
    brightRed: "#ff7fac"
    brightGreen: "#c8ed71"
    brightYellow: "#ebdf86"
    brightBlue: "#75dff2"
    brightMagenta: "#ae89fe"
    brightCyan: "#b1c6ca"
    brightWhite: "#f9f9f4"
  
# Records, feel free to edit them
records:
  - delay: 818
    content: "\e[1m\e[7m%\e[27m\e[1m\e[0m                                                                                                                                                                                                                                          \r \r\e]2;bee@beehive: ~/Documents/RustScan\a\e]1;..ents/RustScan\a"
  - delay: 187
    content: "\r\e[0m\e[27m\e[24m\e[J\r\n\e[1m\e[0m\e[1m\e[36mRustScan\e[0m\e[36m\e[39m\e[1m \e[0m\e[1mon \e[0m\e[1m\e[37m\e[1m\e[37m\e[0m\e[37m\e[1m\e[37m\e[35m master\e[0m\e[35m\e[39m\e[1m\e[0m\e[1m\e[0m\e[1m\e[31m [⇡$!?]\e[0m\e[31m\e[39m\e[1m\e[0m\e[0m\e[39m\e[1m \e[0m\e[1mis \e[0m\e[1m\e[31m\U0001F4E6 vrustscan:1.0.1\e[0m\e[31m\e[39m\e[1m \e[0m\e[1mvia \e[0m\e[1m\e[31m\U0001D5E5 v1.45.0\e[0m\e[31m\e[39m\e[1m \e[0m\r\n\e[1m\e[0m\e[1m\e[32m➜ \e[0m\e[32m\e[39m\e[1m\e[0m\e[K\e[?1h\e=\e[?2004h"
  - delay: 432
    content: "\e[32mc\e[39m\e[90margo build --release && ./target/release/rustscan 8.8.8.8\e[39m\e[57D"
  - delay: 106
    content: "\b\e[1m\e[31mc\e[1m\e[31ma\e[0m\e[39m"
  - delay: 115
    content: "\b\b\e[1m\e[31mc\e[1m\e[31ma\e[1m\e[31mr\e[0m\e[39m"
  - delay: 178
    content: "\b\b\b\e[0m\e[32mc\e[0m\e[32ma\e[0m\e[32mr\e[32mg\e[32mo\e[39m\e[39m \e[39mb\e[39mu\e[39mi\e[39ml\e[39md\e[39m \e[39m-\e[39m-\e[39mr\e[39me\e[39ml\e[39me\e[39ma\e[39ms\e[39me\e[39m \e[39m&\e[39m&\e[39m \e[32m.\e[32m/\e[32mt\e[32ma\e[32mr\e[32mg\e[32me\e[32mt\e[32m/\e[32mr\e[32me\e[32ml\e[32me\e[32ma\e[32ms\e[32me\e[32m/\e[32mr\e[32mu\e[32ms\e[32mt\e[32ms\e[32mc\e[32ma\e[32mn\e[39m\e[39m \e[39m8\e[39m.\e[39m8\e[39m.\e[39m8\e[39m.\e[39m8"
  - delay: 143
    content: "\e[?1l\e>"
  - delay: 8
    content: "\e[?2004l\r\r\n\e]2;cargo build --release && ./target/release/rustscan 8.8.8.8\a\e]1;cargo\a"
  - delay: 40
    content: "\e[0m\e[0m\e[1m\e[36m    Building\e[0m [=================================================>       ] 82/92: proc-macro-nested(build), rayon-core                                                                                                                     \r\e[0m\e[0m\e[1m\e[36m    Building\e[0m [==================================================>      ] 83/92: rayon, proc-macro-nested(build)                                                                                                                          \r\e[0m\e[0m\e[1m\e[36m    Building\e[0m [===================================================>     ] 84/92: proc-macro-nested(build)                                                                                                                                 \r\e[0m\e[0m\e[1m\e[36m    Building\e[0m [===================================================>     ] 85/92: proc-macro-nested                                                                                                                                        \r\e[0m\e[0m\e[1m\e[36m    Building\e[0m [====================================================>    ] 86/92: futures-util                                                                                                                                             \r\e[0m\e[0m\e[1m\e[36m    Building\e[0m [====================================================>    ] 87/92: smol, futures-executor                                                                                                                                   \r\e[0m\e[0m\e[1m\e[36m    Building\e[0m [======================================================>  ] 89/92: async-std, futures                                                                                                                                       \r\e[0m\e[0m\e[1m\e[36m    Building\e[0m [======================================================>  ] 90/92: async-std                                                                                                                                                \r\e[0m\e[0m\e[1m\e[36m    Building\e[0m [=======================================================> ] 91/92: rustscan(bin)                                                                                                                                            \r\e[K\e[0m\e[1m\e[33mwarning\e[0m\e[0m\e[1m: unused import: `Command`\e[0m\r\n\e[0m \e[0m\e[0m\e[1m\e[38;5;12m--> \e[0m\e[0msrc/main.rs:5:26\e[0m\r\n\e[0m  \e[0m\e[0m\e[1m\e[38;5;12m|\e[0m\r\n\e[0m\e[1m\e[38;5;12m5\e[0m\e[0m \e[0m\e[0m\e[1m\e[38;5;12m| \e[0m\e[0muse std::process::{exit, Command};\e[0m\r\n\e[0m  \e[0m\e[0m\e[1m\e[38;5;12m| \e[0m\e[0m                         \e[0m\e[0m\e[1m\e[33m^^^^^^^\e[0m\r\n\e[0m  \e[0m\e[0m\e[1m\e[38;5;12m|\e[0m\r\n\e[0m  \e[0m\e[0m\e[1m\e[38;5;12m= \e[0m\e[0m\e[1mnote\e[0m\e[0m: `#[warn(unused_imports)]` on by default\e[0m\r\n\r\n\e[0m\e[0m\e[1m\e[36m    Building\e[0m [=======================================================> ] 91/92: rustscan(bin)                                                                                                                                            \r\e[K\e[0m\e[1m\e[33mwarning\e[0m\e[0m\e[1m: unreachable expression\e[0m\r\n\e[0m   \e[0m\e[0m\e[1m\e[38;5;12m--> \e[0m\e[0msrc/main.rs:181:21\e[0m\r\n\e[0m    \e[0m\e[0m\e[1m\e[38;5;12m|\e[0m\r\n\e[0m\e[1m\e[38;5;12m180\e[0m\e[0m \e[0m\e[0m\e[1m\e[38;5;12m| \e[0m\e[0m                    panic!(\"Too many open files. Please reduce batch size.\");\e[0m\r\n\e[0m    \e[0m\e[0m\e[1m\e[38;5;12m| \e[0m\e[0m                    \e[0m\e[0m\e[1m\e[38;5;12m---------------------------------------------------------\e[0m\e[0m \e[0m\e[0m\e[1m\e[38;5;12many code following this expression is unreachable\e[0m\r\n\e[0m\e[1m\e[38;5;12m181\e[0m\e[0m \e[0m\e[0m\e[1m\e[38;5;12m| \e[0m\e[0m                    Err(e)\e[0m\r\n\e[0m    \e[0m\e[0m\e[1m\e[38;5;12m| \e[0m\e[0m                    \e[0m\e[0m\e[1m\e[33m^^^^^^\e[0m\e[0m \e[0m\e[0m\e[1m\e[33munreachable expression\e[0m\r\n\e[0m    \e[0m\e[0m\e[1m\e[38;5;12m|\e[0m\r\n\e[0m    \e[0m\e[0m\e[1m\e[38;5;12m= \e[0m\e[0m\e[1mnote\e[0m\e[0m: `#[warn(unreachable_code)]` on by default\e[0m\r\n\r\n\e[0m\e[1m\e[33mwarning\e[0m\e[0m\e[1m: unreachable expression\e[0m\r\n\e[0m   \e[0m\e[0m\e[1m\e[38;5;12m--> \e[0m\e[0msrc/main.rs:189:13\e[0m\r\n\e[0m    \e[0m\e[0m\e[1m\e[38;5;12m|\e[0m\r\n\e[0m\e[1m\e[38;5;12m188\e[0m\e[0m \e[0m\e[0m\e[1m\e[38;5;12m| \e[0m\e[0m            panic!(\"Unable to convert to socket address\");\e[0m\r\n\e[0m    \e[0m\e[0m\e[1m\e[38;5;12m| \e[0m\e[0m            \e[0m\e[0m\e[1m\e[38;5;12m----------------------------------------------\e[0m\e[0m \e[0m\e[0m\e[1m\e[38;5;12many code following this expression is unreachable\e[0m\r\n\e[0m\e[1m\e[38;5;12m189\e[0m\e[0m \e[0m\e[0m\e[1m\e[38;5;12m| \e[0m\e[0m            Err(io::Error::new(io::ErrorKind::Other, e.to_string()))\e[0m\r\n\e[0m    \e[0m\e[0m\e[1m\e[38;5;12m| \e[0m\e[0m            \e[0m\e[0m\e[1m\e[33m^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\e[0m\e[0m \e[0m\e[0m\e[1m\e[33munreachable expression\e[0m\r\n\r\n\e[0m\e[1m\e[33mwarning\e[0m\e[0m\e[1m: unused variable: `command_run`\e[0m\r\n\e[0m  \e[0m\e[0m\e[1m\e[38;5;12m--> \e[0m\e[0msrc/main.rs:55:9\e[0m\r\n\e[0m   \e[0m\e[0m\e[1m\e[38;5;12m|\e[0m\r\n\e[0m\e[1m\e[38;5;12m55\e[0m\e[0m \e[0m\e[0m\e[1m\e[38;5;12m| \e[0m\e[0m    let command_run: String = match command_matches {\e[0m\r\n\e[0m   \e[0m\e[0m\e[1m\e[38;5;12m| \e[0m\e[0m        \e[0m\e[0m\e[1m\e[33m^^^^^^^^^^^\e[0m\e[0m \e[0m\e[0m\e[1m\e[33mhelp: if this is intentional, prefix it with an underscore: `_command_run`\e[0m\r\n\e[0m   \e[0m\e[0m\e[1m\e[38;5;12m|\e[0m\r\n\e[0m   \e[0m\e[0m\e[1m\e[38;5;12m= \e[0m\e[0m\e[1mnote\e[0m\e[0m: `#[warn(unused_variables)]` on by default\e[0m\r\n\r\n\e[0m\e[1m\e[33mwarning\e[0m\e[0m\e[1m: unused variable: `x`\e[0m\r\n\e[0m  \e[0m\e[0m\e[1m\e[38;5;12m--> \e[0m\e[0msrc/main.rs:57:14\e[0m\r\n\e[0m   \e[0m\e[0m\e[1m\e[38;5;12m|\e[0m\r\n\e[0m\e[1m\e[38;5;12m57\e[0m\e[0m \e[0m\e[0m\e[1m\e[38;5;12m| \e[0m\e[0m        Some(x) => {\e[0m\r\n\e[0m   \e[0m\e[0m\e[1m\e[38;5;12m| \e[0m\e[0m             \e[0m\e[0m\e[1m\e[33m^\e[0m\e[0m \e[0m\e[0m\e[1m\e[33mhelp: if this is intentional, prefix it with an underscore: `_x`\e[0m\r\n\r\n\e[0m\e[1m\e[33mwarning\e[0m\e[0m\e[1m: 5 warnings emitted\e[0m\r\n\r\n\e[0m\e[0m\e[1m\e[32m    Finished\e[0m release [optimized] target(s) in 0.03s\r\n\e[32m\r\n     _____           _    _____                 \r\n    |  __ \\         | |  / ____|                \r\n    | |__) |   _ ___| |_| (___   ___ __ _ _ __  \r\n    |  _  / | | / __| __|\\___ \\ / __/ _` | '_ \\ \r\n    | | \\ \\ |_| \\__ \\ |_ ____) | (_| (_| | | | |\r\n    |_|  \\_\\__,_|___/\\__|_____/ \\___\\__,_|_| |_|\r\n    Faster nmap scanning with rust.\e[0m \r\n \e[31mAutomated Decryption Tool - https://github.com/ciphey/ciphey\e[0m \r\n \e[32mCreator https://github.com/brandonskerritt\e[0m\r\n"
  - delay: 368
    content: "Open \e[35m53\e[0m\r\n"
  - delay: 37
    content: "Open \e[35m853\e[0m\r\n"
  - delay: 849
    content: "Open \e[35m443\e[0m\r\n"
  - delay: 6605
    content: "\e[34mStarting nmap.\e[0m\r\n\e[1m\e[7m%\e[27m\e[1m\e[0m                                                                                                                                                                                                                                          \r \r\e]2;bee@beehive: ~/Documents/RustScan\a\e]1;..ents/RustScan\a"
  - delay: 175
    content: "\r\e[0m\e[27m\e[24m\e[J\r\n\e[1m\e[0m\e[1m\e[36mRustScan\e[0m\e[36m\e[39m\e[1m \e[0m\e[1mon \e[0m\e[1m\e[37m\e[1m\e[37m\e[0m\e[37m\e[1m\e[37m\e[35m master\e[0m\e[35m\e[39m\e[1m\e[0m\e[1m\e[0m\e[1m\e[31m [⇡$!?]\e[0m\e[31m\e[39m\e[1m\e[0m\e[0m\e[39m\e[1m \e[0m\e[1mis \e[0m\e[1m\e[31m\U0001F4E6 vrustscan:1.0.1\e[0m\e[31m\e[39m\e[1m \e[0m\e[1mvia \e[0m\e[1m\e[31m\U0001D5E5 v1.45.0\e[0m\e[31m\e[39m\e[1m \e[0m\e[1mtook \e[0m\e[1m\e[33m8s\e[0m\e[33m\e[39m\e[1m \e[0m\r\n\e[1m\e[0m\e[1m\e[31m➜ \e[0m\e[31m\e[39m\e[1m\e[0m\e[K\e[?1h\e=\e[?2004h"
  - delay: 554
    content: "\e[?2004l\r\r\n"


================================================
FILE: pictures/nice.yml
================================================
# The configurations that used for the recording, feel free to edit them
config:

  # Specify a command to be executed
  # like `/bin/bash -l`, `ls`, or any other commands
  # the default is bash for Linux
  # or powershell.exe for Windows
  command: zsh 
  
  # Specify the current working directory path
  # the default is the current working directory path
  cwd: /home/bee/Documents/RustScan
  
  # Export additional ENV variables
  env:
    recording: true
  
  # Explicitly set the number of columns
  # or use `auto` to take the current
  # number of columns of your shell
  cols: 108
  
  # Explicitly set the number of rows
  # or use `auto` to take the current
  # number of rows of your shell
  rows: 45
  
  # Amount of times to repeat GIF
  # If value is -1, play once
  # If value is 0, loop indefinitely
  # If value is a positive number, loop n times
  repeat: 0
  
  # Quality
  # 1 - 100
  quality: 100
  
  # Delay between frames in ms
  # If the value is `auto` use the actual recording delays
  frameDelay: auto
  
  # Maximum delay between frames in ms
  # Ignored if the `frameDelay` isn't set to `auto`
  # Set to `auto` to prevent limiting the max idle time
  maxIdleTime: auto
  
  # The surrounding frame box
  # The `type` can be null, window, floating, or solid`
  # To hide the title use the value null
  # Don't forget to add a backgroundColor style with a null as type
  frameBox:
    type: floating
    title: Terminalizer
    style:
      border: 0px black solid
      # boxShadow: none
      # margin: 0px
  
  # Add a watermark image to the rendered gif
  # You need to specify an absolute path for
  # the image on your machine or a URL, and you can also
  # add your own CSS styles
  watermark:
    imagePath: null
    style:
      position: absolute
      right: 15px
      bottom: 15px
      width: 100px
      opacity: 0.9
  
  # Cursor style can be one of
  # `block`, `underline`, or `bar`
  cursorStyle: block
  
  # Font family
  # You can use any font that is installed on your machine
  # in CSS-like syntax
  fontFamily: "Monaco, Lucida Console, Ubuntu Mono, Monospace"
  
  # The size of the font
  fontSize: 12
  
  # The height of lines
  lineHeight: 1
  
  # The spacing between letters
  letterSpacing: 0
  
  # Theme
  theme:
    background: "transparent"
    foreground: "#afafaf"
    cursor: "#c7c7c7"
    black: "#232628"
    red: "#fc4384"
    green: "#b3e33b"
    yellow: "#ffa727"
    blue: "#75dff2"
    magenta: "#ae89fe"
    cyan: "#708387"
    white: "#d5d5d0"
    brightBlack: "#626566"
    brightRed: "#ff7fac"
    brightGreen: "#c8ed71"
    brightYellow: "#ebdf86"
    brightBlue: "#75dff2"
    brightMagenta: "#ae89fe"
    brightCyan: "#b1c6ca"
    brightWhite: "#f9f9f4"
  
# Records, feel free to edit them
records:
  - delay: 895
    content: "No protocol specified\r\nCan't open display :0\r\n"
  - delay: 253
    content: "\e[1m\e[7m%\e[27m\e[1m\e[0m                                                                                                           \r \r\e]2;bee@beehive: ~/Documents/RustScan\a\e]1;..ents/RustScan\a"
  - delay: 29
    content: c
  - delay: 131
    content: a
  - delay: 29
    content: "\r\e[0m\e[27m\e[24m\e[J\r\n\e[1m\e[0m\e[1m\e[36mRustScan\e[0m\e[36m\e[39m\e[1m \e[0m\e[1mon \e[0m\e[1m\e[37m\e[1m\e[37m\e[0m\e[37m\e[1m\e[37m\e[35m asyncMaster\e[0m\e[35m\e[39m\e[1m\e[0m\e[1m\e[0m\e[1m\e[31m [$!]\e[0m\e[31m\e[39m\e[1m\e[0m\e[0m\e[39m\e[1m \e[0m\e[1mis \e[0m\e[1m\e[31m\U0001F4E6 vrustscan:1.0.1\e[0m\e[31m\e[39m\e[1m \e[0m\e[1mvia \e[0m\e[1m\e[31m\U0001D5E5 v1.45.0\e[0m\e[31m\e[39m\e[1m \e[0m\r\n\e[1m\e[0m\e[1m\e[32m➜ \e[0m\e[32m\e[39m\e[1m\e[0m\e[K\e[?1h\e[?2004hc"
  - delay: 5
    content: "\b\e[1m\e[31mc\e[1m\e[31ma\e[0m\e[39m\e[90mrgo build --release && ./target/release/rustscan 127.0.0.1\e[39m\e[58D"
  - delay: 719
    content: "\b\b\e[1m\e[31mc\e[1m\e[31ma\e[1m\e[31mr\e[0m\e[39m"
  - delay: 697
    content: "\b\b\b\e[1m\e[31mc\e[1m\e[31ma\e[0m\e[39m\e[0m\e[90mr\b"
  - delay: 172
    content: "\b\b\e[0m\e[32mc\e[39m\e[0m\e[90md\e[90m \e[90mR\e[90mu\e[90ms\e[90mt\e[90mS\e[90mc\e[90ma\e[90mn\e[39m\e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[59D"
  - delay: 174
    content: "\b\e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[39m \e[11D"
  - delay: 2955
    content: "\e[32mc\e[39m\e[90md RustScan\e[39m\e[10D"
  - delay: 111
    content: "\b\e[1m\e[31mc\e[1m\e[31ma\e[0m\e[39m\e[90mr\e[90mg\e[90mo\e[90m \e[90mb\e[90mu\e[90mi\e[90ml\e[90md\e[90m --release && ./target/release/rustscan 127.0.0.1\e[39m\e[58D"
  - delay: 99
    content: "\b\b\e[1m\e[31mc\e[1m\e[31ma\e[1m\e[31mr\e[0m\e[39m"
  - delay: 192
    content: "\b\b\b\e[0m\e[32mc\e[0m\e[32ma\e[0m\e[32mr\e[32mg\e[32mo\e[39m\e[39m \e[39mb\e[39mu\e[39mi\e[39ml\e[39md\e[39m \e[39m-\e[39m-\e[39mr\e[39me\e[39ml\e[39me\e[39ma\e[39ms\e[39me\e[39m \e[39m&\e[39m&\e[39m \e[32m.\e[32m/\e[32mt\e[32ma\e[32mr\e[32mg\e[32me\e[32mt\e[32m/\e[32mr\e[32me\e[32ml\e[32me\e[32ma\e[32ms\e[32me\e[32m/\e[32mr\e[32mu\e[32ms\e[32mt\e[32ms\e[32mc\e[32ma\e[32mn\e[39m\e[39m \e[39m1\e[39m2\e[39m7\e[39m.\e[39m0\e[39m.\e[39m0\e[39m.\e[39m1"
  - delay: 217
    content: "\e[?1l\e[?2004l\r\r\n\e]2;cargo build --release && ./target/release/rustscan 127.0.0.1\a\e]1;cargo\a"
  - delay: 38
    content: "\e[0m\e[0m\e[1m\e[36m    Building\e[0m [                                                          ] 0/92: autocfg                   \r\e[0m\e[0m\e[1m\e[36m    Building\e[0m [==========================================>              ] 70/92: crossbeam-utils(build.r...\r\e[0m\e[0m\e[1m\e[36m    Building\e[0m [==========================================>              ] 71/92: crossbeam-utils(build.r...\r\e[0m\e[0m\e[1m\e[36m    Building\e[0m [============================================>            ] 73/92: crossbeam-utils(build),...\r\e[0m\e[0m\e[1m\e[36m    Building\e[0m [=============================================>           ] 75/92: crossbeam-utils, quote    \r\e[0m\e[0m\e[1m\e[36m    Building\e[0m [==============================================>          ] 76/92: crossbeam-epoch, crossb...\r\e[0m\e[0m\e[1m\e[36m    Building\e[0m [===============================================>         ] 78/92: crossbeam-deque, quote    \r\e[0m\e[0m\e[1m\e[36m    Building\e[0m [=================================================>       ] 81/92: rayon, syn                \r\e[0m\e[0m\e[1m\e[36m    Building\e[0m [===================================================>     ] 85/92: pin-project               \r\e[0m\e[0m\e[1m\e[36m    Building\e[0m [====================================================>    ] 86/92: futures-util              \r\e[0m\e[0m\e[1m\e[36m    Building\e[0m [=====================================================>   ] 88/92: async-std, futures-exec...\r\e[0m\e[0m\e[1m\e[36m    Building\e[0m [======================================================>  ] 89/92: futures-executor          \r\e[0m\e[0m\e[1m\e[36m    Building\e[0m [======================================================>  ] 90/92: futures                   \r\e[0m\e[0m\e[1m\e[36m    Building\e[0m [=======================================================> ] 91/92: rustscan(bin)             \r\e[K\e[0m\e[1m\e[33mwarning\e[0m\e[0m\e[1m: unreachable expression\e[0m\r\n\e[0m   \e[0m\e[0m\e[1m\e[38;5;12m--> \e[0m\e[0msrc/main.rs:193:13\e[0m\r\n\e[0m    \e[0m\e[0m\e[1m\e[38;5;12m|\e[0m\r\n\e[0m\e[1m\e[38;5;12m192\e[0m\e[0m \e[0m\e[0m\e[1m\e[38;5;12m| \e[0m\e[0m            panic!(\"Unable to convert to socket address\");\e[0m\r\n\e[0m    \e[0m\e[0m\e[1m\e[38;5;12m| \e[0m\e[0m            \e[0m\e[0m\e[1m\e[38;5;12m----------------------------------------------\e[0m\e[0m \e[0m\e[0m\e[1m\e[38;5;12many code following this expression is unreachable\e[0m\r\n\e[0m\e[1m\e[38;5;12m193\e[0m\e[0m \e[0m\e[0m\e[1m\e[38;5;12m| \e[0m\e[0m            Err(io::Error::new(io::ErrorKind::Other, e.to_string()))\e[0m\r\n\e[0m    \e[0m\e[0m\e[1m\e[38;5;12m| \e[0m\e[0m            \e[0m\e[0m\e[1m\e[33m^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\e[0m\e[0m \e[0m\e[0m\e[1m\e[33munreachable expression\e[0m\r\n\e[0m    \e[0m\e[0m\e[1m\e[38;5;12m|\e[0m\r\n\e[0m    \e[0m\e[0m\e[1m\e[38;5;12m= \e[0m\e[0m\e[1mnote\e[0m\e[0m: `#[warn(unreachable_code)]` on by default\e[0m\r\n\r\n\e[0m\e[1m\e[33mwarning\e[0m\e[0m\e[1m: unused variable: `x`\e[0m\r\n\e[0m  \e[0m\e[0m\e[1m\e[38;5;12m--> \e[0m\e[0msrc/main.rs:57:14\e[0m\r\n\e[0m   \e[0m\e[0m\e[1m\e[38;5;12m|\e[0m\r\n\e[0m\e[1m\e[38;5;12m57\e[0m\e[0m \e[0m\e[0m\e[1m\e[38;5;12m| \e[0m\e[0m        Some(x) => {\e[0m\r\n\e[0m   \e[0m\e[0m\e[1m\e[38;5;12m| \e[0m\e[0m             \e[0m\e[0m\e[1m\e[33m^\e[0m\e[0m \e[0m\e[0m\e[1m\e[33mhelp: if this is intentional, prefix it with an underscore: `_x`\e[0m\r\n\e[0m   \e[0m\e[0m\e[1m\e[38;5;12m|\e[0m\r\n\e[0m   \e[0m\e[0m\e[1m\e[38;5;12m= \e[0m\e[0m\e[1mnote\e[0m\e[0m: `#[warn(unused_variables)]` on by default\e[0m\r\n\r\n\e[0m\e[1m\e[33mwarning\e[0m\e[0m\e[1m: 2 warnings emitted\e[0m\r\n\r\n\e[0m\e[0m\e[1m\e[32m    Finished\e[0m release [optimized] target(s) in 0.03s\r\n\e[32m\r\n     _____           _    _____                 \r\n    |  __ \\         | |  / ____|                \r\n    | |__) |   _ ___| |_| (___   ___ __ _ _ __  \r\n    |  _  / | | / __| __|\\___ \\ / __/ _` | '_ \\ \r\n    | | \\ \\ |_| \\__ \\ |_ ____) | (_| (_| | | | |\r\n    |_|  \\_\\__,_|___/\\__|_____/ \\___\\__,_|_| |_|\r\n    Faster nmap scanning with rust.\e[0m \r\n \e[31mAutomated Decryption Tool - https://github.com/ciphey/ciphey\e[0m \r\n \e[32mCreator https://github.com/brandonskerritt\e[0m\r\n"
  - delay: 309
    content: "Open \e[35m53\e[0m\r\nOpen \e[35m631\e[0m\r\n"
  - delay: 1132
    content: "Open \e[35m46624\e[0m\r\n"
  - delay: 136
    content: "Open \e[35m51934\e[0m\r\n"
  - delay: 159
    content: "\e[34mStarting nmap.\e[0m\r\n\e[1m\e[7m%\e[27m\e[1m\e[0m                                                                                                           \r \r\e]2;bee@beehive: ~/Documents/RustScan\a\e]1;..ents/RustScan\aStarting Nmap 7.80 ( https://nmap.org ) at 2020-07-22 22:09 BST\r\n"
  - delay: 156
    content: "\r\e[0m\e[27m\e[24m\e[J\r\n\e[1m\e[0m\e[1m\e[36mRustScan\e[0m\e[36m\e[39m\e[1m \e[0m\e[1mon \e[0m\e[1m\e[37m\e[1m\e[37m\e[0m\e[37m\e[1m\e[37m\e[35m asyncMaster\e[0m\e[35m\e[39m\e[1m\e[0m\e[1m\e[0m\e[1m\e[31m [$!]\e[0m\e[31m\e[39m\e[1m\e[0m\e[0m\e[39m\e[1m \e[0m\e[1mis \e[0m\e[1m\e[31m\U0001F4E6 vrustscan:1.0.1\e[0m\e[31m\e[39m\e[1m \e[0m\e[1mvia \e[0m\e[1m\e[31m\U0001D5E5 v1.45.0\e[0m\e[31m\e[39m\e[1m \e[0m\e[1mtook \e[0m\e[1m\e[33m2s\e[0m\e[33m\e[39m\e[1m \e[0m\r\n\e[1m\e[0m\e[1m\e[32m➜ \e[0m\e[32m\e[39m\e[1m\e[0m\e[K\e[?1h\e[?2004h"
  - delay: 75
    content: "NSE: Loaded 151 scripts for scanning.\r\nNSE: Script Pre-scanning.\r\nNSE: Starting runlevel 1 (of 3) scan.\r\nInitiating NSE at 22:09\r\nCompleted NSE at 22:09, 0.00s elapsed\r\nNSE: Starting runlevel 2 (of 3) scan.\r\nInitiating NSE at 22:09\r\nCompleted NSE at 22:09, 0.00s elapsed\r\nNSE: Starting runlevel 3 (of 3) scan.\r\nInitiating NSE at 22:09\r\nCompleted NSE at 22:09, 0.00s elapsed\r\n"
  - delay: 21
    content: "Initiating Ping Scan at 22:09\r\nScanning 127.0.0.1 [2 ports]\r\nCompleted Ping Scan at 22:09, 0.00s elapsed (1 total hosts)\r\nInitiating Connect Scan at 22:09\r\nScanning localhost (127.0.0.1) [4 ports]\r\nDiscovered open port 53/tcp on 127.0.0.1\r\nDiscovered open port 631/tcp on 127.0.0.1\r\nDiscovered open port 46624/tcp on 127.0.0.1\r\nCompleted Connect Scan at 22:09, 0.00s elapsed (4 total ports)\r\n"
  - delay: 55
    content: "Initiating Service scan at 22:09\r\nScanning 3 services on localhost (127.0.0.1)\r\n"
  - delay: 42
    content: "\e[?2004l\r\r\n\e[1m\e[7m%\e[27m\e[1m\e[0m                                                                                                           \r \r\e]2;bee@beehive: ~/Documents/RustScan\a\e]1;..ents/RustScan\a"
  - delay: 168
    content: "\r\e[0m\e[27m\e[24m\e[J\r\n\e[1m\e[0m\e[1m\e[36mRustScan\e[0m\e[36m\e[39m\e[1m \e[0m\e[1mon \e[0m\e[1m\e[37m\e[1m\e[37m\e[0m\e[37m\e[1m\e[37m\e[35m asyncMaster\e[0m\e[35m\e[39m\e[1m\e[0m\e[1m\e[0m\e[1m\e[31m [$!]\e[0m\e[31m\e[39m\e[1m\e[0m\e[0m\e[39m\e[1m \e[0m\e[1mis \e[0m\e[1m\e[31m\U0001F4E6 vrustscan:1.0.1\e[0m\e[31m\e[39m\e[1m \e[0m\e[1mvia \e[0m\e[1m\e[31m\U0001D5E5 v1.45.0\e[0m\e[31m\e[39m\e[1m \e[0m\r\n\e[1m\e[0m\e[1m\e[31m➜ \e[0m\e[31m\e[39m\e[1m\e[0m\e[K\e[?1h\e[?2004h"
  - delay: 403
    content: "\e[?2004l\r\r\n"


================================================
FILE: release.sh
================================================
cargo publish && cargo build --release && git add Cargo.lock && git commit -m 'Updating lock file' && gpsup

================================================
FILE: src/address.rs
================================================
//! Provides functions to parse input IP addresses, CIDRs or files.
use std::collections::BTreeSet;
use std::fs::{self, File};
use std::io::{prelude::*, BufReader};
use std::net::{IpAddr, SocketAddr, ToSocketAddrs};
use std::path::Path;
use std::str::FromStr;

use cidr_utils::cidr::{IpCidr, IpInet};
use hickory_resolver::{
    config::{NameServerConfig, Protocol, ResolverConfig, ResolverOpts},
    Resolver,
};
use log::debug;

use crate::input::Opts;
use crate::warning;

/// Parses the string(s) into IP addresses.
///
/// Goes through all possible IP inputs (files or via argparsing).
///
/// ```rust
/// # use rustscan::input::Opts;
/// # use rustscan::address::parse_addresses;
/// let mut opts = Opts::default();
/// opts.addresses = vec!["192.168.0.0/30".to_owned()];
///
/// let ips = parse_addresses(&opts);
/// ```
///
/// Finally, any duplicates are removed to avoid excessive scans.
pub fn parse_addresses(input: &Opts) -> Vec<IpAddr> {
    let mut ips: Vec<IpAddr> = Vec::new();
    let mut unresolved_addresses: Vec<&str> = Vec::new();
    let backup_resolver = get_resolver(&input.resolver);

    for address in &input.addresses {
        let parsed_ips = parse_address(address, &backup_resolver);
        if !parsed_ips.is_empty() {
            ips.extend(parsed_ips);
        } else {
            unresolved_addresses.push(address);
        }
    }

    // If we got to this point this can only be a file path or the wrong input.
    for file_path in unresolved_addresses {
        let file_path = Path::new(file_path);

        if !file_path.is_file() {
            warning!(
                format!("Host {file_path:?} could not be resolved."),
                input.greppable,
                input.accessible
            );

            continue;
        }

        if let Ok(x) = read_ips_from_file(file_path, &backup_resolver) {
            ips.extend(x);
        } else {
            warning!(
                format!("Host {file_path:?} could not be resolved."),
                input.greppable,
                input.accessible
            );
        }
    }

    let excluded_cidrs = parse_excluded_networks(&input.exclude_addresses, &backup_resolver);

    // Remove duplicated/excluded IPs.
    let mut seen = BTreeSet::new();
    ips.retain(|ip| seen.insert(*ip) && !excluded_cidrs.iter().any(|cidr| cidr.contains(ip)));

    ips
}

/// Given a string, parse it as a host, IP address, or CIDR.
///
/// This allows us to pass files as hosts or cidr or IPs easily
/// Call this every time you have a possible IP-or-host.
///
/// If the address is a domain, we can self-resolve the domain locally
/// or resolve it by dns resolver list.
///
/// ```rust
/// # use rustscan::address::parse_address;
/// # use hickory_resolver::Resolver;
/// let ips = parse_address("127.0.0.1", &Resolver::default().unwrap());
/// ```
pub fn parse_address(address: &str, resolver: &Resolver) -> Vec<IpAddr> {
    if let Ok(addr) = IpAddr::from_str(address) {
        // `address` is an IP string
        vec![addr]
    } else if let Ok(net_addr) = IpInet::from_str(address) {
        // `address` is a CIDR string
        net_addr.network().into_iter().addresses().collect()
    } else {
        // `address` is a hostname or DNS name
        // attempt default DNS lookup
        match format!("{address}:80").to_socket_addrs() {
            Ok(mut iter) => vec![iter.next().unwrap().ip()],
            // default lookup didn't work, so try again with the dedicated resolver
            Err(_) => resolve_ips_from_host(address, resolver),
        }
    }
}

/// Uses DNS to get the IPS associated with host
fn resolve_ips_from_host(source: &str, backup_resolver: &Resolver) -> Vec<IpAddr> {
    let mut ips: Vec<IpAddr> = Vec::new();

    if let Ok(addrs) = source.to_socket_addrs() {
        for ip in addrs {
            ips.push(ip.ip());
        }
    } else if let Ok(addrs) = backup_resolver.lookup_ip(source) {
        ips.extend(addrs.iter());
    }

    ips
}

/// Parses excluded networks from a list of addresses.
///
/// This function handles three types of inputs:
/// 1. CIDR notation (e.g. "192.168.0.0/24")
/// 2. Single IP addresses (e.g. "192.168.0.1")
/// 3. Hostnames that need to be resolved (e.g. "example.com")
///
/// ```rust
/// # use rustscan::address::parse_excluded_networks;
/// # use hickory_resolver::Resolver;
/// let resolver = Resolver::default().unwrap();
/// let excluded = parse_excluded_networks(&Some(vec!["192.168.0.0/24".to_owned()]), &resolver);
/// ```
pub fn parse_excluded_networks(
    exclude_addresses: &Option<Vec<String>>,
    resolver: &Resolver,
) -> Vec<IpCidr> {
    exclude_addresses
        .iter()
        .flatten()
        .flat_map(|addr| parse_single_excluded_address(addr, resolver))
        .collect()
}

/// Parses a single address into an IpCidr, handling CIDR notation, IP addresses, and hostnames.
fn parse_single_excluded_address(addr: &str, resolver: &Resolver) -> Vec<IpCidr> {
    if let Ok(cidr) = IpCidr::from_str(addr) {
        return vec![cidr];
    }

    if let Ok(ip) = IpAddr::from_str(addr) {
        return vec![IpCidr::new_host(ip)];
    }

    resolve_ips_from_host(addr, resolver)
        .into_iter()
        .map(IpCidr::new_host)
        .collect()
}

/// Derive a DNS resolver.
///
/// 1. if the `resolver` parameter has been set:
///     1. assume the parameter is a path and attempt to read IPs.
///     2. parse the input as a comma-separated list of IPs.
/// 2. if `resolver` is not set:
///    1. attempt to derive a resolver from the system config. (e.g.
///       `/etc/resolv.conf` on *nix).
///    2. finally, build a CloudFlare-based resolver (default
///       behaviour).
fn get_resolver(resolver: &Option<String>) -> Resolver {
    match resolver {
        Some(r) => {
            let mut config = ResolverConfig::new();
            let resolver_ips = match read_resolver_from_file(r) {
                Ok(ips) => ips,
                Err(_) => r
                    .split(',')
                    .filter_map(|r| IpAddr::from_str(r).ok())
                    .collect::<Vec<_>>(),
            };
            for ip in resolver_ips {
                config.add_name_server(NameServerConfig::new(
                    SocketAddr::new(ip, 53),
                    Protocol::Udp,
                ));
            }
            Resolver::new(config, ResolverOpts::default()).unwrap()
        }
        None => match Resolver::from_system_conf() {
            Ok(resolver) => resolver,
            Err(_) => {
                Resolver::new(ResolverConfig::cloudflare_tls(), ResolverOpts::default()).unwrap()
            }
        },
    }
}

/// Parses and input file of IPs for use in DNS resolution.
fn read_resolver_from_file(path: &str) -> Result<Vec<IpAddr>, std::io::Error> {
    let ips = fs::read_to_string(path)?
        .lines()
        .filter_map(|line| IpAddr::from_str(line.trim()).ok())
        .collect();

    Ok(ips)
}

#[cfg(not(tarpaulin_include))]
/// Parses an input file of IPs and uses those
fn read_ips_from_file(
    ips: &std::path::Path,
    backup_resolver: &Resolver,
) -> Result<Vec<IpAddr>, std::io::Error> {
    let file = File::open(ips)?;
    let reader = BufReader::new(file);

    let mut ips: Vec<IpAddr> = Vec::new();

    for address_line in reader.lines() {
        if let Ok(address) = address_line {
            ips.extend(parse_address(&address, backup_resolver));
        } else {
            debug!("Line in file is not valid");
        }
    }

    Ok(ips)
}

#[cfg(test)]
mod tests {
    use super::{get_resolver, parse_addresses, Opts};
    use std::net::Ipv4Addr;

    #[test]
    fn parse_correct_addresses() {
        let opts = Opts {
            addresses: vec!["127.0.0.1".to_owned(), "192.168.0.0/30".to_owned()],
            ..Default::default()
        };

        let ips = parse_addresses(&opts);

        assert_eq!(
            ips,
            [
                Ipv4Addr::new(127, 0, 0, 1),
                Ipv4Addr::new(192, 168, 0, 0),
                Ipv4Addr::new(192, 168, 0, 1),
                Ipv4Addr::new(192, 168, 0, 2),
                Ipv4Addr::new(192, 168, 0, 3)
            ]
        );
    }

    #[test]
    fn parse_addresses_with_address_exclusions() {
        let opts = Opts {
            addresses: vec!["192.168.0.0/30".to_owned()],
            exclude_addresses: Some(vec!["192.168.0.1".to_owned()]),
            ..Default::default()
        };
        let ips = parse_addresses(&opts);

        assert_eq!(
            ips,
            [
                Ipv4Addr::new(192, 168, 0, 0),
                Ipv4Addr::new(192, 168, 0, 2),
                Ipv4Addr::new(192, 168, 0, 3)
            ]
        );
    }

    #[test]
    fn parse_addresses_with_cidr_exclusions() {
        let opts = Opts {
            addresses: vec!["192.168.0.0/29".to_owned()],
            exclude_addresses: Some(vec!["192.168.0.0/30".to_owned()]),
            ..Default::default()
        };
        let ips = parse_addresses(&opts);

        assert_eq!(
            ips,
            [
                Ipv4Addr::new(192, 168, 0, 4),
                Ipv4Addr::new(192, 168, 0, 5),
                Ipv4Addr::new(192, 168, 0, 6),
                Ipv4Addr::new(192, 168, 0, 7),
            ]
        );
    }

    #[test]
    fn parse_addresses_with_incorrect_address_exclusions() {
        let opts = Opts {
            addresses: vec!["192.168.0.0/30".to_owned()],
            exclude_addresses: Some(vec!["192.168.0.1".to_owned()]),
            ..Default::default()
        };
        let ips = parse_addresses(&opts);

        assert_eq!(
            ips,
            [
                Ipv4Addr::new(192, 168, 0, 0),
                Ipv4Addr::new(192, 168, 0, 2),
                Ipv4Addr::new(192, 168, 0, 3)
            ]
        );
    }

    #[test]
    fn parse_correct_host_addresses() {
        let opts = Opts {
            addresses: vec!["google.com".to_owned()],
            ..Default::default()
        };

        let ips = parse_addresses(&opts);

        assert_eq!(ips.len(), 1);
    }

    #[test]
    fn parse_correct_and_incorrect_addresses() {
        let opts = Opts {
            addresses: vec!["127.0.0.1".to_owned(), "im_wrong".to_owned()],
            ..Default::default()
        };

        let ips = parse_addresses(&opts);

        assert_eq!(ips, [Ipv4Addr::new(127, 0, 0, 1),]);
    }

    #[test]
    fn parse_incorrect_addresses() {
        let opts = Opts {
            addresses: vec!["im_wrong".to_owned(), "300.10.1.1".to_owned()],
            ..Default::default()
        };

        let ips = parse_addresses(&opts);

        assert!(ips.is_empty());
    }

    #[test]
    fn parse_hosts_file_and_incorrect_hosts() {
        // Host file contains IP, Hosts, incorrect IPs, incorrect hosts
        let opts = Opts {
            addresses: vec!["fixtures/hosts.txt".to_owned()],
            ..Default::default()
        };

        let ips = parse_addresses(&opts);

        assert_eq!(ips.len(), 3);
    }

    #[test]
    fn parse_empty_hosts_file() {
        // Host file contains IP, Hosts, incorrect IPs, incorrect hosts
        let opts = Opts {
            addresses: vec!["fixtures/empty_hosts.txt".to_owned()],
            ..Default::default()
        };

        let ips = parse_addresses(&opts);

        assert_eq!(ips.len(), 0);
    }

    #[test]
    fn parse_naughty_host_file() {
        // Host file contains IP, Hosts, incorrect IPs, incorrect hosts
        let opts = Opts {
            addresses: vec!["fixtures/naughty_string.txt".to_owned()],
            ..Default::default()
        };

        let ips = parse_addresses(&opts);

        assert_eq!(ips.len(), 0);
    }

    #[test]
    fn parse_duplicate_cidrs() {
        let opts = Opts {
            addresses: vec!["79.98.104.0/21".to_owned(), "79.98.104.0/24".to_owned()],
            ..Default::default()
        };

        let ips = parse_addresses(&opts);

        assert_eq!(ips.len(), 2_048);
    }

    #[test]
    fn parse_overspecific_cidr() {
        // a canonical CIDR string has 0 in all host bits, but we want to treat any CIDR-like string as CIDR
        let opts = Opts {
            addresses: vec!["192.128.1.1/24".to_owned()],
            ..Default::default()
        };

        let ips = parse_addresses(&opts);

        assert_eq!(ips.len(), 256);
    }

    #[test]
    fn resolver_args_google_dns() {
        // https://developers.google.com/speed/public-dns
        let opts = Opts {
            resolver: Some("8.8.8.8,8.8.4.4".to_owned()),
            ..Default::default()
        };

        let resolver = get_resolver(&opts.resolver);
        let lookup = resolver.lookup_ip("www.example.com.").unwrap();

        assert!(lookup.iter().next().is_some());
    }
}


================================================
FILE: src/benchmark/mod.rs
================================================
//! Provides functionality to capture timing information for scans.
//!
//! # Usage
//!
//! ```rust
//! // Initiate Benchmark vector
//! # use rustscan::benchmark::{Benchmark, NamedTimer};
//! # use log::info;
//! let mut bm = Benchmark::init();
//! // Start named timer with name
//! let mut example_bench = NamedTimer::start("Example Bench");
//! // Stop named timer
//! example_bench.end();
//! // Add named timer to Benchmarks
//! bm.push(example_bench);
//! // Print Benchmark Summary
//! info!("{}", bm.summary());
//! ```
use std::time::Instant;

/// A Benchmark struct to hold NamedTimers with name, start and end Instants,
#[derive(Debug)]
pub struct Benchmark {
    named_timers: Vec<NamedTimer>,
}

impl Benchmark {
    pub fn init() -> Self {
        Self {
            named_timers: Vec::new(),
        }
    }
    pub fn push(&mut self, timer: NamedTimer) {
        self.named_timers.push(timer);
    }

    /// Summary of the benchmarks will destruct the vector,
    /// formats every element the same way and return
    /// a single String with all the available information
    /// for easy printing
    pub fn summary(&self) -> String {
        let mut summary = String::from("\nRustScan Benchmark Summary");

        for timer in &self.named_timers {
            if let Some(start) = timer.start {
                if let Some(end) = timer.end {
                    let runtime_secs = end.saturating_duration_since(start).as_secs_f32();
                    summary.push_str(&format!("\n{0: <10} | {1: <10}s", timer.name, runtime_secs));
                }
            }
        }
        summary
    }
}

/// The purpose of NamedTimer is to hold a name,
/// start Instant and end Instant for a specific timer.
/// The given name will be presented in the benchmark summary,
/// start and end Instants will be used for calculating runtime.
#[derive(Debug)]
pub struct NamedTimer {
    name: &'static str,
    start: Option<Instant>,
    end: Option<Instant>,
}

impl NamedTimer {
    pub fn start(name: &'static str) -> Self {
        Self {
            name,
            start: Some(Instant::now()),
            end: None,
        }
    }
    pub fn end(&mut self) {
        self.end = Some(Instant::now());
    }
}

#[test]
fn benchmark() {
    let mut benchmarks = Benchmark::init();
    let mut test_timer = NamedTimer::start("test");
    std::thread::sleep(std::time::Duration::from_millis(100));
    test_timer.end();
    benchmarks.push(test_timer);
    benchmarks.push(NamedTimer::start("only_start"));
    assert!(benchmarks
        .summary()
        .contains("\nRustScan Benchmark Summary\ntest       | 0."));
    assert!(!benchmarks.summary().contains("only_start"));
}


================================================
FILE: src/input.rs
================================================
//! Provides a means to read, parse and hold configuration options for scans.
use clap::{Parser, ValueEnum};
use serde_derive::Deserialize;
use std::fs;
use std::path::PathBuf;

const LOWEST_PORT_NUMBER: u16 = 1;
const TOP_PORT_NUMBER: u16 = 65535;

/// Represents the strategy in which the port scanning will run.
///   - Serial will run from start to end, for example 1 to 1_000.
///   - Random will randomize the order in which ports will be scanned.
#[derive(Deserialize, Debug, ValueEnum, Clone, Copy, PartialEq, Eq)]
pub enum ScanOrder {
    Serial,
    Random,
}

/// Represents the scripts variant.
///   - none will avoid running any script, only portscan results will be shown.
///   - default will run the default embedded nmap script, that's part of RustScan since the beginning.
///   - custom will read the ScriptConfig file and the available scripts in the predefined folders
#[derive(Deserialize, Debug, ValueEnum, Clone, PartialEq, Eq, Copy)]
pub enum ScriptsRequired {
    None,
    Default,
    Custom,
}

/// Represents the range of ports to be scanned.
#[derive(Deserialize, Debug, Clone, PartialEq, Eq)]
pub struct PortRange {
    pub start: u16,
    pub end: u16,
}

#[cfg(not(tarpaulin_include))]
fn parse_range(input: &str) -> Result<PortRange, String> {
    let range = input
        .split('-')
        .map(str::parse)
        .collect::<Result<Vec<u16>, std::num::ParseIntError>>();

    if range.is_err() {
        return Err(String::from(
            "the range format must be 'start-end'. Example: 1-1000.",
        ));
    }

    match range.unwrap().as_slice() {
        [start, end] => Ok(PortRange {
            start: *start,
            end: *end,
        }),
        _ => Err(String::from(
            "the range format must be 'start-end'. Example: 1-1000.",
        )),
    }
}

#[derive(Parser, Debug, Clone)]
#[command(
    name = "rustscan",
    version = env!("CARGO_PKG_VERSION"),
    max_term_width = 120,
    help_template = "{bin} {version}\n{about}\n\nUSAGE:\n    {usage}\n\nOPTIONS:\n{options}",
)]
#[allow(clippy::struct_excessive_bools)]
/// Fast Port Scanner built in Rust.
/// WARNING Do not use this program against sensitive infrastructure since the
/// specified server may not be able to handle this many socket connections at once.
/// - Discord  <http://discord.skerritt.blog>
/// - GitHub <https://github.com/RustScan/RustScan>
pub struct Opts {
    /// A comma-delimited list or newline-delimited file of separated CIDRs, IPs, or hosts to be scanned.
    #[arg(short, long, value_delimiter = ',')]
    pub addresses: Vec<String>,

    /// A list of comma separated ports to be scanned. Example: 80,443,8080.
    #[arg(short, long, value_delimiter = ',')]
    pub ports: Option<Vec<u16>>,

    /// A range of ports with format start-end. Example: 1-1000.
    #[arg(short, long, conflicts_with = "ports", value_parser = parse_range)]
    pub range: Option<PortRange>,

    /// Whether to ignore the configuration file or not.
    #[arg(short, long)]
    pub no_config: bool,

    /// Hide the banner
    #[arg(long)]
    pub no_banner: bool,

    /// Custom path to config file
    #[arg(short, long, value_parser)]
    pub config_path: Option<PathBuf>,

    /// Greppable mode. Only output the ports. No Nmap. Useful for grep or outputting to a file.
    #[arg(short, long)]
    pub greppable: bool,

    /// Accessible mode. Turns off features which negatively affect screen readers.
    #[arg(long)]
    pub accessible: bool,

    /// A comma-delimited list or file of DNS resolvers.
    #[arg(long)]
    pub resolver: Option<String>,

    /// The batch size for port scanning, it increases or slows the speed of
    /// scanning. Depends on the open file limit of your OS.  If you do 65535
    /// it will do every port at the same time. Although, your OS may not
    /// support this.
    #[arg(short, long, default_value = "4500")]
    pub batch_size: usize,

    /// The timeout in milliseconds before a port is assumed to be closed.
    #[arg(short, long, default_value = "1500")]
    pub timeout: u32,

    /// The number of tries before a port is assumed to be closed.
    /// If set to 0, rustscan will correct it to 1.
    #[arg(long, default_value = "1")]
    pub tries: u8,

    /// Automatically ups the ULIMIT with the value you provided.
    #[arg(short, long)]
    pub ulimit: Option<usize>,

    /// The order of scanning to be performed. The "serial" option will
    /// scan ports in ascending order while the "random" option will scan
    /// ports randomly.
    #[arg(long, value_enum, ignore_case = true, default_value = "serial")]
    pub scan_order: ScanOrder,

    /// Level of scripting required for the run.
    #[arg(long, value_enum, ignore_case = true, default_value = "default")]
    pub scripts: ScriptsRequired,

    /// Use the top 1000 ports.
    #[arg(long)]
    pub top: bool,

    /// The Script arguments to run.
    /// To use the argument -A, end RustScan's args with '-- -A'.
    /// Example: 'rustscan -t 1500 -a 127.0.0.1 -- -A -sC'.
    /// This command adds -Pn -vvv -p $PORTS automatically to nmap.
    /// For things like --script '(safe and vuln)' enclose it in quotations marks \"'(safe and vuln)'\"
    #[arg(last = true)]
    pub command: Vec<String>,

    /// A list of comma separated ports to be excluded from scanning. Example: 80,443,8080.
    #[arg(short, long, value_delimiter = ',')]
    pub exclude_ports: Option<Vec<u16>>,

    /// A list of comma separated CIDRs, IPs, or hosts to be excluded from scanning.
    #[arg(short = 'x', long = "exclude-addresses", value_delimiter = ',')]
    pub exclude_addresses: Option<Vec<String>>,

    /// UDP scanning mode, finds UDP ports that send back responses
    #[arg(long)]
    pub udp: bool,
}

#[cfg(not(tarpaulin_include))]
impl Opts {
    pub fn read() -> Self {
        let mut opts = Opts::parse();

        if opts.ports.is_none() && opts.range.is_none() {
            opts.range = Some(PortRange {
                start: LOWEST_PORT_NUMBER,
                end: TOP_PORT_NUMBER,
            });
        }

        opts
    }

    /// Reads the command line arguments into an Opts struct and merge
    /// values found within the user configuration file.
    pub fn merge(&mut self, config: &Config) {
        if !self.no_config {
            self.merge_required(config);
            self.merge_optional(config);
        }
    }

    fn merge_required(&mut self, config: &Config) {
        macro_rules! merge_required {
            ($($field: ident),+) => {
                $(
                    if let Some(e) = &config.$field {
                        self.$field = e.clone();
                    }
                )+
            }
        }

        merge_required!(
            addresses, greppable, accessible, batch_size, timeout, tries, scan_order, scripts,
            command, udp, no_banner
        );
    }

    fn merge_optional(&mut self, config: &Config) {
        macro_rules! merge_optional {
            ($($field: ident),+) => {
                $(
                    if config.$field.is_some() {
                        self.$field = config.$field.clone();
                    }
                )+
            }
        }

        // Only use top ports when the user asks for them
        if self.top && config.ports.is_some() {
            self.ports = config.ports.clone();
        }

        merge_optional!(range, resolver, ulimit, exclude_ports, exclude_addresses);
    }
}

impl Default for Opts {
    fn default() -> Self {
        Self {
            addresses: vec![],
            ports: None,
            range: None,
            greppable: true,
            batch_size: 0,
            timeout: 0,
            tries: 0,
            ulimit: None,
            command: vec![],
            accessible: false,
            resolver: None,
            scan_order: ScanOrder::Serial,
            no_config: true,
            no_banner: false,
            top: false,
            scripts: ScriptsRequired::Default,
            config_path: None,
            exclude_ports: None,
            exclude_addresses: None,
            udp: false,
        }
    }
}

/// Struct used to deserialize the options specified within our config file.
/// These will be further merged with our command line arguments in order to
/// generate the final Opts struct.
#[cfg(not(tarpaulin_include))]
#[derive(Debug, Deserialize)]
pub struct Config {
    addresses: Option<Vec<String>>,
    ports: Option<Vec<u16>>,
    range: Option<PortRange>,
    greppable: Option<bool>,
    accessible: Option<bool>,
    batch_size: Option<usize>,
    timeout: Option<u32>,
    tries: Option<u8>,
    ulimit: Option<usize>,
    resolver: Option<String>,
    scan_order: Option<ScanOrder>,
    command: Option<Vec<String>>,
    scripts: Option<ScriptsRequired>,
    exclude_ports: Option<Vec<u16>>,
    exclude_addresses: Option<Vec<String>>,
    udp: Option<bool>,
    no_banner: Option<bool>,
}

#[cfg(not(ta
Download .txt
gitextract_zfz_ha5m/

├── .SRCINFO
├── .all-contributorsrc
├── .dockerignore
├── .github/
│   ├── FUNDING.yml
│   ├── ISSUE_TEMPLATE/
│   │   ├── bug_report.md
│   │   └── feature_request.md
│   ├── config.yml
│   ├── dependabot.yml
│   ├── release-drafter.yml
│   └── workflows/
│       ├── build.yml
│       ├── dependabot.yml
│       ├── mlc_config.json
│       └── test.yml
├── .gitignore
├── .gitmodules
├── .travis.yml
├── CODE_OF_CONDUCT.md
├── Cargo.toml
├── LICENSE
├── Makefile
├── README.md
├── benches/
│   └── benchmark_portscan.rs
├── build.rs
├── config.toml
├── contributing.Dockerfile
├── contributing.md
├── fixtures/
│   ├── .rustscan_scripts/
│   │   ├── test_script.pl
│   │   ├── test_script.py
│   │   ├── test_script.sh
│   │   ├── test_script.txt
│   │   └── test_script_invalid_headers.txt
│   ├── .rustscan_scripts.toml
│   ├── empty_hosts.txt
│   ├── hosts.txt
│   ├── naughty_strings.txt
│   └── test_rustscan_scripts.toml
├── justfile
├── nmap-payloads
├── pictures/
│   ├── accessible.yml
│   ├── fast.yml
│   ├── newfast.yml
│   └── nice.yml
├── release.sh
├── src/
│   ├── address.rs
│   ├── benchmark/
│   │   └── mod.rs
│   ├── input.rs
│   ├── lib.rs
│   ├── main.rs
│   ├── port_strategy/
│   │   ├── mod.rs
│   │   └── range_iterator.rs
│   ├── scanner/
│   │   ├── mod.rs
│   │   └── socket_iterator.rs
│   ├── scripts/
│   │   └── mod.rs
│   └── tui.rs
└── tests/
    └── timelimits.rs
Download .txt
SYMBOL INDEX (154 symbols across 12 files)

FILE: benches/benchmark_portscan.rs
  function portscan_tcp (line 10) | fn portscan_tcp(scanner: &Scanner) {
  function portscan_udp (line 14) | fn portscan_udp(scanner: &Scanner) {
  function bench_address (line 18) | fn bench_address() {
  function bench_port_strategy (line 22) | fn bench_port_strategy() {
  function bench_address_parsing (line 30) | fn bench_address_parsing() {
  function criterion_benchmark (line 48) | fn criterion_benchmark(c: &mut Criterion) {

FILE: build.rs
  function main (line 10) | pub fn main() {
  function generate_code (line 61) | fn generate_code(port_payload_map: BTreeMap<Vec<u16>, Vec<u8>>) {
  function ports_v (line 120) | fn ports_v(fp_map: &BTreeMap<i32, String>) -> BTreeMap<i32, Vec<u16>> {
  function payloads_v (line 166) | fn payloads_v(fp_map: &BTreeMap<i32, String>) -> BTreeMap<i32, Vec<u8>> {
  function parser (line 189) | fn parser(payload: &str) -> Vec<u8> {
  function port_payload_map (line 219) | fn port_payload_map(

FILE: src/address.rs
  function parse_addresses (line 33) | pub fn parse_addresses(input: &Opts) -> Vec<IpAddr> {
  function parse_address (line 94) | pub fn parse_address(address: &str, resolver: &Resolver) -> Vec<IpAddr> {
  function resolve_ips_from_host (line 113) | fn resolve_ips_from_host(source: &str, backup_resolver: &Resolver) -> Ve...
  function parse_excluded_networks (line 140) | pub fn parse_excluded_networks(
  function parse_single_excluded_address (line 152) | fn parse_single_excluded_address(addr: &str, resolver: &Resolver) -> Vec...
  function get_resolver (line 177) | fn get_resolver(resolver: &Option<String>) -> Resolver {
  function read_resolver_from_file (line 206) | fn read_resolver_from_file(path: &str) -> Result<Vec<IpAddr>, std::io::E...
  function read_ips_from_file (line 217) | fn read_ips_from_file(
  function parse_correct_addresses (line 243) | fn parse_correct_addresses() {
  function parse_addresses_with_address_exclusions (line 264) | fn parse_addresses_with_address_exclusions() {
  function parse_addresses_with_cidr_exclusions (line 283) | fn parse_addresses_with_cidr_exclusions() {
  function parse_addresses_with_incorrect_address_exclusions (line 303) | fn parse_addresses_with_incorrect_address_exclusions() {
  function parse_correct_host_addresses (line 322) | fn parse_correct_host_addresses() {
  function parse_correct_and_incorrect_addresses (line 334) | fn parse_correct_and_incorrect_addresses() {
  function parse_incorrect_addresses (line 346) | fn parse_incorrect_addresses() {
  function parse_hosts_file_and_incorrect_hosts (line 358) | fn parse_hosts_file_and_incorrect_hosts() {
  function parse_empty_hosts_file (line 371) | fn parse_empty_hosts_file() {
  function parse_naughty_host_file (line 384) | fn parse_naughty_host_file() {
  function parse_duplicate_cidrs (line 397) | fn parse_duplicate_cidrs() {
  function parse_overspecific_cidr (line 409) | fn parse_overspecific_cidr() {
  function resolver_args_google_dns (line 422) | fn resolver_args_google_dns() {

FILE: src/benchmark/mod.rs
  type Benchmark (line 23) | pub struct Benchmark {
    method init (line 28) | pub fn init() -> Self {
    method push (line 33) | pub fn push(&mut self, timer: NamedTimer) {
    method summary (line 41) | pub fn summary(&self) -> String {
  type NamedTimer (line 61) | pub struct NamedTimer {
    method start (line 68) | pub fn start(name: &'static str) -> Self {
    method end (line 75) | pub fn end(&mut self) {
  function benchmark (line 81) | fn benchmark() {

FILE: src/input.rs
  constant LOWEST_PORT_NUMBER (line 7) | const LOWEST_PORT_NUMBER: u16 = 1;
  constant TOP_PORT_NUMBER (line 8) | const TOP_PORT_NUMBER: u16 = 65535;
  type ScanOrder (line 14) | pub enum ScanOrder {
  type ScriptsRequired (line 24) | pub enum ScriptsRequired {
  type PortRange (line 32) | pub struct PortRange {
  function parse_range (line 38) | fn parse_range(input: &str) -> Result<PortRange, String> {
  type Opts (line 74) | pub struct Opts {
    method read (line 168) | pub fn read() -> Self {
    method merge (line 183) | pub fn merge(&mut self, config: &Config) {
    method merge_required (line 190) | fn merge_required(&mut self, config: &Config) {
    method merge_optional (line 207) | fn merge_optional(&mut self, config: &Config) {
  method default (line 228) | fn default() -> Self {
  type Config (line 259) | pub struct Config {
    method read (line 295) | pub fn read(custom_config_path: Option<PathBuf>) -> Self {
    method default (line 350) | fn default() -> Self {
  function default_config_path (line 325) | pub fn default_config_path() -> PathBuf {
  function old_default_config_path (line 334) | pub fn old_default_config_path() -> PathBuf {
  function verify_cli (line 374) | fn verify_cli() {
  function parse_trailing_command (line 391) | fn parse_trailing_command(input: Vec<&str>, command: Vec<String>) {
  function opts_no_merge_when_config_is_ignored (line 399) | fn opts_no_merge_when_config_is_ignored() {
  function opts_merge_required_arguments (line 414) | fn opts_merge_required_arguments() {
  function opts_merge_optional_arguments (line 430) | fn opts_merge_optional_arguments() {

FILE: src/main.rs
  constant DEFAULT_FILE_DESCRIPTORS_LIMIT (line 26) | const DEFAULT_FILE_DESCRIPTORS_LIMIT: usize = 8000;
  constant AVERAGE_BATCH_SIZE (line 28) | const AVERAGE_BATCH_SIZE: usize = 3000;
  function main (line 37) | fn main() {
  function print_opening (line 196) | fn print_opening(opts: &Opts) {
  function adjust_ulimit_size (line 236) | fn adjust_ulimit_size(opts: &Opts) -> usize {
  function infer_batch_size (line 262) | fn infer_batch_size(opts: &Opts, ulimit: usize) -> usize {
  function batch_size_lowered (line 306) | fn batch_size_lowered() {
  function batch_size_lowered_average_size (line 318) | fn batch_size_lowered_average_size() {
  function batch_size_equals_ulimit_lowered (line 329) | fn batch_size_equals_ulimit_lowered() {
  function batch_size_adjusted_2000 (line 342) | fn batch_size_adjusted_2000() {
  function test_high_ulimit_no_greppable_mode (line 356) | fn test_high_ulimit_no_greppable_mode() {
  function test_print_opening_no_panic (line 369) | fn test_print_opening_no_panic() {

FILE: src/port_strategy/mod.rs
  type PortStrategy (line 13) | pub enum PortStrategy {
    method pick (line 20) | pub fn pick(range: &Option<PortRange>, ports: Option<Vec<u16>>, order:...
    method order (line 46) | pub fn order(&self) -> Vec<u16> {
  type RangeOrder (line 57) | trait RangeOrder {
    method generate (line 58) | fn generate(&self) -> Vec<u16>;
    method generate (line 70) | fn generate(&self) -> Vec<u16> {
    method generate (line 93) | fn generate(&self) -> Vec<u16> {
  type SerialRange (line 64) | pub struct SerialRange {
  type RandomRange (line 78) | pub struct RandomRange {
  function serial_strategy_with_range (line 104) | fn serial_strategy_with_range() {
  function random_strategy_with_range (line 112) | fn random_strategy_with_range() {
  function serial_strategy_with_ports (line 124) | fn serial_strategy_with_ports() {
  function random_strategy_with_ports (line 131) | fn random_strategy_with_ports() {

FILE: src/port_strategy/range_iterator.rs
  type RangeIterator (line 5) | pub struct RangeIterator {
    method new (line 24) | pub fn new(start: u32, end: u32) -> Self {
  type Item (line 45) | type Item = u16;
  method next (line 49) | fn next(&mut self) -> Option<Self::Item> {
  function pick_random_coprime (line 82) | fn pick_random_coprime(end: u32) -> u32 {
  function range_iterator_iterates_through_the_entire_range (line 104) | fn range_iterator_iterates_through_the_entire_range() {
  function generate_sorted_range (line 126) | fn generate_sorted_range(start: u32, end: u32) -> Vec<u16> {

FILE: src/scanner/mod.rs
  type Scanner (line 30) | pub struct Scanner {
    method new (line 45) | pub fn new(
    method run (line 72) | pub async fn run(&self) -> Vec<SocketAddr> {
    method scan_socket (line 134) | async fn scan_socket(
    method scan_udp_socket (line 175) | async fn scan_udp_socket(
    method connect (line 215) | async fn connect(&self, socket: SocketAddr) -> io::Result<TcpStream> {
    method udp_bind (line 238) | async fn udp_bind(&self, socket: SocketAddr) -> io::Result<UdpSocket> {
    method udp_scan (line 262) | async fn udp_scan(
    method fmt_ports (line 298) | fn fmt_ports(&self, socket: SocketAddr) {
  function scanner_runs (line 317) | fn scanner_runs() {
  function ipv6_scanner_runs (line 341) | fn ipv6_scanner_runs() {
  function quad_zero_scanner_runs (line 365) | fn quad_zero_scanner_runs() {
  function google_dns_runs (line 387) | fn google_dns_runs() {
  function infer_ulimit_lowering_no_panic (line 409) | fn infer_ulimit_lowering_no_panic() {
  function udp_scan_runs (line 435) | fn udp_scan_runs() {
  function udp_ipv6_runs (line 459) | fn udp_ipv6_runs() {
  function udp_quad_zero_scanner_runs (line 483) | fn udp_quad_zero_scanner_runs() {
  function udp_google_dns_runs (line 505) | fn udp_google_dns_runs() {

FILE: src/scanner/socket_iterator.rs
  type SocketIterator (line 4) | pub struct SocketIterator<'s> {
  function new (line 23) | pub fn new(ips: &'s [IpAddr], ports: &'s [u16]) -> Self {
  type Item (line 34) | type Item = SocketAddr;
  method next (line 46) | fn next(&mut self) -> Option<Self::Item> {
  function goes_through_every_ip_port_combination (line 59) | fn goes_through_every_ip_port_combination() {

FILE: src/scripts/mod.rs
  function init_scripts (line 100) | pub fn init_scripts(scripts: &ScriptsRequired) -> Result<Vec<ScriptFile>> {
  function parse_scripts (line 152) | pub fn parse_scripts(scripts: Vec<PathBuf>) -> Vec<ScriptFile> {
  type Script (line 165) | pub struct Script {
    method build (line 204) | pub fn build(
    method run (line 226) | pub fn run(self) -> Result<String> {
  type ExecPartsScript (line 189) | struct ExecPartsScript {
  type ExecParts (line 197) | struct ExecParts {
  function execute_script (line 278) | fn execute_script(script: &str) -> Result<String> {
  function find_scripts (line 323) | pub fn find_scripts(path: PathBuf) -> Result<Vec<PathBuf>> {
  type ScriptFile (line 338) | pub struct ScriptFile {
    method new (line 348) | fn new(script: PathBuf) -> Option<ScriptFile> {
  type ScriptConfig (line 384) | pub struct ScriptConfig {
    method read_config (line 393) | pub fn read_config() -> Result<ScriptConfig> {
  function into_script (line 411) | fn into_script(script_f: ScriptFile) -> Script {
  function find_and_parse_scripts (line 424) | fn find_and_parse_scripts() {
  function find_invalid_folder (line 432) | fn find_invalid_folder() {
  function open_script_file_invalid_headers (line 438) | fn open_script_file_invalid_headers() {
  function open_script_file_invalid_call_format (line 445) | fn open_script_file_invalid_call_format() {
  function open_script_file_missing_call_format (line 455) | fn open_script_file_missing_call_format() {
  function open_nonexisting_script_file (line 465) | fn open_nonexisting_script_file() {
  function parse_txt_script (line 470) | fn parse_txt_script() {
  function run_bash_script (line 493) | fn run_bash_script() {
  function run_python_script (line 502) | fn run_python_script() {
  function run_perl_script (line 515) | fn run_perl_script() {
  function test_custom_directory_config (line 524) | fn test_custom_directory_config() {
  function test_default_directory_fallback (line 550) | fn test_default_directory_fallback() {

FILE: tests/timelimits.rs
  constant TIMEOUT_MARGIN (line 14) | const TIMEOUT_MARGIN: u32 = 3;
  function run_rustscan_with_timeout (line 17) | fn run_rustscan_with_timeout(args: &[&str], timeout: Duration) {
  function scan_localhost (line 54) | fn scan_localhost() {
  function scan_google_com (line 61) | fn scan_google_com() {
  function scan_example_com (line 78) | fn scan_example_com() {
  function scan_rustscan_cmnatic_co_uk (line 95) | fn scan_rustscan_cmnatic_co_uk() {
  function udp_scan_localhost (line 111) | fn udp_scan_localhost() {
  function udp_scan_google_com (line 117) | fn udp_scan_google_com() {
  function udp_scan_example_com (line 133) | fn udp_scan_example_com() {
  function udp_scan_rustscan_cmnatic_co_uk (line 149) | fn udp_scan_rustscan_cmnatic_co_uk() {
Condensed preview — 55 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (287K chars).
[
  {
    "path": ".SRCINFO",
    "chars": 231,
    "preview": "pkgbase = rustscan-bin\n\tpkgdesc = Faster Nmap Scanning with Rust\n\tpkgver = 1.1.0\n\tpkgrel = 1\n\turl = https://github.com/r"
  },
  {
    "path": ".all-contributorsrc",
    "chars": 6879,
    "preview": "{\n  \"files\": [\n    \"README.md\"\n  ],\n  \"imageSize\": 100,\n  \"commit\": false,\n  \"contributors\": [\n    {\n      \"login\": \"bra"
  },
  {
    "path": ".dockerignore",
    "chars": 16,
    "preview": ".git\nDockerfile\n"
  },
  {
    "path": ".github/FUNDING.yml",
    "chars": 16,
    "preview": "github: bee-san\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/bug_report.md",
    "chars": 1102,
    "preview": "---\nname: Bug report\nabout: Create a report to help us improve\ntitle: ''\nlabels: ''\nassignees: ''\n\n---\n\nIMPORTANT: If yo"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/feature_request.md",
    "chars": 595,
    "preview": "---\nname: Feature request\nabout: Suggest an idea for this project\ntitle: ''\nlabels: ''\nassignees: ''\n\n---\n\n**Is your fea"
  },
  {
    "path": ".github/config.yml",
    "chars": 27,
    "preview": "todo:\n  keyword: \"// TODO\"\n"
  },
  {
    "path": ".github/dependabot.yml",
    "chars": 540,
    "preview": "version: 2\nupdates:\n- package-ecosystem: \"github-actions\"\n  directory: \"/\"\n  schedule:\n    interval: \"daily\"\n- package-e"
  },
  {
    "path": ".github/release-drafter.yml",
    "chars": 44,
    "preview": "template: |\n  ## What’s Changed\n\n  $CHANGES\n"
  },
  {
    "path": ".github/workflows/build.yml",
    "chars": 5978,
    "preview": "name: CD Pipeline\n\non: [push]\n\njobs:\n  build-nix:\n    env:\n      IN_PIPELINE: true\n    runs-on: ${{ matrix.os }}\n    if:"
  },
  {
    "path": ".github/workflows/dependabot.yml",
    "chars": 417,
    "preview": "name: Dependabot Auto-Merge\n\njobs:\n  dependabot:\n    runs-on: ubuntu-latest\n    if: ${{ github.actor == 'dependabot[bot]"
  },
  {
    "path": ".github/workflows/mlc_config.json",
    "chars": 394,
    "preview": "{\n    \"_comment\": \"Config for markdown-link-check. Resolves issue #540.\",\n    \"ignorePatterns\": [\n      {\n        \"patte"
  },
  {
    "path": ".github/workflows/test.yml",
    "chars": 723,
    "preview": "name: Test\non:\n  pull_request:\n    branches: [master]\n  push:\n    branches:\n      - master\njobs:\n  test:\n    name: Test "
  },
  {
    "path": ".gitignore",
    "chars": 2651,
    "preview": "# Generated by Cargo\n# will have compiled files and executables\n/target/\n# generated file by build.rs for mapping nmap-p"
  },
  {
    "path": ".gitmodules",
    "chars": 143,
    "preview": "[submodule \"src/rustscan_scripting_engine\"]\n\tpath = src/rustscan_scripting_engine\n\turl = https://github.com/RustScan/rus"
  },
  {
    "path": ".travis.yml",
    "chars": 1600,
    "preview": "language: rust\nos:\n- linux\n- osx\narch:\n- amd64\n- arm64\nservices:\n- docker\nbefore_install:\n- rustup component add rustfmt"
  },
  {
    "path": "CODE_OF_CONDUCT.md",
    "chars": 3384,
    "preview": "# Contributor Covenant Code of Conduct\n\n## Our Pledge\n\nIn the interest of fostering an open and welcoming environment, w"
  },
  {
    "path": "Cargo.toml",
    "chars": 1580,
    "preview": "[package]\nname = \"rustscan\"\nversion = \"2.4.1\"\nauthors = [\"Autumn <autumn@skerritt.blog>\"]\nedition = \"2018\"\ndescription ="
  },
  {
    "path": "LICENSE",
    "chars": 35149,
    "preview": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free "
  },
  {
    "path": "Makefile",
    "chars": 636,
    "preview": "install:\n\tcargo install cross\n\nbuild:\n\tmake build-linux\n\tmake build-mac\n\n\tmake shasum\n\nbuild-linux:\n\t@echo 'Building for"
  },
  {
    "path": "README.md",
    "chars": 18443,
    "preview": "<div align=\"center\" markdown=\"1\">\n\n➡️ [Discord][discord] | [Installation Guide][toc-install] | [Usage Guide][usage-guide"
  },
  {
    "path": "benches/benchmark_portscan.rs",
    "chars": 2892,
    "preview": "use async_std::task::block_on;\nuse criterion::{criterion_group, criterion_main, Criterion};\nuse rustscan::input::{Opts, "
  },
  {
    "path": "build.rs",
    "chars": 7064,
    "preview": "use std::collections::BTreeMap;\nuse std::fs::{self, File};\n\nuse std::env;\nuse std::io::{BufReader, Read};\nuse std::path:"
  },
  {
    "path": "config.toml",
    "chars": 9050,
    "preview": "ip=\"127.0.0.1\"\n\n# The hashmap of {ports: {1:1}}\n[ports]\n1 = 1\n3 = 1\n4 = 1\n6 = 1\n7 = 1\n9 = 1\n13 = 1\n17 = 1\n19 = 1\n20 = 1\n"
  },
  {
    "path": "contributing.Dockerfile",
    "chars": 311,
    "preview": "# Dockerfile for RustScan development environment\n# Provides a containerized setup with Rust, nmap, and development tool"
  },
  {
    "path": "contributing.md",
    "chars": 2801,
    "preview": "Howdy Space Cow-Person 🤠🌌\n\nRustScan is always looking for contributors. Whether that's spelling mistakes or major change"
  },
  {
    "path": "fixtures/.rustscan_scripts/test_script.pl",
    "chars": 710,
    "preview": "#!/usr/bin/perl\n#tags = [\"core_approved\", \"example\",]\n#developer = [ \"example\", \"https://example.org\" ]\n#ports_separator"
  },
  {
    "path": "fixtures/.rustscan_scripts/test_script.py",
    "chars": 465,
    "preview": "#!/usr/bin/python3\n#tags = [\"core_approved\", \"example\",]\n#developer = [ \"example\", \"https://example.org\" ]\n#trigger_port"
  },
  {
    "path": "fixtures/.rustscan_scripts/test_script.sh",
    "chars": 456,
    "preview": "#!/bin/bash \n#tags = [\"core_approved\", \"example\",]\n#developer = [ \"example\", \"https://example.org\" ]\n#ports_separator = "
  },
  {
    "path": "fixtures/.rustscan_scripts/test_script.txt",
    "chars": 369,
    "preview": "#!intentional_blank_line\n#tags = [\"core_approved\", \"example\"]\n#developer = [ \"example\", \"https://example.org\" ]\n#ports_s"
  },
  {
    "path": "fixtures/.rustscan_scripts/test_script_invalid_headers.txt",
    "chars": 226,
    "preview": "#!intentional_blank_line\n#tags = \"core_approved\"\n#developer = [ \"example\", \"https://example.org\" ]\n#ports_separator = \","
  },
  {
    "path": "fixtures/.rustscan_scripts.toml",
    "chars": 154,
    "preview": "tags = [\"core_approved\", \"example\"]\nports = [\"80\", \"443\", \"8080\"]\ndeveloper = [\"example\", \"https://example.org\"]\ndirecto"
  },
  {
    "path": "fixtures/empty_hosts.txt",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "fixtures/hosts.txt",
    "chars": 182,
    "preview": "127.0.0.1\ngoogle.com\nexample.com\n66666666666666.666666666666666666.66666666666666666.6666666666\n....\ne3b0c44298fc1c149af"
  },
  {
    "path": "fixtures/naughty_strings.txt",
    "chars": 1286,
    "preview": "# https://github.com/minimaxir/big-list-of-naughty-strings\n\n\n­؀؁؂؃؄؅؜۝܏᠎​‌‍‎‏‪‫‬‭‮⁠⁡⁢⁣⁤⁦⁧⁨⁩𑂽𛲠𛲡𛲢𛲣𝅳𝅴𝅵𝅶𝅷𝅸𝅹𝅺󠀁󠀠󠀡󠀢󠀣󠀤"
  },
  {
    "path": "fixtures/test_rustscan_scripts.toml",
    "chars": 407,
    "preview": "# Test/Example ScriptConfig file\n\n# Tags to filter on scripts. Only scripts containing all these tags will run.\ntags = ["
  },
  {
    "path": "justfile",
    "chars": 387,
    "preview": "test:\n    cargo test\n    cargo clippy -- --deny warnings\n    cargo clippy --tests -- --deny warnings\n    cargo fmt --che"
  },
  {
    "path": "nmap-payloads",
    "chars": 21092,
    "preview": "# Nmap nmap payload database -*- mode: fundamental; -*-\n# $Id$\n#\n# These payloads are sent with every host discovery or "
  },
  {
    "path": "pictures/accessible.yml",
    "chars": 5518,
    "preview": "# The configurations that used for the recording, feel free to edit them\nconfig:\n\n  # Specify a command to be executed\n "
  },
  {
    "path": "pictures/fast.yml",
    "chars": 10155,
    "preview": "# The configurations that used for the recording, feel free to edit them\nconfig:\n\n  # Specify a command to be executed\n "
  },
  {
    "path": "pictures/newfast.yml",
    "chars": 12723,
    "preview": "# The configurations that used for the recording, feel free to edit them\nconfig:\n\n  # Specify a command to be executed\n "
  },
  {
    "path": "pictures/nice.yml",
    "chars": 12715,
    "preview": "# The configurations that used for the recording, feel free to edit them\nconfig:\n\n  # Specify a command to be executed\n "
  },
  {
    "path": "release.sh",
    "chars": 107,
    "preview": "cargo publish && cargo build --release && git add Cargo.lock && git commit -m 'Updating lock file' && gpsup"
  },
  {
    "path": "src/address.rs",
    "chars": 12787,
    "preview": "//! Provides functions to parse input IP addresses, CIDRs or files.\nuse std::collections::BTreeSet;\nuse std::fs::{self, "
  },
  {
    "path": "src/benchmark/mod.rs",
    "chars": 2698,
    "preview": "//! Provides functionality to capture timing information for scans.\n//!\n//! # Usage\n//!\n//! ```rust\n//! // Initiate Benc"
  },
  {
    "path": "src/input.rs",
    "chars": 14299,
    "preview": "//! Provides a means to read, parse and hold configuration options for scans.\nuse clap::{Parser, ValueEnum};\nuse serde_d"
  },
  {
    "path": "src/lib.rs",
    "chars": 1961,
    "preview": "//! This crate exposes the internal functionality of the\n//! [RustScan](https://rustscan.github.io/RustScan) port scanne"
  },
  {
    "path": "src/main.rs",
    "chars": 12392,
    "preview": "#![deny(clippy::all)]\n#![warn(clippy::pedantic)]\n#![allow(clippy::doc_markdown, clippy::if_not_else, clippy::non_ascii_l"
  },
  {
    "path": "src/port_strategy/mod.rs",
    "chars": 4555,
    "preview": "//! Provides a means to hold configuration options specifically for port scanning.\nmod range_iterator;\nuse crate::input:"
  },
  {
    "path": "src/port_strategy/range_iterator.rs",
    "chars": 4453,
    "preview": "use gcd::Gcd;\nuse rand::RngExt;\nuse std::convert::TryInto;\n\npub struct RangeIterator {\n    active: bool,\n    normalized_"
  },
  {
    "path": "src/scanner/mod.rs",
    "chars": 16497,
    "preview": "//! Core functionality for actual scanning behaviour.\nuse crate::generated::get_parsed_data;\nuse crate::port_strategy::P"
  },
  {
    "path": "src/scanner/socket_iterator.rs",
    "chars": 2949,
    "preview": "use itertools::{iproduct, Product};\nuse std::net::{IpAddr, SocketAddr};\n\npub struct SocketIterator<'s> {\n    // product_"
  },
  {
    "path": "src/scripts/mod.rs",
    "chars": 18302,
    "preview": "//! Scripting Engine to run scripts based on tags.\n//!\n//! This module serves to filter and run the scripts selected by "
  },
  {
    "path": "src/tui.rs",
    "chars": 4059,
    "preview": "//! Utilities for terminal output during scanning.\n\n/// Terminal User Interface Module for RustScan\n/// Defines macros t"
  },
  {
    "path": "tests/timelimits.rs",
    "chars": 4060,
    "preview": "/*\n * Test rustscan against different targets with a time limit.\n * The tests assumes target/debug/rustscan has already "
  }
]

About this extraction

This page contains the full source code of the bee-san/RustScan GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 55 files (262.3 KB), approximately 83.6k tokens, and a symbol index with 154 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!