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

做网站工作图淘宝seo是指什么

做网站工作图,淘宝seo是指什么,福田庆三案例照,七牛云使用wordpress在攻击中,命令注入是比较常见的方式,今天我们细说在软件开发中如何避免命令执行漏洞 我们通过DVWA中不同的安全等级来细说命令执行漏洞 1、先调整DVWA的安全等级为Lower,调整等级在DVWA Security页面调整 2、在Command Injection页面输入127.0.0.1&…

在攻击中,命令注入是比较常见的方式,今天我们细说在软件开发中如何避免命令执行漏洞

我们通过DVWA中不同的安全等级来细说命令执行漏洞

1、先调整DVWA的安全等级为Lower,调整等级在DVWA Security页面调整

2、在Command Injection页面输入127.0.0.1&whoami 点击提交

这里返回是ping Ip的响应时间和当前登录系统的用户,说明后面的whoami命令已经执行了,这样就是存在命令执行漏洞,我们看看这个地方源码是怎么写的,

我们点击View Source,获取源代码,进行代码分析

代码分析:

<?phpif( isset( $_POST[ 'Submit' ]  ) ) {// Get input$target = $_REQUEST[ 'ip' ];// 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 );//shell_exec通过shell环境执行命令,并且将完整的输出以字符串的方式返回}// Feedback for the end userecho "<pre>{$cmd}</pre>";
}?>

3、在DVWA Security页面将安全等级调整为Medium ,我们在执行命令

执行127.0.0.1&&whoami出现信息不返回的情况

执行127.0.0.1&whoami信息还是可以返回,说明命令执行漏洞还在

代码分析:

<?phpif( isset( $_POST[ 'Submit' ]  ) ) {// Get input$target = $_REQUEST[ 'ip' ];// Set blacklist$substitutions = array('&&' => '',';'  => '',//这里只是将 && 和;这2种字符进行了删除);// Remove any of the characters 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 );//shell_exec通过shell环境执行命令,并且将完整的输出以字符串的方式返回}else {// *nix$cmd = shell_exec( 'ping  -c 4 ' . $target );}// Feedback for the end userecho "<pre>{$cmd}</pre>";
}?>

4、在DVWA Security页面将安全等级调整为High  ,我们在执行命令

执行127.0.0.1&whoami出现信息不返回的情况,说明&符合的漏洞已经修复

执行127.0.0.1|whoami信息还是可以返回,说明命令执行漏洞还在

代码分析:

<?phpif( isset( $_POST[ 'Submit' ]  ) ) {// Get input$target = trim($_REQUEST[ 'ip' ]);// Set blacklist$substitutions = array('&'  => '',';'  => '','| ' => '','-'  => '','$'  => '','('  => '',')'  => '','`'  => '','||' => '',//这里只是将上面9中字符进行拦截和删除。删除命令中的"| " 不是"|",多一个空格);// Remove any of the characters 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 );//shell_exec通过shell环境执行命令,并且将完整的输出以字符串的方式返回}else {// *nix$cmd = shell_exec( 'ping  -c 4 ' . $target );}// Feedback for the end userecho "<pre>{$cmd}</pre>";
}?>

5、在DVWA Security页面将安全等级调整为Impossible ,我们在执行命令

执行127.0.0.1|whoami将会被拦截。

代码分析:

<?phpif( isset( $_POST[ 'Submit' ]  ) ) {// Check Anti-CSRF tokencheckToken( $_REQUEST[ 'user_token' ], $_SESSION[ 'session_token' ], 'index.php' );// Get input$target = $_REQUEST[ 'ip' ];$target = stripslashes( $target );//去除用户输入的\,防止转移// Split the IP into 4 octects$octet = explode( ".", $target );//把用户输入的数据根据.进行分开,比如127.0.0.1会分开成127 0 0 1// Check IF each octet is an integerif( ( is_numeric( $octet[0] ) ) && ( is_numeric( $octet[1] ) ) && ( is_numeric( $octet[2] ) ) && ( is_numeric( $octet[3] ) ) && ( sizeof( $octet ) == 4 ) ) {//分别判断分开的4个部分是不是数字,如果有不是数字的直接不允许访问// If all 4 octets are int's put the IP back together.$target = $octet[0] . '.' . $octet[1] . '.' . $octet[2] . '.' . $octet[3];//把验证完是数字的4部分在用.拼接起来// 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 userecho "<pre>{$cmd}</pre>";}else {// Ops. Let the user name theres a mistakeecho '<pre>ERROR: You have entered an invalid IP.</pre>';}
}// Generate Anti-CSRF token
generateSessionToken();?>

http://www.ds6.com.cn/news/111468.html

相关文章:

  • 中山网站制作定制百度推广代理加盟
  • 杭州营销型网站建设厦门人才网唯一官方网站
  • 邯郸房产网站广告接单平台有哪些
  • 网站导航条做多高国家职业技能培训学校
  • 营销型网站设计公司四川省人民政府
  • 深圳高端网站建设模版广告公司推广渠道
  • 织梦小说网站模板下载软文推广新闻发布
  • wordpress主题可以更改主页布局杭州seo按天计费
  • w3c网站怎么做网络做推广公司
  • 社团的工商年检网站在哪里做网络推广有前途吗
  • 织梦高端html5网站建设工作室网络公司网站模板长沙专业网络推广公司
  • 做网站许昌怎么在百度上添加自己的店铺地址
  • 专门做网站的公司微信营销平台有哪些
  • 德阳企业品牌网站建设永久免费客服系统
  • 西安优惠电商平台网站武汉百度seo排名
  • 律所网站建设方案书怎么写百度浏览器下载安装2023版本
  • 浙江省建设厅官方网站站长工具官网域名查询
  • 模具厂咋做网站怎样加入网络营销公司
  • 简历上作品展示网站链接怎么做百度sem代运营
  • 域名和网站名要一样吗关键词优化推广公司哪家好
  • 相册网站怎么做的关键词三年级
  • 广东机械加工厂百度关键词搜索引擎排名优化
  • 免费建微网站平台百度推广平台
  • 品牌网站制作网站公司昆明网络推广方式有哪些
  • 专做批发的网站电子软文文章
  • 广州制作外贸网站公司色盲测试图及答案大全
  • 太原企业网站制作高端网站建设公司排行
  • php网站开发cms广东省人大常委会
  • wordpress mate西安seo服务外包
  • java做网站的要求免费seo排名网站