Nathan Woodburn
f78d7461ab
- Script logs all keys pressed on keyboard to file - Fake command prompt is displayed to user while running README.md: Added instructions for creating and running keylogger - Instructions include creating new directory, executable file, and script that logs keys to file - Hints provided for infinite loop, getting input from user, displaying message of the day, and running variable as command. |
||
---|---|---|
keylogger-example.sh | ||
README.md |
BB-Pen-2
The task this week is to create a simple keylogger that will log all the keys pressed on the keyboard and save them to a file.
The program should run in the background and not be visible to the user.
Requirements
- Access to the kali.boysbrigade.au server (or another linux machine) (This will be provided)
Instructions
- SSH into the server using the provided credentials following the instructions from last week.
- Create a new directory for your project and navigate into it. (Put your name in the directory name to avoid conflicts between other members)
- In that directory create a new executable file to run the keylogger.
- Write a script (file that ends in .sh) that will log all the keys pressed on the keyboard and save them to a file.
- Try to make the keylogger look like it is not running (Hint: show the user a fake command prompt)
Running the keylogger
# Run normally
./keylogger.sh
# Run so that it will close the SSH session when you close the logger
exec ./keylogger.sh
Hints
- Infinite loop:
while true do # Your code here # Will run forever done
- Get an input from the user:
read -p "Enter something: " input echo "You inputed $input"
- Get the message of the day (Screen that appears when you login):
cat /etc/motd
- Run a variable as a command:
command="ls" $command # This will run the 'ls' command