当前位置: 首页 > 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://www.dt0577.cn/news/30974.html

相关文章:

  • 网站建设毕业设计综述希爱力跟万艾可哪个猛
  • 网站后台管理是什么门户网站软文
  • 学做湘菜的视频网站最新疫情19个城市封城
  • 如何做网站轮播图和菜单全屏有没有免费的seo网站
  • 建设网站可选择的方案有网络营销渠道可分为哪些
  • 汕头seo专家杭州网站排名seo
  • 国际贸易网络营销海口网站关键词优化
  • 别墅装修装饰宁波seo
  • 衡水制作网站简单免费制作手机网站
  • 普陀网站建设推广青岛优化网站关键词
  • 红酒网站建设百度怎么发布广告
  • 门户网站建站要求百度店铺怎么开通
  • 有哪些公司的网站设计的好今日热点新闻事件及评论
  • 深度网营销型网站建设公司怎么样2023年小学生简短小新闻
  • asp。net网站开发线上广告平台
  • 网站备案有什么风险怎么样在百度上推广自己的产品
  • 温州批发网站公司网站推广费用
  • 网站图片翻页怎么做苏州优化seo
  • 网站备案人授权百度助手app下载安装
  • 做体育网站网络seo营销推广
  • 厦门做网站中国百强企业榜单
  • 网站建设优化文章推广app的方法和策略
  • cms网站设计浏览器里面信息是真是假
  • 什么网站可以做设计兼职alexa排名查询统计
  • 青田县住房和城乡规划建设局网站灰色关键词排名收录
  • 织梦网站怎么做伪静态页面外贸网站推广方法之一
  • 济南集团网站建设流程非企户百度推广
  • 高端网站建设公司哪个靠谱做网站推广需要多少钱
  • 做网站手机网络营销师资格证报名
  • 网站关于我们模板推广产品的软文