Skip to content

Conversation

eiffel-fl
Copy link
Contributor

@eiffel-fl eiffel-fl commented Oct 6, 2020

Hi.

I added a number of tries to scan_socket, by default the number of try is 1 but it can be set with command line option --tries.
This should close #38.

I am not a Rust expert, so please let me know if I wrote something wrong or not elegant.
Moreover, I am not sure of my code for the Config part, so this part needs to be reviewed.

Best regards.

Copy link
Contributor

@niklasmohrin niklasmohrin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet! I made some suggestions that I think would make the code a bit more clear. Especially the semantics around the ret variable seem a bit off to me. However, as I haven't contributed much to this repository yet, I do not insist that these changes are implemented and I don't know what is best used here. Anyway, good work and thanks for contributing!

@eiffel-fl
Copy link
Contributor Author

You are welcome and thank you for you review!
About the ret variable, I am more used to C so I sometimes use C habit in other languages particularly when I do not know well like Rust.
I will try to remove it though but there are some points that I did not understand in your reviews.

@niklasmohrin
Copy link
Contributor

Don't get me wrong, it is a valid way to solve the problem and you did a great job overall, but I personally find this pattern very iritating as it is more complex than what it accomplishes (see that one (somehwat long) comment where I try to explain my point).

@eiffel-fl
Copy link
Contributor Author

There is not problem at all.
We are here to discuss and find the best solution, moreover I do agree that my solution makes the code less readable and I also have to adapt to the language.
If I understand correctly Rust philosophy the less mut variable you have the happier you are.

@bergabman
Copy link
Contributor

Awesome PR! We are in the need of this functionality so it's a great PR to have. I think I know what @niklasmohrin tries to explain and I have to agree, so I downloaded this branch to test it. It does what it supposed to do, but that error on the top of the function does look a little weird. I think it also costs some memory allocation and reallocation because of mutability and reassignements. Based on your PR, there were just a few things I had to change to avoid extra allocations, and only allocate that error when and if it's needed. Please check the code I sketched up @eiffel-fl @niklasmohrin and let me know what you think. This would be a bit more rustacian style I think :)

    async fn scan_socket(&self, socket: SocketAddr) -> io::Result<SocketAddr> {
        for nr_try in 0..self.tries {
            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.greppable {
                        if self.accessible {
                            println!("Open {}", socket.to_string());
                        } else {
                            println!("Open {}", socket.to_string().purple());
                        }
                    }
                    return Ok(socket);
                }
                Err(e) => {
                    if nr_try < self.tries {
                        continue;
                    } else {
                        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);
                                    return Err(e);
                                } 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.");
                                }
                            }
                            _ => return Err(e),
                        }
                    }
                }
            }
        }
        Err(io::Error::new(
            io::ErrorKind::Other,
            format!("Did not connect to {}", &socket),
        ))
    }

One interesting thing, maybe there is a problem with this logic, because no matter what I tried and made sure to cover all the arms inside the loop to or return or continue, the compiler kept complaining that not all the arms return a Result. So I added the last line as Err and it gets hit with the default tries. So it's something I don't get right now. Someone?

@niklasmohrin
Copy link
Contributor

niklasmohrin commented Oct 14, 2020

@bergabman You need to add semicolons after your match blocks (both the outer one and the one over e.kind()). (<- Nope that's not it)

Your loop is going from 0 to self.tries - 1. Therefore, the condition nr_try < self.tries is always true and you always continue. Without the Err after the loop, your function would not return anything if no connection succeeded. Furthermore, now that that is there, you always return that error instead of the one from inside the match arm (because the outer if condition is always true).

The logic is not right though, you still want to look at the error in every iteration and panic if needed. The check should only include the return statements. This is roughly how I imagine it:

async fn scan_socket(&self, socket: SocketAddr) -> io::Result<SocketAddr> {
    for nr_try in 1..=self.tries {
        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.greppable {
                    if self.accessible {
                        println!("Open {}", socket.to_string());
                    } else {
                        println!("Open {}", socket.to_string().purple());
                    }
                }
                return Ok(socket);
            }
            Err(e) => {
                // let error_string = e.to_string();
                if 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);
                    } 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.");
                    }
                }
                
                if nr_try == self.tries {
                    return Err(io::Error::new(io::ErrorKind::Other, e.to_string()));
                }
            }
        };
    }
    
    // Only runs if self.tries is 0
    Err(io::Error::new(
        io::ErrorKind::Other,
        format!("Did not connect to {}", &socket),
    ))
}

Note that this does not include the caching of the result of .to_string(). Interestingly. this result may never be used, but I think that it is still best to always compute it since most times the error will be the network error. If that's not the case, we might have to come up with something more clever.

@bergabman
Copy link
Contributor

I see. I was not sure in the 0..self.tries part but you are right, as we already start with 1 we can use that and inclusive ..= range so it's easier to compare. It's better. But where I match Error::kind, I think I cover everything, as all the errors have kind and if it's not Other, it should hit _. But if I always continue, that doesn't really matter :).
How you wrote it is the way to catch the too many files open exception and panic on it right away (current logic), instead of looping further. It would only cost 2 more loop iterations and it would probably hit panic, but your way seems the most optimal/efficient. 👍

@eiffel-fl
Copy link
Contributor Author

eiffel-fl commented Oct 14, 2020

I updated my code to take into account all reviews and discussions!
So please, let me know if there is a problem.

Moreover, can someone please reviews the code about reading into the config? I am not sure if tries is correctly taken into account.

I also add a print with eprintln to indicate to user that he/she sets tries to 0 so the code sets it to 1.
I would have liked to use warning! from tui but I had troubles with rust import system...

@bergabman I quickly checked your code and I agree with @niklasmohrin about the if condition.
About the panic, I would suggest that if we have to panic we should do it as soon as possible, but maybe panic here is not as severe as a kernel panic.

Copy link
Contributor

@niklasmohrin niklasmohrin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, we are getting there! Apart from a small suggestion from cargo clippy, the Ok arm looks perfect to me. I suggested a refactor in the Err arm, but it's mostly a syntax change with a slight performance improvement, as the logic was impeccable ✨ .

While reading your code that corrects the value of tries to 1 if 0 was given, I remembered that there is NonZeroU8 etc. If you were to use that, you could get rid of the Err after the for loop, because then you know that there will be at least one iteration (and that the last iteration will return). Note that the compiler might not figure that out by itself. If you get an error about a missing return after the loop, you just put unreachable!() after the loop to tell the compiler just that.

I have not come around to look at the config part yet, because I will have to read some documentation for that too and it is getting late. Maybe I will review tests and config tomorrow.

That said, great work and thank you for being so cooperative! I hope you don't take my large requests amiss and keep on writing great (Rust) code! 🦀

@bergabman
Copy link
Contributor

That panic is a crash, but not as serious as a kernel panic for sure :D. We will handle that logic different in the future.
I also agree with that if statement there, so I think the structure/logic is good like this!

Those macros are exported to the root of the crate, so you can use them with

use super::warning;

and then

warning!("somestring");

To get Options and Config merged right, please add the tries to the input.rs merge_required! macro.
merge_required!(addresses, greppable, accessible, batch_size, tries, timeout, scan_order, command);

I will ask @bernardoamc to take a look at it as well, but I also think we are getting there and it will be ok for a merge. And we have to change the README and the manual so people will know about the function. :D

Copy link
Contributor

@bernardoamc bernardoamc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First thank you so much for the contribution. <3

I have a proposal that might change the code a bit.

Proposal:

I think we could simplify a lot this logic by just retrying the scanner itself inside main.rs. It would go like this:

  1. Create a set inside main.
  2. Run the scanner
  3. Store open ports within set
  4. Go to step 1 until retries are exhausted.

Benefits:

  1. Keep the Scanner with a single responsibility
  2. Small change required, so the code becomes more intuitive

Downsides

  1. We might scan open ports multiple times

I don't mind the downside that much since usually the majority of ports are closed, so we will scanner pretty much the same number of ports during every iteration.

cc/ @bergabman @niklasmohrin @eiffel-fl

@eiffel-fl
Copy link
Contributor Author

eiffel-fl commented Oct 15, 2020

@bergabman Thank you for the tip to include warning! I try a lot of combination but not this simple one...
I also modify the README.md on my local version, but where is the manual you are talking about? So I will update it too.

@bernardoamc You are welcome!
If the downside is not so important why not.
I did not go to a solution like this when I implemented the first version because I though RustScan goal was to be as performant as possible.
I will let others express their opinion about your suggestion.

@niklasmohrin
Copy link
Contributor

@bernardoamc Wow, that approach is tempting indeed, this would be a very simple addition 😅

However, I would prefer the current approach as it is (probably) more performant and the condition that determines "port open" vs. "port closed" is in one place.

Furthermore, it allows for more specialized additions down the road (for example different number of tries allowed for different IPs or ports). Maybe we should consider refactoring the scan_socket method to not take &self (so we make it static) and instead have everything needed given to it as an argument (that would be tries and timeout). This would allow for other methods to use scan_socket for other strategies or so.

Yet, I can see how the easier change may be more appropriate here. I am fine with both versions, but I personally prefer the current approach.

@bernardoamc
Copy link
Contributor

@niklasmohrin I'm fine with the current approach too, and when the need to further specialize this logic comes we can extract this logic to a self contained struct. Something like a "SocketStrategy" of sorts.

Most of my comments were around style, but @niklasmohrin and @bergabman did a great job reviewing the PR already. As soon as they are adjusted we can ship this great addition 🎉

@eiffel-fl
Copy link
Contributor Author

I added all the reviews but stick with the implementation where tries takes place inside scan_socket.
Let me know if there is a problem or I I can improve something!

println!("Open {}", socket.to_string());
} else {
println!("Open {}", socket.to_string().purple());
let tries = self.tries.get();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following my last comment , now we can use tries normally, so this would become let tries = self.tries;

Copy link
Contributor

@niklasmohrin niklasmohrin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I think it is almost perfect now. Additionally to these suggestions, the suggested refactoring on line 128 is not in yet.

Note: I think you should be able to close older suggestions with a button saying resolve conversation to make the page here a bit shorter 😄

@eiffel-fl
Copy link
Contributor Author

Normally I added everything!
The button resolve conversation was in front of me and I did not see it 🤣🤣🤣!

@bergabman
Copy link
Contributor

I tested it and made 2 small comments so the output gets improved a bit. Besides this I think we discussed the important parts and I'm happy with the final code. Thanks again for this great PR!

By default the number of try is 1, it can be set on the command line by using
--tries option.

This should close bee-san#38.
@eiffel-fl
Copy link
Contributor Author

@bergabman You are welcome! And thanks also the others for your reviews!
I added them and push the new code.

@niklasmohrin
Copy link
Contributor

niklasmohrin commented Oct 16, 2020

Hey, I think I found a neat little adjustment: Since NonZeroU8 implements FromStr, you can actually require the flag to be non-zero all the way from the start. That means the user gets an explicit error instead of a silent adjustment:

$ target/debug/rustscan --tries 0 192.168.178.97 --no-nmap
error: Invalid value for '--tries <tries>': number would be zero for non-zero type

All I did was change u8 to NonZeroU8 in Config, Scanner etc. This also gets rid of the conversion in Scanner::new.

Copy link
Contributor

@bergabman bergabman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again for the PR. Great code!

@bee-san
Copy link
Owner

bee-san commented Oct 16, 2020

@all-contributors please add @eiffel-fl for code
@all-contributors please add @niklasmohrin for code

@allcontributors
Copy link
Contributor

@bee-san

I could not determine your intention.

Basic usage: @all-contributors please add @Someone for code, doc and infra

For other usages see the documentation

@bee-san
Copy link
Owner

bee-san commented Oct 16, 2020

@all-contributors please add @eiffel-fl for code

@allcontributors
Copy link
Contributor

@bee-san

I've put up a pull request to add @eiffel-fl! 🎉

@bee-san
Copy link
Owner

bee-san commented Oct 16, 2020

@all-contributors please add @niklasmohrin for code

@allcontributors
Copy link
Contributor

@bee-san

I've put up a pull request to add @niklasmohrin! 🎉

@bee-san bee-san merged commit 9bbee9d into bee-san:master Oct 16, 2020
@niklasmohrin
Copy link
Contributor

Uhhhm, @bee-san I actually only reviewed this PR 😄 I opened #277 yesterday, so I guess I am going to make up for the "code-contributor" title soon 😅

@bee-san
Copy link
Owner

bee-san commented Oct 16, 2020

Uhhhm, @bee-san I actually only reviewed this PR smile I opened #277 yesterday, so I guess I am going to make up for the "code-contributor" title soon sweat_smile

ahhh my bad, I saw your name in the reviews a lot so I thought I'd give it to ya 😆

@eiffel-fl
Copy link
Contributor Author

Thank you for the merge!
Good language, good project and good community 😄!

bee-san added a commit that referenced this pull request Nov 2, 2022
* 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](Nugine/rlimit@v0.3.0...v0.4.0)

Signed-off-by: dependabot-preview[bot] <[email protected]>

* Updated README to include instructions on building the new Dockerfile

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

* 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]>

* docs: fix typo in README.md, link to GitHub flow in contributing doc

* 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.

* 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)

* 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

* Reduce crate size

* Use absolute image URLs instead of relative

* 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.

* updated config file to feature nmap top 1k ports

* removed -A from nmap

* updated AUR package in readme

* 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.

* 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

* 2000 milliseconds not seconds

* 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](TeXitoi/structopt@v0.3.16...v0.3.17)

Signed-off-by: dependabot-preview[bot] <[email protected]>

* Fixed small typo in a warning message

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

* Convert -T to -t

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

* Add Travis configuration to publish doc to GitHub pages

* added submodule

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

* 1.8.0 publish

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

* Cleanup Dockerfile

* Pin Alpine 3.12 to prevent breakages in the future

* Prevent cache bustages

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

* added travis token

* Remove argument placeholders in docker alias

* Mark code blocks as bash commands in README

* Move "rustscan -h" and output together

* updated logo

* Update README.md

* Add Fedora/CentOS installation instructions

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

* 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.

* Update README.md

Typo fix in the Debian / Kali install section.

* 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.

* 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.

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

* Update FUNDING.yml

* 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.

* Improved scanner engine to work more efficient and consistent with scanning.

* Small improvement at an if.

* Fix format.

* Remove unnecessary comment.
Fix mistake at adding futures to the initial stream.

* added release drafter

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

* Fix incorrect timeout option

* 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.

* 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.

* 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](serde-rs/serde@v1.0.115...v1.0.116)

Signed-off-by: dependabot-preview[bot] <[email protected]>

* 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](serde-rs/serde@v1.0.115...v1.0.116)

Signed-off-by: dependabot-preview[bot] <[email protected]>

* fixed debug log

* cargo fmt

* 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.

* 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`

* Update README.md

Small typos after initial commit to #224

* 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](async-rs/async-std@v1.6.3...v1.6.4)

Signed-off-by: dependabot-preview[bot] <[email protected]>

* Runtime measurement implementation, better debugging, and better error handling for unreachable hosts.

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

* fix typo

* Added top ports, fixed accessibility. (#230)

* Refactored scanner struct for accessibility, fixed macros

Co-authored-by: Bee <[email protected]>

* fixed accessible issues

* 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]>

* releasing

* Update README for v1.9.0 release

DockerHub tag for v1.9.0 release has been pushed too

* Update README for v1.9.0 release (#233)

DockerHub tag for v1.9.0 release has been pushed too

* typo in docker instructions

* Refactored test, intorduced default() in test context for structs for easier test writing, Scanner struct quiet changed to greppable. (#235)

* Increase code coverage (#236)

* Updated code coverage

* README updates

* docs: add dmitris as a contributor (#232)

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Bee <[email protected]>

* Update Dockerfile to encourage layer caching (#241)

At the moment the Dockerfile brings the entire current directory in as a context for the building container. We can encourage some caching here by only bringing forward the essentials:
`cargo.tml`, `cargo.lock` and the `src`

+ Added a maintainer label

* Fixed output error, Warning! ran when file opened (#237)

Take file of addresses as input

* Bump structopt from 0.3.17 to 0.3.18 (#243)

Bumps [structopt](https://github.com/TeXitoi/structopt) from 0.3.17 to 0.3.18.
- [Release notes](https://github.com/TeXitoi/structopt/releases)
- [Changelog](https://github.com/TeXitoi/structopt/blob/master/CHANGELOG.md)
- [Commits](TeXitoi/structopt@v0.3.17...v0.3.18)

Signed-off-by: dependabot-preview[bot] <[email protected]>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Added DNS lookup using Google DNS, refactored IP code (#246)

* Added DNS lookup using Google DNS, refactored IP code

* fixed comments & cargo fmt

* Fixed code review comments, added tests, removed unwrap() panics

* Added assertion to test

* 1.10.0 release

* 1.10.0 release

* building CI

* building CI

* Added HomeBrew Bump + More CI Tests (#252)

* CI and more tests

* included package name

* Update README for instructions for v.10.0 & detail history (#251)

DockerHub now contains every major release from `v1.0.1` to `1.10.0`

Waiting for this README PR to approve before I remove the `v1.9.0` DockerHub tag as it no longer conforms with standards.

Co-authored-by: Bee <[email protected]>

* Add integration tests with timeout (#254)

* Add integration tests with timeout

* cargo fmt

* Fix travis command line

* Add extra margins for the timeout values

* Increase the time to scan

Output the time taken after each test

* docs: add bofh69 as a contributor (#256)

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Bee <[email protected]>

* Updated the person of README. (#255)

Fixed some minor description corrections in README.

Co-authored-by: Bee <[email protected]>

* Update documentation to include greppable (#253)

* Update documentation include greppable

* Replace quiet mode for greppable mode

Co-authored-by: Bee <[email protected]>

* Fix cosmetic issues, change maintainer to rustscan (#249)

Changing only a few lines does not give you maintainer. Also people might contact the person if they need to reach out about something which is probably not intended.

Co-authored-by: Bee <[email protected]>

* docs: add mattcorbin as a contributor (#261)

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>

* Fix archives-generation from Makefile 👷‍♂️ (#263)

* Bump futures from 0.3.5 to 0.3.6 (#265)

Bumps [futures](https://github.com/rust-lang/futures-rs) from 0.3.5 to 0.3.6.
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](rust-lang/futures-rs@0.3.5...0.3.6)

Signed-off-by: dependabot-preview[bot] <[email protected]>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Bee <[email protected]>

* Bump structopt from 0.3.18 to 0.3.19 (#267)

Bumps [structopt](https://github.com/TeXitoi/structopt) from 0.3.18 to 0.3.19.
- [Release notes](https://github.com/TeXitoi/structopt/releases)
- [Changelog](https://github.com/TeXitoi/structopt/blob/master/CHANGELOG.md)
- [Commits](TeXitoi/structopt@v0.3.18...v0.3.19)

Signed-off-by: dependabot-preview[bot] <[email protected]>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Update .SRCINFO url (#268)

Update the .SRCINFO file to point to new repo URL

Co-authored-by: Bee <[email protected]>

* docs: add rootsploit as a contributor (#274)

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>

* Bump structopt from 0.3.19 to 0.3.20 (#272)

Bumps [structopt](https://github.com/TeXitoi/structopt) from 0.3.19 to 0.3.20.
- [Release notes](https://github.com/TeXitoi/structopt/releases)
- [Changelog](https://github.com/TeXitoi/structopt/blob/master/CHANGELOG.md)
- [Commits](TeXitoi/structopt@v0.3.19...v0.3.20)

Signed-off-by: dependabot-preview[bot] <[email protected]>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump toml from 0.5.6 to 0.5.7 (#270)

Bumps [toml](https://github.com/alexcrichton/toml-rs) from 0.5.6 to 0.5.7.
- [Release notes](https://github.com/alexcrichton/toml-rs/releases)
- [Commits](toml-rs/toml-rs@0.5.6...0.5.7)

Signed-off-by: dependabot-preview[bot] <[email protected]>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Make address an optional instead of a positional argument (#271)

This has the benefit of making the input flexible and fixing an existing
bug that happens when a single port is specified, see #211.

Other benefits:
  - We are now parsing only failures as a file, reducing the amount of
    attempts to open a file.
  - We check if a file exists before trying to open it.

Fixes #211

Co-authored-by: Bee <[email protected]>

* docs: add eiffel-fl as a contributor (#281)

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>

* docs: add niklasmohrin as a contributor (#282)

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>

* Add tries to scan_socket. (#266)

By default the number of try is 1, it can be set on the command line by using
--tries option.

This should close #38.

Co-authored-by: Bee <[email protected]>

* Bump serde from 1.0.116 to 1.0.117 (#278)

Bumps [serde](https://github.com/serde-rs/serde) from 1.0.116 to 1.0.117.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](serde-rs/serde@v1.0.116...v1.0.117)

Signed-off-by: dependabot-preview[bot] <[email protected]>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Bee <[email protected]>

* Fix Rlimit breaking change. (#283) (#284)

* Replace rlimit::rlim with rlimit::RawRlim

Signed-off-by: u5surf <[email protected]>

* docs: add u5surf as a contributor (#285)

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Bee <[email protected]>

* Scripting Engine Implementation.

* Fix clippy warnings around match expressions

* Fix clippy warnings about syntax

* Fix clippy warnings around return statements that could just be expressions

* Fix clippy warnings around under-specific method calls

* Add clippy workflow

* Additional small if let refactors

* docs: add niklasmohrin as a contributor (#288)

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Bee <[email protected]>

* Add tests for rustscan scripting engine (#286) (#289)

* Add tests for rustscan scripting engine (#286)

* Increase test coverage

* Add more scripting tests

Co-authored-by: Bee <[email protected]>

* docs: add okrplay as a contributor (#290)

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>

* Bump env_logger from 0.7.1 to 0.8.1 (#295)

Bumps [env_logger](https://github.com/env-logger-rs/env_logger) from 0.7.1 to 0.8.1.
- [Release notes](https://github.com/env-logger-rs/env_logger/releases)
- [Changelog](https://github.com/env-logger-rs/env_logger/blob/master/CHANGELOG.md)
- [Commits](rust-cli/env_logger@v0.7.1...v0.8.1)

Signed-off-by: dependabot-preview[bot] <[email protected]>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Add some instructions to create contributing development environment. (#298)

A new Dockerfile "contributing.Dockerfile" was added.
This Dockerfile permits creating a "ready to develop" container image to ease
contributing to RustScan.
The instructions to use it are detailed in contributing.md.

* Better enforce clippy lints (#294)

* Clippy deny default lints and warn for clippy::pedantic

* Fix all existing pedantic clippy lints on stable and nightly

* Improve error handling in scripts init (#300)

* Changed the dns resolving to use std::net::ToSocketAddrs (#264)

* Changed dns resolving library to to_socket_addrs and removed the usage of trust-dns

* Reverted automatic IDE spacing

* Ran cargo fmt on the code

* Made trust-dns a fallback dns resolver and reverted cargo toml and lock

* Reverted cargo.lock

* Ran cargo fmt

* Changed style of err checking

* Fixed errors

* Fixed merging errors

* Changed for CR

Co-authored-by: Bee <[email protected]>

* Bump futures from 0.3.6 to 0.3.7 (#302)

Bumps [futures](https://github.com/rust-lang/futures-rs) from 0.3.6 to 0.3.7.
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](rust-lang/futures-rs@0.3.6...0.3.7)

Signed-off-by: dependabot-preview[bot] <[email protected]>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Redesign of README (#293)

Updated README

Co-authored-by: bee <[email protected]>

* Bump async-std from 1.6.5 to 1.7.0 (#306)

Bumps [async-std](https://github.com/async-rs/async-std) from 1.6.5 to 1.7.0.
- [Release notes](https://github.com/async-rs/async-std/releases)
- [Changelog](https://github.com/async-rs/async-std/blob/master/CHANGELOG.md)
- [Commits](async-rs/async-std@v1.6.5...v1.7.0)

Signed-off-by: dependabot-preview[bot] <[email protected]>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Bee <[email protected]>

* Bump anyhow from 1.0.33 to 1.0.34 (#304)

Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.33 to 1.0.34.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](dtolnay/anyhow@1.0.33...1.0.34)

Signed-off-by: dependabot-preview[bot] <[email protected]>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Bee <[email protected]>

* cargo.lock

* 2.0

* Delete bump.yml

* update logo

* fixing cargo lock

* Bump env_logger from 0.8.1 to 0.8.2 (#317)

Bumps [env_logger](https://github.com/env-logger-rs/env_logger) from 0.8.1 to 0.8.2.
- [Release notes](https://github.com/env-logger-rs/env_logger/releases)
- [Changelog](https://github.com/env-logger-rs/env_logger/blob/master/CHANGELOG.md)
- [Commits](rust-cli/env_logger@v0.8.1...v0.8.2)

Signed-off-by: dependabot-preview[bot] <[email protected]>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Scripting engine extra user argument interpretation error fixed. Scanner engine errors and error handling clarified. (#325)

* Update README.md

* Partially fix #362: Fix examples (#363)

Include -a to specify addresses

* Bump serde from 1.0.117 to 1.0.124 (#361)

Bumps [serde](https://github.com/serde-rs/serde) from 1.0.117 to 1.0.124.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](serde-rs/serde@v1.0.117...v1.0.124)

Signed-off-by: dependabot-preview[bot] <[email protected]>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump anyhow from 1.0.34 to 1.0.40 (#368)

Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.34 to 1.0.40.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](dtolnay/anyhow@1.0.34...1.0.40)

Signed-off-by: dependabot-preview[bot] <[email protected]>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump cidr-utils from 0.5.0 to 0.5.1 (#367)

Bumps [cidr-utils](https://github.com/magiclen/cidr-utils) from 0.5.0 to 0.5.1.
- [Release notes](https://github.com/magiclen/cidr-utils/releases)
- [Commits](magiclen/cidr-utils@v0.5.0...v0.5.1)

Signed-off-by: dependabot-preview[bot] <[email protected]>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Brandon <[email protected]>

* Bump rlimit from 0.5.2 to 0.5.4 (#360)

Bumps [rlimit](https://github.com/Nugine/rlimit) from 0.5.2 to 0.5.4.
- [Release notes](https://github.com/Nugine/rlimit/releases)
- [Commits](Nugine/rlimit@v0.5.2...v0.5.4)

Signed-off-by: dependabot-preview[bot] <[email protected]>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Brandon <[email protected]>

* Bump futures from 0.3.7 to 0.3.13 (#358)

Bumps [futures](https://github.com/rust-lang/futures-rs) from 0.3.7 to 0.3.13.
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](rust-lang/futures-rs@0.3.7...0.3.13)

Signed-off-by: dependabot-preview[bot] <[email protected]>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Brandon <[email protected]>

* Update tui.rs (#396)

added a quote

* Update Cargo.lock file to support latest version of Rust (#435)

* 2.1.0 release

Signed-off-by: dependabot-preview[bot] <[email protected]>
Signed-off-by: u5surf <[email protected]>
Co-authored-by: Bernardo Araujo <[email protected]>
Co-authored-by: Brandon <[email protected]>
Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Ben (CMNatic) <[email protected]>
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: andy5995 <[email protected]>
Co-authored-by: Spenser Black <[email protected]>
Co-authored-by: Brandon <[email protected]>
Co-authored-by: Phenomite <[email protected]>
Co-authored-by: Ferry <[email protected]>
Co-authored-by: Sandro Jäckel <[email protected]>
Co-authored-by: remigourdon <[email protected]>
Co-authored-by: Niklas Mohrin <[email protected]>
Co-authored-by: Artem Polishchuk <[email protected]>
Co-authored-by: Gabriel <[email protected]>
Co-authored-by: mulc <[email protected]>
Co-authored-by: Bee <[email protected]>
Co-authored-by: bergabman <[email protected]>
Co-authored-by: Martin Chrástek <[email protected]>
Co-authored-by: Dmitry Savintsev <[email protected]>
Co-authored-by: bergabman <[email protected]>
Co-authored-by: Sebastian Andersson <[email protected]>
Co-authored-by: Hardeep Singh <[email protected]>
Co-authored-by: Teofilo Monteiro <[email protected]>
Co-authored-by: Thomas Gotwig <[email protected]>
Co-authored-by: Frederik B <[email protected]>
Co-authored-by: eiffel-fl <[email protected]>
Co-authored-by: Y.Horie <[email protected]>
Co-authored-by: Niklas Mohrin <[email protected]>
Co-authored-by: Oskar <[email protected]>
Co-authored-by: shahar481 <[email protected]>
Co-authored-by: bee <[email protected]>
Co-authored-by: Brandon <[email protected]>
Co-authored-by: Thomas de Queiroz Barros <[email protected]>
Co-authored-by: Ryan Montgomery <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Increase max retries limit
5 participants