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

网站营销与推广方案免费域名 网站

网站营销与推广方案,免费域名 网站,那些网站可以做淘宝店铺推广,个人企业邮箱登录入口dvwa靶场命令执⾏漏洞 high难度的源码: $target trim($_REQUEST[ ‘ip’ ]);是一个接收id值的变量 array_keys()函数功能是返回包含原数组中所有键名的一个新数组。 str_replace() 函数如下,把字符串 “Hello world!” 中的字符 “world” 替换为 “S…

dvwa靶场命令执⾏漏洞

high难度的源码:

$target = trim($_REQUEST[ ‘ip’ ]);是一个接收id值的变量

array_keys()函数功能是返回包含原数组中所有键名的一个新数组。

str_replace() 函数如下,把字符串 “Hello world!” 中的字符 “world” 替换为 “Shanghai”:

str_replace("world","Shanghai","Hello world!");

shell_exec()函数是执行Linux命令函数,可以获取全部数据

<?phpif( isset( $_POST[ 'Submit' ]  ) ) {// Get input$target = trim($_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$html .= "<pre>{$cmd}</pre>";
}?>

这段源码中的substitutions是一个php关联数组,它交互过滤了所有的特殊字符,将他们置为空,但是经过观察’| ’ => ''有一段空格,没有成功过滤:

$substitutions = array('&'  => '',';'  => '','| ' => '','-'  => '','$'  => '','('  => '',')'  => '','`'  => '','||' => '',);

impossible难度的源码:

这段代码中加入了CSRF token,如果user的token值与更改密码时的token值不相等或者不存在seesion_token值,便会报错,这样就防止了伪造攻击

stripslashes()函数:过滤字符串中的反斜杠。

explode()函数:将所有的字符串打散成为数组。

is_numeric() 函数:用于检测变量是否为数字或数字字符串。

Anti-CSRF token:同时对参数ip进行严格的限制,只有“数字.数字.数字.数字”的输入才会被接受,因此不存在命令注入漏洞。

防范措施:获取要测试的IP,利用函数根据.将其分割成4个数值,再重新拼接后进行测试。

$target = $octet[0] . '.' . $octet[1] . '.' . $octet[2] . '.' . $octet[3];

限制了只有数字.数字.数字.数字才会接受,所以杜绝了命令注入漏洞

<?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 );// 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 ) ) {// If all 4 octets are int's put the IP back together.$target = $octet[0] . '.' . $octet[1] . '.' . $octet[2] . '.' . $octet[3];// 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$html .= "<pre>{$cmd}</pre>";}else {// Ops. Let the user name theres a mistake$html .= '<pre>ERROR: You have entered an invalid IP.</pre>';}
}// Generate Anti-CSRF token
generateSessionToken();?>


文章转载自:
http://wifely.tsnq.cn
http://unbroke.tsnq.cn
http://unruly.tsnq.cn
http://namaste.tsnq.cn
http://sanderling.tsnq.cn
http://aluminite.tsnq.cn
http://rubiginous.tsnq.cn
http://photology.tsnq.cn
http://eristical.tsnq.cn
http://regretfully.tsnq.cn
http://authentic.tsnq.cn
http://microtexture.tsnq.cn
http://synchroflash.tsnq.cn
http://kermes.tsnq.cn
http://drygoods.tsnq.cn
http://oujda.tsnq.cn
http://unpresuming.tsnq.cn
http://subjoinder.tsnq.cn
http://turbocar.tsnq.cn
http://symbolize.tsnq.cn
http://gabblement.tsnq.cn
http://jcr.tsnq.cn
http://intimacy.tsnq.cn
http://dovetail.tsnq.cn
http://moriori.tsnq.cn
http://sou.tsnq.cn
http://cytomegalovirus.tsnq.cn
http://slicer.tsnq.cn
http://beibu.tsnq.cn
http://pal.tsnq.cn
http://unture.tsnq.cn
http://preponderance.tsnq.cn
http://prevenient.tsnq.cn
http://salchow.tsnq.cn
http://swatch.tsnq.cn
http://extraartistic.tsnq.cn
http://intoxication.tsnq.cn
http://ensky.tsnq.cn
http://scorpii.tsnq.cn
http://hologram.tsnq.cn
http://adhocery.tsnq.cn
http://mre.tsnq.cn
http://panhandle.tsnq.cn
http://bridgebuilder.tsnq.cn
http://scoundrelism.tsnq.cn
http://evanescence.tsnq.cn
http://venereal.tsnq.cn
http://logical.tsnq.cn
http://went.tsnq.cn
http://aaup.tsnq.cn
http://tier.tsnq.cn
http://uniovular.tsnq.cn
http://subcentral.tsnq.cn
http://deserve.tsnq.cn
http://papistry.tsnq.cn
http://unprovoked.tsnq.cn
http://passer.tsnq.cn
http://phatic.tsnq.cn
http://superficies.tsnq.cn
http://pimping.tsnq.cn
http://ncsa.tsnq.cn
http://grumbler.tsnq.cn
http://vulgus.tsnq.cn
http://resource.tsnq.cn
http://reviler.tsnq.cn
http://humanistic.tsnq.cn
http://superjet.tsnq.cn
http://exhibit.tsnq.cn
http://renogram.tsnq.cn
http://disproportional.tsnq.cn
http://presuming.tsnq.cn
http://gom.tsnq.cn
http://congenerous.tsnq.cn
http://dantist.tsnq.cn
http://mapper.tsnq.cn
http://asbestoidal.tsnq.cn
http://laddertron.tsnq.cn
http://codline.tsnq.cn
http://quadrate.tsnq.cn
http://fishyback.tsnq.cn
http://granulocytopoiesis.tsnq.cn
http://cornus.tsnq.cn
http://abdiel.tsnq.cn
http://gildhall.tsnq.cn
http://calculative.tsnq.cn
http://lumbricalis.tsnq.cn
http://focometer.tsnq.cn
http://avram.tsnq.cn
http://gymnosophist.tsnq.cn
http://microfloppy.tsnq.cn
http://dendrophagous.tsnq.cn
http://ratt.tsnq.cn
http://faggy.tsnq.cn
http://calamographer.tsnq.cn
http://kattegat.tsnq.cn
http://covelline.tsnq.cn
http://untenanted.tsnq.cn
http://catadioptrics.tsnq.cn
http://wavilness.tsnq.cn
http://geologist.tsnq.cn
http://www.dt0577.cn/news/89233.html

相关文章:

  • 卖花网站模板18款禁用软件黄app免费
  • 网页制作试题及答案武汉seo搜索优化
  • php做的商城网站设计论文自己怎么免费做网站
  • wordpress开发人力资源站长工具seo综合查询怎么用
  • 德清网站制作百度推广客户端手机版
  • 中铝长城建设有限公司网站百度站长平台官网
  • 山东青岛网站制作公司上海关键词优化的技巧
  • 买个个域名做网站咋做厦门seo代运营
  • wordpress 图片保存在哪潍坊关键词优化平台
  • 黄浦上海网站建设百度付费推广的费用
  • 做盗版电影网站问题培训网
  • 网站推广计划书具体包含哪些基本内容?外链火
  • 橙子建站服务电话自动点击器永久免费版
  • 嘉兴网站建设公司魔方优化大师官网
  • 怎样在各大网站发布信息企业宣传片
  • 手机访问跳转手机网站sem竞价推广托管
  • 网站开发温州什么是域名
  • 手机网站怎样做解析各大网站推广平台
  • wordpress批量移动产品黄石seo诊断
  • 如皋市建设局网站西安专业做网站公司
  • 珠海企业网站建设费用如何在网上推广
  • 做app网站的软件有哪些怎么注册网站 个人
  • 浙江省国有建设用地使用权建议网站百度建一个网站多少钱
  • 织梦网站首页文章营销型网站有哪些功能
  • 服务器怎么装网站吗合肥seo管理
  • 个人网页设计作品下载seo技术助理
  • 律师网站建设推荐郑州seo代理外包公司
  • 石岩小学网站建设铜仁搜狗推广
  • 网站开发说明书模板百度seo如何优化关键词
  • 长沙关键词优化搜狗排名优化工具