Prompt
Analyze a VSFTPD log file that we obtained.
vsftpd.log411.1KB
Walk-Through
This challenge involves analyzing the log file of a VSFTPD server. The questions can be solved through manual inspection of the file and by using basic Linux commands to parse the log.
Questions
Q1. What IP address did "ftpuser" first log in from?
cat vsftpd.log | grep ftpuser
Q2. What is the first directory that ftpuser created?
cat vsftpd.log | grep ftpuser | grep -i mkdir | head -n 1
ftpuser
account running the mkdir
command.Q3. What is the last directory that ftpuser created?
cat vsftpd.log | grep ftpuser | grep -i mkdir | tail -n 1
ftpuser
account running the mkdir
command.Q4. What file extension was the most used by ftpuser?
cat vsftpd.log | grep ftpuser | grep 'OK UPLOAD' | awk -F ',' '{print $2 }' | cut -d '"' -f 2 | awk -F "." '{print $NF }' | sort | uniq -c
Q5. What is the username of the other user in this log?
Visually inspect the log file for any other usernames. One example can be found on line 249.
cat vsftpd.log | grep '\[.*\] \[.*\]' | awk -F ' ' '{print $8}' | sort | uniq
[.*] [.*]
as these lines contain the usernames. Then, extract the username column, sort, and then get the unique results. Note that the backslashes in the grep command are needed to escape the [
and ]
characters. Q6. What IP address did this other user log in from?
cat vsftpd.log | grep jimmy
Q7. How many total bytes did this other user upload?
cat vsftpd.log | grep jimmy | grep 'OK UPLOAD' | awk -F ',' '{print $3 }' | cut -f 2 -d ' ' | awk '{s+=$1} END {printf "%.0f\n", s}'
Q8. How many total bytes did ftpuser upload?
cat vsftpd.log | grep ftpuser | grep 'OK UPLOAD' | awk -F ',' '{print $3 }' | cut -f 2 -d ' ' | awk '{s+=$1} END {printf "%.0f\n", s}'
Q9. How many total bytes did ftpuser download?
cat vsftpd.log | grep ftpuser | grep 'OK DOWNLOAD' | awk -F ',' '{print $3 }' | cut -f 2 -d ' ' | awk '{s+=$1} END {printf "%.0f\n", s}'
Q10. Identify the IP address of the suspicious login (the login with no subsequent activity)
cat vsftpd.log | grep 'OK LOGIN' | awk -F '"' '{print $2 }' | sort | uniq
©️ 2024 Cyber Skyline. All Rights Reserved. Unauthorized reproduction or distribution of this copyrighted work is illegal.