Compare commits

..
Author SHA1 Message Date
Brandon d6cfc9e38c Merge branch 'master' of github.com:brandonskerritt/RustScan into master 2020-08-28 21:23:39 +01:00
Brandon 8e76a71a4c updated logo 2020-08-28 15:58:42 +01:00
Brandon 07fdea8471 Merge pull request #176 from niklasmohrin/improve-readme
README.md tweaks
2020-08-28 13:50:38 +01:00
Niklas Mohrin 8670bcc35f Move "rustscan -h" and output together 2020-08-28 14:43:50 +02:00
Niklas Mohrin fbba9d16ca Mark code blocks as bash commands in README 2020-08-28 14:43:50 +02:00
Niklas Mohrin 309d1ad660 Remove argument placeholders in docker alias 2020-08-28 14:43:47 +02:00
Brandon ed48161bea added travis token 2020-08-28 11:22:23 +01:00
Brandon f0d1aa2b9a Merge pull request #180 from RustScan/all-contributors/add-SuperSandro2000
docs: add SuperSandro2000 as a contributor
2020-08-28 11:12:35 +01:00
Brandon ac93feddb5 Merge pull request #178 from SuperSandro2000/optimize-docker
Optimize Dockerfile
2020-08-28 11:12:17 +01:00
allcontributors[bot] 1280fa1b47 docs: update .all-contributorsrc [skip ci] 2020-08-28 10:12:08 +00:00
Brandon 6e731aaf93 Merge branch 'master' into optimize-docker 2020-08-28 11:12:08 +01:00
allcontributors[bot] 9230165f8f docs: update README.md [skip ci] 2020-08-28 10:12:07 +00:00
Brandon 818c80041b Merge pull request #177 from RustScan/all-contributors/add-niklasmohrin
docs: add niklasmohrin as a contributor
2020-08-28 11:11:38 +01:00
allcontributors[bot] bce955212a docs: update .all-contributorsrc [skip ci] 2020-08-28 10:11:34 +00:00
allcontributors[bot] 41e0e8905f docs: update README.md [skip ci] 2020-08-28 10:11:33 +00:00
Sandro Jäckel 85f1699724 Prevent cache bustages 2020-08-28 01:31:54 +02:00
Sandro Jäckel bafd0141df Pin Alpine 3.12 to prevent breakages in the future 2020-08-28 01:31:26 +02:00
Sandro Jäckel aba0f3c38c Cleanup Dockerfile 2020-08-28 01:31:08 +02:00
allcontributors[bot] 9e161d4f79 docs: update .all-contributorsrc [skip ci] 2020-08-27 23:12:10 +00:00
allcontributors[bot] 731b4079cf docs: update README.md [skip ci] 2020-08-27 23:12:09 +00:00
Brandon b4edc6cca6 1.8.0 publish 2020-08-28 00:03:02 +01:00
Brandon 4a7cbd701b Merge pull request #175 from RustScan/all-contributors/add-caass
docs: add caass as a contributor
2020-08-27 20:39:46 +01:00
allcontributors[bot] f34ee8f5ef docs: update .all-contributorsrc [skip ci] 2020-08-27 19:36:22 +00:00
allcontributors[bot] 89c763789f docs: update README.md [skip ci] 2020-08-27 19:36:21 +00:00
Brandon 5c48f1173a Merge pull request #140 from remigourdon/docs-pages
Add Travis configuration to publish doc to GitHub pages
2020-08-27 14:02:46 +01:00
Brandon 8d8ca1d4a0 Merge branch 'master' into docs-pages 2020-08-27 14:01:29 +01:00
Brandon 8d8acd61e8 Merge pull request #173 from RustScan/bee-add-submodule
added submodule
2020-08-27 13:33:16 +01:00
Brandon 0ab3e53034 Merge branch 'master' into bee-add-submodule 2020-08-27 13:05:19 +01:00
Brandon 56493859cb added submodule 2020-08-27 12:36:56 +01:00
Brandon 2ef723ed96 Merge branch 'master' into docs-pages 2020-08-27 12:30:33 +01:00
Brandon e9288302ba Merge pull request #172 from RustScan/all-contributors/add-caass
docs: add caass as a contributor
2020-08-27 11:39:35 +01:00
remigourdon 8179511527 Add Travis configuration to publish doc to GitHub pages 2020-08-26 23:22:13 -04:00
allcontributors[bot] fbab4a4020 docs: update .all-contributorsrc [skip ci] 2020-08-26 23:22:13 -04:00
allcontributors[bot] b425d15a98 docs: update README.md [skip ci] 2020-08-26 23:22:13 -04:00
allcontributors[bot] fddda34465 docs: update .all-contributorsrc [skip ci] 2020-08-26 23:39:11 +00:00
allcontributors[bot] 125df4a2ed docs: update README.md [skip ci] 2020-08-26 23:39:10 +00:00
Brandon e670d11223 Merge pull request #170 from RustScan/all-contributors/add-SuperSandro2000
docs: add SuperSandro2000 as a contributor
2020-08-27 00:36:42 +01:00
Brandon 8453320586 Merge pull request #169 from SuperSandro2000/fix-timeout-arg
Convert -T to -t
2020-08-26 17:27:15 +01:00
allcontributors[bot] 99e9c834a9 docs: update .all-contributorsrc [skip ci] 2020-08-26 15:54:45 +00:00
allcontributors[bot] dfbce6a636 docs: update README.md [skip ci] 2020-08-26 15:54:44 +00:00
Sandro Jäckel 916be1e4a2 Convert -T to -t 2020-08-26 17:38:58 +02:00
Brandon 90b4328fb6 Merge pull request #167 from RustScan/all-contributors/add-Phenomite
docs: add Phenomite as a contributor
2020-08-26 16:08:25 +01:00
Brandon 76035d3379 Merge branch 'master' into all-contributors/add-Phenomite 2020-08-26 15:50:08 +01:00
Brandon 4de31ecede Merge pull request #163 from Phenomite/patch-1
2000 milliseconds not seconds
2020-08-26 15:47:50 +01:00
allcontributors[bot] ce9befaa1a docs: update .all-contributorsrc [skip ci] 2020-08-26 14:47:28 +00:00
Brandon 5f6457ed7e Merge branch 'master' into patch-1 2020-08-26 15:47:27 +01:00
allcontributors[bot] 12d3c91983 docs: update README.md [skip ci] 2020-08-26 14:47:27 +00:00
Brandon e0fd7a39dc Merge pull request #164 from RustScan/dependabot/cargo/structopt-0.3.17
Bump structopt from 0.3.16 to 0.3.17
2020-08-26 14:59:31 +01:00
Brandon ff0787e332 Merge branch 'master' into dependabot/cargo/structopt-0.3.17 2020-08-26 14:02:08 +01:00
Brandon 6ce6c0ce9e Merge pull request #166 from RustScan/all-contributors/add-Ferryistaken
docs: add Ferryistaken as a contributor
2020-08-26 14:01:48 +01:00
Brandon edf989ad5d Merge branch 'master' into all-contributors/add-Ferryistaken 2020-08-26 13:35:08 +01:00
Brandon 3fede4c6db Merge pull request #165 from Ferryistaken/fix-message
Fixed small typo in a warning message
2020-08-26 13:34:46 +01:00
allcontributors[bot] 75b310f227 docs: update .all-contributorsrc [skip ci] 2020-08-26 12:34:40 +00:00
allcontributors[bot] 72c6ef1f1d docs: update README.md [skip ci] 2020-08-26 12:34:39 +00:00
Ferry 83b23da32b Fixed small typo in a warning message 2020-08-26 11:00:54 +02:00
dependabot-preview[bot] 3886a07775 Bump structopt from 0.3.16 to 0.3.17
Bumps [structopt](https://github.com/TeXitoi/structopt) from 0.3.16 to 0.3.17.
- [Release notes](https://github.com/TeXitoi/structopt/releases)
- [Changelog](https://github.com/TeXitoi/structopt/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TeXitoi/structopt/compare/v0.3.16...v0.3.17)

Signed-off-by: dependabot-preview[bot] <[email protected]>
2020-08-26 06:52:53 +00:00
Phenomite f5064d3d5c 2000 milliseconds not seconds 2020-08-25 18:42:59 -04:00
15 changed files with 127 additions and 253 deletions

No files matched your search

+49
View File
@@ -115,6 +115,55 @@
"doc",
"design"
]
},
{
"login": "Ferryistaken",
"name": "Alessandro Ferrari",
"avatar_url": "https://avatars3.githubusercontent.com/u/47927670?v=4",
"profile": "https://github.com/Ferryistaken",
"contributions": [
"content"
]
},
{
"login": "Phenomite",
"name": "Phenomite",
"avatar_url": "https://avatars2.githubusercontent.com/u/8285537?v=4",
"profile": "https://github.com/Phenomite",
"contributions": [
"content"
]
},
{
"login": "SuperSandro2000",
"name": "Sandro",
"avatar_url": "https://avatars2.githubusercontent.com/u/7258858?v=4",
"profile": "https://supersandro.de/",
"contributions": [
"content",
"bug",
"code"
]
},
{
"login": "caass",
"name": "Cass",
"avatar_url": "https://avatars2.githubusercontent.com/u/25358963?v=4",
"profile": "https://swag.lgbt",
"contributions": [
"platform",
"code",
"bug"
]
},
{
"login": "niklasmohrin",
"name": "Niklas Mohrin",
"avatar_url": "https://avatars0.githubusercontent.com/u/47574893?v=4",
"profile": "https://github.com/niklasmohrin",
"contributions": [
"doc"
]
}
],
"contributorsPerLine": 7,
+2
View File
@@ -0,0 +1,2 @@
.git
Dockerfile
+3
View File
@@ -0,0 +1,3 @@
[submodule "src/rustscan_scripting_engine"]
path = src/rustscan_scripting_engine
url = https://github.com/RustScan/rustscan_scripting_engine
+23 -42
View File
@@ -1,56 +1,37 @@
language: rust
os:
- linux
- osx
# - windows
- linux
- osx
arch:
- amd64
- arm64
- amd64
- arm64
services:
- docker
- docker
before_install:
- rustup component add rustfmt
# cargo test
rust:
- stable
- beta
- stable
- beta
jobs:
fast_finish: true
# Cargo fmt
script:
- cargo build
- cargo test
- cargo fmt -- --check
# automatic deployment to cargo on release
# deploy:
# provider: releases
# api_key: "GITHUB OAUTH TOKEN"
# file: "FILE TO UPLOAD"
# skip_cleanup: true
# on:
# tags: true
# after_success:
# - wget https://raw.githubusercontent.com/DiscordHooks/travis-ci-discord-webhook/master/send.sh
# - chmod +x send.sh
# - ./send.sh success $WEBHOOK_URL
# only deploy on master branch
# on:
# branch: master
# provider: cargo
# token: $crates
after_failure:
- wget https://raw.githubusercontent.com/DiscordHooks/travis-ci-discord-webhook/master/send.sh
- chmod +x send.sh
- ./send.sh failure $WEBHOOK_URL
- wget https://raw.githubusercontent.com/DiscordHooks/travis-ci-discord-webhook/master/send.sh
- chmod +x send.sh
- "./send.sh failure $WEBHOOK_URL"
after_success: |
if [ -n "${GITHUB_TOKEN}" ]; then
[ "${TRAVIS_BRANCH} " = master ] &&
[ "${TRAVIS_PULL_REQUEST}" = false ] &&
cargo doc &&
echo "<meta http-equiv=refresh content=0;url=rustscan/index.html>" > target/doc/index.html &&
sudo pip install ghp-import &&
ghp-import -n target/doc &&
git push -fq https://${GITHUB_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages
fi
env:
global:
secure: Gf24LG7Hr3Q0drWyPrvISTL35Z57DxdS/wIOo7v+ZdauzY3Qjvv3Lh4TY//C4sdN0g1CLj4yjg7LQOqF4XRdh2Qah7JZPv/i2B5uz9nwjTsoRzmmMWML9VtfT1u53nSFqsNeXbvpmoNG9rfMXcoiyd+Lv+EgniHphDEBlXvS9n9KMcpOi1F2x7bsH0EK37wQYKMTpCCd5TPUPdZou7BJNiZS3ikRLpTRFF7uIN4gYtRH9kU5uBSphWgnJ6eBm2ItzZcUPOgrjAoF4RkmZAzGG4idDh1Qkf3No3nZwT3U5NSk8h7owtJ4oADlRgYqYKCB4YcC9cAKCJgDsyMlKKMkEyagvw1seFnBLCY3ljsW4EklpVEZ0rVqZOx4pTkIaxIxytLTC9pHmdDSnhdhFknOcVAQQWjg+nAZfD07QUeAqUdr0i/vxQoZitvbNY0znzEarycE1waKvwlkiB4gt385U1CBfYldydnOnRKkdtLNrCLClu13HU0djmSXMhojQJhTuNxTHtZAf5fKcWIWwkVbNZ5MNKYjQh4rKufqW3o1iHphB8dfAGsDEPv0RQMtVbu6H4+clCouLkFlxHOIrrOJ5SXQ8cIATPhnJR7y4cSDdRaN0DRLRjeLAIKlbOGBtNuFC+BftocaTY5qN42aKAMqQcT30ycfiLuRVJNiQJ5pkto=
Generated
+5 -21
View File
@@ -759,7 +759,7 @@ dependencies = [
[[package]]
name = "rustscan"
version = "1.7.1"
version = "1.8.0"
dependencies = [
"ansi_term 0.12.1",
"async-std",
@@ -774,7 +774,6 @@ dependencies = [
"rlimit",
"shell-words",
"structopt",
"toml",
]
[[package]]
@@ -783,12 +782,6 @@ version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2"
[[package]]
name = "serde"
version = "1.0.114"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5317f7588f0a5078ee60ef675ef96735a1442132dc645eb1d12c018620ed8cd3"
[[package]]
name = "shell-words"
version = "1.0.0"
@@ -821,9 +814,9 @@ checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a"
[[package]]
name = "structopt"
version = "0.3.16"
version = "0.3.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "de5472fb24d7e80ae84a7801b7978f95a19ec32cb1876faea59ab711eb901976"
checksum = "6cc388d94ffabf39b5ed5fadddc40147cb21e605f53db6f8f36a625d27489ac5"
dependencies = [
"clap",
"lazy_static",
@@ -832,9 +825,9 @@ dependencies = [
[[package]]
name = "structopt-derive"
version = "0.4.9"
version = "0.4.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e0eb37335aeeebe51be42e2dc07f031163fbabfa6ac67d7ea68b5c2f68d5f99"
checksum = "5e2513111825077552a6751dfad9e11ce0fba07d7276a3943a037d7e93e64c5f"
dependencies = [
"heck",
"proc-macro-error",
@@ -881,15 +874,6 @@ dependencies = [
"lazy_static",
]
[[package]]
name = "toml"
version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ffc92d160b1eef40665be3a05630d003936a3bc7da7421277846c2613e92c71a"
dependencies = [
"serde",
]
[[package]]
name = "unicode-segmentation"
version = "1.6.0"
+2 -6
View File
@@ -1,6 +1,6 @@
[package]
name = "rustscan"
version = "1.7.1"
version = "1.8.0"
authors = ["Bee <[email protected]>"]
edition = "2018"
description = "Faster Nmap Scanning with Rust"
@@ -18,7 +18,7 @@ exclude = [
[dependencies]
colored = "2.0.0"
structopt = "0.3.16"
structopt = "0.3.17"
async-std = "1.6.3"
futures = "0.3"
rlimit = "0.4.0"
@@ -26,14 +26,10 @@ shell-words = "1.0.0"
log = "0.4.0"
env_logger = "0.7.1"
dirs = "3.0.1"
toml = "0.5.6"
gcd = "2.0.1"
rand = "0.7.3"
colorful = "0.2.1"
ansi_term = "0.12.1"
ureq = "1.3.0"
serde = "1.0.115"
serde_derive = "1.0.115"
[package.metadata.deb]
depends = "$auto, nmap"
+7 -13
View File
@@ -1,22 +1,16 @@
FROM rust:alpine as builder
RUN apk update && \
apk add build-base && \
rm -rf /var/cache/apk/*
RUN apk add --no-cache build-base
WORKDIR /usr/src/rustscan
COPY . .
RUN cargo install --path .
FROM alpine
FROM alpine:3.12
LABEL author="Hydragyrum <https://github.com/Hydragyrum>"
RUN ulimit -n 100000 && \
apk update && \
apk add \
nmap nmap-scripts wget \
&& \
rm -rf /var/cache/apk/*
COPY --from=builder /usr/local/cargo/bin/rustscan /usr/local/bin/rustscan
RUN addgroup -S rustscan && \
adduser -S -G rustscan rustscan
adduser -S -G rustscan rustscan && \
ulimit -n 100000 && \
apk add --no-cache nmap nmap-scripts wget
COPY --from=builder /usr/local/cargo/bin/rustscan /usr/local/bin/rustscan
USER rustscan
ENTRYPOINT ["/usr/local/bin/rustscan"]
ENTRYPOINT [ "/usr/local/bin/rustscan" ]
+24 -55
View File
@@ -5,7 +5,7 @@
<a href="https://github.com/RustScan/RustScan#-usage">Usage Guide</a>
⬅️
<br>
<img src="https://github.com/RustScan/RustScan/blob/master/pictures/rustscan.png?raw=true">
<img src="pictures/rustscan.png">
</p>
<p align="center">
<u><b> Turns a 17 minutes Nmap scan into 19 seconds. </b></u><br> Find all open ports <b>fast</b> with RustScan, automatically pipe them into Nmap.
@@ -34,27 +34,7 @@
3. ???
4. Profit!
<table>
<tr>
<th>Name</th>
<th>⚡ Nmap <b>with RustScan</b> ⚡ </th>
<th>🐢 Nmap 🐢</th>
</tr>
<tr>
<th>Gif</th>
<td><img src="https://github.com/RustScan/RustScan/blob/master/pictures/with_rustscan.gif?raw=true" alt="The guy she tells you not to worry about"></td>
<td><img src="https://github.com/RustScan/RustScan/blob/master/pictures/without_rustscan.gif?raw=true" alt="You"></td>
</tr>
<tr>
<th>Time</th>
<td><b>39 seconds</b></td>
<td><b>17 minutes and 41 seconds</b></td>
</tr>
</table>
<sub><b>Note</b> This is an older gif. RustScan's current top speed is 3 seconds for all 65k ports. This gif is 26 seconds.</sub><br>
RustScans **only** job is to reduce the friction between finding open ports and inputting them into nmap.
# ✨ Features
* Scans all 65k ports in **8 seconds** (on 10k batch size).
@@ -67,7 +47,7 @@ RustScans **only** job is to reduce the friction between finding open ports and
| Installation Guide | Documentation | Discord |
| ------------------ | ------------- | ------- |
| 📖 [Installation Guide](https://github.com/RustScan/RustScan#-full-installation-guide) | 📚 [Documentation](https://github.com/RustScan/RustScan/issues/89) | 🦜 [Discord](https://discord.gg/GFrQsGy)
| 📖 [Installation Guide](https://github.com/RustScan/RustScan#-full-installation-guide) | 📚 [Documentation](https://rustscan.github.io/RustScan/) | 🦜 [Discord](https://discord.gg/GFrQsGy)
## 🙋 Table of Contents
* 📖 [Installation Guide](https://github.com/RustScan/RustScan#-full-installation-guide)
@@ -136,7 +116,7 @@ We strongly recommend using the `alpine` tag, as this is the latest major - stab
Simply run this command against the IP you want to target:
```
```bash
docker run -it --rm --name rustscan rustscan/rustscan:alpine <rustscan arguments here> <ip address to scan>
```
@@ -146,30 +126,30 @@ Once done, you will no longer need to re-download the image (except when RustSca
You will have to run this command every time, so we suggest aliasing it to something memorable.
```
alias rustscan='docker run -it --rm --name rustscan rustscan/rustscan:alpine <rustscan arguments here> <ip address to scan>'
```bash
alias rustscan='docker run -it --rm --name rustscan rustscan/rustscan:alpine'
```
Then we can:
```
```bash
rustscan 127.0.0.1 -t 500 -b 1500 -- -A
```
#### To build your own image:
Download the repo:
```
```bash
git clone https://github.com/RustScan/RustScan.git
```
Ensure you navigate to the download location of the repo:
```
```bash
cd /path/to/download/RustScan
```
Build away!
```
```bash
docker build -t <yourimagename> .
```
@@ -179,13 +159,13 @@ docker build -t <yourimagename> .
Tap the brew:
```
```bash
brew tap brandonskerritt/rustscan
```
Install it:
```
```bash
brew install rustscan
```
@@ -208,11 +188,9 @@ If you maintain a community distribution and want it listed here, leave an issue
# 🤸 Usage
```
rustscan -h
```
```console
$ rustscan -h
```
Fast Port Scanner built in Rust. WARNING Do not use this program against sensitive infrastructure since the specified
server may not be able to handle this many socket connections at once. - Discord https://discord.gg/GFrQsGy - GitHub
https://github.com/RustScan/RustScan
@@ -241,7 +219,7 @@ OPTIONS:
ARGS:
<ips-or-hosts>... A list of comma separated IP addresses or hosts to be scanned
<command>... The Nmap arguments to run. To use the argument -A, end RustScan's args with '-- -A'.
Example: 'rustscan -T 1500 127.0.0.1 -- -A -sC'. This command adds -Pn -vvv -p $PORTS
Example: 'rustscan -t 1500 127.0.0.1 -- -A -sC'. This command adds -Pn -vvv -p $PORTS
automatically to nmap. For things like --script '(safe and vuln)' enclose it in quotations
marks \"'(safe and vuln)'\"")
```
@@ -287,7 +265,7 @@ Decreasing batch size slows down the program, so as long as it isn't too drastic
Run these 3 commands:
```
```bash
ulimit -a
ulimit -Hn
ulimit -Sn
@@ -301,7 +279,7 @@ Increasing the open file limit increases speed, but poses danger. Although, **op
To open more, set the ulimit to a higher number:
```
```bash
ulimit -n 5000
```
@@ -340,22 +318,6 @@ To increase accuracy, the easiest way is to increase the timeout. The default is
Decreasing accuracy gives some speed bonus, but my testing found that batch size dramatically changed the speed whereas timeout did, but not so much.
## 🤖 Config File
RustScan uses a Config file to make things easier for you. And to also improve itself.
The config file is used as the basis of the _adaptive learning_ mechanisms. This means that RustScan _learns_ from your scans and improves itself over time. (Don't worry, no bloated AI framework here 😉)
The config file should be placed in APPDIRS. To find this folder, run RustScan and look out for RustScan saying "couldn't find config at <location>". That location is where your config file should be.
Once you have this location, copy and paste this:
```toml
# The top ports
[top_ports]
80, 60, 443
```
# 🎪 Community
Howdy Space Cow-Person 🤠🌌
@@ -397,7 +359,7 @@ Please read the [contributing.md file](contributing.md)
## Contributors ✨
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-11-orange.svg?style=flat-square)](#contributors-)
[![All Contributors](https://img.shields.io/badge/all_contributors-16-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
@@ -420,6 +382,13 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center"><a href="https://tgotwig.me"><img src="https://avatars0.githubusercontent.com/u/30773779?v=4" width="100px;" alt=""/><br /><sub><b>Thomas Gotwig</b></sub></a><br /><a href="#platform-TGotwig" title="Packaging/porting to new platform">📦</a></td>
<td align="center"><a href="https://github.com/remigourdon"><img src="https://avatars3.githubusercontent.com/u/2874133?v=4" width="100px;" alt=""/><br /><sub><b>Rémi Gourdon</b></sub></a><br /><a href="https://github.com/RustScan/RustScan/commits?author=remigourdon" title="Documentation">📖</a> <a href="https://github.com/RustScan/RustScan/commits?author=remigourdon" title="Code">💻</a></td>
<td align="center"><a href="https://cmnatic.co.uk"><img src="https://avatars3.githubusercontent.com/u/4163116?v=4" width="100px;" alt=""/><br /><sub><b>Ben (CMNatic)</b></sub></a><br /><a href="https://github.com/RustScan/RustScan/commits?author=cmnatic" title="Code">💻</a> <a href="https://github.com/RustScan/RustScan/commits?author=cmnatic" title="Documentation">📖</a> <a href="#design-cmnatic" title="Design">🎨</a></td>
<td align="center"><a href="https://github.com/Ferryistaken"><img src="https://avatars3.githubusercontent.com/u/47927670?v=4" width="100px;" alt=""/><br /><sub><b>Alessandro Ferrari</b></sub></a><br /><a href="#content-Ferryistaken" title="Content">🖋</a></td>
<td align="center"><a href="https://github.com/Phenomite"><img src="https://avatars2.githubusercontent.com/u/8285537?v=4" width="100px;" alt=""/><br /><sub><b>Phenomite</b></sub></a><br /><a href="#content-Phenomite" title="Content">🖋</a></td>
<td align="center"><a href="https://supersandro.de/"><img src="https://avatars2.githubusercontent.com/u/7258858?v=4" width="100px;" alt=""/><br /><sub><b>Sandro</b></sub></a><br /><a href="#content-SuperSandro2000" title="Content">🖋</a> <a href="https://github.com/RustScan/RustScan/issues?q=author%3ASuperSandro2000" title="Bug reports">🐛</a> <a href="https://github.com/RustScan/RustScan/commits?author=SuperSandro2000" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://swag.lgbt"><img src="https://avatars2.githubusercontent.com/u/25358963?v=4" width="100px;" alt=""/><br /><sub><b>Cass</b></sub></a><br /><a href="#platform-caass" title="Packaging/porting to new platform">📦</a> <a href="https://github.com/RustScan/RustScan/commits?author=caass" title="Code">💻</a> <a href="https://github.com/RustScan/RustScan/issues?q=author%3Acaass" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/niklasmohrin"><img src="https://avatars0.githubusercontent.com/u/47574893?v=4" width="100px;" alt=""/><br /><sub><b>Niklas Mohrin</b></sub></a><br /><a href="https://github.com/RustScan/RustScan/commits?author=niklasmohrin" title="Documentation">📖</a></td>
</tr>
</table>
-28
View File
@@ -1,28 +0,0 @@
FROM archlinux:latest
RUN yes | pacman -Syu
RUN yes | pacman -S fakeroot binutils sudo make gcc gettext awk git
WORKDIR /opt
RUN git clone https://aur.archlinux.org/yay-git.git
RUN useradd -m tecmint
RUN passwd -d tecmint
RUN printf 'tecmint ALL=(ALL) ALL\n' | tee -a /etc/sudoers
WORKDIR /opt/yay-git
RUN chown -R tecmint /opt/yay-git
USER tecmint
RUN makepkg -si --noconfirm
# AUR
RUN yay -S rustscan --noconfirm
RUN rustscan 127.0.0.1 -q -b 250 -t 1
RUN yay -R rustscan --noconfirm
# homebrew
RUN yes | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
ENV PATH="/home/linuxbrew/.linuxbrew/bin:${PATH}"
RUN yes | brew tap brandonskerritt/rustscan
RUN yes | brew install rustscan
RUN rustscan 127.0.0.1 -q -b 250 -t 1
Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 29 KiB

File renamed without changes.
@@ -5,7 +5,6 @@ git pull --force
#amd64
cargo deb
yes | dpkg -i *.deb
#arm64
rustup target add arm-unknown-linux-gnueabihf
File renamed without changes.
+11 -87
View File
@@ -13,20 +13,11 @@ use colorful::Colorful;
use futures::executor::block_on;
use rlimit::Resource;
use rlimit::{getrlimit, setrlimit};
use serde_derive::Deserialize;
use std::collections::HashMap;
use std::net::ToSocketAddrs;
use std::process::Command;
use std::str::FromStr;
use std::{
fs::File,
io::{Read, Write},
net::IpAddr,
path::PathBuf,
time::Duration,
};
use std::{net::IpAddr, net::ToSocketAddrs, time::Duration};
use structopt::{clap::arg_enum, StructOpt};
use ureq;
extern crate colorful;
extern crate dirs;
@@ -106,10 +97,6 @@ struct Opts {
#[structopt(short, long)]
accessible: bool,
///Config file usage
#[structopt(short, long)]
config: bool,
/// The batch size for port scanning, it increases or slows the speed of
/// scanning. Depends on the open file limit of your OS. If you do 65535
/// it will do every port at the same time. Although, your OS may not
@@ -133,18 +120,13 @@ struct Opts {
/// The Nmap arguments to run.
/// To use the argument -A, end RustScan's args with '-- -A'.
/// Example: 'rustscan -T 1500 127.0.0.1 -- -A -sC'.
/// Example: 'rustscan -t 1500 127.0.0.1 -- -A -sC'.
/// This command adds -Pn -vvv -p $PORTS automatically to nmap.
/// For things like --script '(safe and vuln)' enclose it in quotations marks \"'(safe and vuln)'\"")
#[structopt(last = true)]
command: Vec<String>,
}
#[derive(Deserialize)]
struct ConfigFile {
ip: IpAddr,
}
#[cfg(not(tarpaulin_include))]
/// Faster Nmap scanning with Rust
/// If you're looking for the actual scanning, check out the module Scanner
@@ -167,12 +149,6 @@ fn main() {
print_opening();
}
/*
TODO when releasing the new config file feature
turn this on.
if opts.config {
let config = get_config_file();
}*/
let ips: Vec<IpAddr> = parse_ips(&opts);
if ips.is_empty() {
@@ -211,7 +187,7 @@ fn main() {
let x = format!("{} Looks like I didn't find any open ports for {:?}. This is usually caused by a high batch size.
\n*I used {} batch size, consider lowering to {} with {} or a comfortable number for your system.
\n Alternatively, increase the timeout if your ping is high. Rustscan -t 2000 for 2000 second timeout.\n",
\n Alternatively, increase the timeout if your ping is high. Rustscan -t 2000 for 2000 milliseconds (2s) timeout.\n",
"ERROR",
ip,
opts.batch_size,
@@ -269,65 +245,21 @@ Faster Nmap scanning with Rust."#;
--------------------------------------"#;
println!("{}", info.gradient(Color::Yellow).bold());
funny_opening!();
// println!("{}", loaded_config_file);
}
fn get_config_file() {
let result_get_location = get_location_config();
let location = match result_get_location {
Ok(path) => path,
Err(_) => panic!("Your system does not have appdirs."),
};
info!("The location of config is {:?}", location);
detail!(format!("The config file is at {:?}", location));
load_and_parse_config_file(location);
}
fn get_location_config() -> Result<std::path::PathBuf, &'static str> {
info!("Getting location of config file");
let config_path = match dirs::config_dir() {
Some(mut path) => {
path.push("rustscan");
path.push("config.toml");
Ok(path)
path
}
None => Err("Your system does not have APPDIRS"),
None => panic!("Couldn't find config dir."),
};
config_path
detail!(format!(
"{} {:?}",
"The config file is expected to be at", config_path
));
}
fn load_and_parse_config_file(config_path: PathBuf) -> ConfigFile {
// Gets the file and returns the string of TOML
// TODO quiet mode
let mut file = File::open(&config_path);
let mut file: File = match file {
Ok(result) => result,
Err(_) => download_place_config_file(config_path),
};
let mut contents = String::new();
file.read_to_string(&mut contents).unwrap();
let config: ConfigFile = toml::from_str(&contents).unwrap();
config
}
// Downloads config file
// Places into Appdirs
fn download_place_config_file(config_location: PathBuf) -> std::fs::File {
info!("Placing config file");
let body = ureq::get("https://raw.githubusercontent.com/RustScan/RustScan/master/config.toml")
.call()
.into_string()
.unwrap();
let mut file = File::create(config_location).unwrap();
file.write(body.as_bytes()).unwrap();
file
}
#[cfg(not(tarpaulin_include))]
fn build_nmap_arguments<'a>(
addr: &'a str,
@@ -393,7 +325,7 @@ fn infer_batch_size(opts: &Opts, ulimit: rlimit::rlim) -> u16 {
// Adjust the batch size when the ulimit value is lower than the desired batch size
if ulimit < batch_size {
warning!("File limit is lower than default batch size. Consider upping with --ulimt. May cause harm to sensitive servers",
warning!("File limit is lower than default batch size. Consider upping with --ulimit. May cause harm to sensitive servers",
opts.quiet
);
@@ -441,7 +373,6 @@ mod tests {
timeout: 1_000,
ulimit: Some(2_000),
command: Vec::new(),
config: false,
accessible: false,
scan_order: ScanOrder::Serial,
};
@@ -461,7 +392,6 @@ mod tests {
timeout: 1_000,
ulimit: Some(2_000),
command: Vec::new(),
config: false,
accessible: false,
scan_order: ScanOrder::Serial,
};
@@ -482,7 +412,6 @@ mod tests {
timeout: 1_000,
ulimit: Some(2_000),
command: Vec::new(),
config: false,
accessible: false,
scan_order: ScanOrder::Serial,
};
@@ -502,7 +431,6 @@ mod tests {
timeout: 1_000,
ulimit: Some(2_000),
command: Vec::new(),
config: false,
accessible: false,
scan_order: ScanOrder::Serial,
};
@@ -527,7 +455,6 @@ mod tests {
timeout: 1_000,
ulimit: None,
command: Vec::new(),
config: false,
accessible: true,
scan_order: ScanOrder::Serial,
};
@@ -550,7 +477,6 @@ mod tests {
command: Vec::new(),
accessible: false,
scan_order: ScanOrder::Serial,
config: false,
};
let ips = parse_ips(&opts);
@@ -570,7 +496,6 @@ mod tests {
command: Vec::new(),
accessible: false,
scan_order: ScanOrder::Serial,
config: false,
};
let ips = parse_ips(&opts);
@@ -590,7 +515,6 @@ mod tests {
command: Vec::new(),
accessible: false,
scan_order: ScanOrder::Serial,
config: false,
};
let ips = parse_ips(&opts);