dvwa-command injection
来源:互联网 发布:淘宝网店装修模板 编辑:程序博客网 时间:2024/05/22 01:37
Command Injection,即命令注入,是指通过提交恶意构造的参数破坏命令语句结构,从而达到执行恶意命令的目的。
<?phpif( isset( $_POST[ 'Submit' ] ) ) { // Get input $target = $_REQUEST[ 'ip' ]; // Determine OS and execute the ping command. if( stristr( php_uname( 's' ), 'Windows NT' ) ) { // Windows php_uname('s')操作系统名称 $cmd = shell_exec( 'ping ' . $target );//连接字符 } else { // *nix $cmd = shell_exec( 'ping -c 4 ' . $target ); } // Feedback for the end user echo "<pre>{$cmd}</pre>";}?>
1. 127.0.0.1&&net user 列出本机网络连接(ubuntu 下没有net user,我随便换了一个命令groups,多了个daemon)
(ttl 存活时间 time 延迟 icmp_seq 报文 第几个 rrt 往返时延)
medium
<?phpif( isset( $_POST[ 'Submit' ] ) ) { // Get input $target = $_REQUEST[ 'ip' ]; // Set blacklist $substitutions = array( '&&' => '', ';' => '', ); // Remove any of the charactars in the array (blacklist). $target = str_replace( array_keys( $substitutions ), $substitutions, $target );//键替换成值 // Determine OS and execute the ping command. if( stristr( php_uname( 's' ), 'Windows NT' ) ) { // Windows $cmd = shell_exec( 'ping ' . $target ); } else { // *nix $cmd = shell_exec( 'ping -c 4 ' . $target ); } // Feedback for the end user echo "<pre>{$cmd}</pre>";}?>1.127.0.0.1&net user(不管前面是否成功都执行下一个),如上图所示
2.127.0.0.1&ipconfig(ubuntu下是ifconfig)
high
多了一些而已
'&' => '',
';' => '',
'| ' => '',
'-' => '',
'$' => '',
'(' => '',
')' => '',
'`' => '',
'||' => '',
注意:我们的思想就是找漏网之鱼,我们这里的‘|’后面有个空格,那么‘|’就成为了漏网之鱼。
结果就是一个“daemon”
impossible
这里加上了几个函数
stripslashes
explode 把字符串打散为数组,返回字符串的数组。
is_numeric
检测string是否为数字或数字字符串,如果是返回TRUE,否则返回FALSE。
阅读全文
0 0
- dvwa-command injection
- –DVWA-command injection
- DVWA - Command Injection (low, medium, high)
- DVWA-1.9系列操作之Command Injection
- DVWA系列(四)----Command Injection (命令行注入)
- DVWA笔记之二:Command Injection
- DVWA-1.9全级别教程之Command Injection
- Kali下利用XAMPP搭建DVWA及使用command injection
- DVWA SQL Injection
- DVWA-WooYun SQL Injection
- dvwa-SQL Injection
- dvwa-sql injection(blind)
- Command Injection
- DVWA - SQL Injection (Blind) (low)
- DVWA之Command Execution
- sqlmap dvwa SQL Injection使用小记
- SQL injection on DVWA (Low Level)
- SQL injection on DVWA (medium Level)
- 使用FreeMarker替换JSP的10个理由
- scrapy安装和简单使用
- Android酷炫的25种动画开源框架
- 移动app测试中出现bug漏测的原因分析
- 接口
- dvwa-command injection
- MySQL · 引擎特性 · InnoDB Buffer Pool
- Linux系统下安装rz/sz命令及使用说明
- 微信小程序cookie-session问题
- 波波炮轰帕楚利亚?勇士助教:你们也不干净!--- 这好像也是一个逻辑错误
- Javascript面向对象—继承
- FZU1404 Andy的作业
- Gradle文件配置(其它配置)
- 导致InvocationTargetException的常见原因