[1-15] web upload (based upload-labs)

Environment to build

In the official website to download phpstudy and upload-labs , the package will be downloaded onto the WWW under the root directory, open phpstudy integration services, you can access the range by 127.0.0.1/upload-labs

tool

  • Burp Suite (kali own)
  • Chinese chopper (available for shooting range, reality is recommended Chinese ant sword)
  • FireFox Firefox browser plug-ins and Switchy Omega (Science Internet download)

Common file upload vulnerability and method (old)

File upload vulnerability more use of the word, as used herein, php word
<? php eval(@$_POST['word']); ?>
for word analysis of the plane this will not repeat
Notes content

upload-labs / less-1 demo

1.配置代理环境
Switchy Omega->选项->proxy
Configuration
2.打开phpstudy,进入靶场环境
3.上传php木马
查看源码发现前端js脚本过滤文件后缀。
方法1:
在Firefox地址栏里输入“about:config”并按“Enter”键。 这时会弹出个警告页面,点击“我保证会小心”,就会打开个新页面。 在新页面的搜索栏中输入“javascript.enabled”查找到首选项,改为false,此时已禁用js。刷新页面再次上传就能成功。
方法二:
打开Switchy,选中proxy,打开Burp Suite,选中Proxy下的Intercept并将php木马后缀改为.jpg,再次上传,找到一个POST包,将里面的文件1.jpg改为1.php再发送即可成功上传。注意包第一行POST后,HTTP版本前的一串为木马保存位置,复制以备菜刀连接使用。使用方法一的可在开发人员工具下的网络选项看到保存位置Capture information
4.打开中国菜刀
右击添加,输入木马地址及一句话包含的口令。如图,我选择的是admin。点击添加即可看到对方服务器的文件树,渗透完成。

使用FireFox抓包的一个小问题

使用火狐抓包时经常会看到这样一个包,里面有个success.txt
这是火狐确确认接通畅而间隔发送一个get包
这样会污染抓包
所以Chrome大法好(Chrome上也有SwitchyOmega)
Here Insert Picture Description

Released five original articles · won praise 0 · Views 80

Guess you like

Origin blog.csdn.net/cndsmarrylin/article/details/104000282