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

谁有网站推荐一下好昆明网站运营公司有哪些

谁有网站推荐一下好,昆明网站运营公司有哪些,科技之全球垄断,手机套 东莞网站建设在攻击中#xff0c;命令注入是比较常见的方式#xff0c;今天我们细说在软件开发中如何避免命令执行漏洞 我们通过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.1whoami 点击提交 这里返回是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.1whoami出现信息不返回的情况 执行127.0.0.1whoami信息还是可以返回说明命令执行漏洞还在 代码分析 ?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.1whoami出现信息不返回的情况说明符合的漏洞已经修复 执行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 ints 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 preERROR: You have entered an invalid IP./pre;} }// Generate Anti-CSRF token generateSessionToken();?
http://www.pierceye.com/news/413692/

相关文章:

  • 网站建设 管理正能量网站入口地址
  • 做网站没有创意Wordpress国际收款
  • 网站推广关键词工具wap网站分享到微信
  • 哪个网站可以给图片做链接做网站的公司在哪
  • 搬瓦工可以长期做网站广告制作开票大类是什么
  • 高级网站开发工信部小企业门户网站建设
  • 网站建站知识秦皇岛汽车网站制作
  • 建站之星极速版app开发需求
  • .net域名可以做银行网站吗做网站用模版
  • 嘉兴市平湖市建设局网站品牌设计公司 知乎
  • jfinal网站开发模板app开发网站
  • 成都和奇乐网站建设公司怎么样研发网站要多久
  • 蓬莱做网站北京宣传片
  • 网站建设 部署与发布wordpress多说插件
  • 池州做网站的公司哪里有网站开发技术
  • 网站建设内容策划外贸软件排行榜前十名
  • 微信官方网站公众平台郸城建设银行网站
  • .net 微信网站开发免费网站建设制作
  • 做网站需要啥备案之类的嘛传统的网站开发模式
  • 杭州网站seo优化最适合女生的专业排名
  • 广州市酒店网站设计交易平台网站怎么做
  • 江苏省示范校建设专题网站网站网页制作公司网站
  • 前海艾爻网站 建设磐安住房和城乡建设部网站
  • 网站程序h5电商seo是什么意思啊
  • 网站赚钱做跨境电商要什么费用
  • wordpress修改文件简单的seo网站优化排名
  • 专业网专业网站建设展示网站建设的ppt
  • 江淮网站开发商城网站 html模板
  • 上海网站制作电话淄博免费网站建设
  • 做动态在网站需要学什么宁波网站建设用什么软件