Compare commits

...
380 Commits
Author SHA1 Message Date
Dmitry SavintsevandBee f74cb456b1 socket_iterator: use itertools.iproducts for ip x ports set (#231)
Replace the current manual iterator-like implementation
with the call to the itertools.iproduct macro
to generate the cartesian product of the IPs and ports.

stdlib reference:
https://docs.rs/itertools/0.9.0/itertools/macro.iproduct.html

Co-authored-by: Bee <[email protected]>
2020-09-20 12:15:46 +01:00
Brandon 492d2fb3b3 fixed accessible issues 2020-09-20 01:25:41 +01:00
bergabmanandBee af53591ccb Added top ports, fixed accessibility. (#230)
* Refactored scanner struct for accessibility, fixed macros

Co-authored-by: Bee <[email protected]>
2020-09-19 18:24:08 +01:00
Bee 6405b43f5a Merge pull request #229 from dmitris/patch-1
fix typo
2020-09-19 00:54:24 +01:00
Dmitry Savintsev 9a71253697 fix typo 2020-09-18 22:13:33 +02:00
Bee 4d6d57fe2c Merge pull request #226 from RustScan/dependabot/cargo/async-std-1.6.4
Bump async-std from 1.6.3 to 1.6.4
2020-09-18 15:38:36 +01:00
Bee a040ab5521 Merge branch 'master' into dependabot/cargo/async-std-1.6.4 2020-09-18 15:38:29 +01:00
Bee a546aa2ac0 Merge pull request #228 from RustScan/all-contributors/add-bergabman
docs: add bergabman as a contributor
2020-09-18 15:38:04 +01:00
Bee 868e61bb2e Merge branch 'master' into all-contributors/add-bergabman 2020-09-18 15:37:57 +01:00
allcontributors[bot] c4f8ceb336 docs: update .all-contributorsrc [skip ci] 2020-09-18 14:37:46 +00:00
allcontributors[bot] 9d80fb4fa7 docs: update README.md [skip ci] 2020-09-18 14:37:45 +00:00
Bee e659d51976 Merge pull request #225 from bergabman/benchmark
Runtime measurement implementation, better debugging, and better error handling for unreachable hosts.
2020-09-18 15:37:44 +01:00
bergabman 64f4aecacd Runtime measurement implementation, better debugging, and better error handling for unreachable hosts. 2020-09-18 16:14:26 +02:00
dependabot-preview[bot] afe2a9452f Bump async-std from 1.6.3 to 1.6.4
Bumps [async-std](https://github.com/async-rs/async-std) from 1.6.3 to 1.6.4.
- [Release notes](https://github.com/async-rs/async-std/releases)
- [Changelog](https://github.com/async-rs/async-std/blob/master/CHANGELOG.md)
- [Commits](https://github.com/async-rs/async-std/compare/v1.6.3...v1.6.4)

Signed-off-by: dependabot-preview[bot] <[email protected]>
2020-09-18 06:51:32 +00:00
Bernardo Araujo 4a6e74d507 Merge pull request #224 from CMNatic/cmn-v1.80-docker-instructions
Updated README to reflect v1.8.0 DockerHub tag
2020-09-15 22:12:28 -04:00
Ben (CMNatic) eb905f7e7a Update README.md
Small typos after initial commit to #224
2020-09-16 02:41:11 +01:00
Ben (CMNatic) 561e7fb2f0 Updated README to reflect v1.8.0 DockerHub tag
v1.8.0 is the most recent published version of RustScan, the alpine tag quickly became depreciated - meaning people had to rely on `latest` to get any features made within the last month.

Version tags will build as per major realease i.e. `v1.9.0`
2020-09-16 01:55:12 +01:00
Bee e5d22a0421 Merge pull request #221 from RustScan/ba-fix-no-nmap
Fix behaviour of --no-nmap flag
2020-09-15 00:51:52 +01:00
Bernardo Chaves 33c9388586 Fix behaviour of --no-nmap flag
At some point we forgot to check for this flag before actually running
our post scanning tasks. I've also adjusted some of our messages for
reporting.
2020-09-14 19:30:30 -04:00
Bee 4dfe76737b Merge pull request #216 from RustScan/dependabot/cargo/serde_derive-1.0.116
Bump serde_derive from 1.0.115 to 1.0.116
2020-09-14 14:01:52 +01:00
Bee cc0b344232 Merge branch 'master' into dependabot/cargo/serde_derive-1.0.116 2020-09-14 13:58:43 +01:00
Bee abaf100da9 Merge pull request #217 from RustScan/bee-fix-debug-output
fixed debug log
2020-09-14 13:58:29 +01:00
Bee 43602793e0 Merge branch 'master' into bee-fix-debug-output 2020-09-14 12:23:28 +01:00
Brandon 7b827991c1 cargo fmt 2020-09-14 12:23:09 +01:00
Brandon f4555ecb98 fixed debug log 2020-09-14 12:20:48 +01:00
dependabot-preview[bot] 2fb8a399a7 Bump serde_derive from 1.0.115 to 1.0.116
Bumps [serde_derive](https://github.com/serde-rs/serde) from 1.0.115 to 1.0.116.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.115...v1.0.116)

Signed-off-by: dependabot-preview[bot] <[email protected]>
2020-09-14 11:05:24 +00:00
Bee e612ddc4e6 Merge pull request #215 from RustScan/dependabot/cargo/serde-1.0.116
Bump serde from 1.0.115 to 1.0.116
2020-09-14 12:04:08 +01:00
dependabot-preview[bot] 8bf75846d3 Bump serde from 1.0.115 to 1.0.116
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.115 to 1.0.116.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.115...v1.0.116)

Signed-off-by: dependabot-preview[bot] <[email protected]>
2020-09-14 06:57:46 +00:00
Bee bf1cb3a5d0 Merge pull request #208 from RustScan/ba-socket-iterator
Introduce SocketIterator
2020-09-13 00:22:49 +01:00
Bernardo Chaves 01975d7238 Introduce SocketIterator
The goal of this iterator is to generate sockets based on combinations
of IPs and ports in a memory-bounded way, we only consume the next item
of this iterator when a socket has been processed by our scanner.

Before this change we were generating every combination of IP and port
and storing it in a VecDeque, and while this is fine for a small subset
of IPs and ports it can quickly get out of hand with multiple IPs and
a big port range.
2020-09-12 12:24:30 -04:00
Bee 8c4cc77e6b Merge pull request #206 from bergabman/master
Bugfixes
2020-09-11 23:35:23 +01:00
bergabman b0c1ab3177 Logic at adding targets to the FuturesUnordered rolled back to the initial.
In case of batchsize higher than all sockets to scan, we could end up in an infinite loop. Fixed with breaking out of the loop if that's the case.
2020-09-11 19:21:21 +02:00
Bee 6812cc3051 Merge pull request #205 from Martin005/patch-1
Fix incorrect timeout option in README
2020-09-11 13:00:50 +01:00
Martin Chrástek 2800adec34 Fix incorrect timeout option 2020-09-11 13:22:11 +02:00
Bee cf1aa67a21 Merge pull request #204 from RustScan/all-contributors/add-bergabman
docs: add bergabman as a contributor
2020-09-11 01:16:28 +01:00
Bee c9708671e8 Merge branch 'master' into all-contributors/add-bergabman 2020-09-11 01:13:27 +01:00
Bee 461f9aaa6d Merge pull request #203 from bergabman/master
Small improvement in the scanning engine.
2020-09-11 01:12:51 +01:00
allcontributors[bot] 01a74b72df docs: update .all-contributorsrc [skip ci] 2020-09-11 00:01:53 +00:00
allcontributors[bot] d301cf3b20 docs: update README.md [skip ci] 2020-09-11 00:01:52 +00:00
Bee 5e8d45bf01 Merge branch 'master' into master 2020-09-11 01:00:47 +01:00
Brandon bc5b2eea7e added release drafter 2020-09-11 00:59:55 +01:00
bergabman c8a8915682 Remove unnecessary comment.
Fix mistake at adding futures to the initial stream.
2020-09-11 01:48:35 +02:00
bergabman d786e24186 Fix format. 2020-09-11 00:48:23 +02:00
Bee 5b536621e6 Merge branch 'master' into master 2020-09-10 23:45:46 +01:00
bergabman c05f40ae70 Small improvement at an if. 2020-09-10 23:29:07 +02:00
bergabman 24b9f8d8d3 Improved scanner engine to work more efficient and consistent with scanning. 2020-09-10 23:27:28 +02:00
Bee bda392c9a7 Merge pull request #200 from RustScan/ba-add-cidr-support
Add CIDR support
2020-09-10 00:46:19 +01:00
Bernardo Chaves 3836480486 Add CIDR support
Add CIDR support for ips_or_hosts argument. This will allow our users to
specify multiple IPs within a network at once which is pretty
convenient.
2020-09-09 19:21:43 -04:00
Bee 2291ba73d2 Update FUNDING.yml 2020-09-07 23:00:14 +01:00
Bee e0af8a306a Merge pull request #198 from RustScan/all-contributors/add-buermarc
docs: add buermarc as a contributor
2020-09-07 22:22:52 +01:00
Bee cb0f4f7a92 Merge branch 'master' into all-contributors/add-buermarc 2020-09-07 22:17:59 +01:00
Bee 402bea4b06 Merge pull request #195 from buermarc/master
Check '.config/rustscan/config.toml' for config
2020-09-07 22:15:47 +01:00
allcontributors[bot] f44dda0360 docs: update .all-contributorsrc [skip ci] 2020-09-07 21:15:35 +00:00
allcontributors[bot] 965a173032 docs: update README.md [skip ci] 2020-09-07 21:15:34 +00:00
Bee d95cae6677 Merge branch 'master' into master 2020-09-07 21:41:27 +01:00
Bee 2f92d5583a Merge pull request #197 from RustScan/ba-no-nmap-option
Introduce the -no-nmap option
2020-09-07 21:41:09 +01:00
Bee 8d8da79640 Merge branch 'master' into ba-no-nmap-option 2020-09-07 21:29:23 +01:00
Bee e5b4a2f443 Merge branch 'master' into master 2020-09-07 21:23:18 +01:00
Bernardo Araujo a0b877729e Merge pull request #194 from usrGabriel/patch-1
Update README.md
2020-09-07 11:20:25 -04:00
Bernardo Chaves 743fa1cad6 Introduce the -no-nmap option
As the name implies this will allow RustScan to to run the scan without
starting an nmap scan with ports that are found.
2020-09-06 22:22:17 -04:00
mulc a0561d4728 Check '.config/rustscan/config.toml' for config
When reading the config file '$CONFIG_DIR/.config/rustscan/config.toml'
should also be checked. If both '~/.rustscan.toml' and
'$CONFIG_DIR/.config/rustscan/config.toml' exist, then later will be
used.
2020-09-05 18:32:08 +02:00
Gabriel b2a1bd2e7a Update README.md
Typo fix in the Debian / Kali install section.
2020-09-05 12:23:18 -04:00
Brandon 87de96c3c4 Merge pull request #185 from RustScan/ba-add-config-file
Add configuration file
2020-08-30 14:00:07 +01:00
Bernardo Chaves 8e21f3bf8c Add configuration file
This configuration file will be read from the home directory of the
user. Options set within this file will have priority over arguments
from the command line unless the `--no-config` option is passed to the
program.
2020-08-29 18:01:44 -04:00
Brandon 4019d1ff3a Merge pull request #182 from RustScan/all-contributors/add-tim77
docs: add tim77 as a contributor
2020-08-29 12:15:07 +01:00
Brandon c004bd0527 Merge pull request #181 from tim77/tim77-patch-1
Add Fedora/CentOS installation instructions
2020-08-29 11:53:44 +01:00
allcontributors[bot] cdc5bbd924 docs: update .all-contributorsrc [skip ci] 2020-08-29 10:53:35 +00:00
allcontributors[bot] f41213047a docs: update README.md [skip ci] 2020-08-29 10:53:34 +00:00
Artem Polishchuk 2315ef2417 Add Fedora/CentOS installation instructions 2020-08-28 23:33:42 +03:00
Brandon cb87d5b9ce Update README.md 2020-08-28 16:14:10 +01:00
Brandon 92800678cd Merge branch 'master' of github.com:brandonskerritt/RustScan into master 2020-08-28 15:59:05 +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
Brandon 22cbfc5826 Merge pull request #159 from RustScan/bee-add-nmap-ports
updated config file to feature nmap top 1k ports
2020-08-24 16:49:13 +01:00
Brandon a9d729300c Merge branch 'master' into bee-add-nmap-ports 2020-08-24 13:49:10 +01:00
Brandon 4f5dd20e85 Merge pull request #162 from RustScan/ba-reduce-binary-size
Reduce binary size from 2.4MB to 1.9MB
2020-08-24 12:48:45 +01:00
Bernardo Chaves 499ff66f36 Reduce binary size from 2.4MB to 1.9MB
By default, Cargo instructs compilation units to be compiled and optimized
in isolation. LTO instructs the linker to optimize at the link stage.
This can, for example, remove dead code and often times reduces binary size.

By default, when Rust code encounters a situation when it must call panic!(),
it unwinds the stack and produces a helpful backtrace. The unwinding code,
however, does require extra binary size. rustc can be instructed to abort
immediately rather than unwind, which removes the need for this extra unwinding code.

For more information see: https://github.com/johnthagen/min-sized-rust
2020-08-23 18:10:53 -04:00
Brandon 61b87243d9 Merge pull request #161 from RustScan/ba-refactor-port-strategy
Allow randomized order for manual ports
2020-08-22 22:27:37 +01:00
Bernardo Chaves e069991c8d Allow randomized order for manual ports
Before this change we would always scan manually specified ports in
sequential way, this is not the case anymore. This is an important
change since we are planning to introduce a config file with the top 1K
ports and we would like to scan those in a randomized way.
2020-08-21 13:09:41 -04:00
Brandon 85c1cbf445 Merge pull request #160 from RustScan/bee-remove-A
removed -A from nmap
2020-08-20 22:58:39 +01:00
Brandon 5551e64166 updated AUR package in readme 2020-08-20 00:40:41 +01:00
Brandon e0aa1423ad removed -A from nmap 2020-08-20 00:32:37 +01:00
Brandon e609b3617c updated config file to feature nmap top 1k ports 2020-08-20 00:05:45 +01:00
Brandon d0d8380296 Merge pull request #158 from RustScan/ba-add-port-and-range-options
Add --port and --range options
2020-08-19 16:26:39 +01:00
Brandon d66ad34f8c Merge branch 'master' into ba-add-port-and-range-options 2020-08-19 16:02:49 +01:00
Brandon 2670ec43df Merge pull request #156 from spenserblack/exclude-files
Exclude files
2020-08-19 00:05:59 +01:00
Bernardo Chaves 90d0b03ba7 Add --port and --range options
These options are mutually exclusive, this means that when a user
selects manual ports we will ignore ranges and vice-versa.

Manually specifying ports won't allow scan randomization for now.
2020-08-17 20:43:44 -04:00
Spenser Black 57eb3627b3 Use absolute image URLs instead of relative 2020-08-17 10:03:04 -04:00
Spenser Black 7e675b7557 Reduce crate size 2020-08-17 09:30:07 -04:00
Bernardo Araujo fdeaa05f23 Merge pull request #152 from RustScan/ba-add-host-resolution
Add host resolution
2020-08-16 18:35:40 -04:00
Bernardo Araujo 9fbf39f0cc Merge branch 'master' into ba-add-host-resolution 2020-08-16 18:11:27 -04:00
Ben (CMNatic) 14b6ea928d Merge pull request #155 from CMNatic/master
Updated README to use the rustscan dockerhub alpine image
2020-08-16 22:39:10 +01:00
Ben (CMNatic) 9452b1f922 Update README to add a disclaimer about the DockerHub Images
+ Instruct user to use the `alpine` image as it's considered the latest major release as per the release page

+ Formatting instructions
2020-08-16 22:37:51 +01:00
Ben (CMNatic) ed12888e81 Updated README to use the rustscan dockerhub alpine image
+ Added another step to clarify process for Docker as the build will fail if the user is not in the downloaded repo

+ DockerHub has CI with master branch and two images tags `latest` and `alpine` where `alpine` is tagged on feature releases (currently 1.7.1)
2020-08-16 22:28:57 +01:00
Bernardo Chaves f68abcb955 Add host resolution
For now if we can establish a socket on port 80 we can infer the IP of the
host. This might change in the future if we start considering other
ports like 443.
2020-08-16 11:52:11 -04:00
Brandon 4c91e8fb40 Merge pull request #153 from andy5995/docs
docs: fix typo in README.md, link to GitHub flow in contributing doc
2020-08-15 11:08:03 +01:00
andy5995 1d3e831066 docs: fix typo in README.md, link to GitHub flow in contributing doc 2020-08-15 02:05:20 -05:00
dependabot-preview[bot] ff6b1c40db Merge pull request #151 from RustScan/dependabot/cargo/async-std-1.6.3 2020-08-15 00:58:44 +00:00
dependabot-preview[bot] 5573d91a7b Bump async-std from 1.6.2 to 1.6.3
Bumps [async-std](https://github.com/async-rs/async-std) from 1.6.2 to 1.6.3.
- [Release notes](https://github.com/async-rs/async-std/releases)
- [Changelog](https://github.com/async-rs/async-std/blob/master/CHANGELOG.md)
- [Commits](https://github.com/async-rs/async-std/commits/v1.6.3)

Signed-off-by: dependabot-preview[bot] <[email protected]>
2020-08-14 08:38:10 +00:00
Brandon a8e56eec4b Merge pull request #149 from RustScan/all-contributors/add-cmnatic
docs: add cmnatic as a contributor
2020-08-13 22:56:14 +01:00
Brandon fb75c9d332 Merge branch 'master' into all-contributors/add-cmnatic 2020-08-13 22:43:56 +01:00
Ben (CMNatic) 581ec27cb5 Merge pull request #148 from CMNatic/master
Updated README to include instructions on building the new Dockerfile
2020-08-13 20:25:05 +01:00
allcontributors[bot] 9673c8807d docs: update .all-contributorsrc [skip ci] 2020-08-13 19:24:12 +00:00
allcontributors[bot] 78818d6bc7 docs: update README.md [skip ci] 2020-08-13 19:24:11 +00:00
Ben (CMNatic) d0ff597be6 Updated README to include instructions on building the new Dockerfile 2020-08-13 20:11:58 +01:00
Ben (CMNatic) 516ebe367a Merge pull request #118 from Hydragyrum/feature/create-alpine-based-dockerfile
Feature/create alpine based dockerfile
2020-08-13 19:41:52 +01:00
Ben (CMNatic) 1e9660e4ff Merge branch 'master' into feature/create-alpine-based-dockerfile 2020-08-13 19:32:13 +01:00
Brandon 7b4dda5a19 Merge pull request #147 from RustScan/dependabot/cargo/rlimit-0.4.0
Bump rlimit from 0.3.0 to 0.4.0
2020-08-13 11:40:23 +01:00
dependabot-preview[bot] a20b71191d Bump rlimit from 0.3.0 to 0.4.0
Bumps [rlimit](https://github.com/Nugine/rlimit) from 0.3.0 to 0.4.0.
- [Release notes](https://github.com/Nugine/rlimit/releases)
- [Commits](https://github.com/Nugine/rlimit/compare/v0.3.0...v0.4.0)

Signed-off-by: dependabot-preview[bot] <[email protected]>
2020-08-13 08:36:23 +00:00
Brandon 18c5dd69e5 Merge pull request #145 from RustScan/all-contributors/add-TGotwig
docs: add TGotwig as a contributor
2020-08-11 19:45:15 +01:00
Brandon 090264ac26 Merge branch 'master' into all-contributors/add-TGotwig 2020-08-11 19:32:11 +01:00
Bernardo Araujo 702681606f Merge pull request #146 from RustScan/bee-fix-spelling
fixed spelling mistake
2020-08-10 20:59:20 -04:00
Brandon c58ac613c9 fixed spelling mistake 2020-08-11 01:47:25 +01:00
Brandon 44b53fb877 Merge pull request #143 from RustScan/all-contributors/add-remigourdon
docs: add remigourdon as a contributor
2020-08-10 21:47:24 +01:00
Brandon 99e72e4a16 Merge branch 'master' into all-contributors/add-remigourdon 2020-08-10 21:12:53 +01:00
Brandon e02073bd97 Merge pull request #144 from TGotwig/master
Add Makefile for cross-compiling to Linux & Mac 👷‍♂️
2020-08-10 21:12:34 +01:00
allcontributors[bot] 59bb72426d docs: update .all-contributorsrc [skip ci] 2020-08-10 19:57:32 +00:00
allcontributors[bot] f48590c238 docs: update README.md [skip ci] 2020-08-10 19:57:31 +00:00
tgotwig a3eb548ae9 Add Makefile for cross-compiling to Linux & Mac 👷‍♂️ 2020-08-10 15:04:06 +02:00
allcontributors[bot] 050a8baf48 docs: update .all-contributorsrc [skip ci] 2020-08-10 12:39:34 +00:00
allcontributors[bot] 9b893dbf71 docs: update README.md [skip ci] 2020-08-10 12:39:33 +00:00
Brandon 8245ccf31e Fixing all contributors 2020-08-10 13:38:53 +01:00
Brandon 301a656006 Merge pull request #138 from RustScan/ba-update-readme-instructions
Update documentation
2020-08-10 13:02:21 +01:00
Bernardo Chaves 1639aadc54 Update documentation
- README
- Port strategies
2020-08-09 12:29:16 -04:00
Brandon c66bb50508 Merge pull request #132 from RustScan/ba-optimize-range-generator
Refactor RangeIterator to not require Option types
2020-08-09 01:13:54 +01:00
Bernardo Chaves b490eb08be Refactor RangeIterator to not require Option types
There's no need to deal with `unwrap` for this specific algorithm,
instead we can rely on simple types to achieve the same result.
2020-08-08 14:08:43 -04:00
Brandon 990e92dcbf Merge pull request #134 from RustScan/bee-add-a11y-mode
Add a11y mode
2020-08-08 13:45:59 +01:00
Brandon 883e89fe5e cargo fmt 2020-08-08 13:26:45 +01:00
Brandon 1b15cc2f71 Merge branch 'master' into bee-add-a11y-mode 2020-08-08 13:24:41 +01:00
Brandon 18b574f6bb Merge pull request #137 from Nugine/fix-typo
Fix typo of "ulimt"
2020-08-08 13:22:12 +01:00
Nugine 3fafee42b9 Fix typo of "ulimt" 2020-08-08 19:54:12 +08:00
Brandon 8b21dfd9a2 Merge pull request #135 from RustScan/ba-add-scan-strategy
Add port scanning strategy
2020-08-08 00:43:07 +01:00
Bernardo Chaves 2f16729c54 Add port scanning strategy
User will be able to pick from:
  - serial: in order to have their ports scanned in ascending order
  - random: in order to have their ports scanned randomly
2020-08-07 18:59:44 -04:00
Brandon 785c2a4de1 fixed tests 2020-08-07 22:28:57 +01:00
Brandon 80cc97bf83 removed perf data 2020-08-07 22:04:33 +01:00
Brandon 7a825dae41 the printopening() would suck in a TTS program 2020-08-07 21:39:53 +01:00
Brandon 751c4daff6 1.7.1 2020-08-07 17:48:37 +01:00
Brandon f6214cfb27 Merge branch 'master' of github.com:brandonskerritt/RustScan 2020-08-07 17:48:10 +01:00
Brandon a92eb80365 updated lock files 2020-08-07 17:30:39 +01:00
Brandon aeab4fb68c Merge pull request #131 from RustScan/bee-colours
Added TUI A11Y colours + Quiet Mode Macros
2020-08-07 17:25:57 +01:00
Brandon 9ab15c9d8b cargo fmt 2020-08-07 17:11:14 +01:00
Brandon 7146c23ed9 cleanup 2020-08-07 17:06:43 +01:00
Brandon f37f2d8f9d switching to master 2020-08-07 16:50:42 +01:00
Brandon 5a3a4d1c0c cargo fmt 2020-08-07 16:36:14 +01:00
Brandon 33e7cd44b6 added quiet mode to macros 2020-08-07 16:33:25 +01:00
Brandon 8288856949 added quotes 2020-08-07 13:21:19 +01:00
Brandon c3b96e262d Merge pull request #130 from RustScan/bee-add-TUI-module
Bee add tui module
2020-08-07 12:53:46 +01:00
Brandon a54868000e cargo format 2020-08-07 12:37:05 +01:00
Brandon 8f4acdf99a cleaned up colours 2020-08-07 12:33:44 +01:00
Brandon c637042906 fixed visual table 2020-08-07 02:08:12 +01:00
Brandon 766164588c fixed spacing 2020-08-07 01:53:14 +01:00
Brandon b2be83c04a added basic TUI interface 2020-08-07 00:52:56 +01:00
Brandon a3654b68eb added basic TUI interface 2020-08-07 00:40:28 +01:00
Brandon 1873a92951 Merge pull request #128 from RustScan/dependabot/cargo/structopt-0.3.16
Bump structopt from 0.3.15 to 0.3.16
2020-08-06 11:25:24 +01:00
dependabot-preview[bot] c7a422b962 Bump structopt from 0.3.15 to 0.3.16
Bumps [structopt](https://github.com/TeXitoi/structopt) from 0.3.15 to 0.3.16.
- [Release notes](https://github.com/TeXitoi/structopt/releases)
- [Changelog](https://github.com/TeXitoi/structopt/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TeXitoi/structopt/commits)

Signed-off-by: dependabot-preview[bot] <[email protected]>
2020-08-06 08:39:30 +00:00
Bernardo Chaves 0eec9233bd Make use of our new RangeIterator
We now rely on a pseudo random generator to scan our IPs. We also
interleave IP scanning in order to not overwhelm a single IP.
2020-08-06 01:36:36 +01:00
Bernardo Chaves 0f18bb49a3 Add pseudo random port scanning
This is based on the Linear Congruential Generator algorithm which
guarantees we will iterate through an entire range in a pseudo random
manner.

This implementation should be bound in memory by the batch_size
specified by the user, which will be in average 1_000.
2020-08-06 01:36:36 +01:00
Adam Bertrand 8b363571f1 Merge branch 'master' into feature/create-alpine-based-dockerfile 2020-08-05 21:52:34 +02:00
yogendra0sharma e546608ff8 show batch_size to user 2020-08-05 19:12:53 +01:00
yogendra0sharma a7d1952b72 Fix Issue Unneccesary text printed 2020-08-05 19:12:53 +01:00
Hydragyrum 0fa11f6e51 Add a non-privileged user to run rustscan 2020-08-05 18:53:06 +02:00
Adam Bertrand d423f34e7a Merge branch 'master' into feature/create-alpine-based-dockerfile 2020-08-05 18:25:54 +02:00
Brandon 67726cc490 1.6 2020-08-04 23:30:52 +01:00
Brandon d5d39cacd3 Merge pull request #117 from RustScan/ba-implement-multi-ip
Support multiple IPs
2020-08-04 23:21:17 +01:00
Bernardo Chaves 52cbbeeac6 Adjust messages taking into account quiet mode 2020-08-04 17:40:23 -04:00
Hydragyrum e17f9d0bb1 Add newline to dockerfile 2020-08-04 23:18:12 +02:00
Hydragyrum 3329428766 Create a basic Alpine-Based Dockerfile 2020-08-04 23:17:30 +02:00
Bernardo Chaves 23c049413b Support multiple IPs
IPs should be provided in a comma separated list.

Right now every IP will be scanned sequentially and NMAP will run before
the next IP scan starts. This will change on the long term once we
provide randomized scans in order to not overwhelm hosts or trigger
detection systems in place.
2020-08-04 16:17:27 -04:00
Brandon 9858406271 fixing cargo.toml issue 2020-08-04 16:43:14 +01:00
Brandon 6abb3737ec cargo updates 2020-08-04 16:40:32 +01:00
Brandon 65b9cb1659 cargo update 2020-08-04 16:36:48 +01:00
Brandon d2684baead 1.5 2020-08-04 16:36:24 +01:00
Brandon 5a40bc4182 Merge pull request #116 from RustScan/bee-add-section-deb
Bee add section deb #114
2020-08-04 15:09:40 +01:00
Brandon f03f15a6d0 Merge branch 'master' into bee-add-section-deb 2020-08-04 13:30:34 +01:00
Brandon 5f95b34250 deb builder works 2020-08-04 13:01:49 +01:00
Brandon 4bca6ce337 Merge pull request #108 from RustScan/bee-fix-mac-os-ulimit
Bee fix mac os ulimit
2020-08-04 12:57:24 +01:00
Brandon 9740d54912 Merge pull request #112 from RustScan/all-contributors/add-Atul9
docs: add Atul9 as a contributor
2020-08-04 12:55:46 +01:00
Brandon f577cd23bd Merge branch 'master' into all-contributors/add-Atul9 2020-08-04 12:49:57 +01:00
Brandon f16d704c86 Update README.md 2020-08-04 12:45:50 +01:00
Brandon e5368a31db Made it new line 2020-08-04 12:44:50 +01:00
Brandon 01c2580672 Made Docker command shorter 2020-08-04 12:44:14 +01:00
Brandon 200382a731 Update README.md 2020-08-04 12:42:03 +01:00
Brandon 6a000762a5 Merge branch 'master' into all-contributors/add-Atul9 2020-08-04 12:38:56 +01:00
Brandon e9b21338ef Added Docker to README 2020-08-04 12:28:49 +01:00
Brandon bd436221ca Merge branch 'master' into all-contributors/add-Atul9 2020-08-04 12:18:04 +01:00
Brandon 5d16af21f1 Updated 404 links & added emojis 2020-08-04 11:51:15 +01:00
Brandon e331789598 Merge pull request #105 from Atul9/cleanup-readme
Clean up the README file
2020-08-04 11:44:02 +01:00
Brandon bf56b10ff4 Merge branch 'master' into all-contributors/add-Atul9 2020-08-04 11:29:57 +01:00
Brandon 719c38bd32 Update README.md 2020-08-04 11:29:05 +01:00
Atul Bhosale a08fe2456d Rename Community section heading to Contributing [ci skip] 2020-08-04 08:09:49 +05:30
Atul Bhosale db1831c4b8 Replace Homebrew in Readme table with Docker [ci skip] 2020-08-04 08:09:49 +05:30
Atul Bhosale 74e2ff026a Move table of contents higher up [ci skip] 2020-08-04 08:09:49 +05:30
Atul Bhosale 897c1c4091 Move important links under features [ci skip] 2020-08-04 08:09:49 +05:30
Brandon a9340bb622 Merge pull request #108 from RustScan/bee-fix-mac-os-ulimit
Bee fix mac os ulimit
2020-08-03 23:48:00 +01:00
Brandon 9caed66265 accidentally included Vim keybindings lol 2020-08-03 23:09:24 +01:00
Brandon eae6342255 adjusted test names 2020-08-03 22:56:30 +01:00
Brandon 328156c613 changed mac osx tests to fail 2020-08-03 21:36:27 +01:00
Brandon f53f6123bf Merge branch 'bee-fix-mac-os-ulimit' of github.com:brandonskerritt/RustScan into bee-fix-mac-os-ulimit 2020-08-03 21:35:40 +01:00
Brandon 7044174933 fixed code review issues 2020-08-03 21:33:18 +01:00
Brandon 1ede04d539 Merge branch 'master' into bee-fix-mac-os-ulimit 2020-08-03 20:10:19 +01:00
Brandon e56456e779 rustfmt 2020-08-03 20:09:11 +01:00
Brandon 484cf023d7 Merge pull request #113 from RustScan/all-contributors/add-royharoush
docs: add royharoush as a contributor
2020-08-03 20:08:27 +01:00
Brandon 98763d43e0 added more tests to reach 90% code cov 2020-08-03 20:05:59 +01:00
allcontributors[bot] a81c409ed4 docs: update .all-contributorsrc [skip ci] 2020-08-03 17:56:06 +00:00
allcontributors[bot] c0f63e0534 docs: update README.md [skip ci] 2020-08-03 17:56:05 +00:00
allcontributors[bot] 137f8669fe docs: update .all-contributorsrc [skip ci] 2020-08-03 17:55:15 +00:00
allcontributors[bot] c658b0ea70 docs: update README.md [skip ci] 2020-08-03 17:55:14 +00:00
Brandon 1d68c842d9 removed cargo upload 2020-08-03 12:44:07 +01:00
Brandon 6568203f46 Merge pull request #109 from RustScan/bee-auto-deployment
added crates.io publishing
2020-08-03 12:29:43 +01:00
Brandon 0cfe82eb5d remvoed codecov 2020-08-03 12:18:56 +01:00
Brandon 53512039d1 Merge branch 'bee-auto-deployment' of github.com:brandonskerritt/RustScan into bee-auto-deployment 2020-08-03 11:30:51 +01:00
Brandon 7b392f0d6d added codecoverage 2020-08-03 11:30:29 +01:00
Brandon bf67019079 Merge branch 'master' into bee-auto-deployment 2020-08-03 11:26:02 +01:00
Brandon da27b17485 only deploy on master branch 2020-08-03 01:36:36 +01:00
Brandon a528d41ac6 Update .travis.yml 2020-08-03 01:19:05 +01:00
Brandon 7686c25d0d osx now no longer fails ci 2020-08-03 01:18:29 +01:00
Brandon 9cf4177faa mac os doesnt fail ci now 2020-08-03 01:17:45 +01:00
Brandon 647b97b52c added crates.io publishing 2020-08-03 01:14:48 +01:00
Brandon 1b8b0b4478 Cannot fix until opts can be made without arguments 2020-08-03 01:10:03 +01:00
Brandon c6dedc317a maybe ci will show this working? 2020-08-03 00:45:36 +01:00
Brandon 654488cbbc Added ulimit warning, info log, and test 2020-08-03 00:33:49 +01:00
Brandon 81701d4243 automatic ulimit halving 2020-08-03 00:29:42 +01:00
Brandon 97eac2aa33 Merge pull request #106 from bernardoamc/ba-tackle-config
Move config path disclaimer to opening function
2020-08-03 00:19:11 +01:00
Bernardo de Araujo 76ee4666b8 Move config path disclaimer to opening function
This will always be displayed unless the `quiet` flag is specified and
has the added benefit of allowing us to enforce the IP address.
2020-08-02 18:41:08 -04:00
Brandon 7e48f125dc why wont you work :( 2020-08-02 23:00:23 +01:00
Brandon 56482fd8ff increased timeout 2020-08-02 22:53:21 +01:00
Brandon 5e41472814 reducing batch sizes 2020-08-02 22:47:54 +01:00
Brandon d99c811e93 amending for mac os 2020-08-02 22:39:26 +01:00
Brandon ec003e4557 amending for mac os 2020-08-02 22:33:26 +01:00
Brandon 50ca069f20 added many more tests 2020-08-02 22:25:48 +01:00
Brandon 9d2318ab9c trying cmnatic test server 2020-08-02 22:10:08 +01:00
Brandon 9c7916f92a Merge pull request #104 from SanjoAndPanjo/master
Added gh releases, windows support, added up docker service, re-enabled discord webhooks
2020-08-02 21:42:06 +01:00
Brandon 6d053ad199 Update .travis.yml 2020-08-02 21:33:35 +01:00
Brandon 7dedfb5fed fixed travis to not include windows 2020-08-02 21:08:29 +01:00
Sanjo and Panjo 748ad43db0 fixed spacing... damn it 2020-08-02 18:26:26 +02:00
Sanjo and Panjo 75523d03cb added github releases, re-enabled messages to discord on successfull deployment 2020-08-02 18:18:14 +02:00
Brandon 328226838e Merge pull request #103 from RustScan/bee-add-travis-ci
Bee add travis ci
2020-08-02 16:11:10 +01:00
Brandon f78b114486 Merge branch 'master' into bee-add-travis-ci 2020-08-02 16:00:56 +01:00
Brandon 7bb1f7860b dont post to discord on ok build 2020-08-02 15:43:40 +01:00
Brandon 2fd63fa1f3 changing batch size to 100 for testing 2020-08-02 15:13:02 +01:00
Brandon 89047f4b26 added discord webhook 2020-08-02 15:04:25 +01:00
Brandon f659b8dd3d fixing MacOS builds 2020-08-02 15:01:41 +01:00
Brandon 6ab1c526cc added matrix 2020-08-02 14:51:10 +01:00
Brandon b2eac63130 added rustfmt 2020-08-02 14:45:46 +01:00
Brandon cdb55261b2 added cargo test to travisci 2020-08-02 14:31:34 +01:00
Brandon fb666f46bb changed language to rust 2020-08-02 13:53:10 +01:00
Brandon 96659dcd89 added travisci file 2020-08-02 13:52:41 +01:00
Brandon b4f9d9d228 added travisci file 2020-08-02 13:51:05 +01:00
Brandon 30ab9523a2 Merge pull request #97 from RustScan/bee-update-cargo
updated cargo.toml file
2020-08-02 02:20:32 +01:00
Brandon ff2eea2015 Merge branch 'master' into bee-update-cargo 2020-08-02 01:26:10 +01:00
Brandon aef842c2e3 Merge pull request #93 from RustScan/bee-add-app-dirs
Added AppDirs
2020-08-02 01:24:51 +01:00
Brandon 2f9a54e2ba fixed discord link 2020-08-02 01:21:46 +01:00
Brandon dfb451aacc fixed path bug. .config/config.toml -> .config/rustscan/config.toml 2020-08-02 00:16:13 +01:00
Brandon 0cd37b4ffe updated cargo.toml file 2020-08-01 23:12:47 +01:00
Brandon 0c01dc0f17 fixing merge 2020-08-01 22:55:50 +01:00
Brandon b52a990ad0 Merge pull request #95 from RustScan/bee-scheduled-markdown-action
Scheduled markdown action 404 links
2020-08-01 22:47:37 +01:00
Brandon 1c88f98132 fixing rust fmt 2020-08-01 22:45:52 +01:00
Brandon c8404781dc Merge branch 'master' into bee-scheduled-markdown-action 2020-08-01 22:45:29 +01:00
Brandon 6617b2178b added very important emoji to readme 2020-08-01 22:44:06 +01:00
Brandon e2395f8ddc Added distributions to readme, fixed required ip address 2020-08-01 22:43:17 +01:00
Brandon 6ab43bf213 Merge pull request #96 from bernardoamc/ba-reduce-unsig-int
Refactor ulimit and batch_size logic consider the OS architecture
2020-08-01 21:15:39 +01:00
Brandon da3629cc7b Merge branch 'master' into bee-scheduled-markdown-action 2020-08-01 21:08:11 +01:00
Bernardo de Araujo af344becbc Refactor ulimit and batch_size logic consider the OS architecture
RustScan should be able to run on systems with either 32 or 64 bits. In
order to achieve that we should rely on the `rlimit` library to get the
proper unsigned int type from the system.
2020-08-01 15:45:31 -04:00
Brandon 85b7f9fe7a Merge pull request #94 from RustScan/bee-readme-community-additions
Updated readme
2020-08-01 19:34:00 +01:00
Brandon 9d1d064e71 fixed typo 2020-08-01 19:30:33 +01:00
Brandon 343563818f checking to see if CI works 2020-08-01 17:40:59 +01:00
Brandon bc77814d59 checking to see if CI works 2020-08-01 17:37:49 +01:00
Brandon 42b72ea114 added daily 404 link checking 2020-08-01 17:31:46 +01:00
Brandon d73c66482e Updated readme 2020-08-01 17:07:50 +01:00
Brandon b850868265 added appdirs 2020-08-01 13:54:58 +01:00
Brandon c77e45d478 added new github action to check readme for 404s 2020-08-01 13:23:43 +01:00
Brandon 82e3128641 Update README.md 2020-08-01 13:21:53 +01:00
Brandon 679d1a787d Merge pull request #92 from RustScan/dependabot/cargo/colored-2.0.0
Bump colored from 1.9.3 to 2.0.0
2020-08-01 11:42:04 +01:00
dependabot-preview[bot] 813b6753c8 Bump colored from 1.9.3 to 2.0.0
Bumps [colored](https://github.com/mackwic/colored) from 1.9.3 to 2.0.0.
- [Release notes](https://github.com/mackwic/colored/releases)
- [Changelog](https://github.com/mackwic/colored/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mackwic/colored/compare/v1.9.3...v2.0.0)

Signed-off-by: dependabot-preview[bot] <[email protected]>
2020-08-01 10:35:53 +00:00
Brandon 51df49836b Merge pull request #91 from bernardoamc/ba-refactor-ip-parsing
Fail early when the specified IP format is not valid
2020-08-01 11:18:53 +01:00
Bernardo de Araujo 2df98016c9 Fail early when the specified IP format is not valid
We can let structopt parse the supplied IP for us and fail early when
that IP address is invalid. We can also let IpAddr let us know when an
IP is an ipv4 or ipv6 without relying on the user to supply this
information to us.
2020-08-01 00:15:19 -04:00
Brandon deb8bb3216 rust fmt 2020-07-31 16:23:28 +01:00
Brandon 6ce8fe1afd trying to fix docs.rs 2020-07-31 14:23:38 +01:00
Brandon 8aa9a44949 updating lock file 2020-07-31 13:34:33 +01:00
Brandon 416602dd02 added ipv6 to readme 2020-07-31 13:34:04 +01:00
Brandon a2e7125e03 updated cargo.toml 2020-07-31 13:33:24 +01:00
Brandon 10acad243c Merge pull request #87 from RustScan/ipv6-support
Ipv6 support
2020-07-31 13:02:56 +01:00
Brandon 5d69339cc7 cargo fmt 2020-07-31 11:33:08 +01:00
Brandon d8fd12694c fixed tests 2020-07-31 11:32:02 +01:00
Brandon 7d4084d06c added ipv6 support to nmap command 2020-07-31 11:21:58 +01:00
Brandon 365be75689 Merge branch 'ipv6-support' of github.com:brandonskerritt/RustScan into ipv6-support 2020-07-31 02:11:28 +01:00
Brandon 5ea316c5db ipv6 is now implemented. Just need to do a final cleanup 2020-07-31 02:11:09 +01:00
Brandon b363529045 ipv6 is now implemented. Just need to do a final cleanup 2020-07-31 01:30:35 +01:00
Brandon ed378f7fc8 Either this doesnt work or my internet is broken 2020-07-31 01:17:38 +01:00
Brandon aa3c591016 added logging module 2020-07-30 23:44:48 +01:00
Brandon ef893fdcb8 Update README.md 2020-07-30 12:49:22 +01:00
Brandon b78a8ad0af edited contributing.md 2020-07-30 12:39:54 +01:00
Brandon 7ad7e34abc Updated comments -> issues bot 2020-07-30 12:24:36 +01:00
Brandon e41393b4ad Update Dockerfile 2020-07-30 11:22:45 +01:00
Brandon 6d72037974 Code finally compiles 2020-07-30 02:17:17 +01:00
Brandon 66486b2467 scanner.rs now works 2020-07-30 01:46:38 +01:00
Brandon 4b085d97f2 added ipv6 testing 2020-07-29 18:11:57 +01:00
Brandon 4785b75f9f 1.3 release 2020-07-29 12:02:01 +01:00
Brandon 3951c25dff end of dya 2020-07-29 01:50:36 +01:00
Brandon 071c437206 sending to smackhack 2020-07-29 00:45:47 +01:00
Brandon 7d351f2025 socketaddr is now ipv4 and ipv6 2020-07-28 23:12:08 +01:00
Brandon 8ce14c5690 Added arguments in structopts for ipv6 2020-07-28 02:23:07 +01:00
Brandon 6cf71a1529 switching branches real quick 2020-07-28 01:07:57 +01:00
Brandon 50c74d63cf Merge pull request #78 from jsegaran/jsegaran/remove_quote_quiet
Remove quote on quiet
2020-07-27 10:26:32 +01:00
Joshua Segaran c1f9be150f Remove quote on quiet 2020-07-26 19:10:52 -07:00
Brandon 0a13100185 Merge pull request #77 from RustScan/adding_testing
Adding testing
2020-07-26 19:44:14 +01:00
Brandon b67aa40eae clippy has an error 2020-07-26 19:43:22 +01:00
Brandon fb3c7c4ce2 added rustfmt to github actions 2020-07-26 19:35:48 +01:00
Brandon 4d4ef5ac51 added testing to CI 2020-07-26 19:33:19 +01:00
Brandon 022cc8725a Merge pull request #75 from bernardoamc/refactor-into-structopts
Refactor code in order to use structopt
2020-07-26 19:14:28 +01:00
Brandon e12a12fd04 merging structopts 2020-07-26 19:14:15 +01:00
Brandon 999634cf9b Merge pull request #76 from Atul9/cargo-fmt
Format code using 'cargo fmt'
2020-07-26 19:10:27 +01:00
Atul Bhosale c45f4d1b86 Format code using 'cargo fmt' 2020-07-26 23:05:59 +05:30
Bernardo de Araujo 3f4c0c32cc Refactor code in order to use structopt
This allows us to not worry about argument parsing anymore since Rust
can automatically infer the parsing logic from the type of our
arguments.
2020-07-26 11:09:16 -04:00
Brandon a3a4cf9587 Merge pull request #73 from bernardoamc/parse-user-args-with-quotes
Use shellwords to parse nmap arguments from user
2020-07-26 15:54:23 +01:00
Brandon e17ec84867 completing merge to master 2020-07-26 15:52:39 +01:00
Brandon 0fbdda51d2 added details to readme and help menu 2020-07-26 15:49:52 +01:00
Brandon 4de017250d Merge pull request #74 from RustScan/remove-advertising-and-readme
Remove advertising and readme updates
2020-07-26 11:49:18 +01:00
Brandon 08cbf08beb adding spacing in deb install section 2020-07-26 11:47:50 +01:00
Brandon e5c51c3980 README updates 2020-07-26 11:43:28 +01:00
Brandon 757653a30b removed advertising from rustscan logo 2020-07-26 11:30:02 +01:00
Bernardo de Araujo c5d02c31f1 Use shellwords to parse nmap arguments from user
We were not considering user arguments with quotes or other special
characters.
2020-07-25 20:56:11 -04:00
Brandon 6906177ec2 Merge pull request #68 from brandonskerritt/all-contributors/add-imlonghao
docs: add imlonghao as a contributor
2020-07-25 16:06:01 +01:00
allcontributors[bot] 276e0d193c docs: update .all-contributorsrc [skip ci] 2020-07-25 15:01:55 +00:00
allcontributors[bot] 965d3d780c docs: update README.md [skip ci] 2020-07-25 15:01:54 +00:00
Brandon 67d34b5036 Updated to include correct AUR link 2020-07-25 15:57:29 +01:00
31 changed files with 3825 additions and 501 deletions

No files matched your search

+138 -1
View File
@@ -56,11 +56,148 @@
"contributions": [
"bug"
]
},
{
"login": "imlonghao",
"name": "imlonghao",
"avatar_url": "https://avatars1.githubusercontent.com/u/4951333?v=4",
"profile": "https://imlonghao.com",
"contributions": [
"bug",
"maintenance"
]
},
{
"login": "royharoush",
"name": "royharoush",
"avatar_url": "https://avatars3.githubusercontent.com/u/8113056?v=4",
"profile": "https://github.com/royharoush",
"contributions": [
"ideas",
"design"
]
},
{
"login": "Atul9",
"name": "Atul Bhosale",
"avatar_url": "https://avatars1.githubusercontent.com/u/3390330?v=4",
"profile": "https://github.com/Atul9",
"contributions": [
"code"
]
},
{
"login": "TGotwig",
"name": "Thomas Gotwig",
"avatar_url": "https://avatars0.githubusercontent.com/u/30773779?v=4",
"profile": "https://tgotwig.me",
"contributions": [
"platform"
]
},
{
"login": "remigourdon",
"name": "Rémi Gourdon",
"avatar_url": "https://avatars3.githubusercontent.com/u/2874133?v=4",
"profile": "https://github.com/remigourdon",
"contributions": [
"doc",
"code"
]
},
{
"login": "cmnatic",
"name": "Ben (CMNatic)",
"avatar_url": "https://avatars3.githubusercontent.com/u/4163116?v=4",
"profile": "https://cmnatic.co.uk",
"contributions": [
"code",
"doc",
"design"
]
},
{
"login": "Ferryistaken",
"name": "Alessandro Ferrari",
"avatar_url": "https://avatars3.githubusercontent.com/u/47927670?v=4",
"profile": "https://github.com/Ferryistaken",
"contributions": [
"content"
]
},
{
"login": "Phenomite",
"name": "Phenomite",
"avatar_url": "https://avatars2.githubusercontent.com/u/8285537?v=4",
"profile": "https://github.com/Phenomite",
"contributions": [
"content"
]
},
{
"login": "SuperSandro2000",
"name": "Sandro",
"avatar_url": "https://avatars2.githubusercontent.com/u/7258858?v=4",
"profile": "https://supersandro.de/",
"contributions": [
"content",
"bug",
"code"
]
},
{
"login": "caass",
"name": "Cass",
"avatar_url": "https://avatars2.githubusercontent.com/u/25358963?v=4",
"profile": "https://swag.lgbt",
"contributions": [
"platform",
"code",
"bug"
]
},
{
"login": "niklasmohrin",
"name": "Niklas Mohrin",
"avatar_url": "https://avatars0.githubusercontent.com/u/47574893?v=4",
"profile": "https://github.com/niklasmohrin",
"contributions": [
"doc"
]
},
{
"login": "tim77",
"name": "Artem Polishchuk",
"avatar_url": "https://avatars0.githubusercontent.com/u/5614476?v=4",
"profile": "https://liberapay.com/Artem4/",
"contributions": [
"platform"
]
},
{
"login": "buermarc",
"name": "buermarc",
"avatar_url": "https://avatars2.githubusercontent.com/u/44375277?v=4",
"profile": "https://github.com/buermarc",
"contributions": [
"code"
]
},
{
"login": "bergabman",
"name": "bergabman",
"avatar_url": "https://avatars1.githubusercontent.com/u/44554109?v=4",
"profile": "https://github.com/bergabman",
"contributions": [
"code",
"bug",
"design"
]
}
],
"contributorsPerLine": 7,
"projectName": "RustScan",
"projectOwner": "brandonskerritt",
"projectOwner": "RustScan",
"repoType": "github",
"repoHost": "https://github.com",
"skipCi": true
+2
View File
@@ -0,0 +1,2 @@
.git
Dockerfile
+1 -1
View File
@@ -1,4 +1,4 @@
github: brandonskerritt
github: bee-san
patreon: brandonskerritt
ko_fi: hacker
custom: ["https://monzo.me/bee", "https://paypal.me/brandonskerritt"]
+1 -1
View File
@@ -1,2 +1,2 @@
todo:
keyword: "TODO"
keyword: "// TODO"
+4
View File
@@ -0,0 +1,4 @@
template: |
## What’s Changed
$CHANGES
+10
View File
@@ -0,0 +1,10 @@
name: Check Markdown links
on: push
jobs:
markdown-link-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: gaurav-nelson/github-action-markdown-link-check@v1
+23
View File
@@ -30,3 +30,26 @@ jobs:
- uses: actions-rs/cargo@v1
with:
command: test
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
links:
name: markdown-link-check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: gaurav-nelson/github-action-markdown-link-check@v1
@@ -0,0 +1,18 @@
name: Check Markdown links
on:
push:
branches:
- master
schedule:
# Run everyday at 9:00 AM (See https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html#tag_20_25_07)
- cron: "0 9 * * *"
jobs:
markdown-link-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
use-quiet-mode: 'yes'
+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
+37
View File
@@ -0,0 +1,37 @@
language: rust
os:
- linux
- osx
arch:
- amd64
- arm64
services:
- docker
before_install:
- rustup component add rustfmt
rust:
- stable
- beta
jobs:
fast_finish: true
script:
- cargo build
- cargo test
- cargo fmt -- --check
after_failure:
- wget https://raw.githubusercontent.com/DiscordHooks/travis-ci-discord-webhook/master/send.sh
- chmod +x send.sh
- "./send.sh failure $WEBHOOK_URL"
after_success: |
if [ -n "${GITHUB_TOKEN}" ]; then
[ "${TRAVIS_BRANCH} " = master ] &&
[ "${TRAVIS_PULL_REQUEST}" = false ] &&
cargo doc &&
echo "<meta http-equiv=refresh content=0;url=rustscan/index.html>" > target/doc/index.html &&
sudo pip install ghp-import &&
ghp-import -n target/doc &&
git push -fq https://${GITHUB_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages
fi
env:
global:
secure: Gf24LG7Hr3Q0drWyPrvISTL35Z57DxdS/wIOo7v+ZdauzY3Qjvv3Lh4TY//C4sdN0g1CLj4yjg7LQOqF4XRdh2Qah7JZPv/i2B5uz9nwjTsoRzmmMWML9VtfT1u53nSFqsNeXbvpmoNG9rfMXcoiyd+Lv+EgniHphDEBlXvS9n9KMcpOi1F2x7bsH0EK37wQYKMTpCCd5TPUPdZou7BJNiZS3ikRLpTRFF7uIN4gYtRH9kU5uBSphWgnJ6eBm2ItzZcUPOgrjAoF4RkmZAzGG4idDh1Qkf3No3nZwT3U5NSk8h7owtJ4oADlRgYqYKCB4YcC9cAKCJgDsyMlKKMkEyagvw1seFnBLCY3ljsW4EklpVEZ0rVqZOx4pTkIaxIxytLTC9pHmdDSnhdhFknOcVAQQWjg+nAZfD07QUeAqUdr0i/vxQoZitvbNY0znzEarycE1waKvwlkiB4gt385U1CBfYldydnOnRKkdtLNrCLClu13HU0djmSXMhojQJhTuNxTHtZAf5fKcWIWwkVbNZ5MNKYjQh4rKufqW3o1iHphB8dfAGsDEPv0RQMtVbu6H4+clCouLkFlxHOIrrOJ5SXQ8cIATPhnJR7y4cSDdRaN0DRLRjeLAIKlbOGBtNuFC+BftocaTY5qN42aKAMqQcT30ycfiLuRVJNiQJ5pkto=
+16 -16
View File
@@ -14,22 +14,22 @@ appearance, race, religion, or sexual identity and orientation.
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
- The use of sexualized language or imagery and unwelcome sexual attention or
advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic
address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
@@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at brandon@skerritt.blog. All
reported by contacting the project team at our discord via a private message to any of the owners. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
@@ -67,10 +67,10 @@ members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
This Code of Conduct is adapted from the Contributor Covenant homepage, version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
[homepage]: https://www.contributor-covenant.org
homepage: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
Generated
+584 -94
View File
@@ -1,5 +1,14 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
[[package]]
name = "aho-corasick"
version = "0.7.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "043164d8ba5c4c3035fec9bbee8647c0261d788f3474306f93bb65901cae0e86"
dependencies = [
"memchr",
]
[[package]]
name = "ansi_term"
version = "0.11.0"
@@ -10,10 +19,31 @@ dependencies = [
]
[[package]]
name = "async-channel"
version = "1.1.1"
name = "ansi_term"
version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ee81ba99bee79f3c8ae114ae4baa7eaa326f63447cf2ec65e4393618b63f8770"
checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2"
dependencies = [
"winapi",
]
[[package]]
name = "arrayref"
version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544"
[[package]]
name = "arrayvec"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8"
[[package]]
name = "async-channel"
version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43de69555a39d52918e2bc33a408d3c0a86c829b212d898f4ca25d21a6387478"
dependencies = [
"concurrent-queue",
"event-listener",
@@ -21,16 +51,79 @@ dependencies = [
]
[[package]]
name = "async-std"
version = "1.6.2"
name = "async-executor"
version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "00d68a33ebc8b57800847d00787307f84a562224a14db069b0acefe4c2abbf5d"
checksum = "a831e74aa1937d3bbd3a356f34c23dbc6b6f0abc5160bd5484a9f75d5e76aea8"
dependencies = [
"async-task",
"concurrent-queue",
"fastrand",
"futures-lite",
"once_cell",
]
[[package]]
name = "async-global-executor"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c07d34f7bea9658346df5745d5c7b121c475aab7f7ec7c3dc5905d33ddefc899"
dependencies = [
"async-executor",
"async-io",
"futures-lite",
"num_cpus",
"once_cell",
]
[[package]]
name = "async-io"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "38628c78a34f111c5a6b98fc87dfc056cd1590b61afe748b145be4623c56d194"
dependencies = [
"cfg-if",
"concurrent-queue",
"fastrand",
"futures-lite",
"libc",
"log",
"once_cell",
"parking",
"polling",
"socket2",
"vec-arena",
"waker-fn",
"wepoll-sys-stjepang",
"winapi",
]
[[package]]
name = "async-mutex"
version = "1.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "20e85981fc34e84cdff3fc2c9219189752633fdc538a06df8b5ac45b68a4f3a9"
dependencies = [
"event-listener",
]
[[package]]
name = "async-std"
version = "1.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3c92085acfce8b32e5b261d0b59b8f3309aee69fea421ea3f271f8b93225754f"
dependencies = [
"async-global-executor",
"async-io",
"async-mutex",
"async-task",
"blocking",
"crossbeam-utils",
"futures-channel",
"futures-core",
"futures-io",
"futures-lite",
"gloo-timers",
"kv-log-macro",
"log",
"memchr",
@@ -39,7 +132,6 @@ dependencies = [
"pin-project-lite",
"pin-utils",
"slab",
"smol",
"wasm-bindgen-futures",
]
@@ -72,6 +164,12 @@ version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d"
[[package]]
name = "base64"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7"
[[package]]
name = "bitflags"
version = "1.2.1"
@@ -79,16 +177,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
[[package]]
name = "blocking"
version = "0.4.7"
name = "blake2b_simd"
version = "0.5.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d2468ff7bf85066b4a3678fede6fe66db31846d753ff0adfbfab2c6a6e81612b"
checksum = "d8fb2d74254a3a0b5cac33ac9f8ed0e44aa50378d9dbb2e5d83bd21ed1dc2c8a"
dependencies = [
"arrayref",
"arrayvec",
"constant_time_eq",
]
[[package]]
name = "blocking"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2640778f8053e72c11f621b0a5175a0560a269282aa98ed85107773ab8e2a556"
dependencies = [
"async-channel",
"atomic-waker",
"fastrand",
"futures-lite",
"once_cell",
"parking",
"waker-fn",
]
@@ -117,12 +226,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
[[package]]
name = "clap"
version = "2.33.1"
name = "cidr-utils"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bdfa80d47f954d53a35a64987ca1422f495b8d6483c0fe9f7117b36c2a792129"
checksum = "89f7b6372f3c783f6d44c0da283d3694af4104967bf2371cb3bdc9d09e1cfe00"
dependencies = [
"ansi_term",
"debug-helper",
"num-bigint",
"num-traits",
"once_cell",
"regex",
]
[[package]]
name = "clap"
version = "2.33.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "10040cdf04294b565d9e0319955430099ec3813a64c952b86a41200ad714ae48"
dependencies = [
"ansi_term 0.11.0",
"atty",
"bitflags",
"strsim",
@@ -133,9 +255,9 @@ dependencies = [
[[package]]
name = "colored"
version = "1.9.3"
version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f4ffc801dacf156c5854b9df4f425a626539c3a6ef7893cc0c5084a23f0b6c59"
checksum = "b3616f750b84d8f0de8a58bda93e08e2a81ad3f523089b05f1dffecab48c6cbd"
dependencies = [
"atty",
"lazy_static",
@@ -143,14 +265,26 @@ dependencies = [
]
[[package]]
name = "concurrent-queue"
version = "1.1.2"
name = "colorful"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1582139bb74d97ef232c30bc236646017db06f13ee7cc01fa24c9e55640f86d4"
checksum = "0bca1619ff57dd7a56b58a8e25ef4199f123e78e503fe1653410350a1b98ae65"
[[package]]
name = "concurrent-queue"
version = "1.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "30ed07550be01594c6026cff2a1d7fe9c8f683caa798e12b68694ac9e88286a3"
dependencies = [
"cache-padded",
]
[[package]]
name = "constant_time_eq"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc"
[[package]]
name = "crossbeam-utils"
version = "0.7.2"
@@ -163,16 +297,61 @@ dependencies = [
]
[[package]]
name = "event-listener"
version = "2.2.1"
name = "debug-helper"
version = "0.3.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "829694371bd7bbc6aee17c4ff624aad8bf9f4dc06c6f9f6071eaa08c89530d10"
checksum = "9a8a5bb894f24f42c247f19b25928a88e31867c0f84552c05df41a9dd527435e"
[[package]]
name = "dirs"
version = "3.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "142995ed02755914747cc6ca76fc7e4583cd18578746716d0508ea6ed558b9ff"
dependencies = [
"dirs-sys",
]
[[package]]
name = "dirs-sys"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e93d7f5705de3e49895a2b5e0b8855a1c27f080192ae9c32a6432d50741a57a"
dependencies = [
"libc",
"redox_users",
"winapi",
]
[[package]]
name = "either"
version = "1.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
[[package]]
name = "env_logger"
version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36"
dependencies = [
"atty",
"humantime",
"log",
"regex",
"termcolor",
]
[[package]]
name = "event-listener"
version = "2.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68082183f458867ce7cddea16d4df4443c1537112c0c09c450dedc09daf5c719"
[[package]]
name = "fastrand"
version = "1.3.3"
version = "1.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "36a9cb09840f81cd211e435d00a4e487edd263dc3c8ff815c32dd76ad668ebed"
checksum = "5c85295147490b8fcf2ea3d104080a105a8b2c63f9c319e82c02d8e952388919"
[[package]]
name = "futures"
@@ -224,9 +403,9 @@ checksum = "de27142b013a8e869c14957e6d2edeef89e97c289e69d042ee3a49acd8b51789"
[[package]]
name = "futures-lite"
version = "0.1.9"
version = "1.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8cc8771bd1bb4c7be3c5f072a1d5e18086ef220f100a0a4efece41076e87b9f2"
checksum = "5b77e08e656f472d8ea84c472fa8b0a7a917883048e1cf2d4e34a323cd0aaf63"
dependencies = [
"fastrand",
"futures-core",
@@ -284,6 +463,45 @@ dependencies = [
"slab",
]
[[package]]
name = "gcd"
version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1c7cd301bf2ab11ae4e5bdfd79c221d97a25e46c089144a62ee9d09cb32d2b92"
[[package]]
name = "getrandom"
version = "0.1.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb"
dependencies = [
"cfg-if",
"libc",
"wasi",
]
[[package]]
name = "gloo-timers"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "47204a46aaff920a1ea58b11d03dec6f704287d27561724a4631e450654a891f"
dependencies = [
"futures-channel",
"futures-core",
"js-sys",
"wasm-bindgen",
"web-sys",
]
[[package]]
name = "heck"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205"
dependencies = [
"unicode-segmentation",
]
[[package]]
name = "hermit-abi"
version = "0.1.15"
@@ -294,10 +512,28 @@ dependencies = [
]
[[package]]
name = "js-sys"
version = "0.3.42"
name = "humantime"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "52732a3d3ad72c58ad2dc70624f9c17b46ecd0943b9a4f1ee37c4c18c5d983e2"
checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f"
dependencies = [
"quick-error",
]
[[package]]
name = "itertools"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b"
dependencies = [
"either",
]
[[package]]
name = "js-sys"
version = "0.3.44"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "85a7e2c92a4804dd459b86c339278d0fe87cf93757fae222c3fa3ae75458bc73"
dependencies = [
"wasm-bindgen",
]
@@ -319,9 +555,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
[[package]]
name = "libc"
version = "0.2.73"
version = "0.2.77"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bd7d4bd64732af4bf3a67f367c27df8520ad7e230c5817b8ff485864d80242b9"
checksum = "f2f96b10ec2560088a8e76961b00d47107b3a625fecb76dedb29ee7ccbf98235"
[[package]]
name = "log"
@@ -338,6 +574,36 @@ version = "2.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400"
[[package]]
name = "num-bigint"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b7f3fc75e3697059fb1bc465e3d8cca6cf92f56854f201158b3f9c77d5a3cfa0"
dependencies = [
"autocfg",
"num-integer",
"num-traits",
]
[[package]]
name = "num-integer"
version = "0.1.43"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8d59457e662d541ba17869cf51cf177c0b5f0cbf476c66bdc90bf1edac4f875b"
dependencies = [
"autocfg",
"num-traits",
]
[[package]]
name = "num-traits"
version = "0.2.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac267bcc07f48ee5f8935ab0d24f316fb722d7a1292e2913f0cc196b29ffd611"
dependencies = [
"autocfg",
]
[[package]]
name = "num_cpus"
version = "1.13.0"
@@ -350,30 +616,30 @@ dependencies = [
[[package]]
name = "once_cell"
version = "1.4.0"
version = "1.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b631f7e854af39a1739f401cf34a8a013dfe09eac4fa4dba91e9768bd28168d"
checksum = "260e51e7efe62b592207e9e13a68e43692a7a279171d6ba57abd208bf23645ad"
[[package]]
name = "parking"
version = "1.0.6"
version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6cb300f271742d4a2a66c01b6b2fa0c83dfebd2e0bf11addb879a3547b4ed87c"
checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72"
[[package]]
name = "pin-project"
version = "0.4.22"
version = "0.4.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "12e3a6cdbfe94a5e4572812a0201f8c0ed98c1c452c7b8563ce2276988ef9c17"
checksum = "ca4433fff2ae79342e497d9f8ee990d174071408f28f726d6d83af93e58e48aa"
dependencies = [
"pin-project-internal",
]
[[package]]
name = "pin-project-internal"
version = "0.4.22"
version = "0.4.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a0ffd45cf79d88737d7cc85bfd5d2894bee1139b356e616fe85dc389c61aaf7"
checksum = "2c0e815c3ee9a031fdf5af21c10aa17c573c9c6a566328d99e3936c34e36461f"
dependencies = [
"proc-macro2",
"quote",
@@ -393,10 +659,53 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
[[package]]
name = "proc-macro-hack"
version = "0.5.16"
name = "polling"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e0456befd48169b9f13ef0f0ad46d492cf9d2dbb918bcf38e01eed4ce3ec5e4"
checksum = "0307b8c7f438902536321f63c28cab0362f6ee89f1c7da47e3642ff956641c8b"
dependencies = [
"cfg-if",
"libc",
"log",
"wepoll-sys-stjepang",
"winapi",
]
[[package]]
name = "ppv-lite86"
version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "237a5ed80e274dbc66f86bd59c1e25edc039660be53194b5fe0a482e0f2612ea"
[[package]]
name = "proc-macro-error"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
dependencies = [
"proc-macro-error-attr",
"proc-macro2",
"quote",
"syn",
"version_check",
]
[[package]]
name = "proc-macro-error-attr"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
dependencies = [
"proc-macro2",
"quote",
"version_check",
]
[[package]]
name = "proc-macro-hack"
version = "0.5.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "99c605b9a0adc77b7211c6b1f722dcb613d68d66859a44f3d485a6da332b0598"
[[package]]
name = "proc-macro-nested"
@@ -413,6 +722,12 @@ dependencies = [
"unicode-xid",
]
[[package]]
name = "quick-error"
version = "1.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0"
[[package]]
name = "quote"
version = "1.0.7"
@@ -422,6 +737,47 @@ dependencies = [
"proc-macro2",
]
[[package]]
name = "rand"
version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03"
dependencies = [
"getrandom",
"libc",
"rand_chacha",
"rand_core",
"rand_hc",
]
[[package]]
name = "rand_chacha"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402"
dependencies = [
"ppv-lite86",
"rand_core",
]
[[package]]
name = "rand_core"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19"
dependencies = [
"getrandom",
]
[[package]]
name = "rand_hc"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c"
dependencies = [
"rand_core",
]
[[package]]
name = "redox_syscall"
version = "0.1.57"
@@ -429,31 +785,102 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce"
[[package]]
name = "rlimit"
version = "0.3.0"
name = "redox_users"
version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e6d26e65e82a1e2628c5f209ec12f4508fa50e644bd2f264138e60129d61eae8"
checksum = "09b23093265f8d200fa7b4c2c76297f47e681c655f6f1285a8780d6a022f7431"
dependencies = [
"getrandom",
"redox_syscall",
"rust-argon2",
]
[[package]]
name = "regex"
version = "1.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c3780fcf44b193bc4d09f36d2a3c87b251da4a046c87795a0d35f4f927ad8e6"
dependencies = [
"aho-corasick",
"memchr",
"regex-syntax",
"thread_local",
]
[[package]]
name = "regex-syntax"
version = "0.6.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "26412eb97c6b088a6997e05f69403a802a92d520de2f8e63c2b65f9e0f47c4e8"
[[package]]
name = "rlimit"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49b02d62c38353a6fce45c25ca19783e25dd5f495ca681c674a4ee15aa4c1536"
dependencies = [
"cfg-if",
"libc",
]
[[package]]
name = "rustscan"
version = "1.2.0"
name = "rust-argon2"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2bc8af4bda8e1ff4932523b94d3dd20ee30a87232323eda55903ffd71d2fb017"
dependencies = [
"async-std",
"clap",
"colored",
"futures",
"rlimit",
"base64",
"blake2b_simd",
"constant_time_eq",
"crossbeam-utils",
]
[[package]]
name = "scoped-tls"
name = "rustscan"
version = "1.8.0"
dependencies = [
"ansi_term 0.12.1",
"async-std",
"cidr-utils",
"colored",
"colorful",
"dirs",
"env_logger",
"futures",
"gcd",
"itertools",
"log",
"rand",
"rlimit",
"serde",
"serde_derive",
"shell-words",
"structopt",
"toml",
]
[[package]]
name = "serde"
version = "1.0.116"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "96fe57af81d28386a513cbc6858332abc6117cfdb5999647c6444b8f43a370a5"
[[package]]
name = "serde_derive"
version = "1.0.116"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f630a6370fd8e457873b4bd2ffdae75408bc291ba72be773772a4c2a065d9ae8"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "shell-words"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2"
checksum = "b6fa3938c99da4914afedd13bf3d79bcb6c277d1b2c398d23257a304d9e1b074"
[[package]]
name = "slab"
@@ -461,27 +888,6 @@ version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8"
[[package]]
name = "smol"
version = "0.1.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "620cbb3c6e34da57d3a248cda0cd01cd5848164dc062e764e65d06fe3ea7aed5"
dependencies = [
"async-task",
"blocking",
"concurrent-queue",
"fastrand",
"futures-io",
"futures-util",
"libc",
"once_cell",
"scoped-tls",
"slab",
"socket2",
"wepoll-sys-stjepang",
"winapi",
]
[[package]]
name = "socket2"
version = "0.3.12"
@@ -501,16 +907,49 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a"
[[package]]
name = "syn"
version = "1.0.35"
name = "structopt"
version = "0.3.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fb7f4c519df8c117855e19dd8cc851e89eb746fe7a73f0157e0d95fdec5369b0"
checksum = "6cc388d94ffabf39b5ed5fadddc40147cb21e605f53db6f8f36a625d27489ac5"
dependencies = [
"clap",
"lazy_static",
"structopt-derive",
]
[[package]]
name = "structopt-derive"
version = "0.4.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5e2513111825077552a6751dfad9e11ce0fba07d7276a3943a037d7e93e64c5f"
dependencies = [
"heck",
"proc-macro-error",
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "syn"
version = "1.0.38"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e69abc24912995b3038597a7a593be5053eb0fb44f3cc5beec0deb421790c1f4"
dependencies = [
"proc-macro2",
"quote",
"unicode-xid",
]
[[package]]
name = "termcolor"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bb6bfa289a4d7c5766392812c0a1f4c1ba45afa1ad47803c11e1f407d846d75f"
dependencies = [
"winapi-util",
]
[[package]]
name = "textwrap"
version = "0.11.0"
@@ -520,6 +959,30 @@ dependencies = [
"unicode-width",
]
[[package]]
name = "thread_local"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14"
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"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e83e153d1053cbb5a118eeff7fd5be06ed99153f00dbcd8ae310c5fb2b22edc0"
[[package]]
name = "unicode-width"
version = "0.1.8"
@@ -532,12 +995,24 @@ version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564"
[[package]]
name = "vec-arena"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eafc1b9b2dfc6f5529177b62cf806484db55b32dc7c9658a118e11bbeb33061d"
[[package]]
name = "vec_map"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
[[package]]
name = "version_check"
version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed"
[[package]]
name = "waker-fn"
version = "1.0.0"
@@ -545,10 +1020,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9571542c2ce85ce642e6b58b3364da2fb53526360dfb7c211add4f5c23105ff7"
[[package]]
name = "wasm-bindgen"
version = "0.2.65"
name = "wasi"
version = "0.9.0+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f3edbcc9536ab7eababcc6d2374a0b7bfe13a2b6d562c5e07f370456b1a8f33d"
checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"
[[package]]
name = "wasm-bindgen"
version = "0.2.67"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f0563a9a4b071746dd5aedbc3a28c6fe9be4586fb3fbadb67c400d4f53c6b16c"
dependencies = [
"cfg-if",
"wasm-bindgen-macro",
@@ -556,9 +1037,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-backend"
version = "0.2.65"
version = "0.2.67"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "89ed2fb8c84bfad20ea66b26a3743f3e7ba8735a69fe7d95118c33ec8fc1244d"
checksum = "bc71e4c5efa60fb9e74160e89b93353bc24059999c0ae0fb03affc39770310b0"
dependencies = [
"bumpalo",
"lazy_static",
@@ -571,9 +1052,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-futures"
version = "0.4.15"
version = "0.4.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41ad6e4e8b2b7f8c90b6e09a9b590ea15cb0d1dbe28502b5a405cd95d1981671"
checksum = "95f8d235a77f880bcef268d379810ea6c0af2eacfa90b1ad5af731776e0c4699"
dependencies = [
"cfg-if",
"js-sys",
@@ -583,9 +1064,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro"
version = "0.2.65"
version = "0.2.67"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eb071268b031a64d92fc6cf691715ca5a40950694d8f683c5bb43db7c730929e"
checksum = "97c57cefa5fa80e2ba15641578b44d36e7a64279bc5ed43c6dbaf329457a2ed2"
dependencies = [
"quote",
"wasm-bindgen-macro-support",
@@ -593,9 +1074,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro-support"
version = "0.2.65"
version = "0.2.67"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf592c807080719d1ff2f245a687cbadb3ed28b2077ed7084b47aba8b691f2c6"
checksum = "841a6d1c35c6f596ccea1f82504a192a60378f64b3bb0261904ad8f2f5657556"
dependencies = [
"proc-macro2",
"quote",
@@ -606,15 +1087,15 @@ dependencies = [
[[package]]
name = "wasm-bindgen-shared"
version = "0.2.65"
version = "0.2.67"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72b6c0220ded549d63860c78c38f3bcc558d1ca3f4efa74942c536ddbbb55e87"
checksum = "93b162580e34310e5931c4b792560108b10fd14d64915d7fff8ff00180e70092"
[[package]]
name = "web-sys"
version = "0.3.42"
version = "0.3.44"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8be2398f326b7ba09815d0b403095f34dd708579220d099caae89be0b32137b2"
checksum = "dda38f4e5ca63eda02c059d243aa25b5f35ab98451e518c51612cd0f1bd19a47"
dependencies = [
"js-sys",
"wasm-bindgen",
@@ -645,6 +1126,15 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
[[package]]
name = "winapi-util"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
dependencies = [
"winapi",
]
[[package]]
name = "winapi-x86_64-pc-windows-gnu"
version = "0.4.0"
+30 -10
View File
@@ -1,25 +1,45 @@
[package]
name = "rustscan"
version = "1.2.0"
version = "1.8.0"
authors = ["Bee <[email protected]>"]
edition = "2018"
description = "Faster Nmap Scanning with Rust"
homepage = "https://github.com/brandonskerritt/rustscan"
repository = "https://github.com/brandonskerritt/rustscan"
homepage = "https://github.com/rustscan/rustscan"
repository = "https://github.com/rustscan/rustscan"
license = "MIT"
keywords = ["port", "scanning", "nmap"]
categories = ["command-line-utilities"]
readme="README.md"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
exclude = [
".github/*",
"pictures/*",
"rustscan-debbuilder/*",
]
[dependencies]
colored = "1.9.3"
clap = "2.33.0"
async-std = "1.6.2"
colored = "2.0.0"
structopt = "0.3.17"
async-std = "1.6.4"
futures = "0.3"
rlimit = "0.3.0"
rlimit = "0.4.0"
shell-words = "1.0.0"
log = "0.4.0"
env_logger = "0.7.1"
dirs = "3.0.1"
gcd = "2.0.1"
rand = "0.7.3"
colorful = "0.2.1"
ansi_term = "0.12.1"
toml = "0.5.6"
serde = "1.0.116"
serde_derive = "1.0.116"
cidr-utils = "0.5.0"
itertools = "0.9.0"
[package.metadata.deb]
depends = "$auto, nmap"
section = "rust"
[profile.release]
lto = true
panic = 'abort'
+16
View File
@@ -0,0 +1,16 @@
FROM rust:alpine as builder
RUN apk add --no-cache build-base
WORKDIR /usr/src/rustscan
COPY . .
RUN cargo install --path .
FROM alpine:3.12
LABEL author="Hydragyrum <https://github.com/Hydragyrum>"
RUN addgroup -S 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" ]
+21
View File
@@ -0,0 +1,21 @@
install:
cargo install cross
build:
make build-linux
make build-mac
make shasum
build-linux:
@echo 'Building for Linux... 🐧'
cross build --release --target=x86_64-unknown-linux-musl
mkdir -p target/release-archives && tar -czf target/release-archives/rustscan-linux.tar.gz target/x86_64-unknown-linux-musl/release/rustscan
build-mac:
@echo 'Building for MacOS... 🍏'
cross build --release --target=x86_64-apple-darwin
mkdir -p target/release-archives && tar -czf target/release-archives/rustscan-mac.tar.gz target/x86_64-apple-darwin/release/rustscan
shasum:
shasum -a 256 target/release-archives/rustscan-*.tar.gz
+285 -102
View File
@@ -1,24 +1,36 @@
<p align="center">
<img src="pictures/rustscan.png"><br>
<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.
➡️
<a href="https://discord.gg/GFrQsGy">Discord</a> |
<a href="https://github.com/RustScan/RustScan#-full-installation-guide">Installation Guide</a> |
<a href="https://github.com/RustScan/RustScan#-usage">Usage Guide</a>
⬅️
<br>
<img src="pictures/rustscan.png" height=400px width=400px>
</p>
<p align="center">
<img alt="AUR version" src="https://img.shields.io/aur/version/rustscan-bin">
<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.
</p>
<p align="center">
<img alt="AUR version" src="https://img.shields.io/aur/version/rustscan">
<img src="https://img.shields.io/badge/Built%20with-Rust-Purple">
<img alt="GitHub commit activity" src="https://img.shields.io/github/commit-activity/w/brandonskerritt/rustscan">
<img alt="GitHub commit activity" src="https://img.shields.io/github/commit-activity/w/Rustscan/Rustscan">
<img alt="GitHub All Releases" src="https://img.shields.io/github/downloads/rustscan/rustscan/total?label=GitHub%20Downloads">
<img alt="Crates.io" src="https://img.shields.io/crates/d/rustscan?label=Cargo%20Downloads">
<img alt="Discord" src="https://img.shields.io/discord/736614461313515576">
<img alt="Actions" src="https://github.com/RustScan/RustScan/workflows/Continuous%20integration/badge.svg?branch=master">
</p>
<hr>
| <p align="center"><a href="https://crates.io/crates/rustscan">🔧 Cargo (Universal) </a></p> | <p align="center"><a href="https://crates.io/crates/rust_scan"> Arch </a></p> | <p align="center"><a href="https://crates.io/crates/rust_scan"> HomeBrew </a></p> | <p align="center"><a href="https://crates.io/crates/rust_scan"> Kali / Debian </p> |
| ---- | ---- | ---- | --- |
| <p align="center"><img src="pictures/rust.png" /></p> | <p align="center"><img src="pictures/arch.png" /></p> | <p align="center"><img src="pictures/apple.png" /></p> | <p align="center"><img src="pictures/kali.png" /></p> |
| `cargo install rustscan` | `yay -S rustscan-bin` | `brew tap brandonskerritt/rustscan && brew install rustscan` | [Read the install guide](https://github.com/brandonskerritt/RustScan/blob/master/README.md#%EF%B8%8F-debian--kali) |
| <p align="center"><a href="https://hub.docker.com/r/cmnatic/rustscan">🐋 Docker (Recommended) </a></p> | <p align="center"><a href="https://github.com/RustScan/RustScan/releases">👩‍💻 Kali / Debian </p> | <p align="center"><a href="https://aur.archlinux.org/packages/rustscan/">🏗️ Arch </a></p> | <p align="center"><a href="https://crates.io/crates/rustscan">🔧 Cargo (Universal) </a></p> |
| ----------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| <p align="center"><img src="https://github.com/RustScan/RustScan/blob/master/pictures/docker.png?raw=true" /></p> | <p align="center"><img src="https://github.com/RustScan/RustScan/blob/master/pictures/kali.png?raw=true" /></p> | <p align="center"><img src="https://github.com/RustScan/RustScan/blob/master/pictures/arch.png?raw=true" /></p> | <p align="center"><img src="https://github.com/RustScan/RustScan/blob/master/pictures/rust.png?raw=true" /></p> |
| `docker pull rustscan/rustscan:v1.8.0` <p>[Usage](https://github.com/RustScan/RustScan#docker-whale) | [Read the install guide](https://github.com/Rustscan/RustScan/blob/master/README.md#%EF%B8%8F-debian--kali) | `yay -S rustscan` | `cargo install rustscan` |
<hr>
# 🤔 What is this?
1. Find ports quickly using Rustscan (**8 seconds at its fastest**).
1. Find ports quickly using Rustscan (**3 seconds at its fastest**).
2. Automatically runs `nmap` on those ports.
3. ???
4. Profit!
@@ -31,8 +43,8 @@
</tr>
<tr>
<th>Gif</th>
<td><img src="pictures/with_rustscan.gif" alt="The guy she tells you not to worry about"></td>
<td><img src="pictures/without_rustscan.gif" alt="You"></td>
<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>
@@ -41,20 +53,37 @@
</tr>
</table>
<sub><b>Note</b> This is an older gif. RustScan's current top speed is 8 seconds for all 65k ports. This gif is 26 seconds.</sub><br>
<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).
* Saves you time by automatically piping it into Nmap. No more manual copying and pasting!
* Does one thing and does it well. **Only** purpose is to improve Nmap, not replace it!
* Let's you choose what Nmap commands to run, or uses the default.
- Scans all 65k ports in **8 seconds** (on 10k batch size).
- Saves you time by automatically piping it into Nmap. No more manual copying and pasting!
- Does one thing and does it well. **Only** purpose is to improve Nmap, not replace it!
- Let's you choose what Nmap commands to run, or uses the default.
- IPv6 Support
## ‼️ Important Links
| Installation Guide | Documentation | Discord |
| -------------------------------------------------------------------------------------- | -------------------------------------------------------- | ---------------------------------------- |
| 📖 [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)
- 🐋 [Docker Usage](https://github.com/RustScan/RustScan#docker-whale)
- 🦜 [Discord](https://discord.gg/GFrQsGy)
- 🤸 [Usage](https://github.com/RustScan/RustScan#-usage)
- 🎪 [Community](https://github.com/RustScan/RustScan#-community)
# 🔭 Why RustScan?
Why spend time running fast scans and manually copying the ports, or waiting for a 20 minute scan to finish when you can just do all 65k ports in less than a minute?
![gif](pictures/8seconds.gif)
![gif](https://github.com/RustScan/RustScan/blob/master/pictures/8seconds.gif?raw=true)
**RustScan running in 8 seconds and finding all open ports out of 65k.**
@@ -62,65 +91,112 @@ Why spend time running fast scans and manually copying the ports, or waiting for
| **Name** | RustScan | Nmap | Masscan |
| ------------------------------------------------------------------------------------------ | -------- | ---- | ------- |
| Fast | ✅ | ❌ | ✅ |
| Actually useful | ❌ | ✅ | ❌ |
| Realises it's not useful, and pipes the only useful data into the only useful port scanner | ✅ | ❌ | ❌ |
## 🙋 FAQ
> I think this would be a great port scanner on its own without Nmap!
No. If you want a fast port scanner, use Masscan.
> I have this great idea for a script to get information on ports / hosts
Great. Contribute it to Nmap! :D
> Not everyone has nmap installed....
If you're a pentester, then yes, you have Nmap installed.
> I want to contribute!
Great! I'd love some help with this. Read the [contributing.md file](contributing.md) file for more information!
| Fast | ✅ | ❌ | ✅ |
| Actually useful | ❌ | ✅ | ❌ |
| Realises it's not useful, and pipes the only useful data into the only useful port scanner | ✅ | ❌ | ❌ |
# 📖 Full Installation Guide
**You need Nmap**. If you have Kali Linux or Parrot OS installed, you already have Nmap. If not, [follow the nmap install guide](https://nmap.org/download.html).
The easiest way to install RustScan is to use one of the packages provided for your system, such as HomeBrew or Yay for Arch Linux.
The most universal way is to use `cargo`, Rust's built in package manager (think Pip but for Rust). [Follow this guide to installing Rust & Cargo](https://doc.rust-lang.org/cargo/getting-started/installation.html).
If you face any issues at all, please leave a GitHub issue. I have only tested this on Linux, so there may be issues for Mac OS or Windows.
If you face any issues at all, please leave a GitHub issue. I have only tested this on Linux, so there may be issues for Mac OS or Windows.
Note: sometimes Rust doesn't add Cargo to the path. Please see [this issue](https://github.com/rust-lang/rustup/issues/2436) for how to fix that.
## 🖥️ Debian / Kali
Download the .deb file from the releases page:
[https://github.com/brandonskerritt/RustScan/releases](https://github.com/brandonskerritt/RustScan/releases)
Run the commpand `dpkg -i` on the file. Note: sometimes you can double click the file to achieve the same result.
### 🥧 .deb file not working?
The .deb file only works on AMD64 CPUs. If yours is different (such as a Raspberry Pi) or the .deb file doesn't work, it is easy to build the .deb file yourself.
**Note**: It is easier to install Rust and install via Cargo, then it is to build the .deb file. But this is just in case!
[https://github.com/RustScan/RustScan/releases](https://github.com/RustScan/RustScan/releases)
1. Install Rust You can do this with `curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh` which I took from the Rust website https://www.rust-lang.org/tools/install
2. `cargo install rustscan` if you want the easiest method possible. Otherwise, to build the .deb file `cargo install cargo-deb`
3. Git clone this repo `git clone https://github.com/brandonskerritt/RustScan`
4. cd RustScan (into the git cloned repo) `cd RustScan`
5. Run `cargo deb`
6. Your .deb file is now located in `target/releases/Debian/`
Run the command `dpkg -i` on the file.
Note: sometimes you can double click the file to achieve the same result.
## Docker :whale:
Docker is the recommended way of installing RustScan. This is because:
- It has a high open file descriptor limit, which is one of the [main problems](https://github.com/RustScan/RustScan/issues/40) with RustScan. Now you don't have to fiddle around trying to understand your OS.
- It works on all systems, regardless of OS. Even Windows, which we don't officially support.
- The Docker image uses the latest build from Cargo, our main source-of-truth package. This means that you will always be using the latest version.
- No need to install Rust, Cargo, or Nmap.
To install Docker, [follow their guide](https://docs.docker.com/engine/install/).
**Once Docker is installed, you can either build your own image using the `Dockerfile` (alpine) provided in the repo, or alternatively, use the published Docker image like below (most convenient)**
Please see our [DockerHub](https://hub.docker.com/repository/docker/rustscan/rustscan) for further our published versions. However, we recommend using our latest release [v1.8.0](https://github.com/RustScan/RustScan/releases/tag/1.8.0)
```
Stable and supported: rustscan/rustscan:v1.8.0
Bleeding edge (run at your own risk!): rustscan/rustscan:latest
```
We strongly recommend using the `v1.8.0` tag, as this is the latest major - stable - release of RustScan. This README uses the `v1.8.0` image by default, however, note that the `latest` image is considered experimental.
#### To get started:
Simply run this command against the IP you want to target:
```bash
docker run -it --rm --name rustscan rustscan/rustscan:v1.8.0 <rustscan arguments here> <ip address to scan>
```
Note: this will scan the Docker's localhost, not your own.
Once done, you will no longer need to re-download the image (except when RustScan updates) and can use RustScan like a normal application.
You will have to run this command every time, so we suggest aliasing it to something memorable.
```bash
alias rustscan='docker run -it --rm --name rustscan rustscan/rustscan:v1.8.0'
```
Then we can scan:
```bash
rustscan 192.168.1.0/24 -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> .
```
## 🍺 HomeBrew
**Note for Mac users** Mac OS has a very, very small ulimit size. This will negatively impact RustScan by a significant amount. Please use the Docker container, or tell RustScan to up the ulimit size on every run.
Tap the brew:
```
```bash
brew tap brandonskerritt/rustscan
```
Install it:
```
```bash
brew install rustscan
```
@@ -132,64 +208,115 @@ brew install rustscan
4. The binary is located at `target/release/rustscan`
5. Symlink to the binary or something. Whatever you want!
## 🦊 Community Distributions
Here are all of RustScan's community distributions.
If you maintain a community distribution and want it listed here, leave an issue / pull request / Discord message or however you want to let us know.
- [OpenSuse](https://software.opensuse.org/package/rustscan?search_term=rustscan)
- [Fedora/CentOS](https://copr.fedorainfracloud.org/coprs/atim/rustscan/)
[![Packaging status](https://repology.org/badge/vertical-allrepos/rustscan.svg)](https://repology.org/project/rustscan/versions)
# 🤸 Usage
```
rustscan -h
```
```console
$ rustscan -h
```
RustScan 1.2.0
Bee https://github.com/brandonskerritt
Fast Port Scanner built in Rust
WARNING Do not use this program against sensitive infrastructure. The specified server may not be able to handle this
many socket connections at once.
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
USAGE:
rustscan [FLAGS] [OPTIONS] <ip> [command]...
rustscan [FLAGS] [OPTIONS] [addresses]... [-- <command>...]
FLAGS:
-h, --help Prints help information
-q, --quiet Quiet mode. Only output the ports. No Nmap. Useful for grep or outputting to a file.
-V, --version Prints version information
--accessible Accessible mode. Turns off features which negatively affect screen readers
-h, --help Prints help information
-n, --no-config Whether to ignore the configuration file or not
--no-nmap Turns off Nmap
-q, --quiet Quiet mode. Only output the ports. No Nmap. Useful for grep or outputting to a file
-V, --version Prints version information
OPTIONS:
-T, --timeout <T> The timeout before a port is assumed to be close. In MS. [default: 1500]
-b, --batch <b> Increases speed of scanning. The batch size for port scanning. Depends on your open file limit
of OS. If you do 65535 it will do every port at the same time. Although, your OS may not
support this. [default: 4500]
-u, --ulimit <u> Automatically ups the ULIMIT with the value you provided.
-b, --batch-size <batch-size> The batch size for port scanning, it increases or slows the speed of scanning.
Depends on the open file limit of your OS. If you do 65535 it will do every port
at the same time. Although, your OS may not support this [default: 4500]
-p, --ports <ports>... A list of comma separed ports to be scanned. Example: 80,443,8080
-r, --range <range> A range of ports with format start-end. Example: 1-1000
--scan-order <scan-order> The order of scanning to be performed. The "serial" option will scan ports in
ascending order while the "random" option will scan ports randomly [default:
serial] [possible values: Serial, Random]
-t, --timeout <timeout> The timeout in milliseconds before a port is assumed to be closed [default: 1500]
-u, --ulimit <ulimit> Automatically ups the ULIMIT with the value you provided
ARGS:
<ip> The IP address to scan
<command>... The Nmap arguments to run. To use the argument -A, end RustScan's args with '-- -A'. To run
EXAMPLE: 'rustscan -T 1500 127.0.0.1 -- -A -sC'. This argument auto runs nmap {your commands}
-vvv -p $PORTS
<addresses>... A list of comma separated CIDRs, IPs, 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 automatically to
nmap. For things like --script '(safe and vuln)' enclose it in quotations marks \"'(safe and
vuln)'\"")
```
The format is `rustscan -b 500 -T 1500 192.168.0.1` to scan 192.168.0.1 with 500 batch size with a timeout of 1500ms. The timeout is how long RustScan waits for a response until it assumes the port is closed.
The format is `rustscan -b 500 -t 1500 192.168.0.1` to scan 192.168.0.1 with 500 batch size with a timeout of 1500ms. The timeout is how long RustScan waits for a response until it assumes the port is closed.
The batch size determines how fast RustScan is. Set it to 65k, and it will scan all 65k ports at the same time. This means at at 65k batch size, RustScan will take TIMEOUT long to scan all ports. Essentially, if timeout is 1000ms, **RustScan can scan in 1 second**.
The batch size determines how fast RustScan is. Set it to 65k, and it will scan all 65k ports at the same time. This means at at 65k batch size, RustScan will take TIMEOUT long to scan all ports. Essentially, if timeout is 1000ms, **RustScan can scan in 1 second**.
Your operating system may not support this, but it is worth it to play around and see where your open file limit is. Shortly I will be releasing a dockerised version with a much larger open file limit, so this will be possible.
## Configuration file
This binary accepts a configuration file that is read from the home directory of the user. It follows the TOML format
and accepts the following fields:
- `addresses`
- `ports`
- `range`
- `scan_order`
- `command`
- `accessible`
- `quiet`
- `batch-size`
- `timeout`
- `ulimit`
### Format example
```toml
addresses = ["127.0.0.1", "192.168.0.0/30", "www.google.com"]
command = ["-A"]
ports = [80, 443, 8080]
range = { start = 1, end = 10 }
quiet = false
accessible = true
scan_order = "Serial"
batch_size = 1000
timeout = 1000
ulimit = 1000
```
## ⚠️ WARNING
This program, by default, scans 5000 ports at a time (5000 per second).
This program, by default, scans 5000 ports at a time (5000 per second).
This may cause damage to a server, or may make it incredibly obvious you are scanning the server.
Servers as well as individual services can block your IP completely after a huge amount of simultaneous connections/tries, Possibly causing you to see false positives. False positives are open ports at the initial scanning process later found closed when you want to do further scanning, or connect to it.
There are 2 ways to deal with this;
1. Decrease batch size
`rustscan -b 10` will run 10 port scans for 1 second, and then another 10 for 1 second and so on.
`rustscan -b 10` will run 10 port scans for 1 second, and then another 10 for 1 second and so on.
2. Increase timeout
`rustscan -T 5000` will mean RustScan waits 5 seconds until it scans the next ports.
`rustscan -T 5000` will mean RustScan waits 5 seconds until it scans the next ports.
You can also use both of these at the same time, to make it as slow or as fast as you want. A fun favourite is 65535 batch size with 1 second timeout. Theoretically, this scans all 65535 ports in 1 second.
**Please** do not use this tool against sensitive servers. It is designed mainly for Capture the Flag events, not real world servers with sensitive data.
## 🚨 Thread Paniced at Main: Too Many Open Files
## 🚨 Thread Panicked at Main: Too Many Open Files
This is the most common error found in RustScan.
The open file limit is how many open sockets you can have at any given time.
@@ -198,9 +325,10 @@ This limit changes from OS to OS.
RustScan does not automatically create defaults (other than 5000) like Nmap does with their -T1, -T2 system.
By figuring out for yourself the optimal batch size, you will know that RustScan is the most optimised port scanner for your system.
By figuring out for yourself the optimal batch size, you will know that RustScan is the most optimised port scanner for your system.
There are 2 things you can do:
1. Decrease batch size
2. Increase open file limit
@@ -208,7 +336,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
@@ -222,55 +350,92 @@ 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
```
**Mac OS**
Mac OS has, from what I can tell, a naturally very low open file descriptor limit. The limit for Ubuntu is 8800. The limit for Mac OS is 255!
Mac OS has, from what I can tell, a naturally very low open file descriptor limit. The limit for Ubuntu is 8800. The limit for Mac OS is 255!
In this case, I would say it is safe to increase the open file limit. As most Linux based OS' have limits in the thousands.
In this case, I would say it is safe to increase the open file limit. As most Linux based OS' have limits in the thousands.
Although, if this breaks anything, please don't blame me.
Although, if this breaks anything, please don't blame me.
**Windows Subsystem for Linux**
Windows Subsystem for Linux does not support ulimt (see issue #39).
Windows Subsystem for Linux does not support ulimit (see issue #39).
The best way is to use it on a host computer, in Docker, or in a VM that isn't WSL.
The best way is to use it on a host computer, in Docker, or in a VM that isn't WSL.
**Automatic Ulimit updating**
We are currently working on automatic Ulimit updating. If it is too high, it will lower itself. If it is too low, it will suggest a higher Ulimit. Watch [this issue](https://github.com/brandonskerritt/RustScan/issues/25) for more.
We are currently working on automatic Ulimit updating. If it is too high, it will lower itself. If it is too low, it will suggest a higher Ulimit. Watch [this issue](https://github.com/RustScan/RustScan/issues/25) for more.
## 🔌 Nmap Custom Flags
To run your own nmap commands, end the RustScan command with `-- -A` where `--` indicates "end of RustScan flags, please do not parse anything further" and any flags after that will be entered into nmap.
RustScan automatically runs `nmap -vvv -p $PORTS $IP`. To make it run `-A`, execute the command `rustscan 127.0.0.1 -- -A`.
RustScan automatically runs `nmap -vvv -p $PORTS $IP`. To make it run `-A`, execute the command `rustscan 127.0.0.1 -- -A`.
**Note**: due to how Nmap behaves, sometimes you cannot SIGINT ctrl+c to end the scan and it acts like it is running in the background, but printing to STD::OUT. There is nothing I can do about this, unless I create a TTY shell for the sole purpose of running Nmap. Sorry 😓 I'll try to fix in an upcoming release. If any Rust experts want to help, please do!
If you want to run commands such as `--script (vuln and safe)`, you will need to enclose it in quotations like so `--script '"(vuln and safe) or default"'`.
## 🎯 Increasing speed / accuracy
* Batch size
- Batch size
This increases speed, by allowing us to process more at once. Something experimental I am working on is changing the open file limit. You can do this manually with `ulimit -n 70000` and then running rustscan with `-b 65535`. This _should_ scan all 65535 ports at the exact same time. But this is extremely experimental.
For non-experimental speed increases, slowly increase the batch size until it no longer gets open ports, or it breaks.
* Accuracy (and some speed)
- Accuracy (and some speed)
To increase accuracy, the easiest way is to increase the timeout. The default is 1.5 seconds, by setting it to 4 seconds (4000) we are telling RustScan "if we do not hear back from a port in 4 seconds, assume it is closed".
Decreasing accuracy gives some speed bonus, but my testing found that batch size dramatically changed the speed whereas timeout did, but not so much.
# 🎪 Contributing
# 🎪 Community
Howdy Space Cow-Person 🤠🌌
RustScan is always looking for contributors. Whether that's spelling mistakes or major changes, your help is **wanted** and welcomed here.
Before contributing, read our [code of conduct](https://github.com/RustScan/RustScan/blob/master/CODE_OF_CONDUCT.md).
TL;DR if you abuse members of our community you will be **perma-banned** 🤗
RustScan has 2 major labels for GitHub issues you should look at:
- Good First issue
These are issues for newcomers to open source!
[https://github.com/RustScan/RustScan/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22](https://github.com/RustScan/RustScan/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22)
- Help wanted
These are issues that aren't really for newcomers, but we could still do wiht help!
[https://github.com/RustScan/RustScan/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22+label%3A%22help+wanted%22](https://github.com/RustScan/RustScan/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22+label%3A%22help+wanted%22)
If you want to, solve the issue or comment on the issue for help.
The flow for contributing to open source software is:
- Fork the repo
- Make changes
- Pull request to the repo
And then comment on the issue that you've done.
RustScan also has some `// TODO`'s in the codebase, which are meant more for the core team but we wouldn't say no to help with these issues.
If you have any feature suggestions or bugs, leave a GitHub issue. We welcome any and all support :D
We communicate over Discord. [Click here](https://discord.gg/GFrQsGy) to join our Discord community!
## Rewarding you
I cannot pay you :-( But, I can place your GitHub profile on the README under `#Contributors` as a thank you! :)
Please read the [contributing.md file](contributing.md)
# 💻 Other Hacking Projects By This Author
## 🧮 Ciphey
Ciphey is an automated decryption tool using artifical intelligence & natural language processing.
[Check it out here!](https://github.com/ciphey/ciphey)
## Contributors ✨
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-5-orange.svg?style=flat-square)](#contributors-)
[![All Contributors](https://img.shields.io/badge/all_contributors-19-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)):
@@ -280,11 +445,29 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<!-- markdownlint-disable -->
<table>
<tr>
<td align="center"><a href="https://skerritt.blog"><img src="https://avatars3.githubusercontent.com/u/10378052?v=4" width="100px;" alt=""/><br /><sub><b>Brandon</b></sub></a><br /><a href="#infra-brandonskerritt" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="https://github.com/brandonskerritt/RustScan/commits?author=brandonskerritt" title="Tests">⚠️</a> <a href="https://github.com/brandonskerritt/RustScan/commits?author=brandonskerritt" title="Code">💻</a> <a href="#design-brandonskerritt" title="Design">🎨</a></td>
<td align="center"><a href="https://sakiir.ovh"><img src="https://avatars1.githubusercontent.com/u/9950578?v=4" width="100px;" alt=""/><br /><sub><b>SakiiR</b></sub></a><br /><a href="https://github.com/brandonskerritt/RustScan/commits?author=SakiiR" title="Code">💻</a> <a href="https://github.com/brandonskerritt/RustScan/issues?q=author%3ASakiiR" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://skerritt.blog"><img src="https://avatars3.githubusercontent.com/u/10378052?v=4" width="100px;" alt=""/><br /><sub><b>Brandon</b></sub></a><br /><a href="#infra-brandonskerritt" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="https://github.com/RustScan/RustScan/commits?author=brandonskerritt" title="Tests">⚠️</a> <a href="https://github.com/RustScan/RustScan/commits?author=brandonskerritt" title="Code">💻</a> <a href="#design-brandonskerritt" title="Design">🎨</a></td>
<td align="center"><a href="https://sakiir.ovh"><img src="https://avatars1.githubusercontent.com/u/9950578?v=4" width="100px;" alt=""/><br /><sub><b>SakiiR</b></sub></a><br /><a href="https://github.com/RustScan/RustScan/commits?author=SakiiR" title="Code">💻</a> <a href="https://github.com/RustScan/RustScan/issues?q=author%3ASakiiR" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/smackhack"><img src="https://avatars2.githubusercontent.com/u/48143394?v=4" width="100px;" alt=""/><br /><sub><b>smackhack</b></sub></a><br /><a href="#ideas-smackhack" title="Ideas, Planning, & Feedback">🤔</a> <a href="#example-smackhack" title="Examples">💡</a></td>
<td align="center"><a href="http://bernardoamc.github.io/"><img src="https://avatars0.githubusercontent.com/u/428984?v=4" width="100px;" alt=""/><br /><sub><b>Bernardo Araujo</b></sub></a><br /><a href="https://github.com/brandonskerritt/RustScan/commits?author=bernardoamc" title="Code">💻</a> <a href="https://github.com/brandonskerritt/RustScan/issues?q=author%3Abernardoamc" title="Bug reports">🐛</a> <a href="#design-bernardoamc" title="Design">🎨</a></td>
<td align="center"><a href="https://github.com/Isona"><img src="https://avatars2.githubusercontent.com/u/11759523?v=4" width="100px;" alt=""/><br /><sub><b>Izzy Whistlecroft</b></sub></a><br /><a href="https://github.com/brandonskerritt/RustScan/issues?q=author%3AIsona" title="Bug reports">🐛</a></td>
<td align="center"><a href="http://bernardoamc.github.io/"><img src="https://avatars0.githubusercontent.com/u/428984?v=4" width="100px;" alt=""/><br /><sub><b>Bernardo Araujo</b></sub></a><br /><a href="https://github.com/RustScan/RustScan/commits?author=bernardoamc" title="Code">💻</a> <a href="https://github.com/RustScan/RustScan/issues?q=author%3Abernardoamc" title="Bug reports">🐛</a> <a href="#design-bernardoamc" title="Design">🎨</a></td>
<td align="center"><a href="https://github.com/Isona"><img src="https://avatars2.githubusercontent.com/u/11759523?v=4" width="100px;" alt=""/><br /><sub><b>Izzy Whistlecroft</b></sub></a><br /><a href="https://github.com/RustScan/RustScan/issues?q=author%3AIsona" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://imlonghao.com"><img src="https://avatars1.githubusercontent.com/u/4951333?v=4" width="100px;" alt=""/><br /><sub><b>imlonghao</b></sub></a><br /><a href="https://github.com/RustScan/RustScan/issues?q=author%3Aimlonghao" title="Bug reports">🐛</a> <a href="#maintenance-imlonghao" title="Maintenance">🚧</a></td>
<td align="center"><a href="https://github.com/royharoush"><img src="https://avatars3.githubusercontent.com/u/8113056?v=4" width="100px;" alt=""/><br /><sub><b>royharoush</b></sub></a><br /><a href="#ideas-royharoush" title="Ideas, Planning, & Feedback">🤔</a> <a href="#design-royharoush" title="Design">🎨</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/Atul9"><img src="https://avatars1.githubusercontent.com/u/3390330?v=4" width="100px;" alt=""/><br /><sub><b>Atul Bhosale</b></sub></a><br /><a href="https://github.com/RustScan/RustScan/commits?author=Atul9" title="Code">💻</a></td>
<td align="center"><a href="https://tgotwig.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>
<td align="center"><a href="https://liberapay.com/Artem4/"><img src="https://avatars0.githubusercontent.com/u/5614476?v=4" width="100px;" alt=""/><br /><sub><b>Artem Polishchuk</b></sub></a><br /><a href="#platform-tim77" title="Packaging/porting to new platform">📦</a></td>
<td align="center"><a href="https://github.com/buermarc"><img src="https://avatars2.githubusercontent.com/u/44375277?v=4" width="100px;" alt=""/><br /><sub><b>buermarc</b></sub></a><br /><a href="https://github.com/RustScan/RustScan/commits?author=buermarc" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/bergabman"><img src="https://avatars1.githubusercontent.com/u/44554109?v=4" width="100px;" alt=""/><br /><sub><b>bergabman</b></sub></a><br /><a href="https://github.com/RustScan/RustScan/commits?author=bergabman" title="Code">💻</a> <a href="https://github.com/RustScan/RustScan/issues?q=author%3Abergabman" title="Bug reports">🐛</a> <a href="#design-bergabman" title="Design">🎨</a></td>
</tr>
</table>
+1004
View File
File diff suppressed because it is too large. Load diff
+29 -4
View File
@@ -1,6 +1,31 @@
This is my first Rust project! As such, I expect there are many, many bugs involved or things that can be sped up.
Howdy Space Cow-Person 🤠🌌
If you're looking to get involved, we make use of Good First Issues / Help Wanted tags. Click this link to see all the issues we could use help with!
[https://github.com/brandonskerritt/RustScan/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22](https://github.com/brandonskerritt/RustScan/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22)
RustScan is always looking for contributors. Whether that's spelling mistakes or major changes, your help is **wanted** and welcomed here.
Please leave issues / pull requests, I'd love to learn more about this amazing language :)
Before contributing, read our [code of conduct](https://github.com/RustScan/RustScan/blob/master/CODE_OF_CONDUCT.md).
TL;DR if you abuse members of our community you will be **perma-banned** with no chance to get unbanned. No warnings either. 🤗
RustScan has 2 major labels for GitHub issues you should look at:
* Good First issue
These are issues for newcomers to open source!
[https://github.com/RustScan/RustScan/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22](https://github.com/RustScan/RustScan/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22)
* Help wanted
These are issues that aren't really for newcomers, but we could still do with help!
[https://github.com/RustScan/RustScan/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22+label%3A%22help+wanted%22](https://github.com/RustScan/RustScan/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22+label%3A%22help+wanted%22)
If you want to, solve the issue or comment on the issue for help.
The [flow for contributing](https://guides.github.com/introduction/flow/) to open source software is:
* Fork the repo
* Make changes
* Pull request to the repo
And then comment on the issue that you've done.
RustScan also has some `// TODO`'s in the codebase, which are meant more for the core team but we wouldn't say no to help with these issues.
If you have any feature suggestions or bugs, leave a GitHub issue. We welcome any and all support :D
## Rewarding you
I cannot pay you :-( But, I can place your GitHub profile on the README under `#Contributors` as a thank you! :)
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.
+89
View File
@@ -0,0 +1,89 @@
//! # Usage
//! ```
//! // Initiate Benchmark vector
//! let mut bm = Benchmark::init();
//! // Start named timer with name
//! let mut example_bench = NamedTimer::start("Example Bench");
//! // Stop named timer
//! example_bench.stop();
//! // Add named timer to Benchmarks
//! bm.push(example_bench);
//! // Print Benchmark Summary
//! info!({}, bm.summary());
//! ```
use std::time::Instant;
/// A Benchmark struct to hold NamedTimers with name, start and end Instants,
#[derive(Debug)]
pub struct Benchmark {
named_timers: Vec<NamedTimer>,
}
impl Benchmark {
pub fn init() -> Self {
Self {
named_timers: Vec::new(),
}
}
pub fn push(&mut self, timer: NamedTimer) {
self.named_timers.push(timer);
}
/// Summary of the benchmarks will destruct the vector,
/// formats every element the same way and return
/// a single String with all the available information
/// for easy printing
pub fn summary(&self) -> String {
let mut summary = String::from("\nRustScan Benchmark Summary");
for timer in &self.named_timers {
if timer.start.is_some() && timer.end.is_some() {
let runtime_secs = timer
.end
.unwrap()
.saturating_duration_since(timer.start.unwrap())
.as_secs_f32();
summary.push_str(&format!("\n{0: <10} | {1: <10}s", timer.name, runtime_secs))
}
}
summary
}
}
/// The purpose of NamedTimer is to hold a name,
/// start Instant and end Instant for a specific timer.
/// The given name will be presented in the benchmark summary,
/// start and end Instants will be used for calculating runtime.
#[derive(Debug)]
pub struct NamedTimer {
name: &'static str,
start: Option<Instant>,
end: Option<Instant>,
}
impl NamedTimer {
pub fn start(name: &'static str) -> Self {
Self {
name: name,
start: Some(Instant::now()),
end: None,
}
}
pub fn end(&mut self) {
self.end = Some(Instant::now());
}
}
#[test]
fn benchmark() {
let mut benchmarks = Benchmark::init();
let mut test_timer = NamedTimer::start("test");
std::thread::sleep(std::time::Duration::from_millis(100));
test_timer.end();
benchmarks.push(test_timer);
benchmarks.push(NamedTimer::start("only_start"));
assert!(benchmarks
.summary()
.contains("\nRustScan Benchmark Summary\ntest | 0."));
assert_ne!(benchmarks.summary().contains("only_start"), true);
}
+367
View File
@@ -0,0 +1,367 @@
use serde_derive::Deserialize;
use std::collections::HashMap;
use std::fs;
use structopt::{clap::arg_enum, StructOpt};
const LOWEST_PORT_NUMBER: u16 = 1;
const TOP_PORT_NUMBER: u16 = 65535;
arg_enum! {
/// Represents the strategy in which the port scanning will run.
/// - Serial will run from start to end, for example 1 to 1_000.
/// - Random will randomize the order in which ports will be scanned.
#[derive(Deserialize, Debug, StructOpt, Clone, PartialEq)]
pub enum ScanOrder {
Serial,
Random,
}
}
/// Represents the range of ports to be scanned.
#[derive(Deserialize, Debug, Clone, PartialEq)]
pub struct PortRange {
pub start: u16,
pub end: u16,
}
fn parse_range(input: &str) -> Result<PortRange, String> {
let range = input
.split("-")
.map(|x| x.parse::<u16>())
.collect::<Result<Vec<u16>, std::num::ParseIntError>>();
if range.is_err() {
return Err(String::from(
"the range format must be 'start-end'. Example: 1-1000.",
));
}
match range.unwrap().as_slice() {
[start, end] => Ok(PortRange {
start: *start,
end: *end,
}),
_ => Err(String::from(
"the range format must be 'start-end'. Example: 1-1000.",
)),
}
}
#[derive(StructOpt, Debug)]
#[structopt(name = "rustscan", setting = structopt::clap::AppSettings::TrailingVarArg)]
/// 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
pub struct Opts {
/// A list of comma separated CIDRs, IPs, or hosts to be scanned.
#[structopt(use_delimiter = true)]
pub addresses: Vec<String>,
/// A list of comma separed ports to be scanned. Example: 80,443,8080.
#[structopt(short, long, use_delimiter = true)]
pub ports: Option<Vec<u16>>,
/// A range of ports with format start-end. Example: 1-1000.
#[structopt(short, long, conflicts_with = "ports", parse(try_from_str = parse_range))]
pub range: Option<PortRange>,
/// Whether to ignore the configuration file or not.
#[structopt(short, long)]
pub no_config: bool,
/// Greppable mode. Only output the ports. No Nmap. Useful for grep or outputting to a file.
#[structopt(short, long)]
pub greppable: bool,
/// Accessible mode. Turns off features which negatively affect screen readers.
#[structopt(long)]
pub accessible: bool,
/// Turns off Nmap.
#[structopt(long)]
pub no_nmap: 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
/// support this.
#[structopt(short, long, default_value = "4500")]
pub batch_size: u16,
/// The timeout in milliseconds before a port is assumed to be closed.
#[structopt(short, long, default_value = "1500")]
pub timeout: u32,
/// Automatically ups the ULIMIT with the value you provided.
#[structopt(short, long)]
pub ulimit: Option<rlimit::rlim>,
/// The order of scanning to be performed. The "serial" option will
/// scan ports in ascending order while the "random" option will scan
/// ports randomly.
#[structopt(long, possible_values = &ScanOrder::variants(), case_insensitive = true, default_value = "serial")]
pub scan_order: ScanOrder,
/// 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 automatically to nmap.
/// For things like --script '(safe and vuln)' enclose it in quotations marks \"'(safe and vuln)'\"")
#[structopt(last = true)]
pub command: Vec<String>,
/// Use the top 1000 ports.
#[structopt(long)]
pub top: bool,
}
impl Opts {
pub fn read() -> Self {
let mut opts = Opts::from_args();
if opts.ports.is_none() && opts.range.is_none() {
opts.range = Some(PortRange {
start: LOWEST_PORT_NUMBER,
end: TOP_PORT_NUMBER,
});
}
opts
}
/// Reads the command line arguments into an Opts struct and merge
/// values found within the user configuration file.
pub fn merge(&mut self, config: &Config) {
if !self.no_config {
self.merge_required(&config);
self.merge_optional(&config);
}
}
fn merge_required(&mut self, config: &Config) {
macro_rules! merge_required {
($($field: ident),+) => {
$(
if let Some(e) = &config.$field {
self.$field = e.clone();
}
)+
}
}
merge_required!(addresses, greppable, accessible, batch_size, timeout, scan_order, command);
}
fn merge_optional(&mut self, config: &Config) {
macro_rules! merge_optional {
($($field: ident),+) => {
$(
if config.$field.is_some() {
self.$field = config.$field.clone();
}
)+
}
}
// Only use top ports when the user asks for them
if self.top {
if config.ports.is_some() {
let mut ports: Vec<u16> = Vec::with_capacity(config.ports.clone().unwrap().len());
for entry in config.ports.clone().unwrap().keys() {
ports.push(entry.parse().unwrap())
}
self.ports = Some(ports);
}
}
merge_optional!(range, ulimit);
}
}
/// Struct used to deserialize the options specified within our config file.
/// These will be further merged with our command line arguments in order to
/// generate the final Opts struct.
#[derive(Debug, Deserialize)]
pub struct Config {
addresses: Option<Vec<String>>,
ports: Option<HashMap<String, u16>>,
range: Option<PortRange>,
greppable: Option<bool>,
accessible: Option<bool>,
batch_size: Option<u16>,
timeout: Option<u32>,
no_nmap: Option<bool>,
ulimit: Option<rlimit::rlim>,
scan_order: Option<ScanOrder>,
command: Option<Vec<String>>,
}
impl Config {
/// Reads the configuration file with TOML format and parses it into a
/// Config struct.
///
/// # Format
///
/// addresses = ["127.0.0.1", "127.0.0.1"]
/// ports = [80, 443, 8080]
/// quiet = true
/// scan_order: "Serial"
///
pub fn read() -> Self {
let mut home_dir = match dirs::home_dir() {
Some(dir) => dir,
None => panic!("Could not infer config file path."),
};
home_dir.push(".rustscan.toml");
let mut content = String::new();
if home_dir.exists() {
content = match fs::read_to_string(home_dir) {
Ok(content) => content,
Err(_) => String::new(),
}
}
let config: Config = match toml::from_str(&content) {
Ok(config) => config,
Err(e) => {
println!("Found {} in configuration file.\nAborting scan.\n", e);
std::process::exit(1);
}
};
config
}
}
#[cfg(test)]
mod tests {
use super::{Config, Opts, PortRange, ScanOrder};
#[test]
fn opts_no_merge_when_config_is_ignored() {
let mut opts = Opts {
addresses: vec![],
ports: None,
range: None,
greppable: false,
batch_size: 0,
timeout: 0,
ulimit: None,
command: vec![],
accessible: false,
no_nmap: false,
scan_order: ScanOrder::Serial,
no_config: true,
top: false,
};
let config = Config {
addresses: Some(vec!["127.0.0.1".to_owned()]),
ports: None,
range: None,
greppable: Some(true),
batch_size: Some(25_000),
timeout: Some(1_000),
ulimit: None,
no_nmap: Some(false),
command: Some(vec!["-A".to_owned()]),
accessible: Some(true),
scan_order: Some(ScanOrder::Random),
};
opts.merge(&config);
assert_eq!(opts.addresses, vec![] as Vec<String>);
assert_eq!(opts.greppable, false);
assert_eq!(opts.accessible, false);
assert_eq!(opts.timeout, 0);
assert_eq!(opts.command, vec![] as Vec<String>);
assert_eq!(opts.scan_order, ScanOrder::Serial);
}
#[test]
fn opts_merge_required_arguments() {
let mut opts = Opts {
addresses: vec![],
ports: None,
range: None,
greppable: false,
batch_size: 0,
timeout: 0,
ulimit: None,
command: vec![],
accessible: false,
scan_order: ScanOrder::Serial,
no_nmap: false,
no_config: false,
top: false,
};
let config = Config {
addresses: Some(vec!["127.0.0.1".to_owned()]),
ports: None,
no_nmap: Some(false),
range: None,
greppable: Some(true),
batch_size: Some(25_000),
timeout: Some(1_000),
ulimit: None,
command: Some(vec!["-A".to_owned()]),
accessible: Some(true),
scan_order: Some(ScanOrder::Random),
};
opts.merge_required(&config);
assert_eq!(opts.addresses, config.addresses.unwrap());
assert_eq!(opts.greppable, config.greppable.unwrap());
assert_eq!(opts.timeout, config.timeout.unwrap());
assert_eq!(opts.command, config.command.unwrap());
assert_eq!(opts.accessible, config.accessible.unwrap());
assert_eq!(opts.scan_order, config.scan_order.unwrap());
}
#[test]
fn opts_merge_optional_arguments() {
let mut opts = Opts {
addresses: vec![],
ports: None,
range: None,
greppable: false,
batch_size: 0,
timeout: 0,
ulimit: None,
command: vec![],
accessible: false,
scan_order: ScanOrder::Serial,
no_nmap: false,
no_config: false,
top: false,
};
let config = Config {
addresses: None,
ports: None,
range: Some(PortRange {
start: 1,
end: 1_000,
}),
greppable: None,
batch_size: None,
timeout: None,
no_nmap: Some(false),
ulimit: Some(1_000),
command: None,
accessible: None,
scan_order: None,
};
opts.merge_optional(&config);
assert_eq!(opts.range, config.range);
assert_eq!(opts.ulimit, config.ulimit);
}
}
+487 -174
View File
@@ -1,207 +1,520 @@
extern crate shell_words;
mod tui;
mod input;
use input::{Config, Opts, PortRange, ScanOrder};
mod scanner;
use scanner::Scanner;
use clap::{App, Arg, AppSettings};
use colored::*;
use std::time::Duration;
use std::process::{exit, Command};
use std::convert::TryInto;
mod port_strategy;
use port_strategy::PortStrategy;
mod benchmark;
use benchmark::{Benchmark, NamedTimer};
use cidr_utils::cidr::IpCidr;
use colorful::Color;
use colorful::Colorful;
use futures::executor::block_on;
use rlimit::Resource;
use rlimit::{setrlimit, getrlimit};
use rlimit::{getrlimit, setrlimit};
use std::collections::HashMap;
use std::net::ToSocketAddrs;
use std::process::Command;
use std::{net::IpAddr, time::Duration};
extern crate colorful;
extern crate dirs;
// Average value for Ubuntu
const DEFAULT_FILE_DESCRIPTORS_LIMIT: rlimit::rlim = 8000;
// Safest batch size based on experimentation
const AVERAGE_BATCH_SIZE: rlimit::rlim = 3000;
#[macro_use]
extern crate log;
#[cfg(not(tarpaulin_include))]
/// Faster Nmap scanning with Rust
/// If you're looking for the actual scanning, check out the module Scanner
fn main() {
let matches = App::new("RustScan")
.author("Bee https://github.com/brandonskerritt")
.about("Fast Port Scanner built in Rust\nWARNING Do not use this program against sensitive infrastructure. The specified server may not be able to handle this many socket connections at once.")
.version("1.2.0")
.setting(AppSettings::TrailingVarArg)
env_logger::init();
let mut benchmarks = Benchmark::init();
let mut rustscan_bench = NamedTimer::start("RustScan");
// IP address is a required argument
.arg(Arg::with_name("ip")
.required(true)
.index(1)
.long("ip-address")
.help("The IP address to scan"))
.arg(Arg::with_name("b")
.short("b")
.long("batch")
.takes_value(true)
.default_value("4500")
.help("Increases speed of scanning. The batch size for port scanning. Depends on your open file limit of OS. If you do 65535 it will do every port at the same time. Although, your OS may not support this."))
.arg(Arg::with_name("T")
.short("T")
.long("timeout")
.takes_value(true)
.default_value("1500")
.help("The timeout before a port is assumed to be close. In MS."))
.arg(Arg::with_name("q")
.short("-q")
.long("quiet")
.takes_value(false)
.help("Quiet mode. Only output the ports. No Nmap. Useful for grep or outputting to a file."))
.arg(Arg::with_name("u")
.short("u")
.long("ulimit")
.help("Automatically ups the ULIMIT with the value you provided.")
.takes_value(true))
.arg(
Arg::with_name("command")
.help("The Nmap arguments to run. To use the argument -A, end RustScan's args with '-- -A'. To run EXAMPLE: 'rustscan -T 1500 127.0.0.1 -- -A -sC'. This argument auto runs nmap {your commands} -vvv -p $PORTS ")
.takes_value(true)
.multiple(true),
)
.get_matches();
let mut opts: Opts = Opts::read();
let config = Config::read();
opts.merge(&config);
debug!("Main() `opts` arguments are {:?}", opts);
let ip = matches.value_of("ip").unwrap_or("None");
let ulimit_arg = matches.value_of("u").unwrap_or("None");
let quiet = if matches.is_present("q") { true } else { false };
let command_matches= matches.values_of("command");
let command_run: String = match command_matches {
// We use the user supplied args
Some(_x) => {
// TODO x is the same as below, use that instead
matches.values_of("command").unwrap().collect::<Vec<_>>().join(" ")
}
// we default
None => "-A -vvv".to_string()
};
let mut batch_size: u64 = matches
.value_of("b")
.unwrap_or("None")
.parse::<u64>()
.unwrap();
if !quiet {
print_opening();
if !opts.greppable && !opts.accessible {
print_opening(&opts);
}
// checks ulimit
let ips: Vec<IpAddr> = parse_addresses(&opts);
// change ulimit size
if !(ulimit_arg == "None") {
let limit = ulimit_arg.parse::<u64>().unwrap();
if !quiet{
println!("Automatically upping ulimit to {}", ulimit_arg);
}
let uresult = setrlimit(Resource::NOFILE, limit, limit);
match uresult {
Ok(_) => {}
Err(_) => {println!("ERROR. Failed to set Ulimit.")}
}
if ips.is_empty() {
warning!(
"No IPs could be resolved, aborting scan.",
opts.greppable,
opts.accessible
);
std::process::exit(1);
}
let ulimit: rlimit::rlim = adjust_ulimit_size(&opts);
let batch_size: u16 = infer_batch_size(&opts, ulimit);
let scanner = Scanner::new(
&ips,
batch_size,
Duration::from_millis(opts.timeout.into()),
opts.greppable,
PortStrategy::pick(opts.range, opts.ports, opts.scan_order),
opts.accessible,
);
debug!("Scanner finished building: {:?}", scanner);
let (x, _) = getrlimit(Resource::NOFILE).unwrap();
// if maximum limit is lower than batch size
// automatically re-adjust the batch size
if x < batch_size.into() {
if !quiet{
println!("{}", "WARNING: Your file description limit is lower than selected batch size. Please considering upping this (how to is on the README). NOTE: this may be dangerous and may cause harm to sensitive servers. Automatically reducing Batch Size to match your limit, this process isn't harmful but reduces speed.".red());
// TODO this is a joke please fix
// if the OS supports high file limits like 8000
// but the user selected a batch size higher than this
// reduce to a lower number
// basically, ubuntu is 8000
// but i can only get it to work on < 5k in testing
// 5k is default, so 3000 seems safe
if x > 8000{
batch_size = 3000
}
else {
let ten: u64 = 100;
batch_size = x - ten;
}
}
}
// else if the ulimit is higher than batch size
// tell the user they can increase batch size
// if the user set ulimit arg they probably know what they are doing so don't print this
else if x + 2 > batch_size.into() && (ulimit_arg == "None"){
if !quiet{
// TODO this is a joke please fix
let one: u64 = 1;
println!("Your file description limit is higher than the batch size. You can potentially increase the speed by increasing the batch size, but this may cause harm to sensitive servers. Your limit is {}, try batch size {}.", x, x - one);
}
}
// the user has asked to automatically up the ulimit
// gets timeout
let duration_timeout =
matches
.value_of("T")
.unwrap_or("None")
.parse::<u64>()
.unwrap();
// 65535 + 1 because of 0 indexing
let scanner = Scanner::new(ip, 1, 65536, batch_size.try_into().unwrap(), Duration::from_millis(duration_timeout), quiet);
let mut portscan_bench = NamedTimer::start("Portscan");
let scan_result = block_on(scanner.run());
portscan_bench.end();
benchmarks.push(portscan_bench);
// prints ports and places them into nmap string
let nmap_str_ports: Vec<String> = scan_result.into_iter().map(|port| port.to_string()).collect();
let mut ports_per_ip = HashMap::new();
// if no ports are found, suggest running with less
if nmap_str_ports.is_empty() {
panic!("{} Looks like I didn't find any open ports. This is usually caused by a high batch size.
\n*I used {} threads, consider lowering to {} with {} or a comfortable number lfor your system.
\n Alternatively, increase the timeout if your ping is high. Rustscan -T 2000 for 2000 second timeout.", "ERROR".red(), batch_size, (batch_size / 2).to_string().green(), "'rustscan -b <batch_size> <ip address>'".green());
for socket in scan_result {
ports_per_ip
.entry(socket.ip())
.or_insert_with(Vec::new)
.push(socket.port());
}
// Tells the user we are now switching to Nmap
if !quiet{
println!(
"{}",
"Starting nmap.".blue(),
for ip in ips {
if ports_per_ip.contains_key(&ip) {
continue;
}
// If we got here it means the IP was not found within the HashMap, this
// means the scan couldn't find any open ports for it.
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 it with {} or a comfortable number for your system.
\n Alternatively, increase the timeout if your ping is high. Rustscan -t 2000 for 2000 milliseconds (2s) timeout.\n",
ip,
opts.batch_size,
"'rustscan -b <batch_size> <ip address>'");
warning!(x, opts.greppable, opts.accessible);
}
let mut nmap_bench = NamedTimer::start("Nmap");
for (ip, ports) in ports_per_ip.iter_mut() {
let nmap_str_ports: Vec<String> = ports.into_iter().map(|port| port.to_string()).collect();
// nmap port style is 80,443. Comma separated with no spaces.
let ports_str = nmap_str_ports.join(",");
// if quiet mode is on nmap should not be spawned
if opts.greppable || opts.no_nmap {
println!("{} -> [{}]", &ip, ports_str);
continue;
}
detail!("Starting Nmap", opts.greppable, opts.accessible);
let addr = ip.to_string();
let user_nmap_args =
shell_words::split(&opts.command.join(" ")).expect("failed to parse nmap arguments");
let nmap_args = build_nmap_arguments(&addr, &ports_str, &user_nmap_args, ip.is_ipv6());
output!(
format!(
"The Nmap command to be run is nmap {}\n",
&nmap_args.join(" ")
),
opts.greppable.clone(),
opts.accessible.clone()
);
// Runs the nmap command and spawns it as a process.
let mut child = Command::new("nmap")
.args(&nmap_args)
.spawn()
.expect("failed to execute nmap process");
child.wait().expect("failed to wait on nmap process");
}
// To use the runtime benchmark, run the process as: RUST_LOG=info ./rustscan
nmap_bench.end();
benchmarks.push(nmap_bench);
rustscan_bench.end();
benchmarks.push(rustscan_bench);
debug!("Benchmarks raw {:?}", benchmarks);
info!("{}", benchmarks.summary());
}
/// Prints the opening title of RustScan
fn print_opening(opts: &Opts) {
debug!("Printing opening");
let s = r#".----. .-. .-. .----..---. .----. .---. .--. .-. .-.
| {} }| { } |{ {__ {_ _}{ {__ / ___} / {} \ | `| |
| .-. \| {_} |.-._} } | | .-._} }\ }/ /\ \| |\ |
`-' `-'`-----'`----' `-' `----' `---' `-' `-'`-' `-'
Faster Nmap scanning with Rust."#;
println!("{}", s.gradient(Color::Green).bold());
let info = r#"________________________________________
: https://discord.gg/GFrQsGy :
: https://github.com/RustScan/RustScan :
--------------------------------------"#;
println!("{}", info.gradient(Color::Yellow).bold());
funny_opening!();
let mut home_dir = match dirs::home_dir() {
Some(dir) => dir,
None => panic!("Could not infer config file path."),
};
home_dir.push(".rustscan.toml");
detail!(
format!("The config file is expected to be at {:?}", home_dir),
opts.greppable,
opts.accessible
);
}
#[cfg(not(tarpaulin_include))]
fn build_nmap_arguments<'a>(
addr: &'a str,
ports: &'a str,
user_args: &'a Vec<String>,
is_ipv6: bool,
) -> Vec<&'a str> {
let mut arguments: Vec<&str> = user_args.iter().map(AsRef::as_ref).collect();
arguments.push("-vvv");
if is_ipv6 {
arguments.push("-6");
}
arguments.push("-p");
arguments.push(ports);
arguments.push(addr);
arguments
}
fn parse_addresses(opts: &Opts) -> Vec<IpAddr> {
let mut ips: Vec<IpAddr> = Vec::new();
for ip_or_host in &opts.addresses {
match IpCidr::from_str(ip_or_host) {
Ok(cidr) => cidr.iter().for_each(|ip| ips.push(ip)),
_ => match format!("{}:{}", &ip_or_host, 80).to_socket_addrs() {
Ok(mut iter) => ips.push(iter.nth(0).unwrap().ip()),
_ => {
let failed_to_resolve = format!("Host {:?} could not be resolved.", ip_or_host);
warning!(failed_to_resolve, opts.greppable, opts.accessible);
}
},
}
}
ips
}
fn adjust_ulimit_size(opts: &Opts) -> rlimit::rlim {
if opts.ulimit.is_some() {
let limit: rlimit::rlim = opts.ulimit.unwrap();
match setrlimit(Resource::NOFILE, limit, limit) {
Ok(_) => {
detail!(
format!("Automatically increasing ulimit value to {}.", limit),
opts.greppable,
opts.accessible
);
}
Err(_) => println!("{}", "ERROR. Failed to set ulimit value."),
}
}
let (rlim, _) = getrlimit(Resource::NOFILE).unwrap();
rlim
}
fn infer_batch_size(opts: &Opts, ulimit: rlimit::rlim) -> u16 {
let mut batch_size: rlimit::rlim = opts.batch_size.into();
// 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 --ulimit. May cause harm to sensitive servers",
opts.greppable, opts.accessible
);
// When the OS supports high file limits like 8000, but the user
// selected a batch size higher than this we should reduce it to
// a lower number.
if ulimit < AVERAGE_BATCH_SIZE {
// ulimit is smaller than aveage batch size
// user must have very small ulimit
// decrease batch size to half of ulimit
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);
info!("Halving batch_size because ulimit is smaller than average batch size");
batch_size = ulimit / 2
} else if ulimit > DEFAULT_FILE_DESCRIPTORS_LIMIT {
info!("Batch size is now average batch size");
batch_size = AVERAGE_BATCH_SIZE
} else {
batch_size = ulimit - 100
}
}
// When the ulimit is higher than the batch size let the user know that the
// batch size can be increased unless they specified the ulimit themselves.
else if ulimit + 2 > batch_size && (opts.ulimit.is_none()) {
detail!(format!(
"File limit higher than batch size. Can increase speed by increasing batch size '-b {}'.",
ulimit - 100
), opts.greppable, opts.accessible);
}
batch_size as u16
}
#[cfg(test)]
mod tests {
use crate::{
adjust_ulimit_size, infer_batch_size, parse_addresses, print_opening, Opts, ScanOrder,
};
use std::net::Ipv4Addr;
#[test]
fn batch_size_lowered() {
let opts = Opts {
addresses: vec!["127.0.0.1".to_owned()],
ports: None,
range: None,
greppable: true,
batch_size: 50_000,
timeout: 1_000,
ulimit: Some(2_000),
command: Vec::new(),
accessible: false,
scan_order: ScanOrder::Serial,
no_config: false,
no_nmap: false,
top: false,
};
let batch_size = infer_batch_size(&opts, 120);
assert!(batch_size < 50_000);
}
#[test]
fn batch_size_lowered_average_size() {
let opts = Opts {
addresses: vec!["127.0.0.1".to_owned()],
ports: None,
range: None,
greppable: true,
batch_size: 50_000,
timeout: 1_000,
ulimit: Some(2_000),
command: Vec::new(),
accessible: false,
scan_order: ScanOrder::Serial,
no_config: false,
no_nmap: false,
top: false,
};
let batch_size = infer_batch_size(&opts, 9_000);
assert!(batch_size == 3_000);
}
#[test]
fn batch_size_equals_ulimit_lowered() {
// because ulimit and batch size are same size, batch size is lowered
// to ULIMIT - 100
let opts = Opts {
addresses: vec!["127.0.0.1".to_owned()],
ports: None,
range: None,
greppable: true,
batch_size: 50_000,
timeout: 1_000,
ulimit: Some(2_000),
command: Vec::new(),
accessible: false,
scan_order: ScanOrder::Serial,
no_config: false,
no_nmap: false,
top: false,
};
let batch_size = infer_batch_size(&opts, 5_000);
assert!(batch_size == 4_900);
}
#[test]
fn batch_size_adjusted_2000() {
// ulimit == batch_size
let opts = Opts {
addresses: vec!["127.0.0.1".to_owned()],
ports: None,
range: None,
greppable: true,
batch_size: 50_000,
timeout: 1_000,
ulimit: Some(2_000),
command: Vec::new(),
accessible: false,
scan_order: ScanOrder::Serial,
no_config: false,
no_nmap: false,
top: false,
};
let batch_size = adjust_ulimit_size(&opts);
assert!(batch_size == 2_000);
}
#[test]
fn test_print_opening_no_panic() {
let opts = Opts {
addresses: vec!["127.0.0.1".to_owned()],
ports: None,
range: None,
greppable: true,
batch_size: 50_000,
timeout: 1_000,
ulimit: Some(2_000),
command: Vec::new(),
accessible: false,
scan_order: ScanOrder::Serial,
no_config: false,
no_nmap: false,
top: false,
};
// print opening should not panic
print_opening(&opts);
assert!(1 == 1);
}
#[test]
fn test_high_ulimit_no_quiet_mode() {
let opts = Opts {
addresses: vec!["127.0.0.1".to_owned()],
ports: None,
range: None,
greppable: false,
batch_size: 10,
timeout: 1_000,
ulimit: None,
command: Vec::new(),
accessible: true,
scan_order: ScanOrder::Serial,
no_config: false,
no_nmap: false,
top: false,
};
infer_batch_size(&opts, 1_000_000);
assert!(1 == 1);
}
#[test]
fn parse_correct_addresses() {
let opts = Opts {
addresses: vec!["127.0.0.1".to_owned(), "192.168.0.0/30".to_owned()],
ports: None,
range: None,
greppable: true,
batch_size: 10,
timeout: 1_000,
ulimit: Some(2_000),
command: Vec::new(),
accessible: false,
scan_order: ScanOrder::Serial,
no_config: false,
no_nmap: false,
top: false,
};
let ips = parse_addresses(&opts);
assert_eq!(
ips,
[
Ipv4Addr::new(127, 0, 0, 1),
Ipv4Addr::new(192, 168, 0, 0),
Ipv4Addr::new(192, 168, 0, 1),
Ipv4Addr::new(192, 168, 0, 2),
Ipv4Addr::new(192, 168, 0, 3)
]
);
}
// nmap port style is 80,443. Comma seperated with no spaces.
let ports_str = nmap_str_ports.join(",");
#[test]
fn parse_correct_host_addresses() {
let opts = Opts {
addresses: vec!["google.com".to_owned()],
ports: None,
range: None,
greppable: true,
batch_size: 10,
timeout: 1_000,
ulimit: Some(2_000),
command: Vec::new(),
accessible: false,
scan_order: ScanOrder::Serial,
no_config: false,
no_nmap: false,
top: false,
};
let ips = parse_addresses(&opts);
// if quiet mode is on, return ports and exit
if quiet{
println!("{:?}", ports_str);
exit(1);
assert_eq!(ips.len(), 1);
}
let string_format = format!("{} {} {} {} {} {}", command_run, "-Pn", "-vvv", "-p", &ports_str, ip);
if !quiet{
println!("The Nmap command to be run is {}", string_format);
#[test]
fn parse_correct_and_incorrect_addresses() {
let opts = Opts {
addresses: vec!["127.0.0.1".to_owned(), "im_wrong".to_owned()],
ports: None,
range: None,
greppable: true,
batch_size: 10,
timeout: 1_000,
ulimit: Some(2_000),
command: Vec::new(),
accessible: false,
scan_order: ScanOrder::Serial,
no_config: false,
no_nmap: false,
top: false,
};
let ips = parse_addresses(&opts);
assert_eq!(ips, [Ipv4Addr::new(127, 0, 0, 1),]);
}
let command_list = string_format.split_whitespace();
let vec = command_list.collect::<Vec<&str>>();
// Runs the nmap command and spawns it as a process.
let mut child = Command::new("nmap")
.args(&vec)
.spawn()
.expect("failed to execute nmap process");
#[test]
fn parse_incorrect_addresses() {
let opts = Opts {
addresses: vec!["im_wrong".to_owned(), "300.10.1.1".to_owned()],
ports: None,
range: None,
greppable: true,
batch_size: 10,
timeout: 1_000,
ulimit: Some(2_000),
command: Vec::new(),
accessible: false,
scan_order: ScanOrder::Serial,
no_config: false,
no_nmap: false,
top: false,
};
let ips = parse_addresses(&opts);
child.wait().expect("failed to wait on nmap process");
}
fn print_opening() {
let s = "
_____ _ _____
| __ \\ | | / ____|
| |__) | _ ___| |_| (___ ___ __ _ _ __
| _ / | | / __| __|\\___ \\ / __/ _` | '_ \\
| | \\ \\ |_| \\__ \\ |_ ____) | (_| (_| | | | |
|_| \\_\\__,_|___/\\__|_____/ \\___\\__,_|_| |_|
Faster nmap scanning with rust.";
println!(
"{} \n {} \n {}",
s.green(),
"Automated Decryption Tool - https://github.com/ciphey/ciphey".green(),
"Creator https://github.com/brandonskerritt".green()
);
assert_eq!(ips.is_empty(), true);
}
}
+139
View File
@@ -0,0 +1,139 @@
mod range_iterator;
use super::{PortRange, ScanOrder};
use rand::seq::SliceRandom;
use rand::thread_rng;
use range_iterator::RangeIterator;
/// Represents options of port scanning.
///
/// Right now all these options involve ranges, but in the future
/// it will also contain custom lists of ports.
#[derive(Debug)]
pub enum PortStrategy {
Manual(Vec<u16>),
Serial(SerialRange),
Random(RandomRange),
}
impl PortStrategy {
pub fn pick(range: Option<PortRange>, ports: Option<Vec<u16>>, order: ScanOrder) -> Self {
match order {
ScanOrder::Serial if ports.is_none() => {
let range = range.as_ref().unwrap();
PortStrategy::Serial(SerialRange {
start: range.start,
end: range.end,
})
}
ScanOrder::Random if ports.is_none() => {
let range = range.as_ref().unwrap();
PortStrategy::Random(RandomRange {
start: range.start,
end: range.end,
})
}
ScanOrder::Serial => PortStrategy::Manual(ports.unwrap()),
ScanOrder::Random => {
let mut rng = thread_rng();
let mut ports = ports.unwrap();
ports.shuffle(&mut rng);
PortStrategy::Manual(ports)
}
}
}
pub fn order(&self) -> Vec<u16> {
match self {
PortStrategy::Manual(ports) => ports.to_vec(),
PortStrategy::Serial(range) => range.generate(),
PortStrategy::Random(range) => range.generate(),
}
}
}
/// Trait associated with a port strategy. Each PortStrategy must be able
/// to generate an order for future port scanning.
trait RangeOrder {
fn generate(&self) -> Vec<u16>;
}
/// As the name implies SerialRange will always generate a vector in
/// ascending order.
#[derive(Debug)]
pub struct SerialRange {
start: u16,
end: u16,
}
impl RangeOrder for SerialRange {
fn generate(&self) -> Vec<u16> {
(self.start..self.end).collect()
}
}
/// As the name implies RandomRange will always generate a vector with
/// a random order. This vector is built following the LCG algorithm.
#[derive(Debug)]
pub struct RandomRange {
start: u16,
end: u16,
}
impl RangeOrder for RandomRange {
// Right now using RangeIterator and generating a range + shuffling the
// vector is pretty much the same. The advantages of it will come once
// we have to generate different ranges for different IPs without storing
// actual vectors.
//
// Another benefit of RangeIterator is that it always generate a range with
// a certain distance between the items in the Array. The chances of having
// port numbers close to each other are pretty slim due to the way the
// algorithm works.
fn generate(&self) -> Vec<u16> {
RangeIterator::new(self.start.into(), self.end.into()).collect()
}
}
#[cfg(test)]
mod tests {
use super::PortStrategy;
use crate::{PortRange, ScanOrder};
#[test]
fn serial_strategy_with_range() {
let range = PortRange { start: 1, end: 100 };
let strategy = PortStrategy::pick(Some(range), None, ScanOrder::Serial);
let result = strategy.order();
let expected_range = (1..100).into_iter().collect::<Vec<u16>>();
assert_eq!(expected_range, result);
}
#[test]
fn random_strategy_with_range() {
let range = PortRange { start: 1, end: 100 };
let strategy = PortStrategy::pick(Some(range), None, ScanOrder::Random);
let mut result = strategy.order();
let expected_range = (1..100).into_iter().collect::<Vec<u16>>();
assert_ne!(expected_range, result);
result.sort();
assert_eq!(expected_range, result);
}
#[test]
fn serial_strategy_with_ports() {
let strategy = PortStrategy::pick(None, Some(vec![80, 443]), ScanOrder::Serial);
let result = strategy.order();
assert_eq!(vec![80, 443], result);
}
#[test]
fn random_strategy_with_ports() {
let strategy = PortStrategy::pick(None, Some((1..10).collect()), ScanOrder::Random);
let mut result = strategy.order();
let expected_range = (1..10).into_iter().collect::<Vec<u16>>();
assert_ne!(expected_range, result);
result.sort();
assert_eq!(expected_range, result);
}
}
+129
View File
@@ -0,0 +1,129 @@
use gcd::Gcd;
use rand::Rng;
pub struct RangeIterator {
active: bool,
normalized_end: u32,
normalized_first_pick: u32,
normalized_pick: u32,
actual_start: u32,
step: u32,
}
/// An iterator that follows the `Linear Congruential Generator` algorithm.
///
/// For more information: https://en.wikipedia.org/wiki/Linear_congruential_generator
impl RangeIterator {
/// Receives the the start and end of a range and normalize
/// these values before selecting a coprime for the end of the range
/// which will server as the step for the algorithm.
///
/// For example, the range `1000-2500` will be normalized to `0-1500`
/// before going through the algorithm.
pub fn new(start: u32, end: u32) -> Self {
let normalized_end = end - start;
let step = pick_random_coprime(normalized_end);
// Randomly choose a number within the range to be the first
// and assign it as a pick.
let mut rng = rand::thread_rng();
let normalized_first_pick = rng.gen_range(0, normalized_end);
Self {
active: true,
normalized_end,
step,
normalized_first_pick,
normalized_pick: normalized_first_pick,
actual_start: start,
}
}
}
impl Iterator for RangeIterator {
type Item = u16;
// The next step is always bound by the formula: N+1 = (N + STEP) % TOP_OF_THE_RANGE
// It will only stop once we generate a number equal to the first generated number.
fn next(&mut self) -> Option<Self::Item> {
if !self.active {
return None;
}
let current_pick = self.normalized_pick;
let next_pick = (current_pick + self.step) % self.normalized_end;
// If the next pick is equal to the first pick this means that
// we have iterated through the entire range.
if next_pick == self.normalized_first_pick {
self.active = false;
}
self.normalized_pick = next_pick;
Some((self.actual_start + current_pick) as u16)
}
}
/// The probability that two random integers are coprime to one another
/// works out to be around 61%, given that we can safely pick a random
/// number and test it. Just in case we are having a bad day and we cannot
/// pick a coprime number after 10 tries we just return "end - 1" which
/// is guaranteed to be a coprime, but won't provide ideal randomization.
///
/// We pick between "lower_range" and "upper_range" since values too close to
/// the boundaries, which in these case are the "start" and "end" arguments
/// would also provide non-ideal randomization as discussed on the paragraph
/// above.
fn pick_random_coprime(end: u32) -> u32 {
let range_boundary = end / 4;
let lower_range = range_boundary;
let upper_range = end - range_boundary;
let mut rng = rand::thread_rng();
let mut candidate = rng.gen_range(lower_range, upper_range);
for _ in 0..10 {
if end.gcd(candidate) == 1 {
return candidate;
} else {
candidate = rng.gen_range(lower_range, upper_range);
}
}
end - 1
}
#[cfg(test)]
mod tests {
use super::RangeIterator;
#[test]
fn range_iterator_iterates_through_the_entire_range() {
let result = generate_sorted_range(1, 10);
let expected_range = (1..10).into_iter().collect::<Vec<u16>>();
assert_eq!(expected_range, result);
let result = generate_sorted_range(1, 100);
let expected_range = (1..100).into_iter().collect::<Vec<u16>>();
assert_eq!(expected_range, result);
let result = generate_sorted_range(1, 1000);
let expected_range = (1..1000).into_iter().collect::<Vec<u16>>();
assert_eq!(expected_range, result);
let result = generate_sorted_range(1, 65_535);
let expected_range = (1..65_535).into_iter().collect::<Vec<u16>>();
assert_eq!(expected_range, result);
let result = generate_sorted_range(1000, 2000);
let expected_range = (1000..2000).into_iter().collect::<Vec<u16>>();
assert_eq!(expected_range, result);
}
fn generate_sorted_range(start: u32, end: u32) -> Vec<u16> {
let range = RangeIterator::new(start, end);
let mut result = range.into_iter().collect::<Vec<u16>>();
result.sort();
result
}
}
-98
View File
@@ -1,98 +0,0 @@
use async_std::io;
use async_std::net::TcpStream;
use colored::*;
use std::time::Duration;
use std::{
net::{SocketAddr, Shutdown},
io::ErrorKind,
};
use async_std::prelude::*;
use futures::stream::FuturesUnordered;
pub struct Scanner {
host: String,
start: u64,
end: u64,
batch_size: u64,
timeout: Duration,
quiet: bool,
}
impl Scanner {
pub fn new(host: &str, start: u64, end: u64, batch_size: u64, timeout: Duration, quiet: bool) -> Self {
Self {
host: host.to_owned(),
start,
end,
batch_size,
timeout,
quiet
}
}
pub async fn run(&self) -> Vec<u64> {
let ports: Vec<u64> = (self.start..self.end).collect();
let mut open_ports: std::vec::Vec<u64> = Vec::new();
for range in ports.chunks(self.batch_size as usize) {
let mut ports = self.scan_range(range).await;
open_ports.append(&mut ports);
}
open_ports
}
async fn scan_range(&self, range: &[u64]) -> Vec<u64> {
let mut ftrs = FuturesUnordered::new();
for port in range {
ftrs.push(self.scan_port(port));
}
let mut open_ports: Vec<u64> = Vec::new();
while let Some(result) = ftrs.next().await {
match result {
Ok(port) => open_ports.push(port),
_ => {}
}
}
open_ports
}
async fn scan_port(&self, port: &u64) -> io::Result<u64> {
let addr = format!("{}:{}", self.host , port);
match addr.parse() {
Ok(sock_addr) => match self.connect(sock_addr).await {
Ok(stream_result) => {
match stream_result.shutdown(Shutdown::Both) {
_ => {}
}
if !self.quiet {
println!("Open {}", port.to_string().purple());
}
Ok(*port)
}
Err(e) => match e.kind() {
ErrorKind::Other => {
eprintln!("{:?}", e); // in case we get too many open files
panic!("Too many open files. Please reduce batch size. The default is 5000. Try -b 2500.");
}
_ => Err(io::Error::new(io::ErrorKind::Other, e.to_string())),
},
},
Err(e) => {
eprintln!("Unable to convert to socket address {:?}", e);
panic!("Unable to convert to socket address");
}
}
}
async fn connect(&self, addr: SocketAddr) -> io::Result<TcpStream> {
let stream = io::timeout(self.timeout, async move { TcpStream::connect(addr).await }).await?;
Ok(stream)
}
}
+235
View File
@@ -0,0 +1,235 @@
use super::PortStrategy;
mod socket_iterator;
use socket_iterator::SocketIterator;
use async_std::io;
use async_std::net::TcpStream;
use async_std::prelude::*;
use colored::*;
use futures::stream::FuturesUnordered;
use std::{
io::ErrorKind,
net::{IpAddr, Shutdown, SocketAddr},
time::Duration,
};
/// The class for the scanner
/// IP is data type IpAddr and is the IP address
/// start & end is where the port scan starts and ends
/// batch_size is how many ports at a time should be scanned
/// Timeout is the time RustScan should wait before declaring a port closed. As datatype Duration.
/// Quiet is whether or not RustScan should print things, or wait until the end to print only open ports.
#[cfg(not(tarpaulin_include))]
#[derive(Debug)]
pub struct Scanner {
ips: Vec<IpAddr>,
batch_size: u16,
timeout: Duration,
quiet: bool,
port_strategy: PortStrategy,
accessible: bool,
}
impl Scanner {
pub fn new(
ips: &[IpAddr],
batch_size: u16,
timeout: Duration,
quiet: bool,
port_strategy: PortStrategy,
accessible: bool,
) -> Self {
Self {
batch_size,
timeout,
quiet,
port_strategy,
ips: ips.iter().map(|ip| ip.to_owned()).collect(),
accessible,
}
}
/// Runs scan_range with chunk sizes
/// If you want to run RustScan normally, this is the entry point used
/// Returns all open ports as Vec<u16>
pub async fn run(&self) -> Vec<SocketAddr> {
let ports: Vec<u16> = self.port_strategy.order();
let mut socket_iterator: SocketIterator = SocketIterator::new(&self.ips, &ports);
let mut open_sockets: Vec<SocketAddr> = Vec::new();
let mut ftrs = FuturesUnordered::new();
for _ in 0..self.batch_size {
if let Some(socket) = socket_iterator.next() {
ftrs.push(self.scan_socket(socket));
} else {
break;
}
}
debug!("Start scanning sockets. \nBatch size {}\nNumber of ip-s {}\nNumber of ports {}\nTargets all together {} ",
self.batch_size,
self.ips.len(),
&ports.len(),
(self.ips.len() * &ports.len()));
while let Some(result) = ftrs.next().await {
if let Some(socket) = socket_iterator.next() {
ftrs.push(self.scan_socket(socket));
}
match result {
Ok(socket) => open_sockets.push(socket),
_ => {}
}
}
debug!("Open Sockets found: {:?}", &open_sockets);
open_sockets
}
/// Given a port, scan it.
/// Turns the address into a SocketAddr
/// Deals with the <result> type
/// If it experiences error ErrorKind::Other then too many files are open and it Panics!
/// ese any other error, it returns the error in Result as a string
/// If no errors occur, it returns the port number in Result to signify the port is open.
/// This function mainly deals with the logic of Results handling.
/// # Example
///
/// self.scan_port(10:u16)
///
/// Note: `self` must contain `self.ip`.
async fn scan_socket(&self, socket: SocketAddr) -> io::Result<SocketAddr> {
match self.connect(socket).await {
Ok(x) => {
debug!(
"Connection was successful, shutting down stream {}",
&socket
);
match x.shutdown(Shutdown::Both) {
Err(e) => debug!("Shutdown stream error {}", &e),
_ => {}
}
if !self.quiet {
if self.accessible {
println!("Open {}", socket.to_string());
} else {
println!("Open {}", socket.to_string().purple());
}
}
Ok(socket)
}
Err(e) => match e.kind() {
ErrorKind::Other => {
if e.to_string().contains("No route to host")
|| e.to_string().contains("Network is unreachable")
{
debug!("Socket connect error: {} {}", &e.to_string(), &socket);
Err(io::Error::new(io::ErrorKind::Other, e.to_string()))
} else {
debug!("Socket connect error: {} {}", &e.to_string(), &socket);
panic!("Too many open files. Please reduce batch size. The default is 5000. Try -b 2500.");
}
}
_ => Err(io::Error::new(io::ErrorKind::Other, e.to_string())),
},
}
}
/// Performs the connection to the socket with timeout
/// # Example
///
/// let port: u16 = 80
/// // ip is an IpAddr type
/// let ip = IpAddr::V6(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1));
/// let socket = SocketAddr::new(ip, port);
/// self.connect(socket)
/// // returns Result which is either Ok(stream) for port is open, or Er for port is closed.
/// // Timeout occurs after self.timeout seconds
///
async fn connect(&self, socket: SocketAddr) -> io::Result<TcpStream> {
let stream = io::timeout(
self.timeout,
async move { TcpStream::connect(socket).await },
)
.await?;
Ok(stream)
}
}
#[cfg(test)]
mod tests {
use super::*;
use crate::{PortRange, ScanOrder};
use async_std::task::block_on;
use std::{net::IpAddr, time::Duration};
#[test]
fn scanner_runs() {
// Makes sure the program still runs and doesn't panic
let addrs = vec!["127.0.0.1".parse::<IpAddr>().unwrap()];
let range = PortRange {
start: 1,
end: 1_000,
};
let strategy = PortStrategy::pick(Some(range), None, ScanOrder::Random);
let scanner = Scanner::new(&addrs, 10, Duration::from_millis(100), true, strategy, true);
block_on(scanner.run());
// if the scan fails, it wouldn't be able to assert_eq! as it panicked!
assert_eq!(1, 1);
}
#[test]
fn ipv6_scanner_runs() {
// Makes sure the program still runs and doesn't panic
let addrs = vec!["::1".parse::<IpAddr>().unwrap()];
let range = PortRange {
start: 1,
end: 1_000,
};
let strategy = PortStrategy::pick(Some(range), None, ScanOrder::Random);
let scanner = Scanner::new(&addrs, 10, Duration::from_millis(100), true, strategy, true);
block_on(scanner.run());
// if the scan fails, it wouldn't be able to assert_eq! as it panicked!
assert_eq!(1, 1);
}
#[test]
fn quad_zero_scanner_runs() {
let addrs = vec!["0.0.0.0".parse::<IpAddr>().unwrap()];
let range = PortRange {
start: 1,
end: 1_000,
};
let strategy = PortStrategy::pick(Some(range), None, ScanOrder::Random);
let scanner = Scanner::new(&addrs, 10, Duration::from_millis(100), true, strategy, true);
block_on(scanner.run());
assert_eq!(1, 1);
}
#[test]
fn google_dns_runs() {
let addrs = vec!["8.8.8.8".parse::<IpAddr>().unwrap()];
let range = PortRange {
start: 400,
end: 445,
};
let strategy = PortStrategy::pick(Some(range), None, ScanOrder::Random);
let scanner = Scanner::new(&addrs, 10, Duration::from_millis(100), true, strategy, true);
block_on(scanner.run());
assert_eq!(1, 1);
}
#[test]
fn infer_ulimit_lowering_no_panic() {
// Test behaviour on MacOS where ulimit is not automatically lowered
let addrs = vec!["8.8.8.8".parse::<IpAddr>().unwrap()];
// mac should have this automatically scaled down
let range = PortRange {
start: 400,
end: 600,
};
let strategy = PortStrategy::pick(Some(range), None, ScanOrder::Random);
let scanner = Scanner::new(&addrs, 10, Duration::from_millis(100), true, strategy, true);
block_on(scanner.run());
assert_eq!(1, 1);
}
}
+75
View File
@@ -0,0 +1,75 @@
use itertools::{iproduct, Product};
use std::net::{IpAddr, SocketAddr};
pub struct SocketIterator<'s> {
// product_it is a cartesian product iterator over
// the slices of ports and IP addresses.
//
// The IP/port order is intentionally reversed here since we want
// the itertools::iproduct! macro below to generate the pairs with
// all the IPs for one port before moving on to the next one
// ("hold the port, go through all the IPs, then advance the port...").
// See also the comments in the iterator implementation for an example.
product_it:
Product<Box<std::slice::Iter<'s, u16>>, Box<std::slice::Iter<'s, std::net::IpAddr>>>,
}
/// An iterator that receives a slice of IPs and ports and returns a Socket
/// for each IP and port pair until all of these combinations are exhausted.
/// The goal of this iterator is to go over every IP and port combination
/// wihout generating a big memory footprint. The alternative would be
/// generating a vector containing all these combinations.
impl<'s> SocketIterator<'s> {
pub fn new(ips: &'s [IpAddr], ports: &'s [u16]) -> Self {
let ports_it = Box::new(ports.into_iter());
let ips_it = Box::new(ips.into_iter());
Self {
product_it: iproduct!(ports_it, ips_it),
}
}
}
impl<'s> Iterator for SocketIterator<'s> {
type Item = SocketAddr;
/// Returns a socket based on the combination of one of the provided
/// IPs and ports or None when these combinations are exhausted. Every
/// IP will have the same port until a port is incremented.
///
/// let it = SocketIterator::new(&["127.0.0.1", "192.168.0.1"], &[80, 443]);
/// it.next(); // 127.0.0.1:80
/// it.next(); // 192.168.0.1:80
/// it.next(); // 127.0.0.1:443
/// it.next(); // 192.168.0.1:443
/// it.next(); // None
fn next(&mut self) -> Option<Self::Item> {
match self.product_it.next() {
None => None,
Some((port, ip)) => Some(SocketAddr::new(*ip, *port)),
}
}
}
#[cfg(test)]
mod tests {
use super::SocketIterator;
use std::net::{IpAddr, SocketAddr};
#[test]
fn goes_through_every_ip_port_combination() {
let addrs = vec![
"127.0.0.1".parse::<IpAddr>().unwrap(),
"192.168.0.1".parse::<IpAddr>().unwrap(),
];
let ports: Vec<u16> = vec![22, 80, 443];
let mut it = SocketIterator::new(&addrs, &ports);
assert_eq!(Some(SocketAddr::new(addrs[0], ports[0])), it.next());
assert_eq!(Some(SocketAddr::new(addrs[1], ports[0])), it.next());
assert_eq!(Some(SocketAddr::new(addrs[0], ports[1])), it.next());
assert_eq!(Some(SocketAddr::new(addrs[1], ports[1])), it.next());
assert_eq!(Some(SocketAddr::new(addrs[0], ports[2])), it.next());
assert_eq!(Some(SocketAddr::new(addrs[1], ports[2])), it.next());
assert_eq!(None, it.next());
}
}
+81
View File
@@ -0,0 +1,81 @@
/// Terminal User Interface Module for RustScan
/// Defines macros to use
#[macro_export]
macro_rules! warning {
($name:expr) => {
use ansi_term::Colour::Red;
println!("{} {}", Red.bold().paint("[!]"), $name);
};
($name:expr, $greppable:expr, $accessible:expr) => {
use ansi_term::Colour::Red;
// if not greppable then print, otherwise no else statement so do not print.
if !$greppable {
if $accessible {
// Don't print the ascii art
println!("{}", $name);
} else {
println!("{} {}", Red.bold().paint("[!]"), $name);
}
}
};
}
#[macro_export]
macro_rules! detail {
($name:expr) => {
use ansi_term::Colour::Blue;
println!("{} {}", Blue.bold().paint("[~]"), $name);
};
($name:expr, $greppable:expr, $accessible:expr) => {
use ansi_term::Colour::Blue;
// if not greppable then print, otherwise no else statement so do not print.
if !$greppable {
if $accessible {
// Don't print the ascii art
println!("{}", $name);
} else {
println!("{} {}", Blue.bold().paint("[~]"), $name);
}
}
};
}
#[macro_export]
macro_rules! output {
($name:expr) => {
use ansi_term::Colour::RGB;
println!("{} {}", RGB(0, 255, 9).bold().paint("[>]"), $name);
};
($name:expr, $greppable:expr, $accessible:expr) => {
use ansi_term::Colour::RGB;
// if not greppable then print, otherwise no else statement so do not print.
if !$greppable {
if $accessible {
// Don't print the ascii art
println!("{}", $name);
} else {
println!("{} {}", RGB(0, 255, 9).bold().paint("[>]"), $name);
}
}
};
}
#[macro_export]
macro_rules! funny_opening {
// prints a funny quote / opening
() => {
use rand::seq::SliceRandom;
let quotes = vec![
"Nmap? More like slowmap.🐢",
"🌍HACK THE PLANET🌍",
"Real hackers hack time ⌛",
"Please contribute more quotes to our GitHub https://github.com/rustscan/rustscan",
"😵 https://admin.tryhackme.com",
];
let random_quote = quotes.choose(&mut rand::thread_rng()).unwrap();
println!("{}\n", random_quote);
// println!("{} {}", RGB(0, 255, 9).bold().paint("[>]"), $name);
};
}