bee-san / bee-san/RustScan

How do I get the first open port in a range?

Open
#822 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Rust
Stars
20.4k
Forks
1.4k
PR merge metrics
No merged PRs in 30d

Description

Hi, I'm trying to understand how I can implement the below idiom:
`rustscan --ulimit 5000 --no-banner -a $TARGET --range 10000-65535 --scripts none | head -1`

Specifically, I know my target has 1 port open in the range and I'd like to quit scanning when that is found.

Currently it leads to an abort:
```rust
[~] Automatically increasing ulimit value to 5000.

thread 'main' panicked at library/std/src/io/stdio.rs:1123:9:
failed printing to stdout: Broken pipe (os error 32)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```

Is that expected? Is there a nicer way to implement this?

I've tried greppable mode but that only gets me the list of ports at the very end, so in my case on average 2x slower than it would be if it would display the ports live. (E.g. rather than printing when it finds open port 34567 it will only print after it reaches 65535.)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.