Skip to content

Commit

Permalink
v2.0
Browse files Browse the repository at this point in the history
- Check for internet
- Small adjustments
  • Loading branch information
yangr0 committed May 30, 2020
1 parent 0cd476a commit 59d405e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# v2.0
- Check for internet
- Small adjustments

# v1.9
- Bug fixes

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ It is recommended to update once a week

`git pull`

`./install.sh`

## Demo

[![asciicast](https://asciinema.org/a/d2drRZkLdcA3YWgBL1ilnVAfD.svg)](https://asciinema.org/a/d2drRZkLdcA3YWgBL1ilnVAfD)
Expand Down
19 changes: 17 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ fn main() -> std::io::Result<()> {
let args = App::new("RBust")
.version("v1.9")
.author("inc0gnit0 <[email protected]> | skript0r <[email protected]>")
.about("RBust is a blazing fast web directory bruteforce tool")
.about("Example: ./RBust -u https://example.com -w /home/inc0gnit0/RBust/default.txt")
.args_from_usage(
"
-u, --url=[TARGET_URL] 'Sets your target URL(required)'
-w, --wordlist=[PATH_TO/_WORDLIST] 'Sets your wordlist file(required)'
-w, --wordlist=[PATH_TO_WORDLIST] 'Sets your wordlist file(required)'
-t, --timeout=[SECONDS] 'Sets the timeout time in seconds Default(15)'
-U, --user-agent=[USER_AGENT] 'Sets the user agent'",
)
Expand Down Expand Up @@ -62,6 +62,11 @@ fn main() -> std::io::Result<()> {
"\x1b[91mSomething went wrong!\nPlease make sure you typed everything right!\x1b[0m"
),
}
// Check internet connection
match connection() {
Ok(send) => send,
Err(_) => panic!("\x1b[91mConnection not found!\x1b[0m"),
}
// Read file
let mut urls: Vec<String> = Vec::new();
let fd = File::open(wordlist)?;
Expand Down Expand Up @@ -176,3 +181,13 @@ fn url_encode(data: &str) -> String {
}
return buffer;
}

// Check for internet connection
fn connection() -> Result<(), Box<dyn std::error::Error>> {
Request::head("https://github.com")
.timeout(Duration::new(15, 0))
.body("")?
.send()?;

Ok(())
}

0 comments on commit 59d405e

Please sign in to comment.