TryHackMe-Ninja-Skills
靶机链接:Ninja Skills
难度:中等(如果对linux不够熟悉那就是很难)
目地是高效的完成任务.
Answer the questions about the following files:
8V2L
bny0
c4ZX
D8B3
FHl1
oiMO
PFbD
rmfX
SRSq
uqyw
v2Vb
X1Uy
The aim is to answer the questions as efficiently as possible.
先写一个脚本文件
1 | #!/bin/bash |
1
Q:Which of the above files are owned by the best-group group(enter the answer separated by spaces in alphabetical order)
bash 1.sh|xargs ls -l
2
1 | bash 1.sh|xargs grep -E -o "([0-9]{1,3}[\.]){3}[0-9]{1,3}" |
3
1 | bash 1.sh|xargs md5sum |
4
找不到一个文件,推断出只有那个文件是230行bash 1.sh|xargs wc -l
5
1 | find / -type f -user 502 2>/dev/null |
6
查看 ## 1的结果
总结
xargs
有些命令无法接受管道符的输入,所以就要使用到这个命令
md5sum
计算md5哈希值([0-9]{1,3}[\.]){3}[0-9]{1,3}
正则表达式筛选ip