Spray icon indicating copy to clipboard operation
Spray copied to clipboard

Script does not work with usernames containing whitespace

Open daniel-cues opened this issue 3 years ago • 3 comments

The script uses

for u in $(cat $userslist); do 
    (echo -n "[*] user $u%$password " && rpcclient -U "$domain/$u%$password" -c "getusername;quit" $target) >> logs/spray-logs.txt
done

Without modifying IFS as so (this might be an improper fix though, as far as I'm concerned, the actual way to read lines in bash is with read, as in the password reading part of the script):

IFS=$'\n'
...
unset IFS

This translates into usernames with whitespace in them not being supported. the logs also use "cut -d ' ' ", that would also break with whitespace in the username

daniel-cues avatar Feb 23 '22 09:02 daniel-cues

did this result in \r being placed after usernames in requests by chance? seeing that in wireshark and cant figure out why known valid logins are returning as false negatives

hackerlawyer avatar Nov 03 '24 16:11 hackerlawyer

Nevermind found solution to my problem. Add a whitespace after each username or it will send a carriage return following the username (analyzed at packet level with wireshark) and cause logon failures even when password is accurate

hackerlawyer avatar Nov 03 '24 17:11 hackerlawyer

it still sends a carriage return username as an attempted logon in following packet but does so seperately. As long as their isn't a username of r on the network it shouldnt cause any lockout issues

hackerlawyer avatar Nov 03 '24 17:11 hackerlawyer