Compare commits

..
107 Commits
Author SHA1 Message Date
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 c8404781dc Merge branch 'master' into bee-scheduled-markdown-action 2020-08-01 22:45:29 +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 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
Brandon 542fa36650 Removed cargo.lock from .gitignore 2020-07-25 15:28:03 +01:00
Brandon cf56da5aaf Delete RustScan 2020-07-25 15:11:40 +01:00
Brandon 4f36218ffe Delete rustscan 2020-07-25 15:11:37 +01:00
Brandon 65f7db7a07 fixing issue 67 2020-07-25 15:03:28 +01:00
Brandon 9645c58760 Merge pull request #64 from brandonskerritt/add-code-of-conduct-1
Create CODE_OF_CONDUCT.md
2020-07-25 11:45:14 +01:00
Brandon 7e8771fc3b Create CODE_OF_CONDUCT.md 2020-07-25 11:45:05 +01:00
Brandon 37ef19f798 Update issue templates 2020-07-25 11:44:32 +01:00
Brandon f57bd6f395 Merge pull request #61 from bernardoamc/ba-extract-scan-to-mod
Refactor scanning code into its own module
2020-07-25 10:10:37 +01:00
Bernardo de Araujo 661f9f4774 Refactor scanning code into its own module
This will give us flexibility to extend this code into multiple scanners
in the future and also decouple it from argument parsing and reporting.
2020-07-24 21:25:00 -04:00
Brandon 8d1075127f Update README.md 2020-07-25 02:05:14 +01:00
Brandon 5e382948b6 Merge pull request #60 from brandonskerritt/all-contributors/add-bernardoamc
docs: add bernardoamc as a contributor
2020-07-25 01:18:40 +01:00
allcontributors[bot] da325a94ac docs: update .all-contributorsrc [skip ci] 2020-07-25 00:18:04 +00:00
allcontributors[bot] f1741f376c docs: update README.md [skip ci] 2020-07-25 00:18:03 +00:00
Brandon 756ec0a8a5 Added help wanted tag to contributing.md 2020-07-25 00:50:12 +01:00
Brandon bfe8e775cf Merge pull request #57 from brandonskerritt/remove-rayon
Remove rayon
2020-07-24 23:46:32 +01:00
Brandon 9e4f5855aa fixed formatter error 2020-07-24 23:23:36 +01:00
Brandon 8c9e5b57a3 Merge branch 'master' into remove-rayon 2020-07-24 23:09:45 +01:00
Brandon d2ad8ab756 added nmap scan print 2020-07-24 23:06:18 +01:00
Brandon 6ac61a40ae removing rayon from cargo.toml 2020-07-24 22:55:01 +01:00
Brandon ea2a13b021 Merge pull request #23 from justanotheranonymoususer/patch-1
Collect underpants
2020-07-24 22:52:50 +01:00
Brandon b8fc25c76b Merge pull request #52 from bernardoamc/ba-reduce-string-alloc
Reduce string allocation
2020-07-24 22:50:36 +01:00
Brandon 9894942b24 Merge pull request #54 from brandonskerritt/all-contributors/add-Isona
docs: add Isona as a contributor
2020-07-24 22:50:12 +01:00
Brandon 83d544ca9f Merge pull request #53 from Isona/master
Add -Pn to the Nmap arguments
2020-07-24 22:45:44 +01:00
allcontributors[bot] fd0ea4ddce docs: update .all-contributorsrc [skip ci] 2020-07-24 21:45:36 +00:00
allcontributors[bot] 8ce275e240 docs: update README.md [skip ci] 2020-07-24 21:45:35 +00:00
Izzy Whistlecroft 0affe5ec0f Add -Pn to the Nmap arguments 2020-07-24 19:25:04 +01:00
Brandon 4d67440865 Update README.md 2020-07-24 19:22:25 +01:00
Brandon ed3276c3a8 Merge pull request #50 from brandonskerritt/making-ci
added basic CI
2020-07-24 19:18:01 +01:00
Brandon 2218e00783 fixing CI 2020-07-24 19:14:03 +01:00
Bernardo de Araujo 0b2972460b Reduce string allocation
Most of the time we can just reference the memory location of the string
instead of cloning it.
2020-07-24 14:13:07 -04:00
Brandon 9cc9d02eb7 fixing CI 2020-07-24 19:07:15 +01:00
Brandon 803d9c4508 added basic CI 2020-07-24 18:20:10 +01:00
Brandon 41b3f31cfd added basic CI 2020-07-24 18:16:01 +01:00
Brandon 12d4954815 Merge pull request #48 from brandonskerritt/all-contributors/add-bernardoamc
docs: add bernardoamc as a contributor
2020-07-24 18:08:08 +01:00
Brandon 26df0b9877 Merge pull request #47 from bernardoamc/wait-for-resource-release
Wait for child nmap process to exit completely
2020-07-24 18:07:54 +01:00
Brandon 26be07b7cd Create config.yml 2020-07-24 16:05:48 +01:00
allcontributors[bot] 4ec0b73b5c docs: update .all-contributorsrc [skip ci] 2020-07-24 14:35:58 +00:00
allcontributors[bot] 15786dea5c docs: update README.md [skip ci] 2020-07-24 14:35:57 +00:00
Brandon d9c4134657 Update README.md 2020-07-24 15:30:38 +01:00
Bernardo de Araujo b633df020f Wait for child nmap process to exit completely
In certain OSs a process might become a zombie if we do not explicitly
wait for it to finish. This addresses the child not being killed when a
parent receives a CTRL+C.
2020-07-24 10:23:42 -04:00
justanotheranonymoususer c2bb178d6a Collect underpants 2020-07-23 12:41:52 +03:00
17 changed files with 1538 additions and 304 deletions

No files matched your search

+30
View File
@@ -36,6 +36,36 @@
"ideas",
"example"
]
},
{
"login": "bernardoamc",
"name": "Bernardo Araujo",
"avatar_url": "https://avatars0.githubusercontent.com/u/428984?v=4",
"profile": "http://bernardoamc.github.io/",
"contributions": [
"code",
"bug",
"design"
]
},
{
"login": "Isona",
"name": "Izzy Whistlecroft",
"avatar_url": "https://avatars2.githubusercontent.com/u/11759523?v=4",
"profile": "https://github.com/Isona",
"contributions": [
"bug"
]
},
{
"login": "imlonghao",
"name": "imlonghao",
"avatar_url": "https://avatars1.githubusercontent.com/u/4951333?v=4",
"profile": "https://imlonghao.com",
"contributions": [
"bug",
"maintenance"
]
}
],
"contributorsPerLine": 7,
+38
View File
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.
+20
View File
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
+2
View File
@@ -0,0 +1,2 @@
todo:
keyword: "// TODO"
+55
View File
@@ -0,0 +1,55 @@
on: [push, pull_request]
name: Continuous integration
jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: check
test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- 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'
+1 -3
View File
@@ -4,7 +4,6 @@
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock
# These are backup files generated by rustfmt
**/*.rs.bk
@@ -30,7 +29,6 @@ Cargo.lock
*.sig
pkg/
src/
### Rust ###
# Generated by Cargo
@@ -39,9 +37,9 @@ src/
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock
# These are backup files generated by rustfmt
**/*.rs.bk
# End of https://www.toptal.com/developers/gitignore/api/rust,archlinuxpackages
*.deb
+76
View File
@@ -0,0 +1,76 @@
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at brandon@skerritt.blog. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
Generated
+825
View File
@@ -0,0 +1,825 @@
# 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"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"
dependencies = [
"winapi",
]
[[package]]
name = "async-channel"
version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ee81ba99bee79f3c8ae114ae4baa7eaa326f63447cf2ec65e4393618b63f8770"
dependencies = [
"concurrent-queue",
"event-listener",
"futures-core",
]
[[package]]
name = "async-std"
version = "1.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "00d68a33ebc8b57800847d00787307f84a562224a14db069b0acefe4c2abbf5d"
dependencies = [
"async-task",
"crossbeam-utils",
"futures-channel",
"futures-core",
"futures-io",
"kv-log-macro",
"log",
"memchr",
"num_cpus",
"once_cell",
"pin-project-lite",
"pin-utils",
"slab",
"smol",
"wasm-bindgen-futures",
]
[[package]]
name = "async-task"
version = "3.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c17772156ef2829aadc587461c7753af20b7e8db1529bc66855add962a3b35d3"
[[package]]
name = "atomic-waker"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "065374052e7df7ee4047b1160cca5e1467a12351a40b3da123c870ba0b8eda2a"
[[package]]
name = "atty"
version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
dependencies = [
"hermit-abi",
"libc",
"winapi",
]
[[package]]
name = "autocfg"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d"
[[package]]
name = "bitflags"
version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
[[package]]
name = "blocking"
version = "0.4.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d2468ff7bf85066b4a3678fede6fe66db31846d753ff0adfbfab2c6a6e81612b"
dependencies = [
"async-channel",
"atomic-waker",
"futures-lite",
"once_cell",
"parking",
"waker-fn",
]
[[package]]
name = "bumpalo"
version = "3.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b5820"
[[package]]
name = "cache-padded"
version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "631ae5198c9be5e753e5cc215e1bd73c2b466a3565173db433f52bb9d3e66dba"
[[package]]
name = "cc"
version = "1.0.58"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f9a06fb2e53271d7c279ec1efea6ab691c35a2ae67ec0d91d7acec0caf13b518"
[[package]]
name = "cfg-if"
version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
[[package]]
name = "clap"
version = "2.33.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bdfa80d47f954d53a35a64987ca1422f495b8d6483c0fe9f7117b36c2a792129"
dependencies = [
"ansi_term",
"atty",
"bitflags",
"strsim",
"textwrap",
"unicode-width",
"vec_map",
]
[[package]]
name = "colored"
version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b3616f750b84d8f0de8a58bda93e08e2a81ad3f523089b05f1dffecab48c6cbd"
dependencies = [
"atty",
"lazy_static",
"winapi",
]
[[package]]
name = "concurrent-queue"
version = "1.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1582139bb74d97ef232c30bc236646017db06f13ee7cc01fa24c9e55640f86d4"
dependencies = [
"cache-padded",
]
[[package]]
name = "crossbeam-utils"
version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8"
dependencies = [
"autocfg",
"cfg-if",
"lazy_static",
]
[[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.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "829694371bd7bbc6aee17c4ff624aad8bf9f4dc06c6f9f6071eaa08c89530d10"
[[package]]
name = "fastrand"
version = "1.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "36a9cb09840f81cd211e435d00a4e487edd263dc3c8ff815c32dd76ad668ebed"
[[package]]
name = "futures"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e05b85ec287aac0dc34db7d4a569323df697f9c55b99b15d6b4ef8cde49f613"
dependencies = [
"futures-channel",
"futures-core",
"futures-executor",
"futures-io",
"futures-sink",
"futures-task",
"futures-util",
]
[[package]]
name = "futures-channel"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f366ad74c28cca6ba456d95e6422883cfb4b252a83bed929c83abfdbbf2967d5"
dependencies = [
"futures-core",
"futures-sink",
]
[[package]]
name = "futures-core"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "59f5fff90fd5d971f936ad674802482ba441b6f09ba5e15fd8b39145582ca399"
[[package]]
name = "futures-executor"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "10d6bb888be1153d3abeb9006b11b02cf5e9b209fda28693c31ae1e4e012e314"
dependencies = [
"futures-core",
"futures-task",
"futures-util",
]
[[package]]
name = "futures-io"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "de27142b013a8e869c14957e6d2edeef89e97c289e69d042ee3a49acd8b51789"
[[package]]
name = "futures-lite"
version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8cc8771bd1bb4c7be3c5f072a1d5e18086ef220f100a0a4efece41076e87b9f2"
dependencies = [
"fastrand",
"futures-core",
"futures-io",
"memchr",
"parking",
"pin-project-lite",
"waker-fn",
]
[[package]]
name = "futures-macro"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d0b5a30a4328ab5473878237c447333c093297bded83a4983d10f4deea240d39"
dependencies = [
"proc-macro-hack",
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "futures-sink"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f2032893cb734c7a05d85ce0cc8b8c4075278e93b24b66f9de99d6eb0fa8acc"
[[package]]
name = "futures-task"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bdb66b5f09e22019b1ab0830f7785bcea8e7a42148683f99214f73f8ec21a626"
dependencies = [
"once_cell",
]
[[package]]
name = "futures-util"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8764574ff08b701a084482c3c7031349104b07ac897393010494beaa18ce32c6"
dependencies = [
"futures-channel",
"futures-core",
"futures-io",
"futures-macro",
"futures-sink",
"futures-task",
"memchr",
"pin-project",
"pin-utils",
"proc-macro-hack",
"proc-macro-nested",
"slab",
]
[[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"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3deed196b6e7f9e44a2ae8d94225d80302d81208b1bb673fd21fe634645c85a9"
dependencies = [
"libc",
]
[[package]]
name = "humantime"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f"
dependencies = [
"quick-error",
]
[[package]]
name = "js-sys"
version = "0.3.42"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "52732a3d3ad72c58ad2dc70624f9c17b46ecd0943b9a4f1ee37c4c18c5d983e2"
dependencies = [
"wasm-bindgen",
]
[[package]]
name = "kv-log-macro"
version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f"
dependencies = [
"log",
]
[[package]]
name = "lazy_static"
version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
[[package]]
name = "libc"
version = "0.2.73"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bd7d4bd64732af4bf3a67f367c27df8520ad7e230c5817b8ff485864d80242b9"
[[package]]
name = "log"
version = "0.4.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b"
dependencies = [
"cfg-if",
]
[[package]]
name = "memchr"
version = "2.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400"
[[package]]
name = "num_cpus"
version = "1.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3"
dependencies = [
"hermit-abi",
"libc",
]
[[package]]
name = "once_cell"
version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b631f7e854af39a1739f401cf34a8a013dfe09eac4fa4dba91e9768bd28168d"
[[package]]
name = "parking"
version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6cb300f271742d4a2a66c01b6b2fa0c83dfebd2e0bf11addb879a3547b4ed87c"
[[package]]
name = "pin-project"
version = "0.4.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "12e3a6cdbfe94a5e4572812a0201f8c0ed98c1c452c7b8563ce2276988ef9c17"
dependencies = [
"pin-project-internal",
]
[[package]]
name = "pin-project-internal"
version = "0.4.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a0ffd45cf79d88737d7cc85bfd5d2894bee1139b356e616fe85dc389c61aaf7"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "pin-project-lite"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "282adbf10f2698a7a77f8e983a74b2d18176c19a7fd32a45446139ae7b02b715"
[[package]]
name = "pin-utils"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
[[package]]
name = "proc-macro-error"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc175e9777c3116627248584e8f8b3e2987405cabe1c0adf7d1dd28f09dc7880"
dependencies = [
"proc-macro-error-attr",
"proc-macro2",
"quote",
"syn",
"version_check",
]
[[package]]
name = "proc-macro-error-attr"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3cc9795ca17eb581285ec44936da7fc2335a3f34f2ddd13118b6f4d515435c50"
dependencies = [
"proc-macro2",
"quote",
"syn",
"syn-mid",
"version_check",
]
[[package]]
name = "proc-macro-hack"
version = "0.5.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e0456befd48169b9f13ef0f0ad46d492cf9d2dbb918bcf38e01eed4ce3ec5e4"
[[package]]
name = "proc-macro-nested"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eba180dafb9038b050a4c280019bbedf9f2467b61e5d892dcad585bb57aadc5a"
[[package]]
name = "proc-macro2"
version = "1.0.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "04f5f085b5d71e2188cb8271e5da0161ad52c3f227a661a3c135fdf28e258b12"
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"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37"
dependencies = [
"proc-macro2",
]
[[package]]
name = "redox_syscall"
version = "0.1.57"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce"
[[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.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e6d26e65e82a1e2628c5f209ec12f4508fa50e644bd2f264138e60129d61eae8"
dependencies = [
"cfg-if",
"libc",
]
[[package]]
name = "rustscan"
version = "1.4.1"
dependencies = [
"async-std",
"colored",
"env_logger",
"futures",
"log",
"rlimit",
"shell-words",
"structopt",
]
[[package]]
name = "scoped-tls"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2"
[[package]]
name = "shell-words"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6fa3938c99da4914afedd13bf3d79bcb6c277d1b2c398d23257a304d9e1b074"
[[package]]
name = "slab"
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"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "03088793f677dce356f3ccc2edb1b314ad191ab702a5de3faf49304f7e104918"
dependencies = [
"cfg-if",
"libc",
"redox_syscall",
"winapi",
]
[[package]]
name = "strsim"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a"
[[package]]
name = "structopt"
version = "0.3.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "de2f5e239ee807089b62adce73e48c625e0ed80df02c7ab3f068f5db5281065c"
dependencies = [
"clap",
"lazy_static",
"structopt-derive",
]
[[package]]
name = "structopt-derive"
version = "0.4.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "510413f9de616762a4fbeab62509bf15c729603b72d7cd71280fbca431b1c118"
dependencies = [
"heck",
"proc-macro-error",
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "syn"
version = "1.0.35"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fb7f4c519df8c117855e19dd8cc851e89eb746fe7a73f0157e0d95fdec5369b0"
dependencies = [
"proc-macro2",
"quote",
"unicode-xid",
]
[[package]]
name = "syn-mid"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7be3539f6c128a931cf19dcee741c1af532c7fd387baa739c03dd2e96479338a"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[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"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060"
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 = "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"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3"
[[package]]
name = "unicode-xid"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564"
[[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"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9571542c2ce85ce642e6b58b3364da2fb53526360dfb7c211add4f5c23105ff7"
[[package]]
name = "wasm-bindgen"
version = "0.2.65"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f3edbcc9536ab7eababcc6d2374a0b7bfe13a2b6d562c5e07f370456b1a8f33d"
dependencies = [
"cfg-if",
"wasm-bindgen-macro",
]
[[package]]
name = "wasm-bindgen-backend"
version = "0.2.65"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "89ed2fb8c84bfad20ea66b26a3743f3e7ba8735a69fe7d95118c33ec8fc1244d"
dependencies = [
"bumpalo",
"lazy_static",
"log",
"proc-macro2",
"quote",
"syn",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-futures"
version = "0.4.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41ad6e4e8b2b7f8c90b6e09a9b590ea15cb0d1dbe28502b5a405cd95d1981671"
dependencies = [
"cfg-if",
"js-sys",
"wasm-bindgen",
"web-sys",
]
[[package]]
name = "wasm-bindgen-macro"
version = "0.2.65"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eb071268b031a64d92fc6cf691715ca5a40950694d8f683c5bb43db7c730929e"
dependencies = [
"quote",
"wasm-bindgen-macro-support",
]
[[package]]
name = "wasm-bindgen-macro-support"
version = "0.2.65"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf592c807080719d1ff2f245a687cbadb3ed28b2077ed7084b47aba8b691f2c6"
dependencies = [
"proc-macro2",
"quote",
"syn",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-shared"
version = "0.2.65"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72b6c0220ded549d63860c78c38f3bcc558d1ca3f4efa74942c536ddbbb55e87"
[[package]]
name = "web-sys"
version = "0.3.42"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8be2398f326b7ba09815d0b403095f34dd708579220d099caae89be0b32137b2"
dependencies = [
"js-sys",
"wasm-bindgen",
]
[[package]]
name = "wepoll-sys-stjepang"
version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6fd319e971980166b53e17b1026812ad66c6b54063be879eb182342b55284694"
dependencies = [
"cc",
]
[[package]]
name = "winapi"
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
dependencies = [
"winapi-i686-pc-windows-gnu",
"winapi-x86_64-pc-windows-gnu",
]
[[package]]
name = "winapi-i686-pc-windows-gnu"
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"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
+7 -4
View File
@@ -1,6 +1,6 @@
[package]
name = "rustscan"
version = "1.2.0"
version = "1.4.1"
authors = ["Bee <[email protected]>"]
edition = "2018"
description = "Faster Nmap Scanning with Rust"
@@ -14,12 +14,15 @@ readme="README.md"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
colored = "1.9.3"
clap = "2.33.0"
rayon = "1.3.1"
colored = "2.0.0"
structopt = "0.3.15"
async-std = "1.6.2"
futures = "0.3"
rlimit = "0.3.0"
shell-words = "1.0.0"
log = "0.4.0"
env_logger = "0.7.1"
[package.metadata.deb]
depends = "$auto, nmap"
-14
View File
@@ -1,14 +0,0 @@
# Maintainer: Bee <[email protected]>
pkgname=rustscan-bin
pkgver=1.1.0
pkgrel=1
pkgdesc="Faster Nmap Scanning with Rust"
url="https://github.com/brandonskerritt/rustscan"
license=("MIT")
arch=("x86_64")
provides=("rustscan")
depends=('rustup')
package() {
rustup toolchain install stable && cargo install rustscan
}
+81 -26
View File
@@ -1,11 +1,23 @@
<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">
</p>
<p align="center">
<u><b> Turns a 17 minutes Nmap scan into 19 seconds. </b></u><br> Find all open ports <b>fast</b> with RustScan, automatically pipe them into Nmap.
</p>
<p align="center">
<img alt="AUR version" src="https://img.shields.io/aur/version/rustscan-bin">
<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 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>
@@ -13,15 +25,15 @@
| <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> |
| Version 1.1.0 | Version 1.1.0 | Version 1.1.0 | Version 1.1.0 |
| `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) |
| `cargo install rustscan` | `yay -S rustscan` | `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) |
<hr>
# 🤔 What is this?
1. Find ports quickly using Rustscan (**8 seconds at its fastest**).
2. Automatically runs `nmap` on those ports.
3. Profit???
3. ???
4. Profit!
<table>
<tr>
@@ -50,6 +62,7 @@ RustScans **only** job is to reduce the friction between finding open ports and
* 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
# 🔭 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?
@@ -66,21 +79,18 @@ Why spend time running fast scans and manually copying the ports, or waiting for
| Actually useful | ❌ | ✅ | ❌ |
| Realises it's not useful, and pipes the only useful data into the only useful port scanner | ✅ | ❌ | ❌ |
## ‼️ Important Links
## 🙋 FAQ
> I think this would be a great port scanner on its own without Nmap!
| Installation Guide | Documentation | Discord |
| ------------------ | ------------- | ------- |
| 📖 [Installation Guide](https://github.com/RustScan/RustScan#-full-installation-guide) | 📚 [Documentation](https://github.com/RustScan/RustScan/issues/89) | 🦜 [Discord](https://discord.gg/GFrQsGy)
No. If you want a fast port scanner, use Masscan.
> I have this great idea for a script to get information on ports / hosts
## 🙋 Table of Contents
* 📖 [Installation Guide](https://github.com/RustScan/RustScan#-full-installation-guide)
* 🦜 [Discord](https://discord.gg/GFrQsGy)
* 🤸 [Usage](https://github.com/RustScan/RustScan#-usage)
* 🎪 [Contributing](https://github.com/RustScan/RustScan#-contributing)
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!
# 📖 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).
@@ -91,11 +101,17 @@ The most universal way is to use `cargo`, Rust's built in package manager (think
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.
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.
@@ -140,12 +156,15 @@ 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.
USAGE:
rustscan [OPTIONS] <ip> [command]...
rustscan [FLAGS] [OPTIONS] <ip> [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
OPTIONS:
@@ -153,6 +172,7 @@ OPTIONS:
-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.
ARGS:
<ip> The IP address to scan
@@ -240,7 +260,7 @@ To run your own nmap commands, end the RustScan command with `-- -A` where `--`
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
@@ -255,16 +275,48 @@ To increase accuracy, the easiest way is to increase the timeout. The default is
Decreasing accuracy gives some speed bonus, but my testing found that batch size dramatically changed the speed whereas timeout did, but not so much.
# 🎪 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-3-orange.svg?style=flat-square)](#contributors-)
[![All Contributors](https://img.shields.io/badge/all_contributors-6-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)):
@@ -277,6 +329,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<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://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="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/brandonskerritt/RustScan/issues?q=author%3Aimlonghao" title="Bug reports">🐛</a> <a href="#maintenance-imlonghao" title="Maintenance">🚧</a></td>
</tr>
</table>
+28 -6
View File
@@ -1,9 +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 🤠🌌
In particular, here is my roadmap:
* Tokio async
* Better UX
* Optimised code
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).
Please leave issues / pull requests, I'd love to learn more about this amazing language :)
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 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
## 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.
BIN
View File
Binary file not shown.
+210 -251
View File
@@ -1,292 +1,251 @@
use async_std::io;
use async_std::net::TcpStream;
use clap::{App, Arg, AppSettings};
extern crate shell_words;
mod scanner;
use scanner::Scanner;
use colored::*;
use std::process::{exit, Command};
use std::time::Duration;
use std::{
net::{SocketAddr, Shutdown},
io::ErrorKind, convert::TryInto,
};
use async_std::prelude::*;
use futures::stream::FuturesUnordered;
use futures::executor::block_on;
use rlimit::Resource;
use rlimit::{setrlimit, getrlimit};
use rlimit::{getrlimit, setrlimit};
use std::process::{exit, Command};
use std::{net::IpAddr, time::Duration};
use structopt::StructOpt;
// 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;
#[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.
struct Opts {
/// The IP address to scan
#[structopt(parse(try_from_str))]
ip: IpAddr,
///Quiet mode. Only output the ports. No Nmap. Useful for grep or outputting to a file.
#[structopt(short, long)]
quiet: 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")]
batch_size: u32,
/// The timeout in milliseconds before a port is assumed to be closed.
#[structopt(short, long, default_value = "1500")]
timeout: u32,
/// Automatically ups the ULIMIT with the value you provided.
#[structopt(short, long)]
ulimit: Option<rlimit::rlim>,
/// 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)'\"")
command: Vec<String>,
}
/// 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)
// 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();
// logger
env_logger::init();
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()
info!("Starting up");
let opts = Opts::from_args();
info!("Mains() `opts` arguments are {:?}", opts);
};
let mut batch_size: u64 = matches
.value_of("b")
.unwrap_or("None")
.parse::<u64>()
.unwrap();
if !quiet {
if !opts.quiet {
print_opening();
}
// checks ulimit
// change ulimit size
if !(ulimit_arg == "None") {
let limit = ulimit_arg.parse::<u64>().unwrap();
if !quiet{
println!("Automatically upping ulimit to {}", ulimit_arg);
}
setrlimit(Resource::NOFILE, limit, limit);
}
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();
let ulimit: rlimit::rlim = adjust_ulimit_size(&opts);
let batch_size: u32 = infer_batch_size(&opts, ulimit);
// 65535 + 1 because of 0 indexing
let test = run_batched(ip.to_string(), 1, 65536, Duration::from_millis(duration_timeout,), batch_size.try_into().unwrap(), quiet);
let reports_fullsult = block_on(test);
let scanner = Scanner::new(
opts.ip,
1,
65535,
batch_size,
Duration::from_millis(opts.timeout.into()),
opts.quiet,
);
let scan_result = block_on(scanner.run());
// prints ports and places them into nmap string
let mut nmap_str_ports: Vec<String> = Vec::new();
let nmap_str_ports: Vec<String> = scan_result
.into_iter()
.map(|port| port.to_string())
.collect();
// makes vector of open ports
for i in reports_fullsult.iter() {
// appends it to port
nmap_str_ports.push(i.to_string());
}
// if no ports are found, suggest running with less
// 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());
\n*I used {} batch size, consider lowering to {} with {} or a comfortable number for your system.
\n Alternatively, increase the timeout if your ping is high. Rustscan -T 2000 for 2000 second timeout.", "ERROR".red(),
opts.batch_size,
(opts.batch_size / 2).to_string().green(),
"'rustscan -b <batch_size> <ip address>'".green());
}
// Tells the user we are now switching to Nmap
if !quiet{
println!(
"{}",
"Starting nmap.".blue(),
);
if !opts.quiet {
println!("{}", "Starting nmap.".blue(),);
}
// nmap port style is 80,443. Comma seperated with no spaces.
let ports_str = nmap_str_ports.join(",");
// if quiet mode is on, return ports and exit
if quiet{
println!("{:?}", ports_str);
if opts.quiet {
println!("{}", ports_str);
exit(1);
}
let string_format = format!("{} {} {} {} {}", command_run, "-vvv", "-p", &ports_str, ip);
let command_list = string_format.split_whitespace();
let vec = command_list.collect::<Vec<&str>>();
let addr = opts.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, opts.ip.is_ipv6());
if !opts.quiet {
println!("The Nmap command to be run is {}", &nmap_args.join(" "));
}
// Runs the nmap command and spawns it as a process.
Command::new("nmap")
.args(&vec)
let mut child = Command::new("nmap")
.args(&nmap_args)
.spawn()
.expect("failed to execute process");
}
.expect("failed to execute nmap process");
pub async fn run_batched(
host: String,
port_start: u32,
port_end: u32,
timeout: Duration,
batch: u32,
quiet: bool,
) -> Vec<u32> {
// run the scans in batches
let mut begin = port_start;
let mut end = begin + batch;
let mut all_addrs: std::vec::Vec<u32> = Vec::new();
while end <= port_end {
let mut batch_addrs = execute(host.clone(), begin, end, timeout, quiet).await;
all_addrs.append(&mut batch_addrs);
begin = end+1;
end += batch;
}
all_addrs
}
async fn execute(
host: String,
port_start: u32,
port_end: u32,
timeout: Duration,
quiet: bool,
) -> Vec<u32> {
// runs a scan against a range of ports
let mut ftrs = FuturesUnordered::new();
// TODO can I make this async?
for port in port_start..port_end {
ftrs.push(try_connect(host.clone(), port, timeout, quiet));
}
let mut open_addrs: Vec<u32> = Vec::new();
// TODO can I make this async?
while let Some(result) = ftrs.next().await {
match result {
Ok(addr) => open_addrs.push(addr),
Err(_) => {}
}
}
open_addrs
}
async fn try_connect(host: String, port: u32, timeout: Duration, quiet: bool) -> io::Result<u32> {
let addr = host.to_string() + ":" + &port.to_string();
match addr.parse() {
Ok(sock_addr) => match connect(sock_addr, timeout).await {
Ok(stream_result) => {
match stream_result.shutdown(Shutdown::Both) {
_ => {}
}
if !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(e)
}
_ => 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");
Err(io::Error::new(io::ErrorKind::Other, e.to_string()))
}
}
}
async fn connect(addr: SocketAddr, timeout: Duration) -> io::Result<TcpStream> {
let stream = io::timeout(timeout, async move { TcpStream::connect(addr).await }).await?;
Ok(stream)
child.wait().expect("failed to wait on nmap process");
}
/// Prints the opening title of RustScan
fn print_opening() {
info!("Printing 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()
);
println!("{}\n", s.green());
}
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("-A");
arguments.push("-vvv");
if is_ipv6 {
arguments.push("-6");
}
arguments.push("-p");
arguments.push(ports);
arguments.push(addr);
arguments
}
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(_) => {
if !opts.quiet {
println!("\nAutomatically increasing ulimit value to {}.\n", limit);
}
}
Err(_) => println!("{}", "ERROR. Failed to set ulimit value.".red()),
}
}
let (rlim, _) = getrlimit(Resource::NOFILE).unwrap();
rlim
}
fn infer_batch_size(opts: &Opts, ulimit: rlimit::rlim) -> u32 {
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 {
if !opts.quiet {
println!("{}", "WARNING: Your file description limit is lower than the provided batch size. Please considering upping this (instructions in our README). NOTE: this may be dangerous and may cause harm to sensitive servers. Automatically reducing the batch Size to match your system's limit, this process isn't harmful but reduces speed.".red());
}
// 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 > DEFAULT_FILE_DESCRIPTORS_LIMIT {
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()) {
if !opts.quiet {
println!(
"Your file descriptor 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 {}.",
ulimit,
ulimit - 1
);
}
}
batch_size as u32
}
#[cfg(test)]
mod tests {
use super::Scanner;
use async_std::task::block_on;
use std::{net::IpAddr, time::Duration};
#[test]
fn does_it_run() {
// Makes sure te program still runs and doesn't panic
let addr = match "127.0.0.1".parse::<IpAddr>() {
Ok(res) => res,
Err(_) => panic!("Could not parse IP Address"),
};
let scanner = Scanner::new(addr, 1, 65535, 1000, Duration::from_millis(10), true);
let scan_result = block_on(scanner.run());
// if the scan fails, it wouldn't be able to assert_eq! as it panicked!
assert_eq!(1, 1);
}
fn does_it_run_ipv6() {
// Makes sure te program still runs and doesn't panic
let addr = match "::1".parse::<IpAddr>() {
Ok(res) => res,
Err(_) => panic!("Could not parse IP Address"),
};
let scanner = Scanner::new(addr, 1, 65535, 1000, Duration::from_millis(10), true);
let scan_result = block_on(scanner.run());
// if the scan fails, it wouldn't be able to assert_eq! as it panicked!
assert_eq!(1, 1);
}
}
+147
View File
@@ -0,0 +1,147 @@
use async_std::io;
use async_std::net::TcpStream;
use async_std::prelude::*;
use colored::*;
use futures::stream::FuturesUnordered;
use std::time::Duration;
use std::{
io::ErrorKind,
net::{IpAddr, Shutdown, SocketAddr},
};
/// The class for the scanner
/// Host is data type IpAddr and is the host 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.
pub struct Scanner {
host: IpAddr,
start: u16,
end: u16,
batch_size: u32,
timeout: Duration,
quiet: bool,
}
impl Scanner {
pub fn new(
host: IpAddr,
start: u16,
end: u16,
batch_size: u32,
timeout: Duration,
quiet: bool,
) -> Self {
Self {
host: host.to_owned(),
start,
end,
batch_size,
timeout,
quiet,
}
}
/// 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<u16> {
let ports: Vec<u16> = (self.start..self.end).collect();
let mut open_ports: std::vec::Vec<u16> = Vec::new();
// TODO change this to port size
// to fix bug when we introduce custom port ranges
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
}
/// Given a range of ports, scan them all.
/// Returns a vector of open ports.
async fn scan_range(&self, range: &[u16]) -> Vec<u16> {
let mut ftrs = FuturesUnordered::new();
for port in range {
ftrs.push(self.scan_port(*port));
}
let mut open_ports: Vec<u16> = Vec::new();
while let Some(result) = ftrs.next().await {
match result {
Ok(port) => open_ports.push(port),
_ => {}
}
}
open_ports
}
/// 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.host`.
async fn scan_port(&self, port: u16) -> io::Result<u16> {
let addr = SocketAddr::new(self.host, port);
// println!("{:?}", addr);
match self.connect(addr).await {
Ok(x) => {
// match stream_result.shutdown(Shutdown::Both)
info!("Shutting down stream");
match x.shutdown(Shutdown::Both) {
_ => {}
}
if !self.quiet {
println!("Open {}", port.to_string().purple());
}
// if connection successful
// shut down stream
// return port
Ok(port)
}
Err(e) => match e.kind() {
ErrorKind::Other => {
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
/// // Host is an IpAddr type
/// let host = IpAddr::V6(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1));
/// let addr = SocketAddr::new(host, port)
/// self.connect(addr)
/// // 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, addr: SocketAddr) -> io::Result<TcpStream> {
let stream =
io::timeout(self.timeout, async move { TcpStream::connect(addr).await }).await?;
info!("Returning okay from connect");
Ok(stream)
}
}
#[cfg(test)]
mod tests {
#[test]
fn does_it_run() {
// TODO run functions here
assert_eq!(1, 1);
}
}