I would like to make a bash script where I read a list of IP addresses and run the following command:
smbclient \\\\ $ ip \\ ipc $ -U ". \ User" --pw-nt-hash
which does an exit and try with another IP, regardless of that it throws a message if the connection was successful, it does not execute with the IPs that are inside the list, it only tries with the first one in the list.
#/bin/bash 
IPLIST="ip"
for ip in $(cat ip)
do
   smbclient \\\\$ip\\C$ -U ".\user" --pw-nt-hash "user"
   exit
done 
 
     
    