Created
February 15, 2019 19:38
-
-
Save cgimenes/b5e9a0a752bbd4f89f1f10f7bad4ac5a to your computer and use it in GitHub Desktop.
Grab SMB version
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ -z $1 ]; then echo "Usage: ./grabsmbversion.sh RHOST {RPORT}" && exit; else rhost=$1; fi | |
if [ ! -z $2 ]; then rport=$2; else rport=139; fi | |
if [ ! -z $3 ]; then intf=$3; else rport='eth0'; fi | |
ngrep -i -d $intf 's.?a.?m.?b.?a.*[[:digit:]]' port $rport & | |
echo "exit" | smbclient -L $rhost 1>/dev/null 2>/dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment