[
  {
    "path": ".SRCINFO",
    "content": "pkgbase = rustscan-bin\n\tpkgdesc = Faster Nmap Scanning with Rust\n\tpkgver = 1.1.0\n\tpkgrel = 1\n\turl = https://github.com/rustscan/rustscan\n\tarch = x86_64\n\tlicense = MIT\n\tdepends = rustup\n\tprovides = rustscan\n\npkgname = rustscan-bin\n\n"
  },
  {
    "path": ".all-contributorsrc",
    "content": "{\n  \"files\": [\n    \"README.md\"\n  ],\n  \"imageSize\": 100,\n  \"commit\": false,\n  \"contributors\": [\n    {\n      \"login\": \"brandonskerritt\",\n      \"name\": \"Brandon\",\n      \"avatar_url\": \"https://avatars3.githubusercontent.com/u/10378052?v=4\",\n      \"profile\": \"https://skerritt.blog\",\n      \"contributions\": [\n        \"infra\",\n        \"test\",\n        \"code\",\n        \"design\"\n      ]\n    },\n    {\n      \"login\": \"SakiiR\",\n      \"name\": \"SakiiR\",\n      \"avatar_url\": \"https://avatars1.githubusercontent.com/u/9950578?v=4\",\n      \"profile\": \"https://sakiir.ovh\",\n      \"contributions\": [\n        \"code\",\n        \"bug\"\n      ]\n    },\n    {\n      \"login\": \"smackhack\",\n      \"name\": \"smackhack\",\n      \"avatar_url\": \"https://avatars2.githubusercontent.com/u/48143394?v=4\",\n      \"profile\": \"https://github.com/smackhack\",\n      \"contributions\": [\n        \"ideas\",\n        \"example\"\n      ]\n    },\n    {\n      \"login\": \"bernardoamc\",\n      \"name\": \"Bernardo Araujo\",\n      \"avatar_url\": \"https://avatars0.githubusercontent.com/u/428984?v=4\",\n      \"profile\": \"http://bernardoamc.github.io/\",\n      \"contributions\": [\n        \"code\",\n        \"bug\",\n        \"design\"\n      ]\n    },\n    {\n      \"login\": \"Isona\",\n      \"name\": \"Izzy Whistlecroft\",\n      \"avatar_url\": \"https://avatars2.githubusercontent.com/u/11759523?v=4\",\n      \"profile\": \"https://github.com/Isona\",\n      \"contributions\": [\n        \"bug\"\n      ]\n    },\n    {\n      \"login\": \"imlonghao\",\n      \"name\": \"imlonghao\",\n      \"avatar_url\": \"https://avatars1.githubusercontent.com/u/4951333?v=4\",\n      \"profile\": \"https://imlonghao.com\",\n      \"contributions\": [\n        \"bug\",\n        \"maintenance\"\n      ]\n    },\n    {\n      \"login\": \"royharoush\",\n      \"name\": \"royharoush\",\n      \"avatar_url\": \"https://avatars3.githubusercontent.com/u/8113056?v=4\",\n      \"profile\": \"https://github.com/royharoush\",\n      \"contributions\": [\n        \"ideas\",\n        \"design\"\n      ]\n    },\n    {\n      \"login\": \"Atul9\",\n      \"name\": \"Atul Bhosale\",\n      \"avatar_url\": \"https://avatars1.githubusercontent.com/u/3390330?v=4\",\n      \"profile\": \"https://github.com/Atul9\",\n      \"contributions\": [\n        \"code\"\n      ]\n    },\n    {\n      \"login\": \"TGotwig\",\n      \"name\": \"Thomas Gotwig\",\n      \"avatar_url\": \"https://avatars0.githubusercontent.com/u/30773779?v=4\",\n      \"profile\": \"https://tgotwig.me\",\n      \"contributions\": [\n        \"platform\"\n      ]\n    },\n    {\n      \"login\": \"remigourdon\",\n      \"name\": \"Rémi Gourdon\",\n      \"avatar_url\": \"https://avatars3.githubusercontent.com/u/2874133?v=4\",\n      \"profile\": \"https://github.com/remigourdon\",\n      \"contributions\": [\n        \"doc\",\n        \"code\"\n      ]\n    },\n    {\n      \"login\": \"cmnatic\",\n      \"name\": \"Ben (CMNatic)\",\n      \"avatar_url\": \"https://avatars3.githubusercontent.com/u/4163116?v=4\",\n      \"profile\": \"https://cmnatic.co.uk\",\n      \"contributions\": [\n        \"code\",\n        \"doc\",\n        \"design\"\n      ]\n    },\n    {\n      \"login\": \"Ferryistaken\",\n      \"name\": \"Alessandro Ferrari\",\n      \"avatar_url\": \"https://avatars3.githubusercontent.com/u/47927670?v=4\",\n      \"profile\": \"https://github.com/Ferryistaken\",\n      \"contributions\": [\n        \"content\"\n      ]\n    },\n    {\n      \"login\": \"Phenomite\",\n      \"name\": \"Phenomite\",\n      \"avatar_url\": \"https://avatars2.githubusercontent.com/u/8285537?v=4\",\n      \"profile\": \"https://github.com/Phenomite\",\n      \"contributions\": [\n        \"content\"\n      ]\n    },\n    {\n      \"login\": \"SuperSandro2000\",\n      \"name\": \"Sandro\",\n      \"avatar_url\": \"https://avatars2.githubusercontent.com/u/7258858?v=4\",\n      \"profile\": \"https://supersandro.de/\",\n      \"contributions\": [\n        \"content\",\n        \"bug\",\n        \"code\"\n      ]\n    },\n    {\n      \"login\": \"caass\",\n      \"name\": \"Cass\",\n      \"avatar_url\": \"https://avatars2.githubusercontent.com/u/25358963?v=4\",\n      \"profile\": \"https://swag.lgbt\",\n      \"contributions\": [\n        \"platform\",\n        \"code\",\n        \"bug\"\n      ]\n    },\n    {\n      \"login\": \"niklasmohrin\",\n      \"name\": \"Niklas Mohrin\",\n      \"avatar_url\": \"https://avatars0.githubusercontent.com/u/47574893?v=4\",\n      \"profile\": \"https://github.com/niklasmohrin\",\n      \"contributions\": [\n        \"doc\",\n        \"code\",\n        \"bug\"\n      ]\n    },\n    {\n      \"login\": \"tim77\",\n      \"name\": \"Artem Polishchuk\",\n      \"avatar_url\": \"https://avatars0.githubusercontent.com/u/5614476?v=4\",\n      \"profile\": \"https://liberapay.com/Artem4/\",\n      \"contributions\": [\n        \"platform\"\n      ]\n    },\n    {\n      \"login\": \"buermarc\",\n      \"name\": \"buermarc\",\n      \"avatar_url\": \"https://avatars2.githubusercontent.com/u/44375277?v=4\",\n      \"profile\": \"https://github.com/buermarc\",\n      \"contributions\": [\n        \"code\"\n      ]\n    },\n    {\n      \"login\": \"bergabman\",\n      \"name\": \"bergabman\",\n      \"avatar_url\": \"https://avatars1.githubusercontent.com/u/44554109?v=4\",\n      \"profile\": \"https://github.com/bergabman\",\n      \"contributions\": [\n        \"code\",\n        \"bug\",\n        \"design\"\n      ]\n    },\n    {\n      \"login\": \"dmitris\",\n      \"name\": \"Dmitry Savintsev\",\n      \"avatar_url\": \"https://avatars0.githubusercontent.com/u/31205?v=4\",\n      \"profile\": \"https://github.com/dmitris\",\n      \"contributions\": [\n        \"code\"\n      ]\n    },\n    {\n      \"login\": \"bofh69\",\n      \"name\": \"Sebastian Andersson\",\n      \"avatar_url\": \"https://avatars3.githubusercontent.com/u/1444315?v=4\",\n      \"profile\": \"https://github.com/bofh69\",\n      \"contributions\": [\n        \"code\"\n      ]\n    },\n    {\n      \"login\": \"mattcorbin\",\n      \"name\": \"Matt Corbin\",\n      \"avatar_url\": \"https://avatars3.githubusercontent.com/u/6537765?v=4\",\n      \"profile\": \"https://github.com/mattcorbin\",\n      \"contributions\": [\n        \"code\"\n      ]\n    },\n    {\n      \"login\": \"rootsploit\",\n      \"name\": \"RootSploit\",\n      \"avatar_url\": \"https://avatars2.githubusercontent.com/u/67270834?v=4\",\n      \"profile\": \"http://rootsploit.com\",\n      \"contributions\": [\n        \"blog\"\n      ]\n    },\n    {\n      \"login\": \"eiffel-fl\",\n      \"name\": \"eiffel-fl\",\n      \"avatar_url\": \"https://avatars2.githubusercontent.com/u/12171754?v=4\",\n      \"profile\": \"https://github.com/eiffel-fl\",\n      \"contributions\": [\n        \"code\"\n      ]\n    },\n    {\n      \"login\": \"u5surf\",\n      \"name\": \"Y.Horie\",\n      \"avatar_url\": \"https://avatars1.githubusercontent.com/u/14180225?v=4\",\n      \"profile\": \"https://github.com/u5surf\",\n      \"contributions\": [\n        \"code\"\n      ]\n    },\n    {\n      \"login\": \"okrplay\",\n      \"name\": \"Oskar\",\n      \"avatar_url\": \"https://avatars3.githubusercontent.com/u/32576280?v=4\",\n      \"profile\": \"https://github.com/okrplay\",\n      \"contributions\": [\n        \"code\",\n        \"test\"\n      ]\n    }\n  ],\n  \"contributorsPerLine\": 7,\n  \"projectName\": \"RustScan\",\n  \"projectOwner\": \"RustScan\",\n  \"repoType\": \"github\",\n  \"repoHost\": \"https://github.com\",\n  \"skipCi\": true\n}\n"
  },
  {
    "path": ".dockerignore",
    "content": ".git\nDockerfile\n"
  },
  {
    "path": ".github/FUNDING.yml",
    "content": "github: bee-san\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/bug_report.md",
    "content": "---\nname: Bug report\nabout: Create a report to help us improve\ntitle: ''\nlabels: ''\nassignees: ''\n\n---\n\nIMPORTANT: If you do not fill this out, your issue will be automatically closed.\n\nAs 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 :)\n\n**Describe the bug**\nA clear and concise description of what the bug is.\n\n**To Reproduce**\nSteps to reproduce the behavior:\n1. Go to '...'\n2. Click on '....'\n3. Scroll down to '....'\n4. See error\n\n**Expected behavior**\nA clear and concise description of what you expected to happen.\n\n**Screenshots**\nIf applicable, add screenshots to help explain your problem.\n\n**Desktop (please complete the following information):**\n - OS: [e.g. iOS]\n - Browser [e.g. chrome, safari]\n - Version [e.g. 22]\n\n**Smartphone (please complete the following information):**\n - Device: [e.g. iPhone6]\n - OS: [e.g. iOS8.1]\n - Browser [e.g. stock browser, safari]\n - Version [e.g. 22]\n\n**Additional context**\nAdd any other context about the problem here.\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/feature_request.md",
    "content": "---\nname: Feature request\nabout: Suggest an idea for this project\ntitle: ''\nlabels: ''\nassignees: ''\n\n---\n\n**Is your feature request related to a problem? Please describe.**\nA clear and concise description of what the problem is. Ex. I'm always frustrated when [...]\n\n**Describe the solution you'd like**\nA clear and concise description of what you want to happen.\n\n**Describe alternatives you've considered**\nA clear and concise description of any alternative solutions or features you've considered.\n\n**Additional context**\nAdd any other context or screenshots about the feature request here.\n"
  },
  {
    "path": ".github/config.yml",
    "content": "todo:\n  keyword: \"// TODO\"\n"
  },
  {
    "path": ".github/dependabot.yml",
    "content": "version: 2\nupdates:\n- package-ecosystem: \"github-actions\"\n  directory: \"/\"\n  schedule:\n    interval: \"daily\"\n- package-ecosystem: \"docker\"\n  directory: \"/\"\n  schedule:\n    interval: \"daily\"\n- package-ecosystem: cargo\n  directory: \"/\"\n  schedule:\n    interval: daily\n  open-pull-requests-limit: 10\n  ignore:\n  - dependency-name: anyhow\n    versions:\n    - 1.0.38\n    - 1.0.39\n  - dependency-name: serde\n    versions:\n    - 1.0.123\n  - dependency-name: futures\n    versions:\n    - 0.3.12\n  - dependency-name: rlimit\n    versions:\n    - 0.5.3\n"
  },
  {
    "path": ".github/release-drafter.yml",
    "content": "template: |\n  ## What’s Changed\n\n  $CHANGES\n"
  },
  {
    "path": ".github/workflows/build.yml",
    "content": "name: CD Pipeline\n\non: [push]\n\njobs:\n  build-nix:\n    env:\n      IN_PIPELINE: true\n    runs-on: ${{ matrix.os }}\n    if: github.ref == 'refs/heads/master'\n    strategy:\n      matrix:\n        type: [ubuntu-x64, ubuntu-x86, armv7, aarch64]\n        include:\n          - type: ubuntu-x64\n            os: ubuntu-latest\n            target: x86_64-unknown-linux-musl\n            name: x86_64-linux-rustscan\n            path: target/x86_64-unknown-linux-musl/release/rustscan\n            pkg_config_path: /usr/lib/x86_64-linux-gnu/pkgconfig\n          - type: ubuntu-x86\n            os: ubuntu-latest\n            target: i686-unknown-linux-musl\n            name: x86-linux-rustscan\n            path: target/i686-unknown-linux-musl/release/rustscan\n            pkg_config_path: /usr/lib/i686-linux-gnu/pkgconfig\n          - type: armv7\n            os: ubuntu-latest\n            target: armv7-unknown-linux-gnueabihf\n            name: armv7-linux-rustscan\n            path: target/armv7-unknown-linux-gnueabihf/release/rustscan\n            pkg_config_path: /usr/lib/x86_64-linux-gnu/pkgconfig\n          - type: aarch64\n            os: ubuntu-latest\n            target: aarch64-unknown-linux-gnu\n            name: aarch64-linux-rustscan\n            path: target/aarch64-unknown-linux-gnu/release/rustscan\n            pkg_config_path: /usr/lib/x86_64-linux-gnu/pkgconfig\n    steps:\n      - uses: actions/checkout@v4\n      - name: Cache cargo & target directories\n        uses: Swatinem/rust-cache@v2\n      - name: Build binary\n        uses: houseabsolute/actions-rust-cross@v0\n        with:\n          command: build\n          target: ${{ matrix.target }}\n          args: \"--locked --release\"\n          strip: true\n          toolchain: stable\n      - name: Build tar.gz for homebrew installs\n        if: matrix.type == 'ubuntu-x64'\n        run: |\n          tar czf ${{ matrix.name }}.tar.gz -C target/x86_64-unknown-linux-musl/release rustscan\n      - uses: actions/upload-artifact@v4\n        with:\n          name: ${{ matrix.name }}\n          path: ${{ matrix.path }}\n      - uses: actions/upload-artifact@v4\n        if: matrix.type == 'ubuntu-x64'\n        with:\n          name: ${{ matrix.name }}.tar.gz\n          path: ${{ matrix.name }}.tar.gz\n  build-deb:\n    needs: [build-nix]\n    runs-on: ubuntu-latest\n    env:\n      IN_PIPELINE: true\n    steps:\n      - uses: actions/checkout@v4\n      - name: Install cargo-deb\n        run: cargo install -f cargo-deb\n      - uses: awalsh128/cache-apt-pkgs-action@v1\n        with:\n          packages: musl-tools # provides musl-gcc\n          version: 1.0\n      - name: Install musl toolchain\n        run: rustup target add x86_64-unknown-linux-musl\n      - name: Deb Build\n        run: cargo deb --target=x86_64-unknown-linux-musl\n      - name: Upload Deb Artifact\n        uses: actions/upload-artifact@v4\n        with:\n          name: rustscan.deb\n          path: ./target/x86_64-unknown-linux-musl/debian/*\n\n  build-macos:\n    env:\n      IN_PIPELINE: true\n    runs-on: macos-latest\n    if: github.ref == 'refs/heads/master'\n    steps:\n      - uses: actions/checkout@v4\n      - name: Cache cargo & target directories\n        uses: Swatinem/rust-cache@v2\n      - name: Build binary\n        uses: houseabsolute/actions-rust-cross@v0\n        with:\n          command: build\n          target: x86_64-apple-darwin\n          args: \"--locked --release\"\n          strip: true\n          toolchain: stable\n      - name: Build tar.gz for homebrew installs\n        run: |\n          tar czf x86_64-macos-rustscan.tar.gz -C target/x86_64-apple-darwin/release rustscan\n      - uses: actions/upload-artifact@v4\n        with:\n          name: x86_64-macos-rustscan\n          path: target/x86_64-apple-darwin/release/rustscan\n      - uses: actions/upload-artifact@v4\n        with:\n          name: x86_64-macos-rustscan.tar.gz\n          path: x86_64-macos-rustscan.tar.gz\n  \n  build-macos-aarch64:\n    env:\n      IN_PIPELINE: true\n    runs-on: macos-latest\n    if: github.ref == 'refs/heads/master'\n    steps:\n      - uses: actions/checkout@v4\n      - name: Cache cargo & target directories\n        uses: Swatinem/rust-cache@v2\n      - name: Build binary\n        uses: houseabsolute/actions-rust-cross@v0\n        with:\n          command: build\n          target: aarch64-apple-darwin\n          args: \"--locked --release\"\n          strip: true\n          toolchain: stable\n      - name: Build tar.gz for homebrew installs\n        run: |\n          tar czf aarch64-macos-rustscan.tar.gz -C target/aarch64-apple-darwin/release rustscan\n      - uses: actions/upload-artifact@v4\n        with:\n          name: aarch64-macos-rustscan\n          path: target/aarch64-apple-darwin/release/rustscan\n      - uses: actions/upload-artifact@v4\n        with:\n          name: aarch64-macos-rustscan.tar.gz\n          path: aarch64-macos-rustscan.tar.gz\n\n  build-windows:\n    env:\n      IN_PIPELINE: true\n    runs-on: ${{ matrix.os }}\n    if: github.ref == 'refs/heads/master'\n    strategy:\n      matrix:\n        type: [windows-x64, windows-x86]\n        include:\n          - type: windows-x64\n            os: windows-latest\n            target: x86_64-pc-windows-msvc\n            name: x86_64-windows-rustscan.exe\n            path: target\\x86_64-pc-windows-msvc\\release\\rustscan.exe\n          - type: windows-x86\n            os: windows-latest\n            target: i686-pc-windows-msvc\n            name: x86-windows-rustscan.exe\n            path: target\\i686-pc-windows-msvc\\release\\rustscan.exe\n    steps:\n      - uses: actions/checkout@v4\n      - name: Cache cargo & target directories\n        uses: Swatinem/rust-cache@v2\n      - name: Build binary\n        uses: houseabsolute/actions-rust-cross@v0\n        with:\n          command: build\n          target:  ${{ matrix.target }}\n          args: \"--locked --release\"\n          strip: true\n          toolchain: stable\n      - uses: actions/upload-artifact@v4\n        with:\n          name: ${{ matrix.name }}\n          path: ${{ matrix.path }}\n"
  },
  {
    "path": ".github/workflows/dependabot.yml",
    "content": "name: Dependabot Auto-Merge\n\njobs:\n  dependabot:\n    runs-on: ubuntu-latest\n    if: ${{ github.actor == 'dependabot[bot]' }}\n    steps:\n      - name: Enable auto-merge for Dependabot PRs\n        run: |\n          gh pr review --approve \"$PR_URL\"\n          gh pr merge --auto --merge \"$PR_URL\"\n        env:\n          PR_URL: ${{ github.event.pull_request.html_url }}\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n"
  },
  {
    "path": ".github/workflows/mlc_config.json",
    "content": "{\n    \"_comment\": \"Config for markdown-link-check. Resolves issue #540.\",\n    \"ignorePatterns\": [\n      {\n        \"pattern\": \"^https://github.com/RustScan/RustScan/workflows/Continuous%20integration/badge.svg\"\n      },\n      {\n        \"pattern\": \"^https://crates.io/crates/rustscan/\"\n      },\n      {\n        \"pattern\": \"^https://bees.substack.com/p/making-hacking-accessible\"\n      }\n    ]\n  }"
  },
  {
    "path": ".github/workflows/test.yml",
    "content": "name: Test\non:\n  pull_request:\n    branches: [master]\n  push:\n    branches:\n      - master\njobs:\n  test:\n    name: Test Suite\n    strategy:\n      matrix:\n        os: [ubuntu-latest, macos-latest, windows-latest]\n        rust: [stable]\n    runs-on: ${{ matrix.os }}\n    steps:\n      - name: Checkout sources\n        uses: actions/checkout@v4\n\n      - name: Install stable toolchain\n        uses: actions-rs/toolchain@v1\n        with:\n          profile: minimal\n          toolchain: ${{ matrix.rust }}\n          override: true\n\n      - uses: taiki-e/install-action@nextest\n      - uses: Swatinem/rust-cache@v2\n\n      - name: Install Just\n        uses: extractions/setup-just@v2\n\n      - name: Run just\n        run: just test\n"
  },
  {
    "path": ".gitignore",
    "content": "# Generated by Cargo\n# will have compiled files and executables\n/target/\n# generated file by build.rs for mapping nmap-payloads to rust\nsrc/generated.rs\n\n# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries\n# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html\n\n# These are backup files generated by rustfmt\n**/*.rs.bk\n\n\n#Added by cargo\n\n/target\n\n# Created by https://www.toptal.com/developers/gitignore/api/rust,archlinuxpackages\n# Edit at https://www.toptal.com/developers/gitignore?templates=rust,archlinuxpackages\n\n### ArchLinuxPackages ###\n*.tar\n*.tar.*\n*.jar\n*.exe\n*.msi\n*.zip\n*.tgz\n*.log\n*.log.*\n*.sig\n\npkg/\n\n### Rust ###\n# Generated by Cargo\n# will have compiled files and executables\n/target/\n\n# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries\n# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html\n\n# These are backup files generated by rustfmt\n**/*.rs.bk\n\n# End of https://www.toptal.com/developers/gitignore/api/rust,archlinuxpackages\n*.deb\n\n\n# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider\n# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839\n\n# User-specific stuff\n.idea/**/workspace.xml\n.idea/**/tasks.xml\n.idea/**/usage.statistics.xml\n.idea/**/dictionaries\n.idea/**/shelf\n\n# Generated files\n.idea/**/contentModel.xml\n\n# Sensitive or high-churn files\n.idea/**/dataSources/\n.idea/**/dataSources.ids\n.idea/**/dataSources.local.xml\n.idea/**/sqlDataSources.xml\n.idea/**/dynamic.xml\n.idea/**/uiDesigner.xml\n.idea/**/dbnavigator.xml\n\n# Gradle\n.idea/**/gradle.xml\n.idea/**/libraries\n\n# Gradle and Maven with auto-import\n# When using Gradle or Maven with auto-import, you should exclude module files,\n# since they will be recreated, and may cause churn.  Uncomment if using\n# auto-import.\n# .idea/artifacts\n# .idea/compiler.xml\n# .idea/jarRepositories.xml\n# .idea/modules.xml\n# .idea/*.iml\n# .idea/modules\n# *.iml\n# *.ipr\n\n# CMake\ncmake-build-*/\n\n# Mongo Explorer plugin\n.idea/**/mongoSettings.xml\n\n# File-based project format\n*.iws\n\n# IntelliJ\nout/\n\n# mpeltonen/sbt-idea plugin\n.idea_modules/\n\n# JIRA plugin\natlassian-ide-plugin.xml\n\n# Cursive Clojure plugin\n.idea/replstate.xml\n\n# Crashlytics plugin (for Android Studio and IntelliJ)\ncom_crashlytics_export_strings.xml\ncrashlytics.properties\ncrashlytics-build.properties\nfabric.properties\n\n# Editor-based Rest Client\n.idea/httpRequests\n\n# Android studio 3.1+ serialized cache file\n.idea/caches/build_file_checksums.ser\n\n.idea/*\n.idea\n.idea*\n\nsettings.json\n"
  },
  {
    "path": ".gitmodules",
    "content": "[submodule \"src/rustscan_scripting_engine\"]\n\tpath = src/rustscan_scripting_engine\n\turl = https://github.com/RustScan/rustscan_scripting_engine\n"
  },
  {
    "path": ".travis.yml",
    "content": "language: rust\nos:\n- linux\n- osx\narch:\n- amd64\n- arm64\nservices:\n- docker\nbefore_install:\n- rustup component add rustfmt\nrust:\n- stable\n- beta\njobs:\n  fast_finish: true\nscript:\n- cargo build\n- cargo test\n- \"ulimit -n 5000; cargo test timelimits:: -- --ignored --test-threads=1 --show-output\"\n- cargo fmt -- --check\nafter_failure:\n- wget https://raw.githubusercontent.com/DiscordHooks/travis-ci-discord-webhook/master/send.sh\n- chmod +x send.sh\n- \"./send.sh failure $WEBHOOK_URL\"\nafter_success: |\n  if [ -n \"${GITHUB_TOKEN}\" ]; then\n    [ \"${TRAVIS_BRANCH} \" = master ] &&\n    [ \"${TRAVIS_PULL_REQUEST}\" = false ] &&\n    cargo doc &&\n    echo \"<meta http-equiv=refresh content=0;url=rustscan/index.html>\" > target/doc/index.html &&\n    sudo pip install ghp-import &&\n    ghp-import -n target/doc &&\n    git push -fq https://${GITHUB_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages\n  fi\nenv:\n  global:\n    secure: Gf24LG7Hr3Q0drWyPrvISTL35Z57DxdS/wIOo7v+ZdauzY3Qjvv3Lh4TY//C4sdN0g1CLj4yjg7LQOqF4XRdh2Qah7JZPv/i2B5uz9nwjTsoRzmmMWML9VtfT1u53nSFqsNeXbvpmoNG9rfMXcoiyd+Lv+EgniHphDEBlXvS9n9KMcpOi1F2x7bsH0EK37wQYKMTpCCd5TPUPdZou7BJNiZS3ikRLpTRFF7uIN4gYtRH9kU5uBSphWgnJ6eBm2ItzZcUPOgrjAoF4RkmZAzGG4idDh1Qkf3No3nZwT3U5NSk8h7owtJ4oADlRgYqYKCB4YcC9cAKCJgDsyMlKKMkEyagvw1seFnBLCY3ljsW4EklpVEZ0rVqZOx4pTkIaxIxytLTC9pHmdDSnhdhFknOcVAQQWjg+nAZfD07QUeAqUdr0i/vxQoZitvbNY0znzEarycE1waKvwlkiB4gt385U1CBfYldydnOnRKkdtLNrCLClu13HU0djmSXMhojQJhTuNxTHtZAf5fKcWIWwkVbNZ5MNKYjQh4rKufqW3o1iHphB8dfAGsDEPv0RQMtVbu6H4+clCouLkFlxHOIrrOJ5SXQ8cIATPhnJR7y4cSDdRaN0DRLRjeLAIKlbOGBtNuFC+BftocaTY5qN42aKAMqQcT30ycfiLuRVJNiQJ5pkto=\n"
  },
  {
    "path": "CODE_OF_CONDUCT.md",
    "content": "# Contributor Covenant Code of Conduct\n\n## Our Pledge\n\nIn the interest of fostering an open and welcoming environment, we as\ncontributors and maintainers pledge to making participation in our project and\nour community a harassment-free experience for everyone, regardless of age, body\nsize, disability, ethnicity, sex characteristics, gender identity and expression,\nlevel of experience, education, socio-economic status, nationality, personal\nappearance, race, religion, or sexual identity and orientation.\n\n## Our Standards\n\nExamples of behavior that contributes to creating a positive environment\ninclude:\n\n- Using welcoming and inclusive language\n- Being respectful of differing viewpoints and experiences\n- Gracefully accepting constructive criticism\n- Focusing on what is best for the community\n- Showing empathy towards other community members\n\nExamples of unacceptable behavior by participants include:\n\n- The use of sexualized language or imagery and unwelcome sexual attention or\n  advances\n- Trolling, insulting/derogatory comments, and personal or political attacks\n- Public or private harassment\n- Publishing others' private information, such as a physical or electronic\n  address, without explicit permission\n- Other conduct which could reasonably be considered inappropriate in a\n  professional setting\n\n## Our Responsibilities\n\nProject maintainers are responsible for clarifying the standards of acceptable\nbehavior and are expected to take appropriate and fair corrective action in\nresponse to any instances of unacceptable behavior.\n\nProject maintainers have the right and responsibility to remove, edit, or\nreject comments, commits, code, wiki edits, issues, and other contributions\nthat are not aligned to this Code of Conduct, or to ban temporarily or\npermanently any contributor for other behaviors that they deem inappropriate,\nthreatening, offensive, or harmful.\n\n## Scope\n\nThis Code of Conduct applies both within project spaces and in public spaces\nwhen an individual is representing the project or its community. Examples of\nrepresenting a project or community include using an official project e-mail\naddress, posting via an official social media account, or acting as an appointed\nrepresentative at an online or offline event. Representation of a project may be\nfurther defined and clarified by project maintainers.\n\n## Enforcement\n\nInstances of abusive, harassing, or otherwise unacceptable behavior may be\nreported by contacting the project team at our discord via a private message to any of the owners. All\ncomplaints will be reviewed and investigated and will result in a response that\nis deemed necessary and appropriate to the circumstances. The project team is\nobligated to maintain confidentiality with regard to the reporter of an incident.\nFurther details of specific enforcement policies may be posted separately.\n\nProject maintainers who do not follow or enforce the Code of Conduct in good\nfaith may face temporary or permanent repercussions as determined by other\nmembers of the project's leadership.\n\n## Attribution\n\nThis Code of Conduct is adapted from the Contributor Covenant homepage, version 1.4,\navailable at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html\n\nhomepage: https://www.contributor-covenant.org\n\nFor answers to common questions about this code of conduct, see\nhttps://www.contributor-covenant.org/faq\n"
  },
  {
    "path": "Cargo.toml",
    "content": "[package]\nname = \"rustscan\"\nversion = \"2.4.1\"\nauthors = [\"Autumn <autumn@skerritt.blog>\"]\nedition = \"2018\"\ndescription = \"Faster Nmap Scanning with Rust\"\nhomepage = \"https://github.com/rustscan/rustscan\"\nrepository = \"https://github.com/rustscan/rustscan\"\nlicense = \"GPL-3.0-only\"\nkeywords = [\"port\", \"scanning\", \"nmap\"]\ncategories = [\"command-line-utilities\"]\nreadme = \"README.md\"\nexclude = [\n    \".github/*\",\n    \"pictures/*\",\n    \"rustscan-debbuilder/*\",\n]\n\n[dependencies]\nclap = { version = \"4.6.0\", features = [\"derive\", \"wrap_help\"] }\ncolored = \"3.1.1\"\nasync-std = \"1.13.2\"\nfutures = \"0.3\"\nrlimit = \"0.11.0\"\nlog = \"0.4.29\"\nenv_logger = \"0.11.9\"\nanstream = \"=1.0.0\"\ndirs = \"6.0.0\"\ngcd = \"2.0.1\"\nrand = \"0.10.0\"\ncolorful = \"0.3.2\"\nansi_term = \"0.12.1\"\ntoml = \"1.0.6\"\nserde = \"1.0.124\"\nserde_derive = \"1.0.116\"\ncidr-utils = \"0.6.2\"\nitertools = \"0.14.0\"\nhickory-resolver = { version = \"0.24.3\", features = [\"dns-over-rustls\"] }\nanyhow = \"1.0.40\"\ntext_placeholder = { version = \"0.5\", features = [\"struct_context\"] }\nonce_cell = \"1.21.4\"\n\n[dev-dependencies]\nparameterized = \"2.0.0\"\nwait-timeout = \"0.2\"\ncriterion = { version = \"0.8\", features = [\"html_reports\"] }\n\n[package.metadata.deb]\ndepends = \"$auto, nmap\"\nsection = \"rust\"\n\n[profile.release]\nlto = true\npanic = 'abort'\nstrip = true\n\n# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html\n[[bin]]\nname = \"rustscan\"\npath = \"src/main.rs\"\n\n[lints.rust]\nunexpected_cfgs = { level = \"warn\", check-cfg = [\"cfg(tarpaulin_include)\"] }\n\n[[bench]]\nname = \"benchmark_portscan\"\nharness = false\n"
  },
  {
    "path": "LICENSE",
    "content": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU General Public License is a free, copyleft license for\nsoftware and other kinds of works.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nthe GNU General Public License is intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.  We, the Free Software Foundation, use the\nGNU General Public License for most of our software; it applies also to\nany other work released this way by its authors.  You can apply it to\nyour programs, too.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  To protect your rights, we need to prevent others from denying you\nthese rights or asking you to surrender the rights.  Therefore, you have\ncertain responsibilities if you distribute copies of the software, or if\nyou modify it: responsibilities to respect the freedom of others.\n\n  For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must pass on to the recipients the same\nfreedoms that you received.  You must make sure that they, too, receive\nor can get the source code.  And you must show them these terms so they\nknow their rights.\n\n  Developers that use the GNU GPL protect your rights with two steps:\n(1) assert copyright on the software, and (2) offer you this License\ngiving you legal permission to copy, distribute and/or modify it.\n\n  For the developers' and authors' protection, the GPL clearly explains\nthat there is no warranty for this free software.  For both users' and\nauthors' sake, the GPL requires that modified versions be marked as\nchanged, so that their problems will not be attributed erroneously to\nauthors of previous versions.\n\n  Some devices are designed to deny users access to install or run\nmodified versions of the software inside them, although the manufacturer\ncan do so.  This is fundamentally incompatible with the aim of\nprotecting users' freedom to change the software.  The systematic\npattern of such abuse occurs in the area of products for individuals to\nuse, which is precisely where it is most unacceptable.  Therefore, we\nhave designed this version of the GPL to prohibit the practice for those\nproducts.  If such problems arise substantially in other domains, we\nstand ready to extend this provision to those domains in future versions\nof the GPL, as needed to protect the freedom of users.\n\n  Finally, every program is threatened constantly by software patents.\nStates should not allow patents to restrict development and use of\nsoftware on general-purpose computers, but in those that do, we wish to\navoid the special danger that patents applied to a free program could\nmake it effectively proprietary.  To prevent this, the GPL assures that\npatents cannot be used to render the program non-free.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Use with the GNU Affero General Public License.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU Affero General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the special requirements of the GNU Affero General Public License,\nsection 13, concerning interaction through a network will apply to the\ncombination as such.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU General Public License from time to time.  Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If the program does terminal interaction, make it output a short\nnotice like this when it starts in an interactive mode:\n\n    <program>  Copyright (C) <year>  <name of author>\n    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n    This is free software, and you are welcome to redistribute it\n    under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the appropriate\nparts of the General Public License.  Of course, your program's commands\nmight be different; for a GUI interface, you would use an \"about box\".\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU GPL, see\n<https://www.gnu.org/licenses/>.\n\n  The GNU General Public License does not permit incorporating your program\ninto proprietary programs.  If your program is a subroutine library, you\nmay consider it more useful to permit linking proprietary applications with\nthe library.  If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License.  But first, please read\n<https://www.gnu.org/licenses/why-not-lgpl.html>.\n"
  },
  {
    "path": "Makefile",
    "content": "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 Linux... 🐧'\n\tcross build --release --target=x86_64-unknown-linux-musl\n\tmkdir -p target/release-archives && tar -C target/x86_64-unknown-linux-musl/release -czf target/release-archives/rustscan-linux.tar.gz rustscan\n\nbuild-mac:\n\t@echo 'Building for MacOS... 🍏'\n\tcross build --release --target=x86_64-apple-darwin\n\tmkdir -p target/release-archives && tar -C target/x86_64-apple-darwin/release -czf target/release-archives/rustscan-mac.tar.gz rustscan\n\nshasum:\n\tshasum -a 256 target/release-archives/rustscan-*.tar.gz\n"
  },
  {
    "path": "README.md",
    "content": "<div align=\"center\" markdown=\"1\">\n\n➡️ [Discord][discord] | [Installation Guide][toc-install] | [Usage Guide][usage-guide] ⬅️\n\n<img src=\"pictures/rustscan.png\" height=400px width=400px>\n\n<!--<u>**The Modern Port Scanner.**</u>-->\n**Fast, smart, effective.**\n\n![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]\n\n</div>\n\n# 🤔 What is this?\n\n![fast][speed-1]\n\nThe Modern Port Scanner. **Find ports quickly (3 seconds at its fastest)**. Run scripts through our scripting engine (Python, Lua, Shell supported).\n\n# 🛠️ Installation\n\nYou can install RustScan's binary from our [releases page](https://github.com/RustScan/RustScan/releases).\n\nWe would prefer you to install with a package manager so it is tested and works for your system.\n\nRustScan is in many repositories already. Install it with whatever tools you wish:\n\n[![Packaging status](https://repology.org/badge/vertical-allrepos/rustscan.svg)](https://repology.org/project/rustscan/versions)\n\nRustScan only officially supports Cargo installations, if you want to use that please install Rust and then `cargo install rustscan`\n\nExample installations include:\n\nMacOS:\n\n```\n  brew install rustscan\n```\n\nArch:\n\n```\n  pacman -S rustscan\n```\n\n# ✨ Features\n\n- Scans all 65k ports in **3 seconds**.\n- Full scripting engine support. Automatically pipe results into Nmap, or use our scripts (or write your own) to do whatever you want.\n- Adaptive learning. RustScan improves the more you use it. No bloated machine learning here, just basic maths.\n- The usuals you would expect. IPv6, CIDR, file input and more.\n- Automatically pipes ports into Nmap.\n\n## ‼️ Important Links\n\n|         <!--Installation Guide-->          |          <!--Documentation-->          |       <!--Discord-->        |\n| :----------------------------------------: | :------------------------------------: | :-------------------------: |\n| :book: [Installation Guide][toc-install] | :books: [Documentation][links-table-2] | :parrot: [Discord][discord] |\n\n## 🙋 Table of Contents\n\n- 📖 [Installation Guide][toc-install]\n- 🐋 [Docker Usage][toc-docker-usage]\n- 🦜 [Discord][discord]\n- 🤸 [Usage][usage-1]\n\n# 🔭 Why RustScan?\n\nRustScan is a modern take on the port scanner. Sleek & fast. All while providing extensive extendability to you.\n\nNot to mention RustScan uses Adaptive Learning to improve itself over time, making it the best port scanner for **you**.\n\n## 🧋 Speed\n\n![fast][speed-1]\n\nSpeed is guaranteed via RustScan. However, if you want to run a slow scan due to stealth, that is possible too.\n\nFirstly, let's talk code.\n\nWe 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.\n\n[HyperFine][speed-2] is used to monitor RustScan's performance over time to answer the question, \"Are we getting faster? Are we getting slower?\".\n\nEvery 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.\n\n[Read more here][speed-3].\n\n## ⚙️ Extensible\n\n![scripts][extensible-1]\n\n### _RustScan piping results into the custom Python script_\n\nRustScan has a new scripting engine that allows anyone to write scripts in most languages. Python, Lua, and Shell are all supported.\n\nWant 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.\n\nThe possibilities are endless -- and you can write scripts in whatever language you feel comfortable with.\n\n[Read more here][extensible-2].\n\n## 🌊 Adaptive\n\n![adaptive][adaptive-1]\n\n### _RustScan automatically fine-tunes itself to match the host OS_\n\nRustScan 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**.\n\nWe 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].\n\n## 👩‍🦯 Accessible\n\n![fast][accessible-1]\n\nRustScan is one of the first penetration testing tools that aims to be entirely accessible.\n\n[Most penetration testing tools are not accessible][accessible-2], which negatively affects the whole industry.\n\nRustScan 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.\n\n# 🤸 Usage\n\nWe have 2 usage guides. [Basic Usage][usage-1] and [Things you may want to do][usage-2].\n\nWe also have documentation about our config file [here][config-file-here].\n\n# 🎪 Community\n\n[Contributing][community-1] Read this to learn how.\n\n## Contributors ✨\n\n<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->\n\n[![All Contributors](https://img.shields.io/badge/all_contributors-26-orange.svg?style=flat-square)](#contributors-)\n\n<!-- ALL-CONTRIBUTORS-BADGE:END -->\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->\n<!-- prettier-ignore-start -->\n<!-- markdownlint-disable -->\n<table>\n  <tr>\n    <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>\n    <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>\n    <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>\n    <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>\n    <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>\n    <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>\n    <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>\n  </tr>\n  <tr>\n    <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>\n    <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>\n    <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>\n    <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>\n    <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>\n    <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>\n    <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>\n  </tr>\n  <tr>\n    <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>\n    <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>\n    <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>\n    <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>\n    <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>\n    <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>\n    <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>\n  </tr>\n  <tr>\n    <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>\n    <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>\n    <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>\n    <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>\n    <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>\n  </tr>\n</table>\n\n<!-- markdownlint-enable -->\n<!-- prettier-ignore-end -->\n\n<!-- ALL-CONTRIBUTORS-LIST:END -->\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n\n<!--Links-->\n\n[Docker]: https://hub.docker.com/r/cmnatic/rustscan \"This is the recommended distribution of rustscan\"\n[kali]: https://github.com/RustScan/RustScan/wiki/Installation-Guide#%EF%B8%8F-debian--kali \"Read the install guide\"\n[Kali/Debian]: https://github.com/RustScan/RustScan/releases \"Kali Debian\"\n[Arch-Linux]: https://archlinux.org/packages/extra/x86_64/rustscan/ \"Arch Linux installation of Rustscan\"\n[Homebrew]: https://formulae.brew.sh/formula/rustscan \"Homebrew install of Rustscan\"\n[usage-1]: https://github.com/RustScan/RustScan/wiki/Usage \"Basic Usage of Rustscan\"\n[usage-0]: https://github.com/RustScan/RustScan/wiki/Installation-Guide#docker-whale \"Use Docker Rustscan\"\n[config-file-here]: https://github.com/RustScan/RustScan/wiki/Config-File \"RustScan Configuration File\"\n[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\"\n[community-1]: https://github.com/RustScan/RustScan/wiki/Contributing \"Learn how to contribute\"\n[distributions-1]: https://software.opensuse.org/package/rustscan?search_term=rustscan \"Open Suse rustscan distribution\"\n[distributions-2]: https://copr.fedorainfracloud.org/coprs/atim/rustscan/ \"Rustscan in Fedora\"\n[repology-1]: https://repology.org/project/rustscan/versions \"Packaging Status\"\n[install-1]: https://github.com/RustScan/RustScan/wiki/Installation-Guide \"Installation guide\"\n[accessible-2]: https://bees.substack.com/p/making-hacking-accessible \"Making Hacking Accessible\"\n[extensible-2]: https://github.com/RustScan/RustScan/wiki/RustScan-Scripting-Engine \"Scripting Engine\"\n[speed-2]: https://github.com/sharkdp/hyperfine \"Hyperfine\"\n[speed-3]: https://github.com/RustScan/RustScan/wiki/Increasing-Speed-&-Accuracy \"Increasing Speed & Accuracy\"\n[toc-community]: https://github.com/RustScan/RustScan#-community \"Community\"\n[links-table-1]: https://github.com/RustScan/RustScan#-full-installation-guide \"Full installation guide\"\n[links-table-2]: https://github.com/bee-san/RustScan/wiki \"Rustscan\"\n[discord]: http://discord.skerritt.blog \"Discord blog\"\n[toc-install]: https://github.com/RustScan/RustScan/wiki/Installation-Guide \"Installation Guide Wiki\"\n[toc-docker-usage]: https://github.com/RustScan/RustScan/wiki/Installation-Guide#docker- \"Docker Installation Guide Wiki\"\n[usage-guide]: https://github.com/RustScan/RustScan#-usage\n[adaptive-learning]: https://github.com/RustScan/RustScan/wiki/Adaptive-Learning \"Adaptive Learning\"\n\n<!--Pictures-->\n\n[DockerPic]: https://github.com/RustScan/RustScan/blob/master/pictures/docker.png?raw=true \"Docker install\"\n[Kali1]: https://github.com/RustScan/RustScan/blob/master/pictures/kali.png?raw=true \"Kali Picture\"\n[Arch]: https://github.com/RustScan/RustScan/blob/master/pictures/arch.png?raw=true \"Arch Linux\"\n[Apple]: https://raw.githubusercontent.com/RustScan/RustScan/master/pictures/apple.png?size \"Apple\"\n[rustscan-svg]: https://repology.org/badge/vertical-allrepos/rustscan.svg \"Picture of rustscan repology\"\n[accessible-1]: pictures/accessible.gif \"Fast\"\n[adaptive-1]: pictures/adaptive.gif \"Adaptive\"\n[extensible-1]: pictures/scripts.gif \"Scripts\"\n[speed-1]: pictures/fast.gif \"Speed\"\n[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\n[badge-2]: https://img.shields.io/badge/Built%20with-Rust-Purple\n[badge-3]: https://img.shields.io/github/downloads/rustscan/rustscan/total?label=GitHub%20Downloads\n[badge-4]: https://img.shields.io/crates/d/rustscan?label=Cargo%20Downloads\n[badge-5]: https://img.shields.io/discord/754001738184392704\n[badge-6]: https://github.com/RustScan/RustScan/actions/workflows/build.yml/badge.svg?branch=master\n"
  },
  {
    "path": "benches/benchmark_portscan.rs",
    "content": "use async_std::task::block_on;\nuse criterion::{criterion_group, criterion_main, Criterion};\nuse rustscan::input::{Opts, PortRange, ScanOrder};\nuse rustscan::port_strategy::PortStrategy;\nuse rustscan::scanner::Scanner;\nuse std::hint::black_box;\nuse std::net::IpAddr;\nuse std::time::Duration;\n\nfn portscan_tcp(scanner: &Scanner) {\n    let _scan_result = block_on(scanner.run());\n}\n\nfn portscan_udp(scanner: &Scanner) {\n    let _scan_result = block_on(scanner.run());\n}\n\nfn bench_address() {\n    let _addrs = [\"127.0.0.1\".parse::<IpAddr>().unwrap()];\n}\n\nfn bench_port_strategy() {\n    let range = PortRange {\n        start: 1,\n        end: 1_000,\n    };\n    let _strategy = PortStrategy::pick(&Some(range.clone()), None, ScanOrder::Serial);\n}\n\nfn bench_address_parsing() {\n    let opts = Opts {\n        addresses: vec![\n            \"127.0.0.1\".to_owned(),\n            \"10.2.0.1\".to_owned(),\n            \"192.168.0.0/24\".to_owned(),\n        ],\n        exclude_addresses: Some(vec![\n            \"10.0.0.0/8\".to_owned(),\n            \"172.16.0.0/12\".to_owned(),\n            \"192.168.0.0/16\".to_owned(),\n            \"172.16.0.1\".to_owned(),\n        ]),\n        ..Default::default()\n    };\n    let _ips = rustscan::address::parse_addresses(&opts);\n}\n\nfn criterion_benchmark(c: &mut Criterion) {\n    let addrs = vec![\"127.0.0.1\".parse::<IpAddr>().unwrap()];\n    let range = PortRange {\n        start: 1,\n        end: 1_000,\n    };\n    let strategy_tcp = PortStrategy::pick(&Some(range.clone()), None, ScanOrder::Serial);\n    let strategy_udp = PortStrategy::pick(&Some(range.clone()), None, ScanOrder::Serial);\n\n    let scanner_tcp = Scanner::new(\n        &addrs,\n        10,\n        Duration::from_millis(10),\n        1,\n        false,\n        strategy_tcp,\n        true,\n        vec![],\n        false,\n    );\n\n    c.bench_function(\"portscan tcp\", |b| {\n        b.iter(|| portscan_tcp(black_box(&scanner_tcp)))\n    });\n\n    let scanner_udp = Scanner::new(\n        &addrs,\n        10,\n        Duration::from_millis(10),\n        1,\n        false,\n        strategy_udp,\n        true,\n        vec![],\n        true,\n    );\n\n    let mut udp_group = c.benchmark_group(\"portscan udp\");\n    udp_group.measurement_time(Duration::from_secs(20));\n    udp_group.bench_function(\"portscan udp\", |b| {\n        b.iter(|| portscan_udp(black_box(&scanner_udp)))\n    });\n    udp_group.finish();\n\n    // Benching helper functions\n    c.bench_function(\"parse address\", |b| b.iter(bench_address));\n\n    c.bench_function(\"port strategy\", |b| b.iter(bench_port_strategy));\n\n    let mut address_group = c.benchmark_group(\"address parsing\");\n    address_group.measurement_time(Duration::from_secs(10));\n    address_group.bench_function(\"parse addresses with exclusions\", |b| {\n        b.iter(bench_address_parsing)\n    });\n    address_group.finish();\n}\n\ncriterion_group!(benches, criterion_benchmark);\ncriterion_main!(benches);\n"
  },
  {
    "path": "build.rs",
    "content": "use std::collections::BTreeMap;\nuse std::fs::{self, File};\n\nuse std::env;\nuse std::io::{BufReader, Read};\nuse std::path::PathBuf;\nuse std::process::Command;\n\n// Reads in a file with payloads based on port\npub fn main() {\n    let mut file_path = env::current_dir().expect(\"cant find curr dir\");\n    file_path.push(\"./nmap-payloads\");\n\n    let mut data = String::new();\n    let file = File::open(&file_path).expect(\"File not found.\");\n    let mut file_buf = BufReader::new(file);\n    file_buf\n        .read_to_string(&mut data)\n        .expect(\"unable to read file\");\n\n    let mut fp_map: BTreeMap<i32, String> = BTreeMap::new();\n\n    let mut count = 0;\n    let mut capturing = false;\n    let mut curr = String::new();\n\n    for line in data.trim().split('\\n') {\n        if line.contains('#') || line.is_empty() {\n            continue;\n        }\n\n        if line.starts_with(\"udp\") {\n            if !curr.is_empty() {\n                fp_map.insert(count, curr);\n                curr = String::new();\n            }\n            capturing = true;\n            count += 1;\n        }\n\n        if capturing {\n            if !curr.is_empty() {\n                curr.push(' ');\n            }\n            curr.push_str(line);\n        }\n    }\n\n    let pb_linenr = ports_v(&fp_map);\n    let payb_linenr = payloads_v(&fp_map);\n    let map = port_payload_map(pb_linenr, payb_linenr);\n\n    generate_code(map);\n}\n\n/// Generates a file called Generated.rs and calls cargo fmt from the command line\n///\n/// # Arguments\n///\n/// * `port_payload_map` - A BTreeMap mapping port numbers to payload data\nfn generate_code(port_payload_map: BTreeMap<Vec<u16>, Vec<u8>>) {\n    let dest_path = PathBuf::from(\"src/generated.rs\");\n\n    let mut generated_code = String::new();\n    generated_code.push_str(\"use std::collections::BTreeMap;\\n\");\n    generated_code.push_str(\"use once_cell::sync::Lazy;\\n\\n\");\n\n    generated_code.push_str(\"fn generated_data() -> BTreeMap<Vec<u16>, Vec<u8>> {\\n\");\n    generated_code.push_str(\"    let mut map = BTreeMap::new();\\n\");\n\n    for (ports, payloads) in port_payload_map {\n        generated_code.push_str(\"    map.insert(vec![\");\n        generated_code.push_str(\n            &ports\n                .iter()\n                .map(|&p| p.to_string())\n                .collect::<Vec<_>>()\n                .join(\",\"),\n        );\n        generated_code.push_str(\"], vec![\");\n        generated_code.push_str(\n            &payloads\n                .iter()\n                .map(|&p| p.to_string())\n                .collect::<Vec<_>>()\n                .join(\",\"),\n        );\n        generated_code.push_str(\"]);\\n\");\n    }\n\n    generated_code.push_str(\"    map\\n\");\n    generated_code.push_str(\"}\\n\\n\");\n\n    generated_code.push_str(\n        \"static PARSED_DATA: Lazy<BTreeMap<Vec<u16>, Vec<u8>>> = Lazy::new(generated_data);\\n\",\n    );\n    generated_code.push_str(\"pub fn get_parsed_data() -> &'static BTreeMap<Vec<u16>, Vec<u8>> {\\n\");\n    generated_code.push_str(\"    &PARSED_DATA\\n\");\n    generated_code.push_str(\"}\\n\");\n\n    fs::write(dest_path, generated_code).unwrap();\n\n    // format the generated code\n    Command::new(\"cargo\")\n        .arg(\"fmt\")\n        .arg(\"--all\")\n        .output()\n        .expect(\"Failed to execute cargo fmt\");\n}\n\n/// Creates a BTreeMap of line numbers mapped to a Vec<u16> of ports\n///\n/// # Arguments\n///\n/// * `fp_map` - A BTreeMap containing the parsed file data\n///\n/// # Returns\n///\n/// A BTreeMap where keys are line numbers and values are vectors of ports\nfn ports_v(fp_map: &BTreeMap<i32, String>) -> BTreeMap<i32, Vec<u16>> {\n    let mut pb_linenr: BTreeMap<i32, Vec<u16>> = BTreeMap::new();\n    let mut port_list: Vec<u16> = Vec::new();\n\n    for (&line_nr, ports) in fp_map {\n        if ports.contains(\"udp \") {\n            let remain = &ports[4..];\n            let mut start = remain.split(' ');\n\n            let ports = start.next().unwrap();\n            let port_segments: Vec<&str> = ports.split(',').collect();\n\n            for segment in port_segments {\n                if segment.contains('-') {\n                    let range: Vec<&str> = segment.trim().split('-').collect();\n                    let start = range[0].parse::<u16>().unwrap();\n                    let end = range[1].parse::<u16>().unwrap();\n\n                    for port in start..end {\n                        port_list.push(port);\n                    }\n                } else if !segment.is_empty() {\n                    match segment.parse::<u16>() {\n                        Ok(port) => port_list.push(port),\n                        Err(_) => println!(\"Error parsing port: {segment}\"),\n                    }\n                }\n            }\n        }\n\n        pb_linenr.insert(line_nr, port_list.clone());\n        port_list.clear();\n    }\n\n    pb_linenr\n}\n\n/// Parses out the Payloads into a BTreeMap of line numbers mapped to vectors of payload bytes\n///\n/// # Arguments\n///\n/// * `fp_map` - A BTreeMap containing the parsed file data\n///\n/// # Returns\n///\n/// A BTreeMap where keys are line numbers and values are vectors of payload bytes\nfn payloads_v(fp_map: &BTreeMap<i32, String>) -> BTreeMap<i32, Vec<u8>> {\n    let mut payb_linenr: BTreeMap<i32, Vec<u8>> = BTreeMap::new();\n\n    for (&line_nr, data) in fp_map {\n        if data.contains('\\\"') {\n            let start = data.find('\\\"').expect(\"payload opening \\\" not found\");\n            let payloads = &data[start + 1..];\n            payb_linenr.insert(line_nr, parser(payloads.trim()));\n        }\n    }\n\n    payb_linenr\n}\n\n/// Converts a hexadecimal string to a Vec<u8>\n///\n/// # Arguments\n///\n/// * `payload` - A string slice containing the hexadecimal payload\n///\n/// # Returns\n///\n/// A vector of bytes representing the decoded payload\nfn parser(payload: &str) -> Vec<u8> {\n    let payload = payload.trim_matches('\"');\n    let mut tmp_str = String::new();\n    let mut bytes: Vec<u8> = Vec::new();\n\n    for (idx, char) in payload.chars().enumerate() {\n        if char == '\\\\' && payload.chars().nth(idx + 1) == Some('x') {\n            continue;\n        } else if char.is_ascii_hexdigit() {\n            tmp_str.push(char);\n            if tmp_str.len() == 2 {\n                bytes.push(u8::from_str_radix(&tmp_str, 16).unwrap());\n                tmp_str.clear();\n            }\n        }\n    }\n\n    bytes\n}\n\n/// Combines the ports BTreeMap and the Payloads BTreeMap\n///\n/// # Arguments\n///\n/// * `pb_linenr` - A BTreeMap mapping line numbers to vectors of ports\n/// * `payb_linenr` - A BTreeMap mapping line numbers to vectors of payload bytes\n///\n/// # Returns\n///\n/// A BTreeMap mapping vectors of ports to vectors of payload bytes\nfn port_payload_map(\n    pb_linenr: BTreeMap<i32, Vec<u16>>,\n    payb_linenr: BTreeMap<i32, Vec<u8>>,\n) -> BTreeMap<Vec<u16>, Vec<u8>> {\n    let mut ppm_fin: BTreeMap<Vec<u16>, Vec<u8>> = BTreeMap::new();\n\n    for (port_linenr, ports) in pb_linenr {\n        for (pay_linenr, payloads) in &payb_linenr {\n            if pay_linenr == &port_linenr {\n                ppm_fin.insert(ports.to_vec(), payloads.to_vec());\n            }\n        }\n    }\n\n    ppm_fin\n}\n"
  },
  {
    "path": "config.toml",
    "content": "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\n21 = 1\n22 = 1\n23 = 1\n24 = 1\n25 = 1\n26 = 1\n30 = 1\n32 = 1\n33 = 1\n37 = 1\n42 = 1\n43 = 1\n49 = 1\n53 = 1\n70 = 1\n79 = 1\n80 = 1\n81 = 1\n82 = 1\n83 = 1\n84 = 1\n85 = 1\n88 = 1\n89 = 1\n90 = 1\n99 = 1\n100 = 1\n106 = 1\n109 = 1\n110 = 1\n111 = 1\n113 = 1\n119 = 1\n125 = 1\n135 = 1\n139 = 1\n143 = 1\n144 = 1\n146 = 1\n161 = 1\n163 = 1\n179 = 1\n199 = 1\n211 = 1\n212 = 1\n222 = 1\n254 = 1\n255 = 1\n256 = 1\n259 = 1\n264 = 1\n280 = 1\n301 = 1\n306 = 1\n311 = 1\n340 = 1\n366 = 1\n389 = 1\n406 = 1\n407 = 1\n416 = 1\n417 = 1\n425 = 1\n427 = 1\n443 = 1\n444 = 1\n445 = 1\n458 = 1\n464 = 1\n465 = 1\n481 = 1\n497 = 1\n500 = 1\n512 = 1\n513 = 1\n514 = 1\n515 = 1\n524 = 1\n541 = 1\n543 = 1\n544 = 1\n545 = 1\n548 = 1\n554 = 1\n555 = 1\n563 = 1\n587 = 1\n593 = 1\n616 = 1\n617 = 1\n625 = 1\n631 = 1\n636 = 1\n646 = 1\n648 = 1\n666 = 1\n667 = 1\n668 = 1\n683 = 1\n687 = 1\n691 = 1\n700 = 1\n705 = 1\n711 = 1\n714 = 1\n720 = 1\n722 = 1\n726 = 1\n749 = 1\n765 = 1\n777 = 1\n783 = 1\n787 = 1\n800 = 1\n801 = 1\n808 = 1\n843 = 1\n873 = 1\n880 = 1\n888 = 1\n898 = 1\n900 = 1\n901 = 1\n902 = 1\n903 = 1\n911 = 1\n912 = 1\n981 = 1\n987 = 1\n990 = 1\n992 = 1\n993 = 1\n995 = 1\n999 = 1\n1000 = 1\n1001 = 1\n1002 = 1\n1007 = 1\n1009 = 1\n1010 = 1\n1011 = 1\n1021 = 1\n1022 = 1\n1023 = 1\n1024 = 1\n1025 = 1\n1026 = 1\n1027 = 1\n1028 = 1\n1029 = 1\n1030 = 1\n1031 = 1\n1032 = 1\n1033 = 1\n1034 = 1\n1035 = 1\n1036 = 1\n1037 = 1\n1038 = 1\n1039 = 1\n1040 = 1\n1041 = 1\n1042 = 1\n1043 = 1\n1044 = 1\n1045 = 1\n1046 = 1\n1047 = 1\n1048 = 1\n1049 = 1\n1050 = 1\n1051 = 1\n1052 = 1\n1053 = 1\n1054 = 1\n1055 = 1\n1056 = 1\n1057 = 1\n1058 = 1\n1059 = 1\n1060 = 1\n1061 = 1\n1062 = 1\n1063 = 1\n1064 = 1\n1065 = 1\n1066 = 1\n1067 = 1\n1068 = 1\n1069 = 1\n1070 = 1\n1071 = 1\n1072 = 1\n1073 = 1\n1074 = 1\n1075 = 1\n1076 = 1\n1077 = 1\n1078 = 1\n1079 = 1\n1080 = 1\n1081 = 1\n1082 = 1\n1083 = 1\n1084 = 1\n1085 = 1\n1086 = 1\n1087 = 1\n1088 = 1\n1089 = 1\n1090 = 1\n1091 = 1\n1092 = 1\n1093 = 1\n1094 = 1\n1095 = 1\n1096 = 1\n1097 = 1\n1098 = 1\n1099 = 1\n1100 = 1\n1102 = 1\n1104 = 1\n1105 = 1\n1106 = 1\n1107 = 1\n1108 = 1\n1110 = 1\n1111 = 1\n1112 = 1\n1113 = 1\n1114 = 1\n1117 = 1\n1119 = 1\n1121 = 1\n1122 = 1\n1123 = 1\n1124 = 1\n1126 = 1\n1130 = 1\n1131 = 1\n1132 = 1\n1137 = 1\n1138 = 1\n1141 = 1\n1145 = 1\n1147 = 1\n1148 = 1\n1149 = 1\n1151 = 1\n1152 = 1\n1154 = 1\n1163 = 1\n1164 = 1\n1165 = 1\n1166 = 1\n1169 = 1\n1174 = 1\n1175 = 1\n1183 = 1\n1185 = 1\n1186 = 1\n1187 = 1\n1192 = 1\n1198 = 1\n1199 = 1\n1201 = 1\n1213 = 1\n1216 = 1\n1217 = 1\n1218 = 1\n1233 = 1\n1234 = 1\n1236 = 1\n1244 = 1\n1247 = 1\n1248 = 1\n1259 = 1\n1271 = 1\n1272 = 1\n1277 = 1\n1287 = 1\n1296 = 1\n1300 = 1\n1301 = 1\n1309 = 1\n1310 = 1\n1311 = 1\n1322 = 1\n1328 = 1\n1334 = 1\n1352 = 1\n1417 = 1\n1433 = 1\n1434 = 1\n1443 = 1\n1455 = 1\n1461 = 1\n1494 = 1\n1500 = 1\n1501 = 1\n1503 = 1\n1521 = 1\n1524 = 1\n1533 = 1\n1556 = 1\n1580 = 1\n1583 = 1\n1594 = 1\n1600 = 1\n1641 = 1\n1658 = 1\n1666 = 1\n1687 = 1\n1688 = 1\n1700 = 1\n1717 = 1\n1718 = 1\n1719 = 1\n1720 = 1\n1721 = 1\n1723 = 1\n1755 = 1\n1761 = 1\n1782 = 1\n1783 = 1\n1801 = 1\n1805 = 1\n1812 = 1\n1839 = 1\n1840 = 1\n1862 = 1\n1863 = 1\n1864 = 1\n1875 = 1\n1900 = 1\n1914 = 1\n1935 = 1\n1947 = 1\n1971 = 1\n1972 = 1\n1974 = 1\n1984 = 1\n1998 = 1\n1999 = 1\n2000 = 1\n2001 = 1\n2002 = 1\n2003 = 1\n2004 = 1\n2005 = 1\n2006 = 1\n2007 = 1\n2008 = 1\n2009 = 1\n2010 = 1\n2013 = 1\n2020 = 1\n2021 = 1\n2022 = 1\n2030 = 1\n2033 = 1\n2034 = 1\n2035 = 1\n2038 = 1\n2040 = 1\n2041 = 1\n2042 = 1\n2043 = 1\n2045 = 1\n2046 = 1\n2047 = 1\n2048 = 1\n2049 = 1\n2065 = 1\n2068 = 1\n2099 = 1\n2100 = 1\n2103 = 1\n2105 = 1\n2106 = 1\n2107 = 1\n2111 = 1\n2119 = 1\n2121 = 1\n2126 = 1\n2135 = 1\n2144 = 1\n2160 = 1\n2161 = 1\n2170 = 1\n2179 = 1\n2190 = 1\n2191 = 1\n2196 = 1\n2200 = 1\n2222 = 1\n2251 = 1\n2260 = 1\n2288 = 1\n2301 = 1\n2323 = 1\n2366 = 1\n2381 = 1\n2382 = 1\n2383 = 1\n2393 = 1\n2394 = 1\n2399 = 1\n2401 = 1\n2492 = 1\n2500 = 1\n2522 = 1\n2525 = 1\n2557 = 1\n2601 = 1\n2602 = 1\n2604 = 1\n2605 = 1\n2607 = 1\n2608 = 1\n2638 = 1\n2701 = 1\n2702 = 1\n2710 = 1\n2717 = 1\n2718 = 1\n2725 = 1\n2800 = 1\n2809 = 1\n2811 = 1\n2869 = 1\n2875 = 1\n2909 = 1\n2910 = 1\n2920 = 1\n2967 = 1\n2968 = 1\n2998 = 1\n3000 = 1\n3001 = 1\n3003 = 1\n3005 = 1\n3006 = 1\n3007 = 1\n3011 = 1\n3013 = 1\n3017 = 1\n3030 = 1\n3031 = 1\n3052 = 1\n3071 = 1\n3077 = 1\n3128 = 1\n3168 = 1\n3211 = 1\n3221 = 1\n3260 = 1\n3261 = 1\n3268 = 1\n3269 = 1\n3283 = 1\n3300 = 1\n3301 = 1\n3306 = 1\n3322 = 1\n3323 = 1\n3324 = 1\n3325 = 1\n3333 = 1\n3351 = 1\n3367 = 1\n3369 = 1\n3370 = 1\n3371 = 1\n3372 = 1\n3389 = 1\n3390 = 1\n3404 = 1\n3476 = 1\n3493 = 1\n3517 = 1\n3527 = 1\n3546 = 1\n3551 = 1\n3580 = 1\n3659 = 1\n3689 = 1\n3690 = 1\n3703 = 1\n3737 = 1\n3766 = 1\n3784 = 1\n3800 = 1\n3801 = 1\n3809 = 1\n3814 = 1\n3826 = 1\n3827 = 1\n3828 = 1\n3851 = 1\n3869 = 1\n3871 = 1\n3878 = 1\n3880 = 1\n3889 = 1\n3905 = 1\n3914 = 1\n3918 = 1\n3920 = 1\n3945 = 1\n3971 = 1\n3986 = 1\n3995 = 1\n3998 = 1\n4000 = 1\n4001 = 1\n4002 = 1\n4003 = 1\n4004 = 1\n4005 = 1\n4006 = 1\n4045 = 1\n4111 = 1\n4125 = 1\n4126 = 1\n4129 = 1\n4224 = 1\n4242 = 1\n4279 = 1\n4321 = 1\n4343 = 1\n4443 = 1\n4444 = 1\n4445 = 1\n4446 = 1\n4449 = 1\n4550 = 1\n4567 = 1\n4662 = 1\n4848 = 1\n4899 = 1\n4900 = 1\n4998 = 1\n5000 = 1\n5001 = 1\n5002 = 1\n5003 = 1\n5004 = 1\n5009 = 1\n5030 = 1\n5033 = 1\n5050 = 1\n5051 = 1\n5054 = 1\n5060 = 1\n5061 = 1\n5080 = 1\n5087 = 1\n5100 = 1\n5101 = 1\n5102 = 1\n5120 = 1\n5190 = 1\n5200 = 1\n5214 = 1\n5221 = 1\n5222 = 1\n5225 = 1\n5226 = 1\n5269 = 1\n5280 = 1\n5298 = 1\n5357 = 1\n5405 = 1\n5414 = 1\n5431 = 1\n5432 = 1\n5440 = 1\n5500 = 1\n5510 = 1\n5544 = 1\n5550 = 1\n5555 = 1\n5560 = 1\n5566 = 1\n5631 = 1\n5633 = 1\n5666 = 1\n5678 = 1\n5679 = 1\n5718 = 1\n5730 = 1\n5800 = 1\n5801 = 1\n5802 = 1\n5810 = 1\n5811 = 1\n5815 = 1\n5822 = 1\n5825 = 1\n5850 = 1\n5859 = 1\n5862 = 1\n5877 = 1\n5900 = 1\n5901 = 1\n5902 = 1\n5903 = 1\n5904 = 1\n5906 = 1\n5907 = 1\n5910 = 1\n5911 = 1\n5915 = 1\n5922 = 1\n5925 = 1\n5950 = 1\n5952 = 1\n5959 = 1\n5960 = 1\n5961 = 1\n5962 = 1\n5963 = 1\n5987 = 1\n5988 = 1\n5989 = 1\n5998 = 1\n5999 = 1\n6000 = 1\n6001 = 1\n6002 = 1\n6003 = 1\n6004 = 1\n6005 = 1\n6006 = 1\n6007 = 1\n6009 = 1\n6025 = 1\n6059 = 1\n6100 = 1\n6101 = 1\n6106 = 1\n6112 = 1\n6123 = 1\n6129 = 1\n6156 = 1\n6346 = 1\n6389 = 1\n6502 = 1\n6510 = 1\n6543 = 1\n6547 = 1\n6565 = 1\n6566 = 1\n6567 = 1\n6580 = 1\n6646 = 1\n6666 = 1\n6667 = 1\n6668 = 1\n6669 = 1\n6689 = 1\n6692 = 1\n6699 = 1\n6779 = 1\n6788 = 1\n6789 = 1\n6792 = 1\n6839 = 1\n6881 = 1\n6901 = 1\n6969 = 1\n7000 = 1\n7001 = 1\n7002 = 1\n7004 = 1\n7007 = 1\n7019 = 1\n7025 = 1\n7070 = 1\n7100 = 1\n7103 = 1\n7106 = 1\n7200 = 1\n7201 = 1\n7402 = 1\n7435 = 1\n7443 = 1\n7496 = 1\n7512 = 1\n7625 = 1\n7627 = 1\n7676 = 1\n7741 = 1\n7777 = 1\n7778 = 1\n7800 = 1\n7911 = 1\n7920 = 1\n7921 = 1\n7937 = 1\n7938 = 1\n7999 = 1\n8000 = 1\n8001 = 1\n8002 = 1\n8007 = 1\n8008 = 1\n8009 = 1\n8010 = 1\n8011 = 1\n8021 = 1\n8022 = 1\n8031 = 1\n8042 = 1\n8045 = 1\n8080 = 1\n8081 = 1\n8082 = 1\n8083 = 1\n8084 = 1\n8085 = 1\n8086 = 1\n8087 = 1\n8088 = 1\n8089 = 1\n8090 = 1\n8093 = 1\n8099 = 1\n8100 = 1\n8180 = 1\n8181 = 1\n8192 = 1\n8193 = 1\n8194 = 1\n8200 = 1\n8222 = 1\n8254 = 1\n8290 = 1\n8291 = 1\n8292 = 1\n8300 = 1\n8333 = 1\n8383 = 1\n8400 = 1\n8402 = 1\n8443 = 1\n8500 = 1\n8600 = 1\n8649 = 1\n8651 = 1\n8652 = 1\n8654 = 1\n8701 = 1\n8800 = 1\n8873 = 1\n8888 = 1\n8899 = 1\n8994 = 1\n9000 = 1\n9001 = 1\n9002 = 1\n9003 = 1\n9009 = 1\n9010 = 1\n9011 = 1\n9040 = 1\n9050 = 1\n9071 = 1\n9080 = 1\n9081 = 1\n9090 = 1\n9091 = 1\n9099 = 1\n9100 = 1\n9101 = 1\n9102 = 1\n9103 = 1\n9110 = 1\n9111 = 1\n9200 = 1\n9207 = 1\n9220 = 1\n9290 = 1\n9415 = 1\n9418 = 1\n9485 = 1\n9500 = 1\n9502 = 1\n9503 = 1\n9535 = 1\n9575 = 1\n9593 = 1\n9594 = 1\n9595 = 1\n9618 = 1\n9666 = 1\n9876 = 1\n9877 = 1\n9878 = 1\n9898 = 1\n9900 = 1\n9917 = 1\n9929 = 1\n9943 = 1\n9944 = 1\n9968 = 1\n9998 = 1\n9999 = 1\n10000 = 1\n10001 = 1\n10002 = 1\n10003 = 1\n10004 = 1\n10009 = 1\n10010 = 1\n10012 = 1\n10024 = 1\n10025 = 1\n10082 = 1\n10180 = 1\n10215 = 1\n10243 = 1\n10566 = 1\n10616 = 1\n10617 = 1\n10621 = 1\n10626 = 1\n10628 = 1\n10629 = 1\n10778 = 1\n11110 = 1\n11111 = 1\n11967 = 1\n12000 = 1\n12174 = 1\n12265 = 1\n12345 = 1\n13456 = 1\n13722 = 1\n13782 = 1\n13783 = 1\n14000 = 1\n14238 = 1\n14441 = 1\n14442 = 1\n15000 = 1\n15002 = 1\n15003 = 1\n15004 = 1\n15660 = 1\n15742 = 1\n16000 = 1\n16001 = 1\n16012 = 1\n16016 = 1\n16018 = 1\n16080 = 1\n16113 = 1\n16992 = 1\n16993 = 1\n17877 = 1\n17988 = 1\n18040 = 1\n18101 = 1\n18988 = 1\n19101 = 1\n19283 = 1\n19315 = 1\n19350 = 1\n19780 = 1\n19801 = 1\n19842 = 1\n20000 = 1\n20005 = 1\n20031 = 1\n20221 = 1\n20222 = 1\n20828 = 1\n21571 = 1\n22939 = 1\n23502 = 1\n24444 = 1\n24800 = 1\n25734 = 1\n25735 = 1\n26214 = 1\n27000 = 1\n27352 = 1\n27353 = 1\n27355 = 1\n27356 = 1\n27715 = 1\n28201 = 1\n30000 = 1\n30718 = 1\n30951 = 1\n31038 = 1\n31337 = 1\n32768 = 1\n32769 = 1\n32770 = 1\n32771 = 1\n32772 = 1\n32773 = 1\n32774 = 1\n32775 = 1\n32776 = 1\n32777 = 1\n32778 = 1\n32779 = 1\n32780 = 1\n32781 = 1\n32782 = 1\n32783 = 1\n32784 = 1\n32785 = 1\n33354 = 1\n33899 = 1\n34571 = 1\n34572 = 1\n34573 = 1\n35500 = 1\n38292 = 1\n40193 = 1\n40911 = 1\n41511 = 1\n42510 = 1\n44176 = 1\n44442 = 1\n44443 = 1\n44501 = 1\n45100 = 1\n48080 = 1\n49152 = 1\n49153 = 1\n49154 = 1\n49155 = 1\n49156 = 1\n49157 = 1\n49158 = 1\n49159 = 1\n49160 = 1\n49161 = 1\n49163 = 1\n49165 = 1\n49167 = 1\n49175 = 1\n49176 = 1\n49400 = 1\n49999 = 1\n50000 = 1\n50001 = 1\n50002 = 1\n50003 = 1\n50006 = 1\n50300 = 1\n50389 = 1\n50500 = 1\n50636 = 1\n50800 = 1\n51103 = 1\n51493 = 1\n52673 = 1\n52822 = 1\n52848 = 1\n52869 = 1\n54045 = 1\n54328 = 1\n55055 = 1\n55056 = 1\n55555 = 1\n55600 = 1\n56737 = 1\n56738 = 1\n57294 = 1\n57797 = 1\n58080 = 1\n60020 = 1\n60443 = 1\n61532 = 1\n61900 = 1\n62078 = 1\n63331 = 1\n64623 = 1\n64680 = 1\n65000 = 1\n65129 = 1\n65389 = 1\n"
  },
  {
    "path": "contributing.Dockerfile",
    "content": "# Dockerfile for RustScan development environment\n# Provides a containerized setup with Rust, nmap, and development tools\nFROM rust\n# Install nmap first.\nRUN apt-get update -qy && apt-get install -qy nmap\n# Then install rustfmt for code formatting and clippy for linting.\nRUN rustup component add rustfmt clippy"
  },
  {
    "path": "contributing.md",
    "content": "Howdy Space Cow-Person 🤠🌌\n\nRustScan is always looking for contributors. Whether that's spelling mistakes or major changes, your help is **wanted** and welcomed here.\n\nBefore contributing, read our [code of conduct](https://github.com/RustScan/RustScan/blob/master/CODE_OF_CONDUCT.md).\n\nTL;DR if you abuse members of our community you will be **perma-banned** with no chance to get unbanned. No warnings either. 🤗\n\nRustScan has 2 major labels for GitHub issues you should look at:\n\n- Good First issue\n  These are issues for newcomers to open source!\n  [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)\n- Help wanted\n  These are issues that aren't really for newcomers, but we could still do with help!\n  [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)\n\nIf you want to, solve the issue or comment on the issue for help.\n\nThe flow for contributing to open source software is:\n\n- Fork the repo\n- Make changes\n- Pull request to the repo\n\nAnd then comment on the issue that you've done.\n\nRustScan 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.\n\nIf you have any feature suggestions or bugs, leave a GitHub issue. We welcome any and all support :D\n\n## Rewarding you\n\nI cannot pay you :-( But, I can place your GitHub profile on the README under `#Contributors` as a thank you! :)\n\n## Contributing development environment\n\nTo ease contribution to RustScan, you can use the `contributing.Dockerfile` to create a Docker image ready to build and play with RustScan.\nTo build it you just need to run:\n\n```bash\nyou@home:~/RustScan$ docker build -t rustscan_contributing -f contributing.Dockerfile\n```\n\nThen you need to run the container with a volume so it can access, _with read and write permissions_, to RustScan files:\n\n```bash\nyou@home:~/RustScan$ docker run -ti --rm -v \"$PWD\":/rustscan -w /rustscan rustscan_contributing bash\n```\n\nYou 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:\n\n```bash\nroot@container:/rustscan# cargo build\n```\n\nYou are now ready to use RustScan:\n\n```bash\nroot@container:/rustscan# cargo run -- -b 2000 -t 5000 -a 127.0.0.1\n```\n\nYou can also format, lint with `clippy` and test the code with the following commands:\n\n```bash\nroot@container:/rustscan# cargo fmt\nroot@container:/rustscan# cargo clippy\nroot@container:/rustscan# cargo test\n```\n"
  },
  {
    "path": "fixtures/.rustscan_scripts/test_script.pl",
    "content": "#!/usr/bin/perl\n#tags = [\"core_approved\", \"example\",]\n#developer = [ \"example\", \"https://example.org\" ]\n#ports_separator = \",\"\n#call_format = \"perl {{script}} {{ip}} {{port}}\"\n\n# Sriptfile parser stops at the first blank line with parsing.\n# This script will run itself as an argument with the system installed perl interpreter, ports will be concatenated with \",\" .\n# Unused field: trigger_port = \"80\"\n# get total arg passed to this script\nmy $total = $#ARGV + 1;\nmy $counter = 1;\n \n# get script name\nmy $scriptname = $0;\n \nprint \"Total args passed to $scriptname : $total\\n\";\n \n# Use loop to print all args stored in an array called @ARGV\nforeach my $a(@ARGV) {\n\tprint \"Arg # $counter : $a\\n\";\n\t$counter++;\n}"
  },
  {
    "path": "fixtures/.rustscan_scripts/test_script.py",
    "content": "#!/usr/bin/python3\n#tags = [\"core_approved\", \"example\",]\n#developer = [ \"example\", \"https://example.org\" ]\n#trigger_port = \"80\"\n#call_format = \"python3 {{script}} {{ip}} {{port}}\"\n\n# Sriptfile parser stops at the first blank line with parsing.\n# This script will run itself as an argument with the system installed python interpreter, only scanning port 80.\n# Unused filed: ports_separator = \",\"\n\nimport sys\n\nprint('Python script ran with arguments', str(sys.argv))"
  },
  {
    "path": "fixtures/.rustscan_scripts/test_script.sh",
    "content": "#!/bin/bash \n#tags = [\"core_approved\", \"example\",]\n#developer = [ \"example\", \"https://example.org\" ]\n#ports_separator = \",\"\n#call_format = \"bash {{script}} {{ip}} {{port}}\"\n\n# Sriptfile parser stops at the first blank line with parsing.\n# This script will run itself as an argument with the system installed bash interpreter, scanning all ports concatenated with \",\" .\n# Unused filed: trigger_port = \"80\"\n\n# print all arguments passed to the script\necho $@"
  },
  {
    "path": "fixtures/.rustscan_scripts/test_script.txt",
    "content": "#!intentional_blank_line\n#tags = [\"core_approved\", \"example\"]\n#developer = [ \"example\", \"https://example.org\" ]\n#ports_separator = \",\"\n#call_format = \"nmap -vvv -p {{port}} {{ip}}\"\n\n# Scriptfile parser stops at the first blank line with parsing.\n# This script will run the system installed nmap, ports will be concatenated with \",\" .\n# Unused field: trigger_port = \"80\""
  },
  {
    "path": "fixtures/.rustscan_scripts/test_script_invalid_headers.txt",
    "content": "#!intentional_blank_line\n#tags = \"core_approved\"\n#developer = [ \"example\", \"https://example.org\" ]\n#ports_separator = \",\"\n#call_format = \"nmap -vvv -p {{port}} {{ip}}\"\n\n# tags has to be an array, thus this file won't be parsed"
  },
  {
    "path": "fixtures/.rustscan_scripts.toml",
    "content": "tags = [\"core_approved\", \"example\"]\nports = [\"80\", \"443\", \"8080\"]\ndeveloper = [\"example\", \"https://example.org\"]\ndirectory = \"fixtures/.rustscan_scripts\" "
  },
  {
    "path": "fixtures/empty_hosts.txt",
    "content": ""
  },
  {
    "path": "fixtures/hosts.txt",
    "content": "127.0.0.1\ngoogle.com\nexample.com\n66666666666666.666666666666666666.66666666666666666.6666666666\n....\ne3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.radiatorFixtures"
  },
  {
    "path": "fixtures/naughty_strings.txt",
    "content": "# https://github.com/minimaxir/big-list-of-naughty-strings\n\n\n­؀؁؂؃؄؅؜۝܏᠎​‌‍‎‏‪‫‬‭‮⁠⁡⁢⁣⁤⁦⁧⁨⁩⁪⁫⁬⁭⁮⁯﻿￹￺￻𑂽𛲠𛲡𛲢𛲣𝅳𝅴𝅵𝅶𝅷𝅸𝅹𝅺󠀁󠀠󠀡󠀢󠀣󠀤󠀥󠀦󠀧󠀨󠀩󠀪󠀫󠀬󠀭󠀮󠀯󠀰󠀱󠀲󠀳󠀴󠀵󠀶󠀷󠀸󠀹󠀺󠀻󠀼󠀽󠀾󠀿󠁀󠁁󠁂󠁃󠁄󠁅󠁆󠁇󠁈󠁉󠁊󠁋󠁌󠁍󠁎󠁏󠁐󠁑󠁒󠁓󠁔󠁕󠁖󠁗󠁘󠁙󠁚󠁛󠁜󠁝󠁞󠁟󠁠󠁡󠁢󠁣󠁤󠁥󠁦󠁧󠁨󠁩󠁪󠁫󠁬󠁭󠁮󠁯󠁰󠁱󠁲󠁳󠁴󠁵󠁶󠁷󠁸󠁹󠁺󠁻󠁼󠁽󠁾󠁿\n\nΩ≈ç√∫˜µ≤≥÷\nåß∂ƒ©˙∆˚¬…æ\nœ∑´®†¥¨ˆøπ“‘\n¡™£¢∞§¶•ªº–≠\n¸˛Ç◊ı˜Â¯˘¿\nÅÍÎÏ˝ÓÔÒÚÆ☃\nŒ„´‰ˇÁ¨ˆØ∏”’\n`⁄€‹›ﬁﬂ‡°·‚—±\n⅛⅜⅝⅞\nЁЂЃЄЅІЇЈЉЊЋЌЍЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя\n٠١٢٣٤٥٦٧٨٩\n\n\n\n⁰⁴⁵\n₀₁₂\n⁰⁴⁵₀₁₂\nด้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็ ด้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็ ด้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็\n\n田中さんにあげて下さい\nパーティーへ行かないか\n和製漢語\n部落格\n사회과학원 어학연구소\n찦차를 타고 온 펲시맨과 쑛다리 똠방각하\n社會科學院語學研究所\n울란바토르\n𠜎𠜱𠝹𠱓𠱸𠲖𠳏\n𝐓𝐡𝐞 𝐪𝐮𝐢𝐜𝐤 𝐛𝐫𝐨𝐰𝐧 𝐟𝐨𝐱 𝐣𝐮𝐦𝐩𝐬 𝐨𝐯𝐞𝐫 𝐭𝐡𝐞 𝐥𝐚𝐳𝐲 𝐝𝐨𝐠\n𝕿𝖍𝖊 𝖖𝖚𝖎𝖈𝖐 𝖇𝖗𝖔𝖜𝖓 𝖋𝖔𝖝 𝖏𝖚𝖒𝖕𝖘 𝖔𝖛𝖊𝖗 𝖙𝖍𝖊 𝖑𝖆𝖟𝖞 𝖉𝖔𝖌\n𝑻𝒉𝒆 𝒒𝒖𝒊𝒄𝒌 𝒃𝒓𝒐𝒘𝒏 𝒇𝒐𝒙 𝒋𝒖𝒎𝒑𝒔 𝒐𝒗𝒆𝒓 𝒕𝒉𝒆 𝒍𝒂𝒛𝒚 𝒅𝒐𝒈\n𝓣𝓱𝓮 𝓺𝓾𝓲𝓬𝓴 𝓫𝓻𝓸𝔀𝓷 𝓯𝓸𝔁 𝓳𝓾𝓶𝓹𝓼 𝓸𝓿𝓮𝓻 𝓽𝓱𝓮 𝓵𝓪𝔃𝔂 𝓭𝓸𝓰\n𝕋𝕙𝕖 𝕢𝕦𝕚𝕔𝕜 𝕓𝕣𝕠𝕨𝕟 𝕗𝕠𝕩 𝕛𝕦𝕞𝕡𝕤 𝕠𝕧𝕖𝕣 𝕥𝕙𝕖 𝕝𝕒𝕫𝕪 𝕕𝕠𝕘\n𝚃𝚑𝚎 𝚚𝚞𝚒𝚌𝚔 𝚋𝚛𝚘𝚠𝚗 𝚏𝚘𝚡 𝚓𝚞𝚖𝚙𝚜 𝚘𝚟𝚎𝚛 𝚝𝚑𝚎 𝚕𝚊𝚣𝚢 𝚍𝚘𝚐\n⒯⒣⒠ ⒬⒰⒤⒞⒦ ⒝⒭⒪⒲⒩ ⒡⒪⒳ ⒥⒰⒨⒫⒮ ⒪⒱⒠⒭ ⒯⒣⒠ ⒧⒜⒵⒴ ⒟⒪⒢\n\nثم نفس سقطت وبالتحديد،, جزيرتي باستخدام أن دنو. إذ هنا؟ الستار وتنصيب كان. أهّل ايطاليا، بريطانيا-فرنسا قد أخذ. سليمان، إتفاقية بين ما, يذكر الحدود أي بعد, معاملة بولندا، الإطلاق عل إيو."
  },
  {
    "path": "fixtures/test_rustscan_scripts.toml",
    "content": "# Test/Example ScriptConfig file\n\n# Tags to filter on scripts. Only scripts containing all these tags will run.\ntags = [\"core_approved\", \"example\"]\n\n# If it's present then only those scripts will run which has a tag ports = \"80\". Not yet implemented.\n#\n# ex.:\n# ports = [\"80\"]\n# ports = [\"80\",\"81\",\"8080\"]\nports = [\"80\"]\n\n# Only this developer(s) scripts to run. Not yet implemented.\ndeveloper = [\"example\"]"
  },
  {
    "path": "justfile",
    "content": "test:\n    cargo test\n    cargo clippy -- --deny warnings\n    cargo clippy --tests -- --deny warnings\n    cargo fmt --check\n    cargo doc --workspace --all-features --no-deps --document-private-items\n\nfix:\n    cargo fmt\n    cargo clippy --fix\n\n# release only runs if test runs\nrelease: test\n    git checkout master\n    git pull\n    cargo generate-lockfile\n    cargo publish \n    git push\n"
  },
  {
    "path": "nmap-payloads",
    "content": "# Nmap nmap payload database -*- mode: fundamental; -*-\n# $Id$\n#\n# These payloads are sent with every host discovery or port scan probe\n# by default. This database should only include payloads that are\n# unlikely to crash services, trip IDS alerts, or change state on the\n# server. The idea behind these is to evoke a response using a payload.\n# Some of them are taken from nmap-service-probes.\n#\n# This collection of data is (C) 1996-2022 by Nmap Software LLC.  It\n# is distributed under the Nmap Public Source license as provided in\n# the LICENSE file of the source distribution or at\n# https://nmap.org/npsl/.  Note that this free license does not allow\n# incorporation of Nmap or its data files within proprietary\n# software. We sell a separate Nmap OEM for that as described\n# (including pricing) at https://nmap.org/npsl/.\n#\n# Each entry begins with a protocol (only \"udp\" is supported) followed\n# by a comma-separated list of ports, followed by one or more quoted\n# strings containing the payload. These elements may be broken across\n# several lines. For future expansion, additional keywords may follow\n# the payload data. Any data following one of these keywords must be on\n# the same line as the keyword so that unknown keywords can be ignored\n# by the parser. Currently this file contains some entries with the\n# \"source\" keyword to specify a desired source port, but it is not\n# honored by Nmap.\n#\n# Multiple payloads may be defined for a single protocol and port, in\n# which case they will be all be sent concurrently. There is a limit\n# of 255 payloads per port.\n#\n# Lines longer than 1024 characters will be ignored.\n#\n# Example:\n# udp 1234 \"payloaddatapayloaddata\"\n#   \"payloaddatapayloaddata\"\n# source 5678\n\n# GenericLines. Use for the echo service.\nudp 7 \"\\x0D\\x0A\\x0D\\x0A\"\n# DNSStatusRequest\n# Sent for TFTP (69) as well due to its ability to provoke an error response\nudp 53,69,5353,26198 \"\\x00\\x00\\x10\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n# DNS VER\nudp 53,5353,26198\n  \"\\x77\\x77\\x01\\x00\\x00\"\n  \"\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x07version\\x04bind\\x00\\x00\\x10\\x00\\x03\"\n\n# DHCP INFORM\nudp 67\n  \"\\x01\\x01\\x06\\x00\"\n  \"\\x01\\x23\\x45\\x67\\x00\\x00\\x00\\x00\\xff\\xff\\xff\\xff\\x00\\x00\\x00\\x00\\x00\"\n  \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x0e\\x35\\xd4\\xd8\\x51\\x00\\x00\\x00\\x00\"\n  \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n  \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n  \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n  \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n  \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n  \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n  \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n  \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n  \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n  \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n  \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n  \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x63\\x82\\x53\\x63\\x35\\x01\"\n  \"\\x08\\xff\"\n\n# TFTP GET\nudp 69 \"\\x00\\x01r7tftp.txt\\x00octet\\x00\"\n\n# QUIC packet with unsupported version Q999\n# Also found on 443, but need to check whether DTLS or QUIC is more prevalent\nudp 80 \"\\r12345678Q999\\x00\"\n# RPCCheck\nudp 111\n  \"\\x72\\xFE\\x1D\\x13\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x01\\x86\\xA0\"\n  \"\\x00\\x01\\x97\\x7C\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n  \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n# ONCRPC CALL\nudp 111,2049,4045,32768-65535\n  \"\\x3e\\xec\\xe3\\xca\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\"\n  \"\\xbc\\x61\\x4e\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n  \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n# NTPRequest\nudp 123\n  \"\\xE3\\x00\\x04\\xFA\\x00\\x01\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\"\n  \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n  \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xC5\\x4F\\x23\\x4B\\x71\\xB1\\x52\\xF3\"\n# NTP REQ\nudp 123\n  \"\\xd9\\x00\\x0a\\xfa\\x00\\x00\\x00\"\n  \"\\x00\\x00\\x01\\x04\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n  \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xc6\"\n  \"\\xf1\\x5e\\xdb\\x78\\x00\\x00\\x00\"\n# DCERPC CALL\nudp 135,1025-1199\n  \"\\x05\\x00\\x0b\\x03\\x10\\x00\\x00\\x00\\x48\\x00\"\n  \"\\x00\\x00\\x01\\x00\\x00\\x00\\xb8\\x10\\xb8\\x10\\x00\\x00\\x00\\x00\\x01\\x00\\x00\"\n  \"\\x00\\x00\\x00\\x01\\x00\\x01\\x23\\x45\\x67\\x89\\xab\\xcd\\xef\\x01\\x23\\x45\\x67\"\n  \"\\x89\\xab\\xcd\\xef\\xe7\\x03\\x00\\x00\\xfe\\xdc\\xba\\x98\\x76\\x54\\x32\\x10\\x01\"\n  \"\\x23\\x45\\x67\\x89\\xab\\xcd\\xef\\xe7\\x03\\x00\\x00\"\n# NBTStat\nudp 137\n  \"\\x80\\xF0\\x00\\x10\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\"\n  \"\\x20CKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\\x00\\x00\\x21\\x00\\x01\"\n# CIFS NS NAME QUERY UC\nudp 137\n  \"\\x01\\x91\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\"\n  \"\\x20CKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\\x00\\x00\\x21\\x00\\x01\"\n# CIFS NS NAME QUERY BC\nudp 137\n  \"\\x01\\x91\\x00\\x10\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\"\n  \"\\x20CKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\\x00\\x00\\x21\\x00\\x01\"\n# SNMPv3GetRequest\nudp 161,260,3401\n  \"\\x30\\x3A\\x02\\x01\\x03\\x30\\x0F\\x02\\x02\\x4A\\x69\\x02\\x03\\x00\\xFF\\xE3\"\n  \"\\x04\\x01\\x04\\x02\\x01\\x03\\x04\\x10\\x30\\x0E\\x04\\x00\\x02\\x01\\x00\\x02\"\n  \"\\x01\\x00\\x04\\x00\\x04\\x00\\x04\\x00\\x30\\x12\\x04\\x00\\x04\\x00\\xA0\\x0C\"\n  \"\\x02\\x02\\x37\\xF0\\x02\\x01\\x00\\x02\\x01\\x00\\x30\\x00\"\n# SNMP PUBLIC WALK\nudp 161,260,3401\n  \"\\x30\\x1f\\x02\\x01\\x00\\x04\\x06public\\xa1\\x12\\x02\\x01\\x00\\x02\"\n  \"\\x01\\x00\\x02\\x01\\x00\\x30\\x07\\x30\\x05\\x06\\x01\\x00\\x05\\x00\"\n\n# Sqlping - disabled because it trips a Snort rule with SID 2049\n# (\"MS-SQL ping attempt\").\n# udp 1434 \"\\x02\"\n\n# xdmcp - X Display Manager Control Protocol. Version 1, packet type\n# Query (2), no authorization names. We expect a Willing or Unwilling\n# packet in reply.\n# http://cgit.freedesktop.org/xorg/doc/xorg-docs/plain/hardcopy/XDMCP/xdmcp.PS.gz\nudp 177 \"\\x00\\x01\\x00\\x02\\x00\\x01\\x00\"\n\n# Connectionless LDAP - used by Microsoft Active Directory\nudp 389\n  \"\\x30\\x84\\x00\\x00\\x00\\x2d\\x02\\x01\\x07\\x63\\x84\\x00\\x00\\x00\\x24\\x04\\x00\"\n  \"\\x0a\\x01\\x00\\x0a\\x01\\x00\\x02\\x01\\x00\\x02\\x01\\x64\\x01\\x01\\x00\\x87\\x0b\"\n  \"objectClass0\\x84\\x00\\x00\\x00\\x00\"\n\n\n# svrloc\nudp 427\n  \"\\x02\\x01\\x00\\x006 \\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x02en\\x00\\x00\\x00\\x15\"\n  \"service:service-agent\\x00\\x07default\\x00\\x00\\x00\\x00\"\n\n# DTLS\nudp 443,853,3391,4433,4740,5349,5684,5868,6514,6636,8232,10161,10162,12346,12446,12546,12646,12746,12846,12946,13046\n  # DTLS 1.0, length 52\n  \"\\x16\\xfe\\xff\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x36\"\n  # ClientHello, length 40, sequence 0, offset 0\n  \"\\x01\\x00\\x00\\x2a\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x2a\"\n  # DTLS 1.2\n  \"\\xfe\\xfd\"\n  # Random\n  \"\\x00\\x00\\x00\\x00\\x7c\\x77\\x40\\x1e\\x8a\\xc8\\x22\\xa0\\xa0\\x18\\xff\\x93\"\n  \"\\x08\\xca\\xac\\x0a\\x64\\x2f\\xc9\\x22\\x64\\xbc\\x08\\xa8\\x16\\x89\\x19\\x3f\"\n  # Session id length 0, cookie length 0\n  \"\\x00\\x00\"\n  # Cipher suites, mandatory TLS_RSA_WITH_AES_128_CBC_SHA\n  \"\\x00\\x02\\x00\\x2f\"\n  # Compressors (NULL)\n  \"\\x01\\x00\"\n\n# Internet Key Exchange version 1, phase 1 Main Mode. We offer every\n# combination of (DES, 3DES) and (MD5, SHA) in the hope that one of them will\n# be acceptable. Because we use a fixed cookie, we set the association lifetime\n# to 1 second to reduce the chance that repeated probes will look like\n# retransmissions (and therefore not get a response). This payload comes from\n#   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\n# We expect another phase 1 message in response. This payload works better with\n# a source port of 500 or a randomized initiator cookie.\nudp 500\n  # Initiator cookie 0x0011223344556677, responder cookie 0x0000000000000000.\n  \"\\x00\\x11\\x22\\x33\\x44\\x55\\x66\\x77\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n  # Version 1, Main Mode, flags 0x00, message ID 0x00000000, length 192.\n  \"\\x01\\x10\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xC0\"\n  # Security Association payload, length 164, IPSEC, IDENTITY.\n  \"\\x00\\x00\\x00\\xA4\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x01\"\n  # Proposal 1, length 152, ISAKMP, 4 transforms.\n  \"\\x00\\x00\\x00\\x98\\x01\\x01\\x00\\x04\"\n  # Transform 1, 3DES-CBC, SHA, PSK, group 2.\n  \"\\x03\\x00\\x00\\x24\\x01\\x01\\x00\\x00\\x80\\x01\\x00\\x05\\x80\\x02\\x00\\x02\"\n  \"\\x80\\x03\\x00\\x01\\x80\\x04\\x00\\x02\"\n  \"\\x80\\x0B\\x00\\x01\\x00\\x0C\\x00\\x04\\x00\\x00\\x00\\x01\"\n  # Transform 2, 3DES-CBC, MD5, PSK, group 2.\n  \"\\x03\\x00\\x00\\x24\\x02\\x01\\x00\\x00\\x80\\x01\\x00\\x05\\x80\\x02\\x00\\x01\"\n  \"\\x80\\x03\\x00\\x01\\x80\\x04\\x00\\x02\"\n  \"\\x80\\x0B\\x00\\x01\\x00\\x0C\\x00\\x04\\x00\\x00\\x00\\x01\"\n  # Transform 3, DES-CBC, SHA, PSK, group 2.\n  \"\\x03\\x00\\x00\\x24\\x03\\x01\\x00\\x00\\x80\\x01\\x00\\x01\\x80\\x02\\x00\\x02\"\n  \"\\x80\\x03\\x00\\x01\\x80\\x04\\x00\\x02\"\n  \"\\x80\\x0B\\x00\\x01\\x00\\x0C\\x00\\x04\\x00\\x00\\x00\\x01\"\n  # Transform 4, DES-CBC, MD5, PSK, group 2.\n  \"\\x00\\x00\\x00\\x24\\x04\\x01\\x00\\x00\\x80\\x01\\x00\\x01\\x80\\x02\\x00\\x01\"\n  \"\\x80\\x03\\x00\\x01\\x80\\x04\\x00\\x02\"\n  \"\\x80\\x0B\\x00\\x01\\x00\\x0C\\x00\\x04\\x00\\x00\\x00\\x01\"\n# IPSEC START\nudp 500,4500\n  \"\\x31\\x27\\xfc\"\n  \"\\xb0\\x38\\x10\\x9e\\x89\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x10\\x02\\x00\"\n  \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xcc\\x0d\\x00\\x00\\x5c\\x00\\x00\\x00\\x01\\x00\"\n  \"\\x00\\x00\\x01\\x00\\x00\\x00\\x50\\x01\\x01\\x00\\x02\\x03\\x00\\x00\\x24\\x01\\x01\"\n  \"\\x00\\x00\\x80\\x01\\x00\\x05\\x80\\x02\\x00\\x02\\x80\\x04\\x00\\x02\\x80\\x03\\x00\"\n  \"\\x03\\x80\\x0b\\x00\\x01\\x00\\x0c\\x00\\x04\\x00\\x00\\x0e\\x10\\x00\\x00\\x00\\x24\"\n  \"\\x02\\x01\\x00\\x00\\x80\\x01\\x00\\x05\\x80\\x02\\x00\\x01\\x80\\x04\\x00\\x02\\x80\"\n  \"\\x03\\x00\\x03\\x80\\x0b\\x00\\x01\\x00\\x0c\\x00\\x04\\x00\\x00\\x0e\\x10\\x0d\\x00\"\n  \"\\x00\\x18\\x1e\\x2b\\x51\\x69\\x05\\x99\\x1c\\x7d\\x7c\\x96\\xfc\\xbf\\xb5\\x87\\xe4\"\n  \"\\x61\\x00\\x00\\x00\\x04\\x0d\\x00\\x00\\x14\\x40\\x48\\xb7\\xd5\\x6e\\xbc\\xe8\\x85\"\n  \"\\x25\\xe7\\xde\\x7f\\x00\\xd6\\xc2\\xd3\\x0d\\x00\\x00\\x14\\x90\\xcb\\x80\\x91\\x3e\"\n  \"\\xbb\\x69\\x6e\\x08\\x63\\x81\\xb5\\xec\\x42\\x7b\\x1f\\x00\\x00\\x00\\x14\\x26\\x24\"\n  \"\\x4d\\x38\\xed\\xdb\\x61\\xb3\\x17\\x2a\\x36\\xe3\\xd0\\xcf\\xb8\\x19\"\n\n# Routing Information Protocol version 1. Special-case request for the entire\n# routing table (address family 0, address 0.0.0.0, metric 16). RFC 1058,\n# section 3.4.1.\nudp 520\n  \"\\x01\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n  \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x10\"\n\n# RMCP ASF ping\nudp 623\n  \"\\x06\\x00\\xff\\x06\" # RMCP version 6, sequence 0xff, normal RMCP class ASF\n  \"\\x00\\x00\\x11\\xbe\" # IAN ASF code 4542\n  \"\\x80\\x00\\x00\\x00\" # payload-less ASF presence ping\n\n# IPMI\n# RMCP Get Channel Auth Capabilities\nudp 623\n  \"\\x06\\x00\\xff\\x07\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x09\\x20\\x18\"\n  \"\\xc8\\x81\\x00\\x38\\x8e\\x04\\xb5\"\n\n# serialnumberd. This service runs on Mac OS X Server. This probe\n# requests the serial number of another server. In response we expect a\n# packet starting with \"SNRESPS:\", followed by some data whose purpose\n# is not known.\nudp 626 \"SNQUERY: 127.0.0.1:AAAAAA:xsvr\"\n\n# OpenVPN P_CONTROL_HARD_RESET_CLIENT_V2\n# Byte 0; 0x38 opcode\n# Byte 1-8: Session ID, random\n# Byte 9: Message packet-id array length (0)\n# Byte 10-13: Message packet-id (0)\nudp 1194 \"8d\\xc1x\\x01\\xb8\\x9b\\xcb\\x8f\\0\\0\\0\\0\\0\"\n# OpenVPN when in PKI mode and without the \"HMAC Firewall\" setting enabled\n# (tls-auth) should respond to the following probe, which is\n# 0x38<8 random bytes><4 null bytes>\nudp 1194\n  \"\\x38\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x00\\x00\\x00\\x00\"\n\n# Citrix MetaFrame application browser service\n# Original idea from http://sh0dan.org/oldfiles/hackingcitrix.html\n# Payload contents copied from Wireshark capture of Citrix Program\n# Neighborhood client application.  The application uses this payload to\n# locate Citrix servers on the local network.  Response to this probe is\n# a 48 byte UDP payload as shown here:\n#\n# 0000   30 00 02 31 02 fd a8 e3 02 00 06 44 c0 a8 80 55\n# 0010   00 00 00 00 00 00 00 00 00 00 00 00 02 00 06 44\n# 0020   c0 a8 80 56 00 00 00 00 00 00 00 00 00 00 00 00\n#\n# The first 12 bytes appear to be the same in all responses.\n#\n# Bytes 0x00 appears to be a packet length field\n# Bytes 0x0C - 0x0F are the IP address of the server\n# Bytes 0x10 - 0x13 may vary, 0x14 - 0x1F do not appear to\n# Bytes 0x20 - 0x23 are the IP address of the primary system in a server farm\n#                   configuration\n# Bytes 0x24 - 0x27 can vary, 0x28 - 0x2F do not appear to\nudp 1604\n  \"\\x1e\\x00\\x01\\x30\\x02\\xfd\\xa8\\xe3\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n  \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\n# RADIUS Access-Request. This is a degenerate packet with no username or\n# password; we expect an Access-Reject in response. The Identifier and Request\n# Authenticator are both 0. It was generated by running\n#   echo 'User-Password = \"\"' | radclient <ip> auth \"\"\n# and then manually stripping out the password.\n#\n# Section 2 of the RFC says \"A request from a client for which the\n# RADIUS server does not have a shared secret MUST be silently\n# discarded.\" So this payload only works when the server is configured\n# (or misconfigured) to know the scanning machine as a client.\n#\n# RFC 2865: \"The early deployment of RADIUS was done using UDP port\n# number 1645, which conflicts with the \"datametrics\" service. The\n# officially assigned port number for RADIUS is 1812.\nudp 1645,1812\n  \"\\x01\\x00\\x00\\x14\"\n  \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\n# L2TP ICRQ\nudp 1701\n  \"\\xc8\\x02\"\n  \"\\x00\\x3c\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x80\\x08\\x00\\x00\\x00\\x00\\x00\"\n  \"\\x01\\x80\\x08\\x00\\x00\\x00\\x02\\x01\\x00\\x80\\x0e\\x00\\x00\\x00\\x07\"\n  \"nxp-scan\\x80\\x0a\\x00\\x00\\x00\\x03\\x00\\x00\\x00\\x03\\x80\"\n  \"\\x08\\x00\\x00\\x00\\x09\\x00\\x00\"\n\n# UPNP MSEARCH\nudp 1900\n  \"M-SEARCH * HTTP/1.1\\r\\nHost: 239.255.255.250:1900\\r\\n\"\n  \"Man: \\\"ssdp:discover\\\"\\r\\nMX: 5\\r\\nST: ssdp:all\\r\\n\\r\\n\"\n\n# NFS version 2, RFC 1831. XID 0x00000000, program 100003 (NFS), procedure\n# NFSPROC_NULL (does nothing, see section 2.2.1), null authentication (see\n# section 9.1).\nudp 2049\n  \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x01\\x86\\xA3\"\n  \"\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n  \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\n# GPRS Tunneling Protocol (GTP)\nudp 2123,2152\n# GTPv1, protocol 1\n\"\\x32\"\n# EchoRequest\n\"\\x01\"\n# message length\n\"\\x00\\x04\"\n# Tunnel endpoint identifier\n\"\\x00\\x00\\x42\\x00\"\n# sequence number\n\"\\x13\\x37\"\n# N-PDU number\n\"\\x00\"\n# next extension header type\n\"\\x00\"\n\n# GPRS Tunneling Protocol (GTP) \"prime\" v2\n# This same packet can be used for GTP v2 on ports 2123 and 2152 if you change\n# the first byte from \\x4e to \\x40\nudp 3386\n# GTP'v2\n\"\\x4e\"\n# EchoRequest\n\"\\x01\"\n# message length\n\"\\x00\\x04\"\n# sequence number\n\"\\xde\\xfe\\xc8\\x00\"\n\n# Freelancer game server status query\n# http://sourceforge.net/projects/gameq/\n# (relevant files: games.ini, packets.ini, freelancer.php)\nudp 2302 \"\\x00\\x02\\xf1\\x26\\x01\\x26\\xf0\\x90\\xa6\\xf0\\x26\\x57\\x4e\\xac\\xa0\\xec\\xf8\\x68\\xe4\\x8d\\x21\"\n\n# Apple Remote Desktop (ARD)\nudp 3283 \"\\0\\x14\\0\\x01\\x03\"\n\n# STUN Binding request, see RFC 5389 Section 6\n# message type = 0x001, Binding (see Section 18.1)\n# message length = 0\n# magic cookie = 0x2112a442\n# transaction ID = \"\\x00\"*12\nudp 3478 \"\\x00\\x01\\x00\\x00\\x21\\x12\\xa4\\x42\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\n# Sun Service Tag Discovery protocol (stdiscover)\n# http://arc.opensolaris.org/caselog/PSARC/2006/638/stdiscover_protocolv2.pdf\n# Would work better with a varying cookie; the second and later sends of this\n# probe will be interpreted as resends by the server and will be ignored.\nudp 6481 \"[PROBE] 0000\"\n\n# NAT-PMP external IP address request. See section 3.2 of\n# http://files.dns-sd.org/draft-cheshire-nat-pmp.txt.\nudp 5351 \"\\x00\\x00\"\n\n# DNS Service Discovery (DNS-SD) service query, as used in Zeroconf.\n# Transaction ID 0x0000, flags 0x0000, 1 question: PTR query for\n# _services._dns-sd._udp.local. If the remote host supports DNS-SD it will send\n# back a list of all its services. This is the same as a packet capture of\n#   dns-sd -B _services._dns-sd._udp .\n# See section 9 of\n# http://files.dns-sd.org/draft-cheshire-dnsext-dns-sd.txt.\n# This first probe is a QU probe, meaning a unicast response is desired\nudp 5353\n  \"\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\"\n  \"\\x09_services\\x07_dns-sd\\x04_udp\\x05local\\x00\\x00\\x0C\\x80\\x01\"\n# This second probe is a QM probe, meaning a unicast response is desired\nudp 5353\n  \"\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\"\n  \"\\x09_services\\x07_dns-sd\\x04_udp\\x05local\\x00\\x00\\x0C\\x00\\x01\"\n\n# PCANY STATUS\nudp 5632 \"ST\"\n\n# CoAP GET .well-known/core\nudp 5683 \"@\\x01\\x01\\xce\\xbb.well-known\\x04core\"\n\n# UT2K PING\nudp 7777 \"None\\x00\"\n\n# Ubiquiti Discovery Service - v1\nudp 10001 \"\\x01\\x00\\x00\\x00\"\n\n# Amanda backup service noop request. I think that this does nothing on the\n# server but only asks it to send back its feature list. In reply we expect an\n# ACK or (more likely) an ERROR. I couldn't find good online documentation of\n# the Amanda network protocol. There is parsing code in the Amanda source at\n# common-src/security-util.c. This is based on a packet capture of\n#   amcheck <config> <host>\nudp 10080\n  \"Amanda 2.6 REQ HANDLE 000-00000000 SEQ 0\\n\"\n  \"SERVICE noop\\n\"\n\n# VxWorks Wind River Debugger\nudp 17185\n# Random XID\n\"\\x00\\x00\\x00\\x00\"\n# RPC version 2 procedure call\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\"\n# WDB version 1\n\"\\x55\\x55\\x55\\x55\\x00\\x00\\x00\\x01\"\n# WDB_TARGET_PING\n\"\\x00\\x00\\x00\\x00\"\n# RPC Auth NULL\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n# Checksum\n\"\\xff\\xff\\x55\\x13\"\n# WDB wrapper (length and sequence number)\n\"\\x00\\x00\\x00\\x30\\x00\\x00\\x00\\x01\"\n# Empty data?\n\"\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n# VXWORKS DEBUG (alternative?)\nudp 17185\n  \"\\x72\\x37\\x72\\x37\\x00\\x00\\x00\"\n  \"\\x00\\x00\\x00\\x00\\x02\\x55\\x55\\x55\\x55\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x01\"\n  \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xff\"\n  \"\\xff\\x55\\x10\\x00\\x00\\x00\\x3c\\x00\\x00\\x00\\x03\\x00\\x00\\x00\\x02\\x00\\x00\"\n  \"\\x00\\x00\\x00\\x00\\x00\\x00\"\n\n# Quake 2 and Quake 3 game servers (and servers of derived games like Nexuiz).\n# Gets game information from the server (see probe responses in\n# nmap-service-probes). These services typically run on a base port or a\n# few numbers higher.\n# Quake 2. Typical ports: 27910-27914.\nudp 27910-27914 \"\\xff\\xff\\xff\\xffstatus\"\n# Quake 3. Typical ports:\n# 26000-26004: Nexuiz\n# 27960-27964: Various games\n# 30720-30724: Tremulous\n# 44400: Warsow\nudp 26000-26004,27960-27964,30720-30724,44400 \"\\xff\\xff\\xff\\xffgetstatus\"\n\n# Murmur 1.2.X (Mumble server)\n# UDP ping. \"abcdefgh\" is an identifier. See\n# http://mumble.sourceforge.net/Protocol.\nudp 64738 \"\\x00\\x00\\x00\\x00abcdefgh\"\n\n# Ventrilo 2.1.2+\n# UDP general status request (encrypted).\n# See http://aluigi.altervista.org/papers.htm#ventrilo\nudp 3784\n\"\\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\"\n\n# Kademlia (kad) as used by various P2P applications.  Send a Kademlia ping\n# 4665, 4666, 4672, 6429: eDonkey/eMule and variants\nudp 4665,4666,4672,6429 \"\\xE4\\x60\"\n\n# TeamSpeak 2\n# UDP login request\n# See http://wiki.wireshark.org/TeamSpeak2\nudp 8767\n\"\\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\"\n\n# TS3INIT1\nudp 9987\n\"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\"\n\n# TeamSpeak 3\n# UDP login request (encrypted)\n# http://seclists.org/nmap-dev/2013/q3/72\nudp 9987\n\"\\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\"\n\n# Memcached\n# version request (shorter response than stats)\n# https://github.com/memcached/memcached/blob/master/doc/protocol.txt\nudp 11211\n\"\\0\\x01\\0\\0\\0\\x01\\0\\0version\\r\\n\"\n\n# Steam, typically using a port in 27015-27030.  Send a \"Source Engine query\"\nudp 27015-27030\n  \"\\xff\\xff\\xff\\xffTSource Engine Query\\x00\"\n\n# TRIN00 UNIX PING\nudp 27444 \"png l44adsl\"\n\n# BO PING\nudp 31337\n  \"\\xce\\x63\\xd1\\xd2\\x16\\xe7\\x13\\xcf\\x38\"\n  \"\\xa5\\xa5\\x86\\xb2\\x75\\x4b\\x99\\xaa\\x32\\x58\"\n\n# TRIN00 WIN PING\nudp 34555 \"png []..Ks\"\n\n# Beckhoff ADS discovery request\n# https://github.com/ONE75/adsclient/blob/master/src/AdsClient.Finder/DeviceFinder.cs#L49-L64\nudp 48899\n\"\\x03\\x66\\x14\\x71\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x01\\x10\\x27\\x00\\x00\\x00\\x00\"\n"
  },
  {
    "path": "pictures/accessible.yml",
    "content": "# The configurations that used for the recording, feel free to edit them\nconfig:\n\n  # Specify a command to be executed\n  # like `/bin/bash -l`, `ls`, or any other commands\n  # the default is bash for Linux\n  # or powershell.exe for Windows\n  command: zsh\n  \n  # Specify the current working directory path\n  # the default is the current working directory path\n  cwd: /home/bee/Documents/RustScan\n  \n  # Export additional ENV variables\n  env:\n    recording: true\n  \n  # Explicitly set the number of columns\n  # or use `auto` to take the current\n  # number of columns of your shell\n  cols: 107\n  \n  # Explicitly set the number of rows\n  # or use `auto` to take the current\n  # number of rows of your shell\n  rows: 43\n  \n  # Amount of times to repeat GIF\n  # If value is -1, play once\n  # If value is 0, loop indefinitely\n  # If value is a positive number, loop n times\n  repeat: 0\n  \n  # Quality\n  # 1 - 100\n  quality: 100\n  \n  # Delay between frames in ms\n  # If the value is `auto` use the actual recording delays\n  frameDelay: auto\n  \n  # Maximum delay between frames in ms\n  # Ignored if the `frameDelay` isn't set to `auto`\n  # Set to `auto` to prevent limiting the max idle time\n  maxIdleTime: 2000\n  \n  # The surrounding frame box\n  # The `type` can be null, window, floating, or solid`\n  # To hide the title use the value null\n  # Don't forget to add a backgroundColor style with a null as type\n  frameBox:\n    type: floating\n    title: Terminalizer\n    style:\n      border: 0px black solid\n      # boxShadow: none\n      # margin: 0px\n  \n  # Add a watermark image to the rendered gif\n  # You need to specify an absolute path for\n  # the image on your machine or a URL, and you can also\n  # add your own CSS styles\n  watermark:\n    imagePath: null\n    style:\n      position: absolute\n      right: 15px\n      bottom: 15px\n      width: 100px\n      opacity: 0.9\n  \n  # Cursor style can be one of\n  # `block`, `underline`, or `bar`\n  cursorStyle: block\n  \n  # Font family\n  # You can use any font that is installed on your machine\n  # in CSS-like syntax\n  fontFamily: \"Monaco, Lucida Console, Ubuntu Mono, Monospace\"\n  \n  # The size of the font\n  fontSize: 12\n  \n  # The height of lines\n  lineHeight: 1\n  \n  # The spacing between letters\n  letterSpacing: 0\n  \n  # Theme\n  theme:\n    background: \"transparent\"\n    foreground: \"#afafaf\"\n    cursor: \"#c7c7c7\"\n    black: \"#232628\"\n    red: \"#fc4384\"\n    green: \"#b3e33b\"\n    yellow: \"#ffa727\"\n    blue: \"#75dff2\"\n    magenta: \"#ae89fe\"\n    cyan: \"#708387\"\n    white: \"#d5d5d0\"\n    brightBlack: \"#626566\"\n    brightRed: \"#ff7fac\"\n    brightGreen: \"#c8ed71\"\n    brightYellow: \"#ebdf86\"\n    brightBlue: \"#75dff2\"\n    brightMagenta: \"#ae89fe\"\n    brightCyan: \"#b1c6ca\"\n    brightWhite: \"#f9f9f4\"\n  \n# Records, feel free to edit them\nrecords:\n  - delay: 436\n    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\"\n  - delay: 162\n    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\"\n  - delay: 471\n    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\"\n  - delay: 269\n    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\"\n  - delay: 1536\n    content: \"Open 127.0.0.1:38602\\r\\n\"\n  - delay: 395\n    content: \"Open 127.0.0.1:50078\\r\\n\"\n  - delay: 450\n    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\"\n  - delay: 143\n    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\"\n  - delay: 563\n    content: \"\\e[?2004l\\r\\r\\n\"\n"
  },
  {
    "path": "pictures/fast.yml",
    "content": "# The configurations that used for the recording, feel free to edit them\nconfig:\n\n  # Specify a command to be executed\n  # like `/bin/bash -l`, `ls`, or any other commands\n  # the default is bash for Linux\n  # or powershell.exe for Windows\n  command: zsh \n  \n  # Specify the current working directory path\n  # the default is the current working directory path\n  cwd: /home/bee/Documents/RustScan\n  \n  # Export additional ENV variables\n  env:\n    recording: true\n  \n  # Explicitly set the number of columns\n  # or use `auto` to take the current\n  # number of columns of your shell\n  cols: 105\n  \n  # Explicitly set the number of rows\n  # or use `auto` to take the current\n  # number of rows of your shell\n  rows: 34\n  \n  # Amount of times to repeat GIF\n  # If value is -1, play once\n  # If value is 0, loop indefinitely\n  # If value is a positive number, loop n times\n  repeat: 0\n  \n  # Quality\n  # 1 - 100\n  quality: 100\n  \n  # Delay between frames in ms\n  # If the value is `auto` use the actual recording delays\n  frameDelay: auto\n  \n  # Maximum delay between frames in ms\n  # Ignored if the `frameDelay` isn't set to `auto`\n  # Set to `auto` to prevent limiting the max idle time\n  maxIdleTime: auto\n  \n  # The surrounding frame box\n  # The `type` can be null, window, floating, or solid`\n  # To hide the title use the value null\n  # Don't forget to add a backgroundColor style with a null as type\n  frameBox:\n    type: floating\n    title: Terminalizer\n    style:\n      border: 0px black solid\n      # boxShadow: none\n      # margin: 0px\n  \n  # Add a watermark image to the rendered gif\n  # You need to specify an absolute path for\n  # the image on your machine or a URL, and you can also\n  # add your own CSS styles\n  watermark:\n    imagePath: null\n    style:\n      position: absolute\n      right: 15px\n      bottom: 15px\n      width: 100px\n      opacity: 0.9\n  \n  # Cursor style can be one of\n  # `block`, `underline`, or `bar`\n  cursorStyle: block\n  \n  # Font family\n  # You can use any font that is installed on your machine\n  # in CSS-like syntax\n  fontFamily: \"Monaco, Lucida Console, Ubuntu Mono, Monospace\"\n  \n  # The size of the font\n  fontSize: 12\n  \n  # The height of lines\n  lineHeight: 1\n  \n  # The spacing between letters\n  letterSpacing: 0\n  \n  # Theme\n  theme:\n    background: \"transparent\"\n    foreground: \"#afafaf\"\n    cursor: \"#c7c7c7\"\n    black: \"#232628\"\n    red: \"#fc4384\"\n    green: \"#b3e33b\"\n    yellow: \"#ffa727\"\n    blue: \"#75dff2\"\n    magenta: \"#ae89fe\"\n    cyan: \"#708387\"\n    white: \"#d5d5d0\"\n    brightBlack: \"#626566\"\n    brightRed: \"#ff7fac\"\n    brightGreen: \"#c8ed71\"\n    brightYellow: \"#ebdf86\"\n    brightBlue: \"#75dff2\"\n    brightMagenta: \"#ae89fe\"\n    brightCyan: \"#b1c6ca\"\n    brightWhite: \"#f9f9f4\"\n  \n# Records, feel free to edit them\nrecords:\n  - delay: 815\n    content: \"\\e[1m\\e[7m%\\e[27m\\e[1m\\e[0m                                                                                                        \\r \\r\\e]2;..ents/RustScan\\a\"\n  - delay: 178\n    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\"\n  - delay: 406\n    content: \"\\e[32mc\\e[39m\\e[90margo build --release && ./target/release/rustscan 127.0.0.1\\e[39m\\e[59D\"\n  - delay: 137\n    content: \"\\b\\e[1m\\e[31mc\\e[1m\\e[31ma\\e[0m\\e[39m\"\n  - delay: 72\n    content: \"\\b\\b\\e[1m\\e[31mc\\e[1m\\e[31ma\\e[1m\\e[31mr\\e[0m\\e[39m\"\n  - delay: 203\n    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\"\n  - delay: 145\n    content: \"\\e[?1l\\e>\"\n  - delay: 7\n    content: \"\\e[?2004l\\r\\r\\n\\e]2;cargo\\a\"\n  - delay: 37\n    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\"\n  - delay: 326\n    content: \"Open \\e[35m53\\e[0m\\r\\nOpen \\e[35m631\\e[0m\\r\\n\"\n  - delay: 6\n    content: \"Open \\e[35m1716\\e[0m\\r\\n\"\n  - delay: 1138\n    content: \"Open \\e[35m46624\\e[0m\\r\\n\"\n  - delay: 156\n    content: \"Open \\e[35m52880\\e[0m\\r\\n\"\n  - delay: 146\n    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\"\n  - delay: 9\n    content: \"Starting Nmap 7.80 ( https://nmap.org ) at 2020-07-22 22:12 BST\\r\\n\"\n  - delay: 153\n    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\"\n  - delay: 119\n    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\"\n  - delay: 21\n    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\"\n  - delay: 52\n    content: \"Initiating Service scan at 22:12\\r\\nScanning 4 services on localhost (127.0.0.1)\\r\\n\"\n  - delay: 105\n    content: \"\\e[?2004l\\r\\r\\n\\e[1m\\e[7m%\\e[27m\\e[1m\\e[0m                                                                                                        \\r \\r\\e]2;..ents/RustScan\\a\"\n  - delay: 158\n    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\"\n  - delay: 1332\n    content: \"\\e[?2004l\\r\\r\\n\"\n"
  },
  {
    "path": "pictures/newfast.yml",
    "content": "# The configurations that used for the recording, feel free to edit them\nconfig:\n\n  # Specify a command to be executed\n  # like `/bin/bash -l`, `ls`, or any other commands\n  # the default is bash for Linux\n  # or powershell.exe for Windows\n  command: zsh \n  \n  # Specify the current working directory path\n  # the default is the current working directory path\n  cwd: /home/bee/Documents/RustScan\n  \n  # Export additional ENV variables\n  env:\n    recording: true\n  \n  # Explicitly set the number of columns\n  # or use `auto` to take the current\n  # number of columns of your shell\n  cols: 235\n  \n  # Explicitly set the number of rows\n  # or use `auto` to take the current\n  # number of rows of your shell\n  rows: 31\n  \n  # Amount of times to repeat GIF\n  # If value is -1, play once\n  # If value is 0, loop indefinitely\n  # If value is a positive number, loop n times\n  repeat: 0\n  \n  # Quality\n  # 1 - 100\n  quality: 100\n  \n  # Delay between frames in ms\n  # If the value is `auto` use the actual recording delays\n  frameDelay: auto\n  \n  # Maximum delay between frames in ms\n  # Ignored if the `frameDelay` isn't set to `auto`\n  # Set to `auto` to prevent limiting the max idle time\n  maxIdleTime: auto\n  \n  # The surrounding frame box\n  # The `type` can be null, window, floating, or solid`\n  # To hide the title use the value null\n  # Don't forget to add a backgroundColor style with a null as type\n  frameBox:\n    type: floating\n    title: Terminalizer\n    style:\n      border: 0px black solid\n      # boxShadow: none\n      # margin: 0px\n  \n  # Add a watermark image to the rendered gif\n  # You need to specify an absolute path for\n  # the image on your machine or a URL, and you can also\n  # add your own CSS styles\n  watermark:\n    imagePath: null\n    style:\n      position: absolute\n      right: 15px\n      bottom: 15px\n      width: 100px\n      opacity: 0.9\n  \n  # Cursor style can be one of\n  # `block`, `underline`, or `bar`\n  cursorStyle: block\n  \n  # Font family\n  # You can use any font that is installed on your machine\n  # in CSS-like syntax\n  fontFamily: \"Monaco, Lucida Console, Ubuntu Mono, Monospace\"\n  \n  # The size of the font\n  fontSize: 12\n  \n  # The height of lines\n  lineHeight: 1\n  \n  # The spacing between letters\n  letterSpacing: 0\n  \n  # Theme\n  theme:\n    background: \"transparent\"\n    foreground: \"#afafaf\"\n    cursor: \"#c7c7c7\"\n    black: \"#232628\"\n    red: \"#fc4384\"\n    green: \"#b3e33b\"\n    yellow: \"#ffa727\"\n    blue: \"#75dff2\"\n    magenta: \"#ae89fe\"\n    cyan: \"#708387\"\n    white: \"#d5d5d0\"\n    brightBlack: \"#626566\"\n    brightRed: \"#ff7fac\"\n    brightGreen: \"#c8ed71\"\n    brightYellow: \"#ebdf86\"\n    brightBlue: \"#75dff2\"\n    brightMagenta: \"#ae89fe\"\n    brightCyan: \"#b1c6ca\"\n    brightWhite: \"#f9f9f4\"\n  \n# Records, feel free to edit them\nrecords:\n  - delay: 818\n    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\"\n  - delay: 187\n    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\"\n  - delay: 432\n    content: \"\\e[32mc\\e[39m\\e[90margo build --release && ./target/release/rustscan 8.8.8.8\\e[39m\\e[57D\"\n  - delay: 106\n    content: \"\\b\\e[1m\\e[31mc\\e[1m\\e[31ma\\e[0m\\e[39m\"\n  - delay: 115\n    content: \"\\b\\b\\e[1m\\e[31mc\\e[1m\\e[31ma\\e[1m\\e[31mr\\e[0m\\e[39m\"\n  - delay: 178\n    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\"\n  - delay: 143\n    content: \"\\e[?1l\\e>\"\n  - delay: 8\n    content: \"\\e[?2004l\\r\\r\\n\\e]2;cargo build --release && ./target/release/rustscan 8.8.8.8\\a\\e]1;cargo\\a\"\n  - delay: 40\n    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\"\n  - delay: 368\n    content: \"Open \\e[35m53\\e[0m\\r\\n\"\n  - delay: 37\n    content: \"Open \\e[35m853\\e[0m\\r\\n\"\n  - delay: 849\n    content: \"Open \\e[35m443\\e[0m\\r\\n\"\n  - delay: 6605\n    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\"\n  - delay: 175\n    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\"\n  - delay: 554\n    content: \"\\e[?2004l\\r\\r\\n\"\n"
  },
  {
    "path": "pictures/nice.yml",
    "content": "# The configurations that used for the recording, feel free to edit them\nconfig:\n\n  # Specify a command to be executed\n  # like `/bin/bash -l`, `ls`, or any other commands\n  # the default is bash for Linux\n  # or powershell.exe for Windows\n  command: zsh \n  \n  # Specify the current working directory path\n  # the default is the current working directory path\n  cwd: /home/bee/Documents/RustScan\n  \n  # Export additional ENV variables\n  env:\n    recording: true\n  \n  # Explicitly set the number of columns\n  # or use `auto` to take the current\n  # number of columns of your shell\n  cols: 108\n  \n  # Explicitly set the number of rows\n  # or use `auto` to take the current\n  # number of rows of your shell\n  rows: 45\n  \n  # Amount of times to repeat GIF\n  # If value is -1, play once\n  # If value is 0, loop indefinitely\n  # If value is a positive number, loop n times\n  repeat: 0\n  \n  # Quality\n  # 1 - 100\n  quality: 100\n  \n  # Delay between frames in ms\n  # If the value is `auto` use the actual recording delays\n  frameDelay: auto\n  \n  # Maximum delay between frames in ms\n  # Ignored if the `frameDelay` isn't set to `auto`\n  # Set to `auto` to prevent limiting the max idle time\n  maxIdleTime: auto\n  \n  # The surrounding frame box\n  # The `type` can be null, window, floating, or solid`\n  # To hide the title use the value null\n  # Don't forget to add a backgroundColor style with a null as type\n  frameBox:\n    type: floating\n    title: Terminalizer\n    style:\n      border: 0px black solid\n      # boxShadow: none\n      # margin: 0px\n  \n  # Add a watermark image to the rendered gif\n  # You need to specify an absolute path for\n  # the image on your machine or a URL, and you can also\n  # add your own CSS styles\n  watermark:\n    imagePath: null\n    style:\n      position: absolute\n      right: 15px\n      bottom: 15px\n      width: 100px\n      opacity: 0.9\n  \n  # Cursor style can be one of\n  # `block`, `underline`, or `bar`\n  cursorStyle: block\n  \n  # Font family\n  # You can use any font that is installed on your machine\n  # in CSS-like syntax\n  fontFamily: \"Monaco, Lucida Console, Ubuntu Mono, Monospace\"\n  \n  # The size of the font\n  fontSize: 12\n  \n  # The height of lines\n  lineHeight: 1\n  \n  # The spacing between letters\n  letterSpacing: 0\n  \n  # Theme\n  theme:\n    background: \"transparent\"\n    foreground: \"#afafaf\"\n    cursor: \"#c7c7c7\"\n    black: \"#232628\"\n    red: \"#fc4384\"\n    green: \"#b3e33b\"\n    yellow: \"#ffa727\"\n    blue: \"#75dff2\"\n    magenta: \"#ae89fe\"\n    cyan: \"#708387\"\n    white: \"#d5d5d0\"\n    brightBlack: \"#626566\"\n    brightRed: \"#ff7fac\"\n    brightGreen: \"#c8ed71\"\n    brightYellow: \"#ebdf86\"\n    brightBlue: \"#75dff2\"\n    brightMagenta: \"#ae89fe\"\n    brightCyan: \"#b1c6ca\"\n    brightWhite: \"#f9f9f4\"\n  \n# Records, feel free to edit them\nrecords:\n  - delay: 895\n    content: \"No protocol specified\\r\\nCan't open display :0\\r\\n\"\n  - delay: 253\n    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\"\n  - delay: 29\n    content: c\n  - delay: 131\n    content: a\n  - delay: 29\n    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\"\n  - delay: 5\n    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\"\n  - delay: 719\n    content: \"\\b\\b\\e[1m\\e[31mc\\e[1m\\e[31ma\\e[1m\\e[31mr\\e[0m\\e[39m\"\n  - delay: 697\n    content: \"\\b\\b\\b\\e[1m\\e[31mc\\e[1m\\e[31ma\\e[0m\\e[39m\\e[0m\\e[90mr\\b\"\n  - delay: 172\n    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\"\n  - delay: 174\n    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\"\n  - delay: 2955\n    content: \"\\e[32mc\\e[39m\\e[90md RustScan\\e[39m\\e[10D\"\n  - delay: 111\n    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\"\n  - delay: 99\n    content: \"\\b\\b\\e[1m\\e[31mc\\e[1m\\e[31ma\\e[1m\\e[31mr\\e[0m\\e[39m\"\n  - delay: 192\n    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\"\n  - delay: 217\n    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\"\n  - delay: 38\n    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\"\n  - delay: 309\n    content: \"Open \\e[35m53\\e[0m\\r\\nOpen \\e[35m631\\e[0m\\r\\n\"\n  - delay: 1132\n    content: \"Open \\e[35m46624\\e[0m\\r\\n\"\n  - delay: 136\n    content: \"Open \\e[35m51934\\e[0m\\r\\n\"\n  - delay: 159\n    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\"\n  - delay: 156\n    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\"\n  - delay: 75\n    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\"\n  - delay: 21\n    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\"\n  - delay: 55\n    content: \"Initiating Service scan at 22:09\\r\\nScanning 3 services on localhost (127.0.0.1)\\r\\n\"\n  - delay: 42\n    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\"\n  - delay: 168\n    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\"\n  - delay: 403\n    content: \"\\e[?2004l\\r\\r\\n\"\n"
  },
  {
    "path": "release.sh",
    "content": "cargo publish && cargo build --release && git add Cargo.lock && git commit -m 'Updating lock file' && gpsup"
  },
  {
    "path": "src/address.rs",
    "content": "//! Provides functions to parse input IP addresses, CIDRs or files.\nuse std::collections::BTreeSet;\nuse std::fs::{self, File};\nuse std::io::{prelude::*, BufReader};\nuse std::net::{IpAddr, SocketAddr, ToSocketAddrs};\nuse std::path::Path;\nuse std::str::FromStr;\n\nuse cidr_utils::cidr::{IpCidr, IpInet};\nuse hickory_resolver::{\n    config::{NameServerConfig, Protocol, ResolverConfig, ResolverOpts},\n    Resolver,\n};\nuse log::debug;\n\nuse crate::input::Opts;\nuse crate::warning;\n\n/// Parses the string(s) into IP addresses.\n///\n/// Goes through all possible IP inputs (files or via argparsing).\n///\n/// ```rust\n/// # use rustscan::input::Opts;\n/// # use rustscan::address::parse_addresses;\n/// let mut opts = Opts::default();\n/// opts.addresses = vec![\"192.168.0.0/30\".to_owned()];\n///\n/// let ips = parse_addresses(&opts);\n/// ```\n///\n/// Finally, any duplicates are removed to avoid excessive scans.\npub fn parse_addresses(input: &Opts) -> Vec<IpAddr> {\n    let mut ips: Vec<IpAddr> = Vec::new();\n    let mut unresolved_addresses: Vec<&str> = Vec::new();\n    let backup_resolver = get_resolver(&input.resolver);\n\n    for address in &input.addresses {\n        let parsed_ips = parse_address(address, &backup_resolver);\n        if !parsed_ips.is_empty() {\n            ips.extend(parsed_ips);\n        } else {\n            unresolved_addresses.push(address);\n        }\n    }\n\n    // If we got to this point this can only be a file path or the wrong input.\n    for file_path in unresolved_addresses {\n        let file_path = Path::new(file_path);\n\n        if !file_path.is_file() {\n            warning!(\n                format!(\"Host {file_path:?} could not be resolved.\"),\n                input.greppable,\n                input.accessible\n            );\n\n            continue;\n        }\n\n        if let Ok(x) = read_ips_from_file(file_path, &backup_resolver) {\n            ips.extend(x);\n        } else {\n            warning!(\n                format!(\"Host {file_path:?} could not be resolved.\"),\n                input.greppable,\n                input.accessible\n            );\n        }\n    }\n\n    let excluded_cidrs = parse_excluded_networks(&input.exclude_addresses, &backup_resolver);\n\n    // Remove duplicated/excluded IPs.\n    let mut seen = BTreeSet::new();\n    ips.retain(|ip| seen.insert(*ip) && !excluded_cidrs.iter().any(|cidr| cidr.contains(ip)));\n\n    ips\n}\n\n/// Given a string, parse it as a host, IP address, or CIDR.\n///\n/// This allows us to pass files as hosts or cidr or IPs easily\n/// Call this every time you have a possible IP-or-host.\n///\n/// If the address is a domain, we can self-resolve the domain locally\n/// or resolve it by dns resolver list.\n///\n/// ```rust\n/// # use rustscan::address::parse_address;\n/// # use hickory_resolver::Resolver;\n/// let ips = parse_address(\"127.0.0.1\", &Resolver::default().unwrap());\n/// ```\npub fn parse_address(address: &str, resolver: &Resolver) -> Vec<IpAddr> {\n    if let Ok(addr) = IpAddr::from_str(address) {\n        // `address` is an IP string\n        vec![addr]\n    } else if let Ok(net_addr) = IpInet::from_str(address) {\n        // `address` is a CIDR string\n        net_addr.network().into_iter().addresses().collect()\n    } else {\n        // `address` is a hostname or DNS name\n        // attempt default DNS lookup\n        match format!(\"{address}:80\").to_socket_addrs() {\n            Ok(mut iter) => vec![iter.next().unwrap().ip()],\n            // default lookup didn't work, so try again with the dedicated resolver\n            Err(_) => resolve_ips_from_host(address, resolver),\n        }\n    }\n}\n\n/// Uses DNS to get the IPS associated with host\nfn resolve_ips_from_host(source: &str, backup_resolver: &Resolver) -> Vec<IpAddr> {\n    let mut ips: Vec<IpAddr> = Vec::new();\n\n    if let Ok(addrs) = source.to_socket_addrs() {\n        for ip in addrs {\n            ips.push(ip.ip());\n        }\n    } else if let Ok(addrs) = backup_resolver.lookup_ip(source) {\n        ips.extend(addrs.iter());\n    }\n\n    ips\n}\n\n/// Parses excluded networks from a list of addresses.\n///\n/// This function handles three types of inputs:\n/// 1. CIDR notation (e.g. \"192.168.0.0/24\")\n/// 2. Single IP addresses (e.g. \"192.168.0.1\")\n/// 3. Hostnames that need to be resolved (e.g. \"example.com\")\n///\n/// ```rust\n/// # use rustscan::address::parse_excluded_networks;\n/// # use hickory_resolver::Resolver;\n/// let resolver = Resolver::default().unwrap();\n/// let excluded = parse_excluded_networks(&Some(vec![\"192.168.0.0/24\".to_owned()]), &resolver);\n/// ```\npub fn parse_excluded_networks(\n    exclude_addresses: &Option<Vec<String>>,\n    resolver: &Resolver,\n) -> Vec<IpCidr> {\n    exclude_addresses\n        .iter()\n        .flatten()\n        .flat_map(|addr| parse_single_excluded_address(addr, resolver))\n        .collect()\n}\n\n/// Parses a single address into an IpCidr, handling CIDR notation, IP addresses, and hostnames.\nfn parse_single_excluded_address(addr: &str, resolver: &Resolver) -> Vec<IpCidr> {\n    if let Ok(cidr) = IpCidr::from_str(addr) {\n        return vec![cidr];\n    }\n\n    if let Ok(ip) = IpAddr::from_str(addr) {\n        return vec![IpCidr::new_host(ip)];\n    }\n\n    resolve_ips_from_host(addr, resolver)\n        .into_iter()\n        .map(IpCidr::new_host)\n        .collect()\n}\n\n/// Derive a DNS resolver.\n///\n/// 1. if the `resolver` parameter has been set:\n///     1. assume the parameter is a path and attempt to read IPs.\n///     2. parse the input as a comma-separated list of IPs.\n/// 2. if `resolver` is not set:\n///    1. attempt to derive a resolver from the system config. (e.g.\n///       `/etc/resolv.conf` on *nix).\n///    2. finally, build a CloudFlare-based resolver (default\n///       behaviour).\nfn get_resolver(resolver: &Option<String>) -> Resolver {\n    match resolver {\n        Some(r) => {\n            let mut config = ResolverConfig::new();\n            let resolver_ips = match read_resolver_from_file(r) {\n                Ok(ips) => ips,\n                Err(_) => r\n                    .split(',')\n                    .filter_map(|r| IpAddr::from_str(r).ok())\n                    .collect::<Vec<_>>(),\n            };\n            for ip in resolver_ips {\n                config.add_name_server(NameServerConfig::new(\n                    SocketAddr::new(ip, 53),\n                    Protocol::Udp,\n                ));\n            }\n            Resolver::new(config, ResolverOpts::default()).unwrap()\n        }\n        None => match Resolver::from_system_conf() {\n            Ok(resolver) => resolver,\n            Err(_) => {\n                Resolver::new(ResolverConfig::cloudflare_tls(), ResolverOpts::default()).unwrap()\n            }\n        },\n    }\n}\n\n/// Parses and input file of IPs for use in DNS resolution.\nfn read_resolver_from_file(path: &str) -> Result<Vec<IpAddr>, std::io::Error> {\n    let ips = fs::read_to_string(path)?\n        .lines()\n        .filter_map(|line| IpAddr::from_str(line.trim()).ok())\n        .collect();\n\n    Ok(ips)\n}\n\n#[cfg(not(tarpaulin_include))]\n/// Parses an input file of IPs and uses those\nfn read_ips_from_file(\n    ips: &std::path::Path,\n    backup_resolver: &Resolver,\n) -> Result<Vec<IpAddr>, std::io::Error> {\n    let file = File::open(ips)?;\n    let reader = BufReader::new(file);\n\n    let mut ips: Vec<IpAddr> = Vec::new();\n\n    for address_line in reader.lines() {\n        if let Ok(address) = address_line {\n            ips.extend(parse_address(&address, backup_resolver));\n        } else {\n            debug!(\"Line in file is not valid\");\n        }\n    }\n\n    Ok(ips)\n}\n\n#[cfg(test)]\nmod tests {\n    use super::{get_resolver, parse_addresses, Opts};\n    use std::net::Ipv4Addr;\n\n    #[test]\n    fn parse_correct_addresses() {\n        let opts = Opts {\n            addresses: vec![\"127.0.0.1\".to_owned(), \"192.168.0.0/30\".to_owned()],\n            ..Default::default()\n        };\n\n        let ips = parse_addresses(&opts);\n\n        assert_eq!(\n            ips,\n            [\n                Ipv4Addr::new(127, 0, 0, 1),\n                Ipv4Addr::new(192, 168, 0, 0),\n                Ipv4Addr::new(192, 168, 0, 1),\n                Ipv4Addr::new(192, 168, 0, 2),\n                Ipv4Addr::new(192, 168, 0, 3)\n            ]\n        );\n    }\n\n    #[test]\n    fn parse_addresses_with_address_exclusions() {\n        let opts = Opts {\n            addresses: vec![\"192.168.0.0/30\".to_owned()],\n            exclude_addresses: Some(vec![\"192.168.0.1\".to_owned()]),\n            ..Default::default()\n        };\n        let ips = parse_addresses(&opts);\n\n        assert_eq!(\n            ips,\n            [\n                Ipv4Addr::new(192, 168, 0, 0),\n                Ipv4Addr::new(192, 168, 0, 2),\n                Ipv4Addr::new(192, 168, 0, 3)\n            ]\n        );\n    }\n\n    #[test]\n    fn parse_addresses_with_cidr_exclusions() {\n        let opts = Opts {\n            addresses: vec![\"192.168.0.0/29\".to_owned()],\n            exclude_addresses: Some(vec![\"192.168.0.0/30\".to_owned()]),\n            ..Default::default()\n        };\n        let ips = parse_addresses(&opts);\n\n        assert_eq!(\n            ips,\n            [\n                Ipv4Addr::new(192, 168, 0, 4),\n                Ipv4Addr::new(192, 168, 0, 5),\n                Ipv4Addr::new(192, 168, 0, 6),\n                Ipv4Addr::new(192, 168, 0, 7),\n            ]\n        );\n    }\n\n    #[test]\n    fn parse_addresses_with_incorrect_address_exclusions() {\n        let opts = Opts {\n            addresses: vec![\"192.168.0.0/30\".to_owned()],\n            exclude_addresses: Some(vec![\"192.168.0.1\".to_owned()]),\n            ..Default::default()\n        };\n        let ips = parse_addresses(&opts);\n\n        assert_eq!(\n            ips,\n            [\n                Ipv4Addr::new(192, 168, 0, 0),\n                Ipv4Addr::new(192, 168, 0, 2),\n                Ipv4Addr::new(192, 168, 0, 3)\n            ]\n        );\n    }\n\n    #[test]\n    fn parse_correct_host_addresses() {\n        let opts = Opts {\n            addresses: vec![\"google.com\".to_owned()],\n            ..Default::default()\n        };\n\n        let ips = parse_addresses(&opts);\n\n        assert_eq!(ips.len(), 1);\n    }\n\n    #[test]\n    fn parse_correct_and_incorrect_addresses() {\n        let opts = Opts {\n            addresses: vec![\"127.0.0.1\".to_owned(), \"im_wrong\".to_owned()],\n            ..Default::default()\n        };\n\n        let ips = parse_addresses(&opts);\n\n        assert_eq!(ips, [Ipv4Addr::new(127, 0, 0, 1),]);\n    }\n\n    #[test]\n    fn parse_incorrect_addresses() {\n        let opts = Opts {\n            addresses: vec![\"im_wrong\".to_owned(), \"300.10.1.1\".to_owned()],\n            ..Default::default()\n        };\n\n        let ips = parse_addresses(&opts);\n\n        assert!(ips.is_empty());\n    }\n\n    #[test]\n    fn parse_hosts_file_and_incorrect_hosts() {\n        // Host file contains IP, Hosts, incorrect IPs, incorrect hosts\n        let opts = Opts {\n            addresses: vec![\"fixtures/hosts.txt\".to_owned()],\n            ..Default::default()\n        };\n\n        let ips = parse_addresses(&opts);\n\n        assert_eq!(ips.len(), 3);\n    }\n\n    #[test]\n    fn parse_empty_hosts_file() {\n        // Host file contains IP, Hosts, incorrect IPs, incorrect hosts\n        let opts = Opts {\n            addresses: vec![\"fixtures/empty_hosts.txt\".to_owned()],\n            ..Default::default()\n        };\n\n        let ips = parse_addresses(&opts);\n\n        assert_eq!(ips.len(), 0);\n    }\n\n    #[test]\n    fn parse_naughty_host_file() {\n        // Host file contains IP, Hosts, incorrect IPs, incorrect hosts\n        let opts = Opts {\n            addresses: vec![\"fixtures/naughty_string.txt\".to_owned()],\n            ..Default::default()\n        };\n\n        let ips = parse_addresses(&opts);\n\n        assert_eq!(ips.len(), 0);\n    }\n\n    #[test]\n    fn parse_duplicate_cidrs() {\n        let opts = Opts {\n            addresses: vec![\"79.98.104.0/21\".to_owned(), \"79.98.104.0/24\".to_owned()],\n            ..Default::default()\n        };\n\n        let ips = parse_addresses(&opts);\n\n        assert_eq!(ips.len(), 2_048);\n    }\n\n    #[test]\n    fn parse_overspecific_cidr() {\n        // a canonical CIDR string has 0 in all host bits, but we want to treat any CIDR-like string as CIDR\n        let opts = Opts {\n            addresses: vec![\"192.128.1.1/24\".to_owned()],\n            ..Default::default()\n        };\n\n        let ips = parse_addresses(&opts);\n\n        assert_eq!(ips.len(), 256);\n    }\n\n    #[test]\n    fn resolver_args_google_dns() {\n        // https://developers.google.com/speed/public-dns\n        let opts = Opts {\n            resolver: Some(\"8.8.8.8,8.8.4.4\".to_owned()),\n            ..Default::default()\n        };\n\n        let resolver = get_resolver(&opts.resolver);\n        let lookup = resolver.lookup_ip(\"www.example.com.\").unwrap();\n\n        assert!(lookup.iter().next().is_some());\n    }\n}\n"
  },
  {
    "path": "src/benchmark/mod.rs",
    "content": "//! Provides functionality to capture timing information for scans.\n//!\n//! # Usage\n//!\n//! ```rust\n//! // Initiate Benchmark vector\n//! # use rustscan::benchmark::{Benchmark, NamedTimer};\n//! # use log::info;\n//! let mut bm = Benchmark::init();\n//! // Start named timer with name\n//! let mut example_bench = NamedTimer::start(\"Example Bench\");\n//! // Stop named timer\n//! example_bench.end();\n//! // Add named timer to Benchmarks\n//! bm.push(example_bench);\n//! // Print Benchmark Summary\n//! info!(\"{}\", bm.summary());\n//! ```\nuse std::time::Instant;\n\n/// A Benchmark struct to hold NamedTimers with name, start and end Instants,\n#[derive(Debug)]\npub struct Benchmark {\n    named_timers: Vec<NamedTimer>,\n}\n\nimpl Benchmark {\n    pub fn init() -> Self {\n        Self {\n            named_timers: Vec::new(),\n        }\n    }\n    pub fn push(&mut self, timer: NamedTimer) {\n        self.named_timers.push(timer);\n    }\n\n    /// Summary of the benchmarks will destruct the vector,\n    /// formats every element the same way and return\n    /// a single String with all the available information\n    /// for easy printing\n    pub fn summary(&self) -> String {\n        let mut summary = String::from(\"\\nRustScan Benchmark Summary\");\n\n        for timer in &self.named_timers {\n            if let Some(start) = timer.start {\n                if let Some(end) = timer.end {\n                    let runtime_secs = end.saturating_duration_since(start).as_secs_f32();\n                    summary.push_str(&format!(\"\\n{0: <10} | {1: <10}s\", timer.name, runtime_secs));\n                }\n            }\n        }\n        summary\n    }\n}\n\n/// The purpose of NamedTimer is to hold a name,\n/// start Instant and end Instant for a specific timer.\n/// The given name will be presented in the benchmark summary,\n/// start and end Instants will be used for calculating runtime.\n#[derive(Debug)]\npub struct NamedTimer {\n    name: &'static str,\n    start: Option<Instant>,\n    end: Option<Instant>,\n}\n\nimpl NamedTimer {\n    pub fn start(name: &'static str) -> Self {\n        Self {\n            name,\n            start: Some(Instant::now()),\n            end: None,\n        }\n    }\n    pub fn end(&mut self) {\n        self.end = Some(Instant::now());\n    }\n}\n\n#[test]\nfn benchmark() {\n    let mut benchmarks = Benchmark::init();\n    let mut test_timer = NamedTimer::start(\"test\");\n    std::thread::sleep(std::time::Duration::from_millis(100));\n    test_timer.end();\n    benchmarks.push(test_timer);\n    benchmarks.push(NamedTimer::start(\"only_start\"));\n    assert!(benchmarks\n        .summary()\n        .contains(\"\\nRustScan Benchmark Summary\\ntest       | 0.\"));\n    assert!(!benchmarks.summary().contains(\"only_start\"));\n}\n"
  },
  {
    "path": "src/input.rs",
    "content": "//! Provides a means to read, parse and hold configuration options for scans.\nuse clap::{Parser, ValueEnum};\nuse serde_derive::Deserialize;\nuse std::fs;\nuse std::path::PathBuf;\n\nconst LOWEST_PORT_NUMBER: u16 = 1;\nconst TOP_PORT_NUMBER: u16 = 65535;\n\n/// Represents the strategy in which the port scanning will run.\n///   - Serial will run from start to end, for example 1 to 1_000.\n///   - Random will randomize the order in which ports will be scanned.\n#[derive(Deserialize, Debug, ValueEnum, Clone, Copy, PartialEq, Eq)]\npub enum ScanOrder {\n    Serial,\n    Random,\n}\n\n/// Represents the scripts variant.\n///   - none will avoid running any script, only portscan results will be shown.\n///   - default will run the default embedded nmap script, that's part of RustScan since the beginning.\n///   - custom will read the ScriptConfig file and the available scripts in the predefined folders\n#[derive(Deserialize, Debug, ValueEnum, Clone, PartialEq, Eq, Copy)]\npub enum ScriptsRequired {\n    None,\n    Default,\n    Custom,\n}\n\n/// Represents the range of ports to be scanned.\n#[derive(Deserialize, Debug, Clone, PartialEq, Eq)]\npub struct PortRange {\n    pub start: u16,\n    pub end: u16,\n}\n\n#[cfg(not(tarpaulin_include))]\nfn parse_range(input: &str) -> Result<PortRange, String> {\n    let range = input\n        .split('-')\n        .map(str::parse)\n        .collect::<Result<Vec<u16>, std::num::ParseIntError>>();\n\n    if range.is_err() {\n        return Err(String::from(\n            \"the range format must be 'start-end'. Example: 1-1000.\",\n        ));\n    }\n\n    match range.unwrap().as_slice() {\n        [start, end] => Ok(PortRange {\n            start: *start,\n            end: *end,\n        }),\n        _ => Err(String::from(\n            \"the range format must be 'start-end'. Example: 1-1000.\",\n        )),\n    }\n}\n\n#[derive(Parser, Debug, Clone)]\n#[command(\n    name = \"rustscan\",\n    version = env!(\"CARGO_PKG_VERSION\"),\n    max_term_width = 120,\n    help_template = \"{bin} {version}\\n{about}\\n\\nUSAGE:\\n    {usage}\\n\\nOPTIONS:\\n{options}\",\n)]\n#[allow(clippy::struct_excessive_bools)]\n/// Fast Port Scanner built in Rust.\n/// WARNING Do not use this program against sensitive infrastructure since the\n/// specified server may not be able to handle this many socket connections at once.\n/// - Discord  <http://discord.skerritt.blog>\n/// - GitHub <https://github.com/RustScan/RustScan>\npub struct Opts {\n    /// A comma-delimited list or newline-delimited file of separated CIDRs, IPs, or hosts to be scanned.\n    #[arg(short, long, value_delimiter = ',')]\n    pub addresses: Vec<String>,\n\n    /// A list of comma separated ports to be scanned. Example: 80,443,8080.\n    #[arg(short, long, value_delimiter = ',')]\n    pub ports: Option<Vec<u16>>,\n\n    /// A range of ports with format start-end. Example: 1-1000.\n    #[arg(short, long, conflicts_with = \"ports\", value_parser = parse_range)]\n    pub range: Option<PortRange>,\n\n    /// Whether to ignore the configuration file or not.\n    #[arg(short, long)]\n    pub no_config: bool,\n\n    /// Hide the banner\n    #[arg(long)]\n    pub no_banner: bool,\n\n    /// Custom path to config file\n    #[arg(short, long, value_parser)]\n    pub config_path: Option<PathBuf>,\n\n    /// Greppable mode. Only output the ports. No Nmap. Useful for grep or outputting to a file.\n    #[arg(short, long)]\n    pub greppable: bool,\n\n    /// Accessible mode. Turns off features which negatively affect screen readers.\n    #[arg(long)]\n    pub accessible: bool,\n\n    /// A comma-delimited list or file of DNS resolvers.\n    #[arg(long)]\n    pub resolver: Option<String>,\n\n    /// The batch size for port scanning, it increases or slows the speed of\n    /// scanning. Depends on the open file limit of your OS.  If you do 65535\n    /// it will do every port at the same time. Although, your OS may not\n    /// support this.\n    #[arg(short, long, default_value = \"4500\")]\n    pub batch_size: usize,\n\n    /// The timeout in milliseconds before a port is assumed to be closed.\n    #[arg(short, long, default_value = \"1500\")]\n    pub timeout: u32,\n\n    /// The number of tries before a port is assumed to be closed.\n    /// If set to 0, rustscan will correct it to 1.\n    #[arg(long, default_value = \"1\")]\n    pub tries: u8,\n\n    /// Automatically ups the ULIMIT with the value you provided.\n    #[arg(short, long)]\n    pub ulimit: Option<usize>,\n\n    /// The order of scanning to be performed. The \"serial\" option will\n    /// scan ports in ascending order while the \"random\" option will scan\n    /// ports randomly.\n    #[arg(long, value_enum, ignore_case = true, default_value = \"serial\")]\n    pub scan_order: ScanOrder,\n\n    /// Level of scripting required for the run.\n    #[arg(long, value_enum, ignore_case = true, default_value = \"default\")]\n    pub scripts: ScriptsRequired,\n\n    /// Use the top 1000 ports.\n    #[arg(long)]\n    pub top: bool,\n\n    /// The Script arguments to run.\n    /// To use the argument -A, end RustScan's args with '-- -A'.\n    /// Example: 'rustscan -t 1500 -a 127.0.0.1 -- -A -sC'.\n    /// This command adds -Pn -vvv -p $PORTS automatically to nmap.\n    /// For things like --script '(safe and vuln)' enclose it in quotations marks \\\"'(safe and vuln)'\\\"\n    #[arg(last = true)]\n    pub command: Vec<String>,\n\n    /// A list of comma separated ports to be excluded from scanning. Example: 80,443,8080.\n    #[arg(short, long, value_delimiter = ',')]\n    pub exclude_ports: Option<Vec<u16>>,\n\n    /// A list of comma separated CIDRs, IPs, or hosts to be excluded from scanning.\n    #[arg(short = 'x', long = \"exclude-addresses\", value_delimiter = ',')]\n    pub exclude_addresses: Option<Vec<String>>,\n\n    /// UDP scanning mode, finds UDP ports that send back responses\n    #[arg(long)]\n    pub udp: bool,\n}\n\n#[cfg(not(tarpaulin_include))]\nimpl Opts {\n    pub fn read() -> Self {\n        let mut opts = Opts::parse();\n\n        if opts.ports.is_none() && opts.range.is_none() {\n            opts.range = Some(PortRange {\n                start: LOWEST_PORT_NUMBER,\n                end: TOP_PORT_NUMBER,\n            });\n        }\n\n        opts\n    }\n\n    /// Reads the command line arguments into an Opts struct and merge\n    /// values found within the user configuration file.\n    pub fn merge(&mut self, config: &Config) {\n        if !self.no_config {\n            self.merge_required(config);\n            self.merge_optional(config);\n        }\n    }\n\n    fn merge_required(&mut self, config: &Config) {\n        macro_rules! merge_required {\n            ($($field: ident),+) => {\n                $(\n                    if let Some(e) = &config.$field {\n                        self.$field = e.clone();\n                    }\n                )+\n            }\n        }\n\n        merge_required!(\n            addresses, greppable, accessible, batch_size, timeout, tries, scan_order, scripts,\n            command, udp, no_banner\n        );\n    }\n\n    fn merge_optional(&mut self, config: &Config) {\n        macro_rules! merge_optional {\n            ($($field: ident),+) => {\n                $(\n                    if config.$field.is_some() {\n                        self.$field = config.$field.clone();\n                    }\n                )+\n            }\n        }\n\n        // Only use top ports when the user asks for them\n        if self.top && config.ports.is_some() {\n            self.ports = config.ports.clone();\n        }\n\n        merge_optional!(range, resolver, ulimit, exclude_ports, exclude_addresses);\n    }\n}\n\nimpl Default for Opts {\n    fn default() -> Self {\n        Self {\n            addresses: vec![],\n            ports: None,\n            range: None,\n            greppable: true,\n            batch_size: 0,\n            timeout: 0,\n            tries: 0,\n            ulimit: None,\n            command: vec![],\n            accessible: false,\n            resolver: None,\n            scan_order: ScanOrder::Serial,\n            no_config: true,\n            no_banner: false,\n            top: false,\n            scripts: ScriptsRequired::Default,\n            config_path: None,\n            exclude_ports: None,\n            exclude_addresses: None,\n            udp: false,\n        }\n    }\n}\n\n/// Struct used to deserialize the options specified within our config file.\n/// These will be further merged with our command line arguments in order to\n/// generate the final Opts struct.\n#[cfg(not(tarpaulin_include))]\n#[derive(Debug, Deserialize)]\npub struct Config {\n    addresses: Option<Vec<String>>,\n    ports: Option<Vec<u16>>,\n    range: Option<PortRange>,\n    greppable: Option<bool>,\n    accessible: Option<bool>,\n    batch_size: Option<usize>,\n    timeout: Option<u32>,\n    tries: Option<u8>,\n    ulimit: Option<usize>,\n    resolver: Option<String>,\n    scan_order: Option<ScanOrder>,\n    command: Option<Vec<String>>,\n    scripts: Option<ScriptsRequired>,\n    exclude_ports: Option<Vec<u16>>,\n    exclude_addresses: Option<Vec<String>>,\n    udp: Option<bool>,\n    no_banner: Option<bool>,\n}\n\n#[cfg(not(tarpaulin_include))]\n#[allow(clippy::doc_link_with_quotes)]\n#[allow(clippy::manual_unwrap_or_default)]\nimpl Config {\n    /// Reads the configuration file with TOML format and parses it into a\n    /// Config struct.\n    ///\n    /// # Format\n    ///\n    /// addresses = [\"127.0.0.1\", \"127.0.0.1\"]\n    /// ports = [80, 443, 8080]\n    /// greppable = true\n    /// scan_order = \"Serial\"\n    /// exclude_ports = [8080, 9090, 80]\n    /// udp = false\n    ///\n    pub fn read(custom_config_path: Option<PathBuf>) -> Self {\n        let mut content = String::new();\n        let config_path = custom_config_path.unwrap_or_else(|| {\n            let path = default_config_path();\n            match path.exists() {\n                true => path,\n                false => old_default_config_path(),\n            }\n        });\n\n        if config_path.exists() {\n            content = match fs::read_to_string(config_path) {\n                Ok(content) => content,\n                Err(_) => String::new(),\n            }\n        }\n\n        let config: Config = match toml::from_str(&content) {\n            Ok(config) => config,\n            Err(e) => {\n                println!(\"Found {e} in configuration file.\\nAborting scan.\\n\");\n                std::process::exit(1);\n            }\n        };\n\n        config\n    }\n}\n\n/// Constructs default path to config toml\npub fn default_config_path() -> PathBuf {\n    let Some(mut config_path) = dirs::config_dir() else {\n        panic!(\"Could not infer config file path.\");\n    };\n    config_path.push(\".rustscan.toml\");\n    config_path\n}\n\n/// Returns the deprecated home directory config path used for backwards compatibility.\npub fn old_default_config_path() -> PathBuf {\n    let Some(mut config_path) = dirs::home_dir() else {\n        panic!(\"Could not infer config file path.\");\n    };\n    config_path.push(\".rustscan.toml\");\n    config_path\n}\n\n#[cfg(test)]\nmod tests {\n    use clap::{CommandFactory, Parser};\n    use parameterized::parameterized;\n\n    use super::{Config, Opts, PortRange, ScanOrder, ScriptsRequired};\n\n    impl Config {\n        fn default() -> Self {\n            Self {\n                addresses: Some(vec![\"127.0.0.1\".to_owned()]),\n                ports: None,\n                range: None,\n                greppable: Some(true),\n                batch_size: Some(25_000),\n                timeout: Some(1_000),\n                tries: Some(1),\n                ulimit: None,\n                command: Some(vec![\"-A\".to_owned()]),\n                accessible: Some(true),\n                resolver: None,\n                scan_order: Some(ScanOrder::Random),\n                scripts: None,\n                exclude_ports: None,\n                exclude_addresses: None,\n                udp: Some(false),\n                no_banner: None,\n            }\n        }\n    }\n\n    #[test]\n    fn verify_cli() {\n        Opts::command().debug_assert();\n    }\n\n    #[parameterized(input = {\n        vec![\"rustscan\", \"--addresses\", \"127.0.0.1\"],\n        vec![\"rustscan\", \"--addresses\", \"127.0.0.1\", \"--\", \"-sCV\"],\n        vec![\"rustscan\", \"--addresses\", \"127.0.0.1\", \"--\", \"-A\"],\n        vec![\"rustscan\", \"-t\", \"1500\", \"-a\", \"127.0.0.1\", \"--\", \"-A\", \"-sC\"],\n        vec![\"rustscan\", \"--addresses\", \"127.0.0.1\", \"--\", \"--script\", r#\"\"'(safe and vuln)'\"\"#],\n    }, command = {\n        vec![],\n        vec![\"-sCV\".to_owned()],\n        vec![\"-A\".to_owned()],\n        vec![\"-A\".to_owned(), \"-sC\".to_owned()],\n        vec![\"--script\".to_owned(), \"\\\"'(safe and vuln)'\\\"\".to_owned()],\n    })]\n    fn parse_trailing_command(input: Vec<&str>, command: Vec<String>) {\n        let opts = Opts::parse_from(input);\n\n        assert_eq!(vec![\"127.0.0.1\".to_owned()], opts.addresses);\n        assert_eq!(command, opts.command);\n    }\n\n    #[test]\n    fn opts_no_merge_when_config_is_ignored() {\n        let mut opts = Opts::default();\n        let config = Config::default();\n\n        opts.merge(&config);\n\n        assert_eq!(opts.addresses, vec![] as Vec<String>);\n        assert!(opts.greppable);\n        assert!(!opts.accessible);\n        assert_eq!(opts.timeout, 0);\n        assert_eq!(opts.command, vec![] as Vec<String>);\n        assert_eq!(opts.scan_order, ScanOrder::Serial);\n    }\n\n    #[test]\n    fn opts_merge_required_arguments() {\n        let mut opts = Opts::default();\n        let config = Config::default();\n\n        opts.merge_required(&config);\n\n        assert_eq!(opts.addresses, config.addresses.unwrap());\n        assert_eq!(opts.greppable, config.greppable.unwrap());\n        assert_eq!(opts.timeout, config.timeout.unwrap());\n        assert_eq!(opts.command, config.command.unwrap());\n        assert_eq!(opts.accessible, config.accessible.unwrap());\n        assert_eq!(opts.scan_order, config.scan_order.unwrap());\n        assert_eq!(opts.scripts, ScriptsRequired::Default);\n    }\n\n    #[test]\n    fn opts_merge_optional_arguments() {\n        let mut opts = Opts::default();\n        let mut config = Config::default();\n        config.range = Some(PortRange {\n            start: 1,\n            end: 1_000,\n        });\n        config.ulimit = Some(1_000);\n        config.resolver = Some(\"1.1.1.1\".to_owned());\n\n        opts.merge_optional(&config);\n\n        assert_eq!(opts.range, config.range);\n        assert_eq!(opts.ulimit, config.ulimit);\n        assert_eq!(opts.resolver, config.resolver);\n    }\n}\n"
  },
  {
    "path": "src/lib.rs",
    "content": "//! This crate exposes the internal functionality of the\n//! [RustScan](https://rustscan.github.io/RustScan) port scanner.\n//!\n//! ## Example: perform a scan against localhost\n//!\n//! The core scanning behaviour is managed by\n//! [`Scanner`](crate::scanner::Scanner) which in turn requires a\n//! [`PortStrategy`](crate::port_strategy::PortStrategy):\n//!\n//! ```rust\n//! use async_std::task::block_on;\n//! use std::{net::IpAddr, time::Duration};\n//!\n//! use rustscan::input::{PortRange, ScanOrder};\n//! use rustscan::port_strategy::PortStrategy;\n//! use rustscan::scanner::Scanner;\n//!\n//! fn main() {\n//!     let addrs = vec![\"127.0.0.1\".parse::<IpAddr>().unwrap()];\n//!     let range = PortRange {\n//!         start: 1,\n//!         end: 1_000,\n//!     };\n//!     let strategy = PortStrategy::pick(&Some(range), None, ScanOrder::Random); // can be serial, random or manual https://github.com/RustScan/RustScan/blob/master/src/port_strategy/mod.rs\n//!     let scanner = Scanner::new(\n//!         &addrs, // the addresses to scan\n//!         10, // batch_size is how many ports at a time should be scanned\n//!         Duration::from_millis(100), //T imeout is the time RustScan should wait before declaring a port closed. As datatype Duration.\n//!         1, // Tries, how many retries should RustScan do?\n//!         true, // greppable is whether or not RustScan should print things, or wait until the end to print only the ip\n//!         strategy, // the port strategy used\n//!         true, // accessible, should the output be A11Y compliant?\n//!         vec![9000], // What ports should RustScan exclude?\n//!         false, // is this a UDP scan?\n//!     );\n//!\n//!     let scan_result = block_on(scanner.run());\n//!\n//!     println!(\"{:?}\", scan_result);\n//! }\n//! ```\n#![allow(clippy::needless_doctest_main)]\n\npub mod tui;\n\npub mod input;\n\npub mod scanner;\n\npub mod port_strategy;\n\npub mod benchmark;\n\npub mod scripts;\n\npub mod address;\n\npub mod generated;\n"
  },
  {
    "path": "src/main.rs",
    "content": "#![deny(clippy::all)]\n#![warn(clippy::pedantic)]\n#![allow(clippy::doc_markdown, clippy::if_not_else, clippy::non_ascii_literal)]\n\nuse rustscan::benchmark::{Benchmark, NamedTimer};\nuse rustscan::input::{self, Config, Opts, ScriptsRequired};\nuse rustscan::port_strategy::PortStrategy;\nuse rustscan::scanner::Scanner;\nuse rustscan::scripts::{init_scripts, Script, ScriptFile};\nuse rustscan::{detail, funny_opening, output, warning};\n\nuse colorful::{Color, Colorful};\nuse futures::executor::block_on;\nuse std::collections::HashMap;\nuse std::net::IpAddr;\nuse std::string::ToString;\nuse std::time::Duration;\n\nuse rustscan::address::parse_addresses;\n\nextern crate colorful;\nextern crate dirs;\n\n// Average value for Ubuntu\n#[cfg(unix)]\nconst DEFAULT_FILE_DESCRIPTORS_LIMIT: usize = 8000;\n// Safest batch size based on experimentation\nconst AVERAGE_BATCH_SIZE: usize = 3000;\n\n#[macro_use]\nextern crate log;\n\n#[cfg(not(tarpaulin_include))]\n#[allow(clippy::too_many_lines)]\n/// Faster Nmap scanning with Rust\n/// If you're looking for the actual scanning, check out the module Scanner\nfn main() {\n    #[cfg(not(unix))]\n    let _ = ansi_term::enable_ansi_support();\n\n    env_logger::init();\n    let mut benchmarks = Benchmark::init();\n    let mut rustscan_bench = NamedTimer::start(\"RustScan\");\n\n    let mut opts: Opts = Opts::read();\n    let config = Config::read(opts.config_path.clone());\n    opts.merge(&config);\n\n    debug!(\"Main() `opts` arguments are {opts:?}\");\n\n    let scripts_to_run: Vec<ScriptFile> = match init_scripts(&opts.scripts) {\n        Ok(scripts_to_run) => scripts_to_run,\n        Err(e) => {\n            warning!(\n                format!(\"Initiating scripts failed!\\n{e}\"),\n                opts.greppable,\n                opts.accessible\n            );\n            std::process::exit(1);\n        }\n    };\n\n    debug!(\"Scripts initialized {:?}\", &scripts_to_run);\n\n    if !opts.greppable && !opts.accessible && !opts.no_banner {\n        print_opening(&opts);\n    }\n\n    let ips: Vec<IpAddr> = parse_addresses(&opts);\n\n    if ips.is_empty() {\n        warning!(\n            \"No IPs could be resolved, aborting scan.\",\n            opts.greppable,\n            opts.accessible\n        );\n        std::process::exit(1);\n    }\n\n    #[cfg(unix)]\n    let batch_size: usize = infer_batch_size(&opts, adjust_ulimit_size(&opts));\n\n    #[cfg(not(unix))]\n    let batch_size: usize = AVERAGE_BATCH_SIZE;\n\n    let scanner = Scanner::new(\n        &ips,\n        batch_size,\n        Duration::from_millis(opts.timeout.into()),\n        opts.tries,\n        opts.greppable,\n        PortStrategy::pick(&opts.range, opts.ports, opts.scan_order),\n        opts.accessible,\n        opts.exclude_ports.unwrap_or_default(),\n        opts.udp,\n    );\n    debug!(\"Scanner finished building: {scanner:?}\");\n\n    let mut portscan_bench = NamedTimer::start(\"Portscan\");\n    let scan_result = block_on(scanner.run());\n    portscan_bench.end();\n    benchmarks.push(portscan_bench);\n\n    let mut ports_per_ip = HashMap::new();\n\n    for socket in scan_result {\n        ports_per_ip\n            .entry(socket.ip())\n            .or_insert_with(Vec::new)\n            .push(socket.port());\n    }\n\n    for ip in ips {\n        if ports_per_ip.contains_key(&ip) {\n            continue;\n        }\n\n        // If we got here it means the IP was not found within the HashMap, this\n        // means the scan couldn't find any open ports for it.\n\n        let x = format!(\"Looks like I didn't find any open ports for {:?}. This is usually caused by a high batch size.\n        \\n*I used {} batch size, consider lowering it with {} or a comfortable number for your system.\n        \\n Alternatively, increase the timeout if your ping is high. Rustscan -t 2000 for 2000 milliseconds (2s) timeout.\\n\",\n        ip,\n        opts.batch_size,\n        \"'rustscan -b <batch_size> -a <ip address>'\");\n        warning!(x, opts.greppable, opts.accessible);\n    }\n\n    let mut script_bench = NamedTimer::start(\"Scripts\");\n    for (ip, ports) in &ports_per_ip {\n        let vec_str_ports: Vec<String> = ports.iter().map(ToString::to_string).collect();\n\n        // nmap port style is 80,443. Comma separated with no spaces.\n        let ports_str = vec_str_ports.join(\",\");\n\n        // if option scripts is none, no script will be spawned\n        if opts.greppable || opts.scripts == ScriptsRequired::None {\n            println!(\"{} -> [{}]\", &ip, ports_str);\n            continue;\n        }\n        detail!(\"Starting Script(s)\", opts.greppable, opts.accessible);\n\n        // Run all the scripts we found and parsed based on the script config file tags field.\n        for mut script_f in scripts_to_run.clone() {\n            // This part allows us to add commandline arguments to the Script call_format, appending them to the end of the command.\n            if !opts.command.is_empty() {\n                let user_extra_args = &opts.command.join(\" \");\n                debug!(\"Extra args vec {user_extra_args:?}\");\n                if script_f.call_format.is_some() {\n                    let mut call_f = script_f.call_format.unwrap();\n                    call_f.push(' ');\n                    call_f.push_str(user_extra_args);\n                    output!(\n                        format!(\"Running script {:?} on ip {}\\nDepending on the complexity of the script, results may take some time to appear.\", call_f, &ip),\n                        opts.greppable,\n                        opts.accessible\n                    );\n                    debug!(\"Call format {call_f}\");\n                    script_f.call_format = Some(call_f);\n                }\n            }\n\n            // Building the script with the arguments from the ScriptFile, and ip-ports.\n            let script = Script::build(\n                script_f.path,\n                *ip,\n                ports.clone(),\n                script_f.port,\n                script_f.ports_separator,\n                script_f.tags,\n                script_f.call_format,\n            );\n            match script.run() {\n                Ok(script_result) => {\n                    detail!(script_result.clone(), opts.greppable, opts.accessible);\n                }\n                Err(e) => {\n                    warning!(&format!(\"Error {e}\"), opts.greppable, opts.accessible);\n                }\n            }\n        }\n    }\n\n    // To use the runtime benchmark, run the process as: RUST_LOG=info ./rustscan\n    script_bench.end();\n    benchmarks.push(script_bench);\n    rustscan_bench.end();\n    benchmarks.push(rustscan_bench);\n    debug!(\"Benchmarks raw {benchmarks:?}\");\n    info!(\"{}\", benchmarks.summary());\n}\n\n/// Prints the opening title of RustScan\n#[allow(clippy::items_after_statements, clippy::needless_raw_string_hashes)]\nfn print_opening(opts: &Opts) {\n    debug!(\"Printing opening\");\n    let s = r#\".----. .-. .-. .----..---.  .----. .---.   .--.  .-. .-.\n| {}  }| { } |{ {__ {_   _}{ {__  /  ___} / {} \\ |  `| |\n| .-. \\| {_} |.-._} } | |  .-._} }\\     }/  /\\  \\| |\\  |\n`-' `-'`-----'`----'  `-'  `----'  `---' `-'  `-'`-' `-'\nThe Modern Day Port Scanner.\"#;\n\n    println!(\"{}\", s.gradient(Color::Green).bold());\n    let info = r#\"________________________________________\n: http://discord.skerritt.blog         :\n: https://github.com/RustScan/RustScan :\n --------------------------------------\"#;\n    println!(\"{}\", info.gradient(Color::Yellow).bold());\n    funny_opening!();\n\n    let config_path = opts\n        .config_path\n        .clone()\n        .unwrap_or_else(input::default_config_path);\n\n    detail!(\n        format!(\"The config file is expected to be at {config_path:?}\"),\n        opts.greppable,\n        opts.accessible\n    );\n\n    if opts.config_path.is_none() {\n        let old_config_path = input::old_default_config_path();\n        detail!(\n            format!(\n                \"For backwards compatibility, the config file may also be at {old_config_path:?}\"\n            ),\n            opts.greppable,\n            opts.accessible\n        );\n    }\n}\n\n#[cfg(unix)]\nfn adjust_ulimit_size(opts: &Opts) -> usize {\n    use rlimit::Resource;\n    use std::convert::TryInto;\n\n    if let Some(limit) = opts.ulimit {\n        let limit = limit as u64;\n        if Resource::NOFILE.set(limit, limit).is_ok() {\n            detail!(\n                format!(\"Automatically increasing ulimit value to {limit}.\"),\n                opts.greppable,\n                opts.accessible\n            );\n        } else {\n            warning!(\n                \"ERROR. Failed to set ulimit value.\",\n                opts.greppable,\n                opts.accessible\n            );\n        }\n    }\n\n    let (soft, _) = Resource::NOFILE.get().unwrap();\n    soft.try_into().unwrap_or(usize::MAX)\n}\n\n#[cfg(unix)]\nfn infer_batch_size(opts: &Opts, ulimit: usize) -> usize {\n    let mut batch_size = opts.batch_size;\n\n    // Adjust the batch size when the ulimit value is lower than the desired batch size\n    if ulimit < batch_size {\n        warning!(\"File limit is lower than default batch size. Consider upping with --ulimit. May cause harm to sensitive servers\",\n            opts.greppable, opts.accessible\n        );\n\n        // When the OS supports high file limits like 8000, but the user\n        // selected a batch size higher than this we should reduce it to\n        // a lower number.\n        if ulimit < AVERAGE_BATCH_SIZE {\n            // ulimit is smaller than aveage batch size\n            // user must have very small ulimit\n            // decrease batch size to half of ulimit\n            warning!(\"Your file limit is very small, which negatively impacts RustScan's speed. Use the Docker image, or up the Ulimit with '--ulimit 5000'. \", opts.greppable, opts.accessible);\n            info!(\"Halving batch_size because ulimit is smaller than average batch size\");\n            batch_size = ulimit / 2;\n        } else if ulimit > DEFAULT_FILE_DESCRIPTORS_LIMIT {\n            info!(\"Batch size is now average batch size\");\n            batch_size = AVERAGE_BATCH_SIZE;\n        } else {\n            batch_size = ulimit - 100;\n        }\n    }\n    // When the ulimit is higher than the batch size let the user know that the\n    // batch size can be increased unless they specified the ulimit themselves.\n    else if ulimit + 2 > batch_size && (opts.ulimit.is_none()) {\n        detail!(format!(\"File limit higher than batch size. Can increase speed by increasing batch size '-b {}'.\", ulimit - 100),\n        opts.greppable, opts.accessible);\n    }\n\n    batch_size\n}\n\n#[cfg(test)]\nmod tests {\n    #[cfg(unix)]\n    use super::{adjust_ulimit_size, infer_batch_size};\n    use super::{print_opening, Opts};\n\n    #[test]\n    #[cfg(unix)]\n    fn batch_size_lowered() {\n        let opts = Opts {\n            batch_size: 50_000,\n            ..Default::default()\n        };\n        let batch_size = infer_batch_size(&opts, 120);\n\n        assert!(batch_size < opts.batch_size);\n    }\n\n    #[test]\n    #[cfg(unix)]\n    fn batch_size_lowered_average_size() {\n        let opts = Opts {\n            batch_size: 50_000,\n            ..Default::default()\n        };\n        let batch_size = infer_batch_size(&opts, 9_000);\n\n        assert!(batch_size == 3_000);\n    }\n    #[test]\n    #[cfg(unix)]\n    fn batch_size_equals_ulimit_lowered() {\n        // because ulimit and batch size are same size, batch size is lowered\n        // to ULIMIT - 100\n        let opts = Opts {\n            batch_size: 50_000,\n            ..Default::default()\n        };\n        let batch_size = infer_batch_size(&opts, 5_000);\n\n        assert!(batch_size == 4_900);\n    }\n    #[test]\n    #[cfg(unix)]\n    fn batch_size_adjusted_2000() {\n        // ulimit == batch_size\n        let opts = Opts {\n            batch_size: 50_000,\n            ulimit: Some(2_000),\n            ..Default::default()\n        };\n        let batch_size = adjust_ulimit_size(&opts);\n\n        assert!(batch_size == 2_000);\n    }\n\n    #[test]\n    #[cfg(unix)]\n    fn test_high_ulimit_no_greppable_mode() {\n        let opts = Opts {\n            batch_size: 10,\n            greppable: false,\n            ..Default::default()\n        };\n\n        let batch_size = infer_batch_size(&opts, 1_000_000);\n\n        assert!(batch_size == opts.batch_size);\n    }\n\n    #[test]\n    fn test_print_opening_no_panic() {\n        let opts = Opts {\n            ulimit: Some(2_000),\n            ..Default::default()\n        };\n        // print opening should not panic\n        print_opening(&opts);\n    }\n}\n"
  },
  {
    "path": "src/port_strategy/mod.rs",
    "content": "//! Provides a means to hold configuration options specifically for port scanning.\nmod range_iterator;\nuse crate::input::{PortRange, ScanOrder};\nuse rand::rng;\nuse rand::seq::SliceRandom;\nuse range_iterator::RangeIterator;\n\n/// Represents options of port scanning.\n///\n/// Right now all these options involve ranges, but in the future\n/// it will also contain custom lists of ports.\n#[derive(Debug)]\npub enum PortStrategy {\n    Manual(Vec<u16>),\n    Serial(SerialRange),\n    Random(RandomRange),\n}\n\nimpl PortStrategy {\n    pub fn pick(range: &Option<PortRange>, ports: Option<Vec<u16>>, order: ScanOrder) -> Self {\n        match order {\n            ScanOrder::Serial if ports.is_none() => {\n                let range = range.as_ref().unwrap();\n                PortStrategy::Serial(SerialRange {\n                    start: range.start,\n                    end: range.end,\n                })\n            }\n            ScanOrder::Random if ports.is_none() => {\n                let range = range.as_ref().unwrap();\n                PortStrategy::Random(RandomRange {\n                    start: range.start,\n                    end: range.end,\n                })\n            }\n            ScanOrder::Serial => PortStrategy::Manual(ports.unwrap()),\n            ScanOrder::Random => {\n                let mut rng = rng();\n                let mut ports = ports.unwrap();\n                ports.shuffle(&mut rng);\n                PortStrategy::Manual(ports)\n            }\n        }\n    }\n\n    pub fn order(&self) -> Vec<u16> {\n        match self {\n            PortStrategy::Manual(ports) => ports.clone(),\n            PortStrategy::Serial(range) => range.generate(),\n            PortStrategy::Random(range) => range.generate(),\n        }\n    }\n}\n\n/// Trait associated with a port strategy. Each PortStrategy must be able\n/// to generate an order for future port scanning.\ntrait RangeOrder {\n    fn generate(&self) -> Vec<u16>;\n}\n\n/// As the name implies SerialRange will always generate a vector in\n/// ascending order.\n#[derive(Debug)]\npub struct SerialRange {\n    start: u16,\n    end: u16,\n}\n\nimpl RangeOrder for SerialRange {\n    fn generate(&self) -> Vec<u16> {\n        (self.start..=self.end).collect()\n    }\n}\n\n/// As the name implies RandomRange will always generate a vector with\n/// a random order. This vector is built following the LCG algorithm.\n#[derive(Debug)]\npub struct RandomRange {\n    start: u16,\n    end: u16,\n}\n\nimpl RangeOrder for RandomRange {\n    // Right now using RangeIterator and generating a range + shuffling the\n    // vector is pretty much the same. The advantages of it will come once\n    // we have to generate different ranges for different IPs without storing\n    // actual vectors.\n    //\n    // Another benefit of RangeIterator is that it always generate a range with\n    // a certain distance between the items in the Array. The chances of having\n    // port numbers close to each other are pretty slim due to the way the\n    // algorithm works.\n    fn generate(&self) -> Vec<u16> {\n        RangeIterator::new(self.start.into(), self.end.into()).collect()\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use super::PortStrategy;\n    use crate::input::{PortRange, ScanOrder};\n\n    #[test]\n    fn serial_strategy_with_range() {\n        let range = PortRange { start: 1, end: 100 };\n        let strategy = PortStrategy::pick(&Some(range), None, ScanOrder::Serial);\n        let result = strategy.order();\n        let expected_range = (1..=100).collect::<Vec<u16>>();\n        assert_eq!(expected_range, result);\n    }\n    #[test]\n    fn random_strategy_with_range() {\n        let range = PortRange { start: 1, end: 100 };\n        let strategy = PortStrategy::pick(&Some(range), None, ScanOrder::Random);\n        let mut result = strategy.order();\n        let expected_range = (1..=100).collect::<Vec<u16>>();\n        assert_ne!(expected_range, result);\n\n        result.sort_unstable();\n        assert_eq!(expected_range, result);\n    }\n\n    #[test]\n    fn serial_strategy_with_ports() {\n        let strategy = PortStrategy::pick(&None, Some(vec![80, 443]), ScanOrder::Serial);\n        let result = strategy.order();\n        assert_eq!(vec![80, 443], result);\n    }\n\n    #[test]\n    fn random_strategy_with_ports() {\n        let strategy = PortStrategy::pick(&None, Some((1..10).collect()), ScanOrder::Random);\n        let mut result = strategy.order();\n        let expected_range = (1..10).collect::<Vec<u16>>();\n        assert_ne!(expected_range, result);\n\n        result.sort_unstable();\n        assert_eq!(expected_range, result);\n    }\n}\n"
  },
  {
    "path": "src/port_strategy/range_iterator.rs",
    "content": "use gcd::Gcd;\nuse rand::RngExt;\nuse std::convert::TryInto;\n\npub struct RangeIterator {\n    active: bool,\n    normalized_end: u32,\n    normalized_first_pick: u32,\n    normalized_pick: u32,\n    actual_start: u32,\n    step: u32,\n}\n\n/// An iterator that follows the `Linear Congruential Generator` algorithm.\n///\n/// For more information: <https://en.wikipedia.org/wiki/Linear_congruential_generator>\nimpl RangeIterator {\n    /// Receives the start and end of a range and normalize\n    /// these values before selecting a coprime for the end of the range\n    /// which will server as the step for the algorithm.\n    ///\n    /// For example, the range `1000-2500` will be normalized to `0-1500`\n    /// before going through the algorithm.\n    pub fn new(start: u32, end: u32) -> Self {\n        let normalized_end = end - start + 1;\n        let step = pick_random_coprime(normalized_end);\n\n        // Randomly choose a number within the range to be the first\n        // and assign it as a pick.\n        let mut rng = rand::rng();\n        let normalized_first_pick = rng.random_range(0..normalized_end);\n\n        Self {\n            active: true,\n            normalized_end,\n            step,\n            normalized_first_pick,\n            normalized_pick: normalized_first_pick,\n            actual_start: start,\n        }\n    }\n}\n\nimpl Iterator for RangeIterator {\n    type Item = u16;\n\n    // The next step is always bound by the formula: N+1 = (N + STEP) % TOP_OF_THE_RANGE\n    // It will only stop once we generate a number equal to the first generated number.\n    fn next(&mut self) -> Option<Self::Item> {\n        if !self.active {\n            return None;\n        }\n\n        let current_pick = self.normalized_pick;\n        let next_pick = (current_pick + self.step) % self.normalized_end;\n\n        // If the next pick is equal to the first pick this means that\n        // we have iterated through the entire range.\n        if next_pick == self.normalized_first_pick {\n            self.active = false;\n        }\n\n        self.normalized_pick = next_pick;\n        Some(\n            (self.actual_start + current_pick)\n                .try_into()\n                .expect(\"Could not convert u32 to u16\"),\n        )\n    }\n}\n\n/// The probability that two random integers are coprime to one another\n/// works out to be around 61%, given that we can safely pick a random\n/// number and test it. Just in case we are having a bad day and we cannot\n/// pick a coprime number after 10 tries we just return \"end - 1\" which\n/// is guaranteed to be a coprime, but won't provide ideal randomization.\n///\n/// We pick between \"lower_range\" and \"upper_range\" since values too close to\n/// the boundaries, which in these case are the \"start\" and \"end\" arguments\n/// would also provide non-ideal randomization as discussed on the paragraph\n/// above.\nfn pick_random_coprime(end: u32) -> u32 {\n    let range_boundary = end / 4;\n    let lower_range = range_boundary;\n    let upper_range = end - range_boundary;\n    let mut rng = rand::rng();\n    let mut candidate = rng.random_range(lower_range..upper_range);\n\n    for _ in 0..10 {\n        if end.gcd(candidate) == 1 {\n            return candidate;\n        }\n        candidate = rng.random_range(lower_range..upper_range);\n    }\n\n    end - 1\n}\n\n#[cfg(test)]\nmod tests {\n    use super::RangeIterator;\n\n    #[test]\n    fn range_iterator_iterates_through_the_entire_range() {\n        let result = generate_sorted_range(1, 10);\n        let expected_range = (1..=10).collect::<Vec<u16>>();\n        assert_eq!(expected_range, result);\n\n        let result = generate_sorted_range(1, 100);\n        let expected_range = (1..=100).collect::<Vec<u16>>();\n        assert_eq!(expected_range, result);\n\n        let result = generate_sorted_range(1, 1000);\n        let expected_range = (1..=1000).collect::<Vec<u16>>();\n        assert_eq!(expected_range, result);\n\n        let result = generate_sorted_range(1, 65_535);\n        let expected_range = (1..=65_535).collect::<Vec<u16>>();\n        assert_eq!(expected_range, result);\n\n        let result = generate_sorted_range(1000, 2000);\n        let expected_range = (1000..=2000).collect::<Vec<u16>>();\n        assert_eq!(expected_range, result);\n    }\n\n    fn generate_sorted_range(start: u32, end: u32) -> Vec<u16> {\n        let range = RangeIterator::new(start, end);\n        let mut result = range.into_iter().collect::<Vec<u16>>();\n        result.sort_unstable();\n\n        result\n    }\n}\n"
  },
  {
    "path": "src/scanner/mod.rs",
    "content": "//! Core functionality for actual scanning behaviour.\nuse crate::generated::get_parsed_data;\nuse crate::port_strategy::PortStrategy;\nuse log::debug;\n\nmod socket_iterator;\nuse socket_iterator::SocketIterator;\n\nuse async_std::net::TcpStream;\nuse async_std::prelude::*;\nuse async_std::{io, net::UdpSocket};\nuse colored::Colorize;\nuse futures::stream::FuturesUnordered;\nuse std::collections::BTreeMap;\nuse std::{\n    collections::HashSet,\n    net::{IpAddr, Shutdown, SocketAddr},\n    num::NonZeroU8,\n    time::Duration,\n};\n\n/// The class for the scanner\n/// IP is data type IpAddr and is the IP address\n/// start & end is where the port scan starts and ends\n/// batch_size is how many ports at a time should be scanned\n/// Timeout is the time RustScan should wait before declaring a port closed. As datatype Duration.\n/// greppable is whether or not RustScan should print things, or wait until the end to print only the ip and open ports.\n#[cfg(not(tarpaulin_include))]\n#[derive(Debug)]\npub struct Scanner {\n    ips: Vec<IpAddr>,\n    batch_size: usize,\n    timeout: Duration,\n    tries: NonZeroU8,\n    greppable: bool,\n    port_strategy: PortStrategy,\n    accessible: bool,\n    exclude_ports: Vec<u16>,\n    udp: bool,\n}\n\n// Allowing too many arguments for clippy.\n#[allow(clippy::too_many_arguments)]\nimpl Scanner {\n    pub fn new(\n        ips: &[IpAddr],\n        batch_size: usize,\n        timeout: Duration,\n        tries: u8,\n        greppable: bool,\n        port_strategy: PortStrategy,\n        accessible: bool,\n        exclude_ports: Vec<u16>,\n        udp: bool,\n    ) -> Self {\n        Self {\n            batch_size,\n            timeout,\n            tries: NonZeroU8::new(std::cmp::max(tries, 1)).unwrap(),\n            greppable,\n            port_strategy,\n            ips: ips.iter().map(ToOwned::to_owned).collect(),\n            accessible,\n            exclude_ports,\n            udp,\n        }\n    }\n\n    /// Runs scan_range with chunk sizes\n    /// If you want to run RustScan normally, this is the entry point used\n    /// Returns all open ports as `Vec<u16>`\n    pub async fn run(&self) -> Vec<SocketAddr> {\n        let ports: Vec<u16> = self\n            .port_strategy\n            .order()\n            .iter()\n            .filter(|&port| !self.exclude_ports.contains(port))\n            .copied()\n            .collect();\n        let mut socket_iterator: SocketIterator = SocketIterator::new(&self.ips, &ports);\n        let mut open_sockets: Vec<SocketAddr> = Vec::new();\n        let mut ftrs = FuturesUnordered::new();\n        let mut errors: HashSet<String> = HashSet::new();\n        let udp_map = get_parsed_data();\n\n        for _ in 0..self.batch_size {\n            if let Some(socket) = socket_iterator.next() {\n                ftrs.push(self.scan_socket(socket, udp_map.clone()));\n            } else {\n                break;\n            }\n        }\n\n        debug!(\"Start scanning sockets. \\nBatch size {}\\nNumber of ip-s {}\\nNumber of ports {}\\nTargets all together {} \",\n            self.batch_size,\n            self.ips.len(),\n            &ports.len(),\n            (self.ips.len() * ports.len()));\n\n        while let Some(result) = ftrs.next().await {\n            if let Some(socket) = socket_iterator.next() {\n                ftrs.push(self.scan_socket(socket, udp_map.clone()));\n            }\n\n            match result {\n                Ok(socket) => open_sockets.push(socket),\n                Err(e) => {\n                    let error_string = e.to_string();\n                    if errors.len() < self.ips.len() * 1000 {\n                        errors.insert(error_string);\n                    }\n                }\n            }\n        }\n        debug!(\"Typical socket connection errors {errors:?}\");\n        debug!(\"Open Sockets found: {:?}\", &open_sockets);\n        open_sockets\n    }\n\n    /// Given a socket, scan it self.tries times.\n    /// Turns the address into a SocketAddr\n    /// Deals with the `<result>` type\n    /// If it experiences error ErrorKind::Other then too many files are open and it Panics!\n    /// Else any other error, it returns the error in Result as a string\n    /// If no errors occur, it returns the port number in Result to signify the port is open.\n    /// This function mainly deals with the logic of Results handling.\n    /// # Example\n    ///\n    /// ```compile_fail\n    /// scanner.scan_socket(socket)\n    /// ```\n    ///\n    /// Note: `self` must contain `self.ip`.\n    async fn scan_socket(\n        &self,\n        socket: SocketAddr,\n        udp_map: BTreeMap<Vec<u16>, Vec<u8>>,\n    ) -> io::Result<SocketAddr> {\n        if self.udp {\n            return self.scan_udp_socket(socket, udp_map).await;\n        }\n\n        let tries = self.tries.get();\n        for nr_try in 1..=tries {\n            match self.connect(socket).await {\n                Ok(tcp_stream) => {\n                    debug!(\n                        \"Connection was successful, shutting down stream {}\",\n                        &socket\n                    );\n                    if let Err(e) = tcp_stream.shutdown(Shutdown::Both) {\n                        debug!(\"Shutdown stream error {}\", &e);\n                    }\n                    self.fmt_ports(socket);\n\n                    debug!(\"Return Ok after {nr_try} tries\");\n                    return Ok(socket);\n                }\n                Err(e) => {\n                    let mut error_string = e.to_string();\n\n                    assert!(!error_string.to_lowercase().contains(\"too many open files\"), \"Too many open files. Please reduce batch size. The default is 5000. Try -b 2500.\");\n\n                    if nr_try == tries {\n                        error_string.push(' ');\n                        error_string.push_str(&socket.ip().to_string());\n                        return Err(io::Error::other(error_string));\n                    }\n                }\n            };\n        }\n        unreachable!();\n    }\n\n    async fn scan_udp_socket(\n        &self,\n        socket: SocketAddr,\n        udp_map: BTreeMap<Vec<u16>, Vec<u8>>,\n    ) -> io::Result<SocketAddr> {\n        let mut payload: Vec<u8> = Vec::new();\n        for (key, value) in udp_map {\n            if key.contains(&socket.port()) {\n                payload = value;\n            }\n        }\n\n        let tries = self.tries.get();\n        for _ in 1..=tries {\n            match self.udp_scan(socket, &payload, self.timeout).await {\n                Ok(true) => return Ok(socket),\n                Ok(false) => continue,\n                Err(e) => return Err(e),\n            }\n        }\n\n        Err(io::Error::other(format!(\n            \"UDP scan timed-out for all tries on socket {socket}\"\n        )))\n    }\n\n    /// Performs the connection to the socket with timeout\n    /// # Example\n    ///\n    /// ```compile_fail\n    /// # use std::net::{IpAddr, Ipv6Addr, SocketAddr};\n    /// let port: u16 = 80;\n    /// // ip is an IpAddr type\n    /// let ip = IpAddr::V6(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1));\n    /// let socket = SocketAddr::new(ip, port);\n    /// scanner.connect(socket);\n    /// // returns Result which is either Ok(stream) for port is open, or Er for port is closed.\n    /// // Timeout occurs after self.timeout seconds\n    /// ```\n    ///\n    async fn connect(&self, socket: SocketAddr) -> io::Result<TcpStream> {\n        let stream = io::timeout(\n            self.timeout,\n            async move { TcpStream::connect(socket).await },\n        )\n        .await?;\n        Ok(stream)\n    }\n\n    /// Binds to a UDP socket so we can send and receive packets\n    /// # Example\n    ///\n    /// ```compile_fail\n    /// # use std::net::{IpAddr, Ipv6Addr, SocketAddr};\n    /// let port: u16 = 80;\n    /// // ip is an IpAddr type\n    /// let ip = IpAddr::V6(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1));\n    /// let socket = SocketAddr::new(ip, port);\n    /// scanner.udp_bind(socket);\n    /// // returns Result which is either Ok(stream) for port is open, or Err for port is closed.\n    /// // Timeout occurs after self.timeout seconds\n    /// ```\n    ///\n    async fn udp_bind(&self, socket: SocketAddr) -> io::Result<UdpSocket> {\n        let local_addr = match socket {\n            SocketAddr::V4(_) => \"0.0.0.0:0\".parse::<SocketAddr>().unwrap(),\n            SocketAddr::V6(_) => \"[::]:0\".parse::<SocketAddr>().unwrap(),\n        };\n\n        UdpSocket::bind(local_addr).await\n    }\n\n    /// Performs a UDP scan on the specified socket with a payload and wait duration\n    /// # Example\n    ///\n    /// ```compile_fail\n    /// # use std::net::{IpAddr, Ipv6Addr, SocketAddr};\n    /// # use std::time::Duration;\n    /// let port: u16 = 123;\n    /// // ip is an IpAddr type\n    /// let ip = IpAddr::V6(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1));\n    /// let socket = SocketAddr::new(ip, port);\n    /// let payload = vec![0, 1, 2, 3];\n    /// let wait = Duration::from_secs(1);\n    /// let result = scanner.udp_scan(socket, payload, wait).await;\n    /// // returns Result which is either Ok(true) if response received, or Ok(false) if timed out.\n    /// // Err is returned for other I/O errors.\n    async fn udp_scan(\n        &self,\n        socket: SocketAddr,\n        payload: &[u8],\n        wait: Duration,\n    ) -> io::Result<bool> {\n        match self.udp_bind(socket).await {\n            Ok(udp_socket) => {\n                let mut buf = [0u8; 1024];\n\n                udp_socket.connect(socket).await?;\n                udp_socket.send(payload).await?;\n\n                match io::timeout(wait, udp_socket.recv(&mut buf)).await {\n                    Ok(size) => {\n                        debug!(\"Received {size} bytes\");\n                        self.fmt_ports(socket);\n                        Ok(true)\n                    }\n                    Err(e) => {\n                        if e.kind() == io::ErrorKind::TimedOut {\n                            Ok(false)\n                        } else {\n                            Err(e)\n                        }\n                    }\n                }\n            }\n            Err(e) => {\n                println!(\"Err E binding sock {e:?}\");\n                Err(e)\n            }\n        }\n    }\n\n    /// Formats and prints the port status\n    fn fmt_ports(&self, socket: SocketAddr) {\n        if !self.greppable {\n            if self.accessible {\n                println!(\"Open {socket}\");\n            } else {\n                println!(\"Open {}\", socket.to_string().purple());\n            }\n        }\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n    use crate::input::{PortRange, ScanOrder};\n    use async_std::task::block_on;\n    use std::{net::IpAddr, time::Duration};\n\n    #[test]\n    fn scanner_runs() {\n        // Makes sure the program still runs and doesn't panic\n        let addrs = vec![\"127.0.0.1\".parse::<IpAddr>().unwrap()];\n        let range = PortRange {\n            start: 1,\n            end: 1_000,\n        };\n        let strategy = PortStrategy::pick(&Some(range), None, ScanOrder::Random);\n        let scanner = Scanner::new(\n            &addrs,\n            10,\n            Duration::from_millis(100),\n            1,\n            true,\n            strategy,\n            true,\n            vec![9000],\n            false,\n        );\n        block_on(scanner.run());\n        // if the scan fails, it wouldn't be able to assert_eq! as it panicked!\n        assert_eq!(1, 1);\n    }\n    #[test]\n    fn ipv6_scanner_runs() {\n        // Makes sure the program still runs and doesn't panic\n        let addrs = vec![\"::1\".parse::<IpAddr>().unwrap()];\n        let range = PortRange {\n            start: 1,\n            end: 1_000,\n        };\n        let strategy = PortStrategy::pick(&Some(range), None, ScanOrder::Random);\n        let scanner = Scanner::new(\n            &addrs,\n            10,\n            Duration::from_millis(100),\n            1,\n            true,\n            strategy,\n            true,\n            vec![9000],\n            false,\n        );\n        block_on(scanner.run());\n        // if the scan fails, it wouldn't be able to assert_eq! as it panicked!\n        assert_eq!(1, 1);\n    }\n    #[test]\n    fn quad_zero_scanner_runs() {\n        let addrs = vec![\"0.0.0.0\".parse::<IpAddr>().unwrap()];\n        let range = PortRange {\n            start: 1,\n            end: 1_000,\n        };\n        let strategy = PortStrategy::pick(&Some(range), None, ScanOrder::Random);\n        let scanner = Scanner::new(\n            &addrs,\n            10,\n            Duration::from_millis(100),\n            1,\n            true,\n            strategy,\n            true,\n            vec![9000],\n            false,\n        );\n        block_on(scanner.run());\n        assert_eq!(1, 1);\n    }\n    #[test]\n    fn google_dns_runs() {\n        let addrs = vec![\"8.8.8.8\".parse::<IpAddr>().unwrap()];\n        let range = PortRange {\n            start: 400,\n            end: 445,\n        };\n        let strategy = PortStrategy::pick(&Some(range), None, ScanOrder::Random);\n        let scanner = Scanner::new(\n            &addrs,\n            10,\n            Duration::from_millis(100),\n            1,\n            true,\n            strategy,\n            true,\n            vec![9000],\n            false,\n        );\n        block_on(scanner.run());\n        assert_eq!(1, 1);\n    }\n    #[test]\n    fn infer_ulimit_lowering_no_panic() {\n        // Test behaviour on MacOS where ulimit is not automatically lowered\n        let addrs = vec![\"8.8.8.8\".parse::<IpAddr>().unwrap()];\n\n        // mac should have this automatically scaled down\n        let range = PortRange {\n            start: 400,\n            end: 600,\n        };\n        let strategy = PortStrategy::pick(&Some(range), None, ScanOrder::Random);\n        let scanner = Scanner::new(\n            &addrs,\n            10,\n            Duration::from_millis(100),\n            1,\n            true,\n            strategy,\n            true,\n            vec![9000],\n            false,\n        );\n        block_on(scanner.run());\n        assert_eq!(1, 1);\n    }\n\n    #[test]\n    fn udp_scan_runs() {\n        // Makes sure the program still runs and doesn't panic\n        let addrs = vec![\"127.0.0.1\".parse::<IpAddr>().unwrap()];\n        let range = PortRange {\n            start: 1,\n            end: 1_000,\n        };\n        let strategy = PortStrategy::pick(&Some(range), None, ScanOrder::Random);\n        let scanner = Scanner::new(\n            &addrs,\n            10,\n            Duration::from_millis(100),\n            1,\n            true,\n            strategy,\n            true,\n            vec![9000],\n            true,\n        );\n        block_on(scanner.run());\n        // if the scan fails, it wouldn't be able to assert_eq! as it panicked!\n        assert_eq!(1, 1);\n    }\n    #[test]\n    fn udp_ipv6_runs() {\n        // Makes sure the program still runs and doesn't panic\n        let addrs = vec![\"::1\".parse::<IpAddr>().unwrap()];\n        let range = PortRange {\n            start: 1,\n            end: 1_000,\n        };\n        let strategy = PortStrategy::pick(&Some(range), None, ScanOrder::Random);\n        let scanner = Scanner::new(\n            &addrs,\n            10,\n            Duration::from_millis(100),\n            1,\n            true,\n            strategy,\n            true,\n            vec![9000],\n            true,\n        );\n        block_on(scanner.run());\n        // if the scan fails, it wouldn't be able to assert_eq! as it panicked!\n        assert_eq!(1, 1);\n    }\n    #[test]\n    fn udp_quad_zero_scanner_runs() {\n        let addrs = vec![\"0.0.0.0\".parse::<IpAddr>().unwrap()];\n        let range = PortRange {\n            start: 1,\n            end: 1_000,\n        };\n        let strategy = PortStrategy::pick(&Some(range), None, ScanOrder::Random);\n        let scanner = Scanner::new(\n            &addrs,\n            10,\n            Duration::from_millis(100),\n            1,\n            true,\n            strategy,\n            true,\n            vec![9000],\n            true,\n        );\n        block_on(scanner.run());\n        assert_eq!(1, 1);\n    }\n    #[test]\n    fn udp_google_dns_runs() {\n        let addrs = vec![\"8.8.8.8\".parse::<IpAddr>().unwrap()];\n        let range = PortRange {\n            start: 100,\n            end: 150,\n        };\n        let strategy = PortStrategy::pick(&Some(range), None, ScanOrder::Random);\n        let scanner = Scanner::new(\n            &addrs,\n            10,\n            Duration::from_millis(100),\n            1,\n            true,\n            strategy,\n            true,\n            vec![9000],\n            true,\n        );\n        block_on(scanner.run());\n        assert_eq!(1, 1);\n    }\n}\n"
  },
  {
    "path": "src/scanner/socket_iterator.rs",
    "content": "use itertools::{iproduct, Product};\nuse std::net::{IpAddr, SocketAddr};\n\npub struct SocketIterator<'s> {\n    // product_it is a cartesian product iterator over\n    // the slices of ports and IP addresses.\n    //\n    // The IP/port order is intentionally reversed here since we want\n    // the itertools::iproduct! macro below to generate the pairs with\n    // all the IPs for one port before moving on to the next one\n    // (\"hold the port, go through all the IPs, then advance the port...\").\n    // See also the comments in the iterator implementation for an example.\n    product_it:\n        Product<Box<std::slice::Iter<'s, u16>>, Box<std::slice::Iter<'s, std::net::IpAddr>>>,\n}\n\n/// An iterator that receives a slice of IPs and ports and returns a Socket\n/// for each IP and port pair until all of these combinations are exhausted.\n/// The goal of this iterator is to go over every IP and port combination\n/// without generating a big memory footprint. The alternative would be\n/// generating a vector containing all these combinations.\nimpl<'s> SocketIterator<'s> {\n    pub fn new(ips: &'s [IpAddr], ports: &'s [u16]) -> Self {\n        let ports_it = Box::new(ports.iter());\n        let ips_it = Box::new(ips.iter());\n        Self {\n            product_it: iproduct!(ports_it, ips_it),\n        }\n    }\n}\n\n#[allow(clippy::doc_link_with_quotes)]\nimpl Iterator for SocketIterator<'_> {\n    type Item = SocketAddr;\n\n    /// Returns a socket based on the combination of one of the provided\n    /// IPs and ports or None when these combinations are exhausted. Every\n    /// IP will have the same port until a port is incremented.\n    ///\n    /// let it = SocketIterator::new(&[\"127.0.0.1\", \"192.168.0.1\"], &[80, 443]);\n    /// it.next(); // 127.0.0.1:80\n    /// it.next(); // 192.168.0.1:80\n    /// it.next(); // 127.0.0.1:443\n    /// it.next(); // 192.168.0.1:443\n    /// it.next(); // None\n    fn next(&mut self) -> Option<Self::Item> {\n        self.product_it\n            .next()\n            .map(|(port, ip)| SocketAddr::new(*ip, *port))\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use super::SocketIterator;\n    use std::net::{IpAddr, SocketAddr};\n\n    #[test]\n    fn goes_through_every_ip_port_combination() {\n        let addrs = vec![\n            \"127.0.0.1\".parse::<IpAddr>().unwrap(),\n            \"192.168.0.1\".parse::<IpAddr>().unwrap(),\n        ];\n        let ports: Vec<u16> = vec![22, 80, 443];\n        let mut it = SocketIterator::new(&addrs, &ports);\n\n        assert_eq!(Some(SocketAddr::new(addrs[0], ports[0])), it.next());\n        assert_eq!(Some(SocketAddr::new(addrs[1], ports[0])), it.next());\n        assert_eq!(Some(SocketAddr::new(addrs[0], ports[1])), it.next());\n        assert_eq!(Some(SocketAddr::new(addrs[1], ports[1])), it.next());\n        assert_eq!(Some(SocketAddr::new(addrs[0], ports[2])), it.next());\n        assert_eq!(Some(SocketAddr::new(addrs[1], ports[2])), it.next());\n        assert_eq!(None, it.next());\n    }\n}\n"
  },
  {
    "path": "src/scripts/mod.rs",
    "content": "//! Scripting Engine to run scripts based on tags.\n//!\n//! This module serves to filter and run the scripts selected by the user.\n//!\n//! A new commandline and configuration file option was added.\n//!\n//! ## `--scripts`\n//!\n//! ### `default`\n//!\n//! This is the default behavior, like as it was from the beginning of RustScan.\n//!\n//! The user do not have to chose anything for this. This is the only script\n//! embedded in RustScan running as default.\n//!\n//! ### `none`\n//!\n//! The user have to use the `--scripts none` commandline argument or `scripts =\n//! \"none\"` in the config file.\n//!\n//! None of the scripts will run, this replaces the removed `--no-nmap` option.\n//!\n//! ### `custom`\n//!\n//! The user have to use the `--scripts custom` commandline argument or\n//! `scripts = \"custom\"` in the config file.\n//!\n//! RustScan will look for the script configuration file in the user's home\n//! dir: `home_dir/.rustscan_scripts.toml`\n//!\n//! The config file have 3 optional fields: `tag`, `developer` and `port`. Just\n//! the `tag` field will be used forther in the process.\n//!\n//! RustScan will also look for available scripts in the user's home dir:\n//! `home_dir/.rustscan_scripts` and will try to read all the files, and parse\n//! them into a vector of [`ScriptFile`].\n//!\n//! Filtering on tags means the tags found in the `rustscan_scripts.toml` file\n//! will also have to be present in the [`ScriptFile`], otherwise the script\n//! will not be selected.\n//!\n//! All of the `rustscan_script.toml` tags have to be present at minimum in a\n//! [`ScriptFile`] to get selected, but can be also more.\n//!\n//! Config file example:\n//!\n//! - `fixtures/test_rustscan_scripts.toml`\n//!\n//! Script file examples:\n//!\n//! - `fixtures/test_script.py`\n//! - `fixtures/test_script.pl`\n//! - `fixtures/test_script.sh`\n//! - `fixtures/test_script.txt`\n//!\n//! `call_format` in script files can be of 2 variants:\n//!\n//! One is where all of the possible tags `{{script}}`, `{{ip}}` and `{{port}}`\n//! are there.\n//!\n//! - The `{{script}}` part will be replaced with the scriptfile full path\n//!   gathered while parsing available scripts.\n//! - The `{{ip}}` part will be replaced with the ip we got from the scan.\n//! - The `{{port}}` part will be reaplced with the ports separated with the\n//!   `ports_separator` found in the script file\n//!\n//! And when there is only `{{ip}}` and `{{port}}` is in the format, only those\n//! will be replaced with the arguments from the scan.\n//!\n//! This makes it easy to run a system installed command like `nmap`, and give\n//! any kind of arguments to it.\n//!\n//! If the format is different, the script will be silently discarded and will\n//! not run. With the `Debug` option it's possible to see where it goes wrong.\n\n#![allow(clippy::module_name_repetitions)]\n\nuse crate::input::ScriptsRequired;\nuse anyhow::{anyhow, Result};\nuse log::debug;\nuse serde_derive::{Deserialize, Serialize};\nuse std::fs::{self, File};\nuse std::io::{self, prelude::*};\nuse std::net::IpAddr;\nuse std::path::PathBuf;\nuse std::process::{Command, Stdio};\nuse std::string::ToString;\nuse text_placeholder::Template;\n\n#[cfg(unix)]\nuse std::os::unix::process::ExitStatusExt;\n\nstatic DEFAULT: &str = r#\"tags = [\"core_approved\", \"RustScan\", \"default\"]\ndeveloper = [ \"RustScan\", \"https://github.com/RustScan\" ]\nports_separator = \",\"\ncall_format = \"nmap -vvv -p {{port}} -{{ipversion}} {{ip}}\"\n\"#;\n\n#[cfg(not(tarpaulin_include))]\npub fn init_scripts(scripts: &ScriptsRequired) -> Result<Vec<ScriptFile>> {\n    let mut scripts_to_run: Vec<ScriptFile> = Vec::new();\n\n    match scripts {\n        ScriptsRequired::None => {}\n        ScriptsRequired::Default => {\n            let default_script =\n                toml::from_str::<ScriptFile>(DEFAULT).expect(\"Failed to parse Script file.\");\n            scripts_to_run.push(default_script);\n        }\n        ScriptsRequired::Custom => {\n            let script_config = ScriptConfig::read_config()?;\n            debug!(\"Script config \\n{script_config:?}\");\n\n            let script_dir_base = if let Some(config_directory) = &script_config.directory {\n                PathBuf::from(config_directory)\n            } else {\n                dirs::home_dir().ok_or_else(|| anyhow!(\"Could not infer scripts path.\"))?\n            };\n\n            let script_paths = find_scripts(script_dir_base)?;\n            debug!(\"Scripts paths \\n{script_paths:?}\");\n\n            let parsed_scripts = parse_scripts(script_paths);\n            debug!(\"Scripts parsed \\n{parsed_scripts:?}\");\n\n            // Only Scripts that contain all the tags found in ScriptConfig will be selected.\n            if let Some(config_hashset) = script_config.tags {\n                for script in parsed_scripts {\n                    if let Some(script_hashset) = &script.tags {\n                        if script_hashset\n                            .iter()\n                            .all(|tag| config_hashset.contains(tag))\n                        {\n                            scripts_to_run.push(script);\n                        } else {\n                            debug!(\n                                \"\\nScript tags does not match config tags {:?} {}\",\n                                &script_hashset,\n                                script.path.unwrap().display()\n                            );\n                        }\n                    }\n                }\n            }\n            debug!(\"\\nScript(s) to run {scripts_to_run:?}\");\n        }\n    }\n\n    Ok(scripts_to_run)\n}\n\npub fn parse_scripts(scripts: Vec<PathBuf>) -> Vec<ScriptFile> {\n    let mut parsed_scripts: Vec<ScriptFile> = Vec::with_capacity(scripts.len());\n    for script in scripts {\n        debug!(\"Parsing script {}\", &script.display());\n        if let Some(script_file) = ScriptFile::new(script) {\n            parsed_scripts.push(script_file);\n        }\n    }\n    parsed_scripts\n}\n\n#[derive(Clone, Debug)]\n#[allow(dead_code)]\npub struct Script {\n    // Path to the script itself.\n    path: Option<PathBuf>,\n\n    // Ip got from scanner.\n    ip: IpAddr,\n\n    // Ports found with portscan.\n    open_ports: Vec<u16>,\n\n    // Port found in ScriptFile, if defined only this will run with the ip.\n    trigger_port: Option<String>,\n\n    // Character to join ports in case we want to use a string format of them, for example nmap -p.\n    ports_separator: Option<String>,\n\n    // Tags found in ScriptFile.\n    tags: Option<Vec<String>>,\n\n    // The format how we want the script to run.\n    call_format: Option<String>,\n}\n\n#[derive(Serialize)]\nstruct ExecPartsScript {\n    script: String,\n    ip: String,\n    port: String,\n    ipversion: String,\n}\n\n#[derive(Serialize)]\nstruct ExecParts {\n    ip: String,\n    port: String,\n    ipversion: String,\n}\n\nimpl Script {\n    pub fn build(\n        path: Option<PathBuf>,\n        ip: IpAddr,\n        open_ports: Vec<u16>,\n        trigger_port: Option<String>,\n        ports_separator: Option<String>,\n        tags: Option<Vec<String>>,\n        call_format: Option<String>,\n    ) -> Self {\n        Self {\n            path,\n            ip,\n            open_ports,\n            trigger_port,\n            ports_separator,\n            tags,\n            call_format,\n        }\n    }\n\n    // Some variables get changed before read, and compiler throws warning on warn(unused_assignments)\n    #[allow(unused_assignments)]\n    pub fn run(self) -> Result<String> {\n        debug!(\"run self {:?}\", &self);\n\n        let separator = self.ports_separator.unwrap_or_else(|| \",\".into());\n\n        let mut ports_str = self\n            .open_ports\n            .iter()\n            .map(ToString::to_string)\n            .collect::<Vec<String>>()\n            .join(&separator);\n        if let Some(port) = self.trigger_port {\n            ports_str = port;\n        }\n\n        let mut final_call_format = String::new();\n        if let Some(call_format) = self.call_format {\n            final_call_format = call_format;\n        } else {\n            return Err(anyhow!(\"Failed to parse execution format.\"));\n        }\n        let default_template: Template = Template::new(&final_call_format);\n        let mut to_run = String::new();\n\n        if final_call_format.contains(\"{{script}}\") {\n            let exec_parts_script: ExecPartsScript = ExecPartsScript {\n                script: self.path.unwrap().to_str().unwrap().to_string(),\n                ip: self.ip.to_string(),\n                port: ports_str,\n                ipversion: match &self.ip {\n                    IpAddr::V4(_) => String::from(\"4\"),\n                    IpAddr::V6(_) => String::from(\"6\"),\n                },\n            };\n            to_run = default_template.fill_with_struct(&exec_parts_script)?;\n        } else {\n            let exec_parts: ExecParts = ExecParts {\n                ip: self.ip.to_string(),\n                port: ports_str,\n                ipversion: match &self.ip {\n                    IpAddr::V4(_) => String::from(\"4\"),\n                    IpAddr::V6(_) => String::from(\"6\"),\n                },\n            };\n            to_run = default_template.fill_with_struct(&exec_parts)?;\n        }\n        debug!(\"\\nScript format to run {to_run}\");\n        execute_script(&to_run)\n    }\n}\n\n#[cfg(not(tarpaulin_include))]\nfn execute_script(script: &str) -> Result<String> {\n    debug!(\"\\nScript arguments {script}\");\n\n    let (cmd, arg) = if cfg!(unix) {\n        (\"sh\", \"-c\")\n    } else {\n        (\"cmd.exe\", \"/c\")\n    };\n\n    match Command::new(cmd)\n        .args([arg, script])\n        .stdin(Stdio::piped())\n        .stderr(Stdio::piped())\n        .output()\n    {\n        Ok(output) => {\n            let status = output.status;\n\n            let es = match status.code() {\n                Some(code) => code,\n                _ => {\n                    #[cfg(unix)]\n                    {\n                        status.signal().unwrap()\n                    }\n\n                    #[cfg(windows)]\n                    {\n                        return Err(anyhow!(\"Unknown exit status\"));\n                    }\n                }\n            };\n\n            if es != 0 {\n                return Err(anyhow!(\"Exit code = {}\", es));\n            }\n            Ok(String::from_utf8_lossy(&output.stdout).into_owned())\n        }\n        Err(error) => {\n            debug!(\"Command error {error}\",);\n            Err(anyhow!(error.to_string()))\n        }\n    }\n}\n\npub fn find_scripts(path: PathBuf) -> Result<Vec<PathBuf>> {\n    if path.is_dir() {\n        debug!(\"Scripts folder found {}\", &path.display());\n        let mut files_vec: Vec<PathBuf> = Vec::new();\n        for entry in fs::read_dir(path)? {\n            let entry = entry?;\n            files_vec.push(entry.path());\n        }\n        Ok(files_vec)\n    } else {\n        Err(anyhow!(\"Can't find scripts folder {}\", path.display()))\n    }\n}\n\n#[derive(Debug, Clone, Deserialize)]\npub struct ScriptFile {\n    pub path: Option<PathBuf>,\n    pub tags: Option<Vec<String>>,\n    pub developer: Option<Vec<String>>,\n    pub port: Option<String>,\n    pub ports_separator: Option<String>,\n    pub call_format: Option<String>,\n}\n\nimpl ScriptFile {\n    fn new(script: PathBuf) -> Option<ScriptFile> {\n        let real_path = script.clone();\n        let mut lines_buf = String::new();\n        if let Ok(file) = File::open(script) {\n            for mut line in io::BufReader::new(file).lines().skip(1).flatten() {\n                if line.starts_with('#') {\n                    line.retain(|c| c != '#');\n                    line = line.trim().to_string();\n                    line.push('\\n');\n                    lines_buf.push_str(&line);\n                } else {\n                    break;\n                }\n            }\n        } else {\n            debug!(\"Failed to read file: {}\", &real_path.display());\n            return None;\n        }\n        debug!(\"ScriptFile {} lines\\n{}\", &real_path.display(), &lines_buf);\n\n        match toml::from_str::<ScriptFile>(&lines_buf) {\n            Ok(mut parsed) => {\n                debug!(\"Parsed ScriptFile{} \\n{:?}\", &real_path.display(), &parsed);\n                parsed.path = Some(real_path);\n                // parsed_scripts.push(parsed);\n                Some(parsed)\n            }\n            Err(e) => {\n                debug!(\"Failed to parse ScriptFile headers {e}\");\n                None\n            }\n        }\n    }\n}\n\n#[derive(Debug, Deserialize, Clone)]\npub struct ScriptConfig {\n    pub tags: Option<Vec<String>>,\n    pub ports: Option<Vec<String>>,\n    pub developer: Option<Vec<String>>,\n    pub directory: Option<String>,\n}\n\n#[cfg(not(tarpaulin_include))]\nimpl ScriptConfig {\n    pub fn read_config() -> Result<ScriptConfig> {\n        let Some(mut home_dir) = dirs::home_dir() else {\n            return Err(anyhow!(\"Could not infer ScriptConfig path.\"));\n        };\n        home_dir.push(\".rustscan_scripts.toml\");\n\n        let content = fs::read_to_string(home_dir)?;\n        let config = toml::from_str::<ScriptConfig>(&content)?;\n        Ok(config)\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n\n    // Function for testing only, it inserts static values into ip and open_ports\n    // Doesn't use impl in case it's implemented in the super module at some point\n    fn into_script(script_f: ScriptFile) -> Script {\n        Script::build(\n            script_f.path,\n            \"127.0.0.1\".parse().unwrap(),\n            vec![80, 8080],\n            script_f.port,\n            script_f.ports_separator,\n            script_f.tags,\n            script_f.call_format,\n        )\n    }\n\n    #[test]\n    fn find_and_parse_scripts() {\n        let scripts = find_scripts(\"fixtures/.rustscan_scripts\".into()).unwrap();\n        let scripts = parse_scripts(scripts);\n        assert_eq!(scripts.len(), 4);\n    }\n\n    #[test]\n    #[should_panic]\n    fn find_invalid_folder() {\n        let _scripts = find_scripts(\"Cargo.toml\".into()).unwrap();\n    }\n\n    #[test]\n    #[should_panic]\n    fn open_script_file_invalid_headers() {\n        ScriptFile::new(\"fixtures/.rustscan_scripts/test_script_invalid_headers.txt\".into())\n            .unwrap();\n    }\n\n    #[test]\n    #[should_panic]\n    fn open_script_file_invalid_call_format() {\n        let mut script_f =\n            ScriptFile::new(\"fixtures/.rustscan_scripts/test_script.txt\".into()).unwrap();\n        script_f.call_format = Some(\"qwertyuiop\".to_string());\n        let script: Script = into_script(script_f);\n        let _output = script.run().unwrap();\n    }\n\n    #[test]\n    #[should_panic]\n    fn open_script_file_missing_call_format() {\n        let mut script_f =\n            ScriptFile::new(\"fixtures/.rustscan_scripts/test_script.txt\".into()).unwrap();\n        script_f.call_format = None;\n        let script: Script = into_script(script_f);\n        let _output = script.run().unwrap();\n    }\n\n    #[test]\n    #[should_panic]\n    fn open_nonexisting_script_file() {\n        ScriptFile::new(\"qwertyuiop.txt\".into()).unwrap();\n    }\n\n    #[test]\n    fn parse_txt_script() {\n        let script_f =\n            ScriptFile::new(\"fixtures/.rustscan_scripts/test_script.txt\".into()).unwrap();\n        assert_eq!(\n            script_f.tags,\n            Some(vec![\"core_approved\".to_string(), \"example\".to_string()])\n        );\n        assert_eq!(\n            script_f.developer,\n            Some(vec![\n                \"example\".to_string(),\n                \"https://example.org\".to_string()\n            ])\n        );\n        assert_eq!(script_f.ports_separator, Some(\",\".to_string()));\n        assert_eq!(\n            script_f.call_format,\n            Some(\"nmap -vvv -p {{port}} {{ip}}\".to_string())\n        );\n    }\n\n    #[test]\n    #[cfg(unix)]\n    fn run_bash_script() {\n        let script_f = ScriptFile::new(\"fixtures/.rustscan_scripts/test_script.sh\".into()).unwrap();\n        let script: Script = into_script(script_f);\n        let output = script.run().unwrap();\n        // output has a newline at the end by default, .trim() trims it\n        assert_eq!(output.trim(), \"127.0.0.1 80,8080\");\n    }\n\n    #[test]\n    fn run_python_script() {\n        let script_f = ScriptFile::new(\"fixtures/.rustscan_scripts/test_script.py\".into()).unwrap();\n        let script: Script = into_script(script_f);\n        let output = script.run().unwrap();\n        // output has a newline at the end by default, .trim() trims it\n        assert_eq!(\n            output.trim(),\n            \"Python script ran with arguments ['fixtures/.rustscan_scripts/test_script.py', '127.0.0.1', '80,8080']\"\n        );\n    }\n\n    #[test]\n    #[cfg(unix)]\n    fn run_perl_script() {\n        let script_f = ScriptFile::new(\"fixtures/.rustscan_scripts/test_script.pl\".into()).unwrap();\n        let script: Script = into_script(script_f);\n        let output = script.run().unwrap();\n        // output has a newline at the end by default, .trim() trims it\n        assert_eq!(output.trim(), \"Total args passed to fixtures/.rustscan_scripts/test_script.pl : 2\\nArg # 1 : 127.0.0.1\\nArg # 2 : 80,8080\");\n    }\n\n    #[test]\n    fn test_custom_directory_config() {\n        // Create test config\n        let config_str = r#\"\n            tags = [\"core_approved\", \"example\"]\n            directory = \"fixtures/.rustscan_scripts\"\n        \"#;\n\n        let config: ScriptConfig = toml::from_str(config_str).unwrap();\n        assert_eq!(\n            config.directory,\n            Some(\"fixtures/.rustscan_scripts\".to_string())\n        );\n\n        // Test that the directory is actually used\n        let script_dir_base = PathBuf::from(config.directory.unwrap());\n        let scripts = find_scripts(script_dir_base).unwrap();\n\n        // Verify we found the test script\n        assert!(scripts.iter().any(|p| p\n            .file_name()\n            .and_then(|f| f.to_str())\n            .map(|s| s == \"test_script.txt\")\n            .unwrap_or(false)));\n    }\n\n    #[test]\n    fn test_default_directory_fallback() {\n        let config_str = r#\"\n            tags = [\"core_approved\", \"example\"]\n        \"#;\n\n        let config: ScriptConfig = toml::from_str(config_str).unwrap();\n        assert_eq!(config.directory, None);\n\n        // Test fallback to home directory\n        let script_dir_base = if let Some(config_directory) = &config.directory {\n            PathBuf::from(config_directory)\n        } else {\n            dirs::home_dir().unwrap()\n        };\n\n        assert_eq!(script_dir_base, dirs::home_dir().unwrap());\n    }\n}\n"
  },
  {
    "path": "src/tui.rs",
    "content": "//! Utilities for terminal output during scanning.\n\n/// Terminal User Interface Module for RustScan\n/// Defines macros to use\n#[macro_export]\nmacro_rules! warning {\n    ($name:expr) => {\n        println!(\"{} {}\", ansi_term::Colour::Red.bold().paint(\"[!]\"), $name);\n    };\n    ($name:expr, $greppable:expr, $accessible:expr) => {\n        // if not greppable then print, otherwise no else statement so do not print.\n        if !$greppable {\n            if $accessible {\n                // Don't print the ascii art\n                println!(\"{}\", $name);\n            } else {\n                println!(\"{} {}\", ansi_term::Colour::Red.bold().paint(\"[!]\"), $name);\n            }\n        }\n    };\n}\n\n#[macro_export]\nmacro_rules! detail {\n    ($name:expr) => {\n        println!(\"{} {}\", ansi_term::Colour::Blue.bold().paint(\"[~]\"), $name);\n    };\n    ($name:expr, $greppable:expr, $accessible:expr) => {\n        // if not greppable then print, otherwise no else statement so do not print.\n        if !$greppable {\n            if $accessible {\n                // Don't print the ascii art\n                println!(\"{}\", $name);\n            } else {\n                println!(\"{} {}\", ansi_term::Colour::Blue.bold().paint(\"[~]\"), $name);\n            }\n        }\n    };\n}\n\n#[macro_export]\nmacro_rules! output {\n    ($name:expr) => {\n        println!(\n            \"{} {}\",\n            ansi_term::Colour::RGB(0, 255, 9).bold().paint(\"[>]\"),\n            $name\n        );\n    };\n    ($name:expr, $greppable:expr, $accessible:expr) => {\n        // if not greppable then print, otherwise no else statement so do not print.\n        if !$greppable {\n            if $accessible {\n                // Don't print the ascii art\n                println!(\"{}\", $name);\n            } else {\n                println!(\n                    \"{} {}\",\n                    ansi_term::Colour::RGB(0, 255, 9).bold().paint(\"[>]\"),\n                    $name\n                );\n            }\n        }\n    };\n}\n\n#[macro_export]\nmacro_rules! funny_opening {\n    // prints a funny quote / opening\n    () => {\n        use rand::seq::IndexedRandom;\n        let quotes = vec![\n            \"Nmap? More like slowmap.🐢\",\n            \"🌍HACK THE PLANET🌍\",\n            \"Real hackers hack time ⌛\",\n            \"Please contribute more quotes to our GitHub https://github.com/rustscan/rustscan\",\n            \"😵 https://admin.tryhackme.com\",\n            \"0day was here ♥\",\n            \"I don't always scan ports, but when I do, I prefer RustScan.\",\n            \"RustScan: Where scanning meets swagging. 😎\",\n            \"To scan or not to scan? That is the question.\",\n            \"RustScan: Because guessing isn't hacking.\",\n            \"Scanning ports like it's my full-time job. Wait, it is.\",\n            \"Open ports, closed hearts.\",\n            \"I scanned my computer so many times, it thinks we're dating.\",\n            \"Port scanning: Making networking exciting since... whenever.\",\n            \"You miss 100% of the ports you don't scan. - RustScan\",\n            \"Breaking and entering... into the world of open ports.\",\n            \"TCP handshake? More like a friendly high-five!\",\n            \"Scanning ports: The virtual equivalent of knocking on doors.\",\n            \"RustScan: Making sure 'closed' isn't just a state of mind.\",\n            \"RustScan: allowing you to send UDP packets into the void 1200x faster than NMAP\",\n            \"Port scanning: Because every port has a story to tell.\",\n            \"I scanned ports so fast, even my computer was surprised.\",\n            \"Scanning ports faster than you can say 'SYN ACK'\",\n            \"RustScan: Where '404 Not Found' meets '200 OK'.\",\n            \"RustScan: Exploring the digital landscape, one IP at a time.\",\n            \"TreadStone was here 🚀\",\n            \"With RustScan, I scan ports so fast, even my firewall gets whiplash 💨\",\n            \"Scanning ports so fast, even the internet got a speeding ticket!\",\n        ];\n        let random_quote = quotes.choose(&mut rand::rng()).unwrap();\n\n        println!(\"{}\\n\", random_quote);\n    };\n}\n"
  },
  {
    "path": "tests/timelimits.rs",
    "content": "/*\n * Test rustscan against different targets with a time limit.\n * The tests assumes target/debug/rustscan has already been built.\n *\n * The tests are #[ignore] to avoid running them during normal development.\n *\n * Their tests in the timelimits module are run by travis during CI.\n */\n\nuse std::process::Command;\nuse std::time::Duration;\nuse wait_timeout::ChildExt;\n\nconst TIMEOUT_MARGIN: u32 = 3;\n\n#[cfg(not(tarpaulin_include))]\nfn run_rustscan_with_timeout(args: &[&str], timeout: Duration) {\n    println!(\"Running: target/debug/rustscan: {}\", args.join(\" \"));\n\n    use std::time::Instant;\n\n    let start = Instant::now();\n\n    let mut child = Command::new(\"target/debug/rustscan\")\n        .args(args)\n        .spawn()\n        .unwrap();\n\n    let mut tries = TIMEOUT_MARGIN;\n    loop {\n        match child.wait_timeout(timeout).unwrap() {\n            Some(_status) => break,\n            None => {\n                tries -= 1;\n                if tries == 0 {\n                    // child hasn't exited yet\n                    child.kill().unwrap();\n                    child.wait().unwrap().code().unwrap();\n                    panic!(\"Timeout while running command\");\n                }\n            }\n        }\n    }\n    let end = Instant::now();\n    let duration = end.saturating_duration_since(start).as_secs_f32();\n\n    println!(\"time: {duration:1.1}s\");\n}\n\nmod timelimits {\n\n    #[test]\n    #[ignore]\n    fn scan_localhost() {\n        let timeout = super::Duration::from_secs(25);\n        super::run_rustscan_with_timeout(&[\"--greppable\", \"--no-nmap\", \"127.0.0.1\"], timeout);\n    }\n\n    #[test]\n    #[ignore]\n    fn scan_google_com() {\n        super::run_rustscan_with_timeout(\n            &[\n                \"--greppable\",\n                \"--no-nmap\",\n                \"-u\",\n                \"5000\",\n                \"-b\",\n                \"2500\",\n                \"google.com\",\n            ],\n            super::Duration::from_secs(28),\n        );\n    }\n\n    #[test]\n    #[ignore]\n    fn scan_example_com() {\n        super::run_rustscan_with_timeout(\n            &[\n                \"--greppable\",\n                \"--no-nmap\",\n                \"-u\",\n                \"5000\",\n                \"-b\",\n                \"2500\",\n                \"example.com\",\n            ],\n            super::Duration::from_secs(28),\n        );\n    }\n\n    #[test]\n    #[ignore]\n    fn scan_rustscan_cmnatic_co_uk() {\n        super::run_rustscan_with_timeout(\n            &[\n                \"--greppable\",\n                \"--no-nmap\",\n                \"-u\",\n                \"5000\",\n                \"-b\",\n                \"2500\",\n                \"rustscan.cmnatic.co.uk\",\n            ],\n            super::Duration::from_secs(26),\n        );\n    }\n    #[test]\n    #[ignore]\n    fn udp_scan_localhost() {\n        let timeout = super::Duration::from_secs(25);\n        super::run_rustscan_with_timeout(&[\"--greppable\", \"127.0.0.1\", \"--udp\"], timeout);\n    }\n    #[test]\n    #[ignore]\n    fn udp_scan_google_com() {\n        super::run_rustscan_with_timeout(\n            &[\n                \"--udp\",\n                \"--greppable\",\n                \"-u\",\n                \"5000\",\n                \"-b\",\n                \"2500\",\n                \"google.com\",\n            ],\n            super::Duration::from_secs(28),\n        );\n    }\n    #[test]\n    #[ignore]\n    fn udp_scan_example_com() {\n        super::run_rustscan_with_timeout(\n            &[\n                \"--udp\",\n                \"--greppable\",\n                \"-u\",\n                \"5000\",\n                \"-b\",\n                \"2500\",\n                \"example.com\",\n            ],\n            super::Duration::from_secs(28),\n        );\n    }\n    #[test]\n    #[ignore]\n    fn udp_scan_rustscan_cmnatic_co_uk() {\n        super::run_rustscan_with_timeout(\n            &[\n                \"--udp\",\n                \"--greppable\",\n                \"-u\",\n                \"5000\",\n                \"-b\",\n                \"2500\",\n                \"rustscan.cmnatic.co.uk\",\n            ],\n            super::Duration::from_secs(26),\n        );\n    }\n}\n"
  }
]