Here are some scripts that I wrote to mount and search bulk windows machines.
mountmachines.sh
#!/bin/bash
cd /searchmachines
echo “Username please”
read username
echo “Password please”
read -s password
for machine in `cat machinelist.txt`
do
mkdir remote$machine
echo “Attempting to mount $machine…”
mount.cifs //$machine/c$ ./remote$machine -o username=$username,password=$password
done
exit
This next script searches the machines for NTUSER.DAT files to find users that were logged in during a specific time frame.
search.sh
#!/bin/bash
cd [...]
Normally my Internet connection is pretty good; but, once every couple of months, the provider changes something and my current IP address no longer works. The lease doesn’t actually expire, which is set to last 48 hours. So, I lose internet connectivity until a new renewal. It’s easy to do this by hand, but that [...]
So you just kicked your roommate out and you need to change the username and password on 250 switches.
You can do it with a quick bash loop and pipe it into telnet. (ssh is way better, but isn’t enabled by default on most network devices)
Make a new file named credentials.txt and put the username on [...]
Here is a game that is worth your time. You even get to code it yourself.
Lolz. Needs a bash interpreter.
~$ nano guessinggame.sh
Paste this in there.
#!/bin/bash
echo “Please pick an integer between 1 and 10.”
read guess
number=0
while [ "$number" -le 1 ]
do
number=$RANDOM
let “number %= 11 ”
done
if [ $guess -eq $number ]
then
echo “You win!”
else
echo “You suck. The number was [...]