I am writing a simple script with Bash 4.4.23, to perform a demonstrative dictionary attack towards various web servers which use default passwords.
The arrays containing usernames and passwords are declared above the "for" cycles, which are as follows:
for i in $usernames
do for j in $passwords
do printf '%s ' "${usernames[*]}:${passwords[*]}"
done
done
The code should return something like:
root:root root:admin admin:admin admin:root
But instead it is returning
root admin:root admin
Which are the values declared within the arrays (usernames and passwords).
How can I achieve what I'm trying to do? The tuples will then have to be passed to curl in order to perform the dictionary attack.