@@ -20,11 +20,11 @@ fn main() -> std::io::Result<()> {
2020 let args = App :: new ( "RBust" )
2121 . version ( "v1.9" )
2222 . author ( "inc0gnit0 <iinc0gnit0@pm.me> | skript0r <skript0r@protonmail.com>" )
23- . about ( "RBust is a blazing fast web directory bruteforce tool " )
23+ . about ( "Example: ./ RBust -u https://example.com -w /home/inc0gnit0/RBust/default.txt " )
2424 . args_from_usage (
2525 "
2626 -u, --url=[TARGET_URL] 'Sets your target URL(required)'
27- -w, --wordlist=[PATH_TO/_WORDLIST ] 'Sets your wordlist file(required)'
27+ -w, --wordlist=[PATH_TO_WORDLIST ] 'Sets your wordlist file(required)'
2828 -t, --timeout=[SECONDS] 'Sets the timeout time in seconds Default(15)'
2929 -U, --user-agent=[USER_AGENT] 'Sets the user agent'" ,
3030 )
@@ -62,6 +62,11 @@ fn main() -> std::io::Result<()> {
6262 "\x1b [91mSomething went wrong!\n Please make sure you typed everything right!\x1b [0m"
6363 ) ,
6464 }
65+ // Check internet connection
66+ match connection ( ) {
67+ Ok ( send) => send,
68+ Err ( _) => panic ! ( "\x1b [91mConnection not found!\x1b [0m" ) ,
69+ }
6570 // Read file
6671 let mut urls: Vec < String > = Vec :: new ( ) ;
6772 let fd = File :: open ( wordlist) ?;
@@ -176,3 +181,13 @@ fn url_encode(data: &str) -> String {
176181 }
177182 return buffer;
178183}
184+
185+ // Check for internet connection
186+ fn connection ( ) -> Result < ( ) , Box < dyn std:: error:: Error > > {
187+ Request :: head ( "https://github.com" )
188+ . timeout ( Duration :: new ( 15 , 0 ) )
189+ . body ( "" ) ?
190+ . send ( ) ?;
191+
192+ Ok ( ( ) )
193+ }
0 commit comments