玄机应急响应-第一章-应急响应-Linux日志分析
1 | 账号root密码linuxrz |
1.有多少IP在爆破主机ssh的root帐号,如果有多个使用”,”分割 小到大排序 例如flag{192.168.200.1,192.168.200.2}
1 | cat /var/log/auth.log.1 | grep -a "Failed password for root" | awk '{print $11}' | sort | uniq -c | sort -nr | more |
1 | grep -a "Failed password for root" auth.log.1| awk '{print $11}' | sort | uniq -c |
**答案:flag{192.168.200.2,192.168.200.32,192.168.200.31}**(这个flag IP地址有先后顺序试了好几次才试出来)
2.ssh爆破成功登陆的IP是多少,如果有多个使用”,”分割
查找一下accepted即可
linux命令
1 | cat /var/log/auth.log.1 | grep -a "Accepted " | awk '{print $11}' | sort | uniq -c | sort -nr | more |
1 | grep -a "Accepted password" auth.log.1| awk '{print $11}' | sort | uniq -c |
答案:flag{192.168.200.2}
3.爆破用户名字典是什么?如果有多个使用”,”分割
1 | grep -a "Failed password" auth.log.1| perl -e 'while($_=<>){ /for(.*?) from/; print "$1\n";}'| uniq -c |
1 | root@ip-10-0-10-1:~# cat /var/log/auth.log.1 | grep -a "Failed password" | perl -e 'while($_=<>){ /for(.*?) from/; print "$1\n";}'| uniq -c | sort -nr |
答案:flag{user,hello,root,test3,test2,test1}
4.登陆成功的IP共爆破了多少次
筛选一下ip,筛选一下用户
1 | grep -a "Failed password" auth.log.1| awk '{if($11=="192.168.200.2") print $11}'|sort|uniq -c |
也可以使用问题1的命令
答案:flag{4}
5.黑客登陆主机后新建了一个后门用户,用户名是多少
1 | cat /var/log/auth.log.1 |grep -a "new user" |
其实看passwd也可以
1 | cat /etc/passwd |
答案:flag{test2}
1 | 1,有多少IP在爆破主机ssh的root帐号,如果有多个使用","分割flag{192.168.200.2,192.168.200.32,192.168.200.31} |
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 Sword技术分享!
评论