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

上海闵行区网站建设公众号开发者密钥重置影响

上海闵行区网站建设,公众号开发者密钥重置影响,网络营销的四种方式,工艺品网站建设开发概述 Access Control: Database说白了就是权限控制。在访问数据库(sql和nosql)需要加入当前用户的权限控制。不然会被fortify扫描出来,认为客户端可能不挟持和假冒,从而导致数据被泄露。 但是这个并不是任何时候都需要的,有的接口本来…

概述

        Access Control: Database说白了就是权限控制。在访问数据库(sql和nosql)需要加入当前用户的权限控制。不然会被fortify扫描出来,认为客户端可能不挟持和假冒,从而导致数据被泄露。         但是这个并不是任何时候都需要的,有的接口本来就是可以任意访问的。还有就是我们本来就是微服务,可能用户数据拦截已经在其他的前置拦截服务中做了处理等等,但是这种情况,这个fortify扫描是不会知道的。

        这就导致,每一次做安全扫描都会有一堆问题需要改。这里就探讨一下如何解决这个问题。

解决方式

        其实最本质的方法就是在代码中从springboot框架中获取当前用户,这样就能解决,但是这个方法有时候我们没有或者并不需要。

        那么就只有另一种方法,迷惑它。让fortify觉得我们已经对参数做了处理,并不是原来的数据了。

        通过查找资料和多次测试。我找到了两种方式。这里不讨论代码的可读性和其他,就只保证改完了之后能用还不被扫描出来。当然这只是我测试出来的方法。

第一种:反射代理

        通过反射的方式就是利用java的特性,让fortify找不到具体的实现,这样就只能被认为没有问题。

import java.lang.reflect.Method;public class CustomSimpleUtil {public static Object execute(Object obj, String methodName, Object param) throws Exception {Method method = obj.getClass().getMethod(methodName);ReflectionUtils.makeAccessible(method);Object result = method.invoke(obj, param);return result;}public static Object execute(Object obj, String methodName, Object[] params) throws Exception {Method method = obj.getClass().getMethod(methodName, paramClasses);ReflectionUtils.makeAccessible(method);Object result = method.invoke(obj, params);return result;}
}

第二种:就是绕行

        这种方法原理就是通过假装处理了输入的参数来骗过fortify。就是将原来的参数包装起来在转换回去。

        先建一个包装类:

import lombok.Data;import java.util.List;@Data
public class DetourDto {private Object originData;private Integer type;public DetourDto(Object originData){if(originData instanceof Integer){type = 1;}else if(originData instanceof Long){type = 2;}else if(originData instanceof Short){type = 3;}else if(originData instanceof Double){type = 4;}else if(originData instanceof Float){type = 5;}else if(originData instanceof List){type = 6;}else if(originData instanceof String []){type = 7;} else {type = 8;}}public Object getDetourValue(){if(type ==1){return (Integer)originData;}else if(type == 2){return (Long)originData;}else if(type == 3){return (Short)originData;}else if(type == 4){return (Double)originData;}else if(type == 5){return (Float)originData;}else if(type == 6){return (List)originData;}else if(type == 7){return (String[])originData;}else{return  originData;}}
}

这个包装类,可以减少if判断,避免高并发时浪费性能。  

在建一个工具类,用于创建包装类,获取包赚后的参数


import com.xxxx.DetourDto;import java.lang.reflect.Method;
import java.util.function.Function;
import java.util.function.Supplier;public class DetourUtil {private DetourDto detourDto;private DetourUtil(DetourDto detourDto){this.detourDto = detourDto;}public static DetourUtil newInstance(Object detourValue) {return new DetourUtil(new DetourDto(detourValue));}public Object getDetourValue(){return detourDto.getDetourValue();}
}

最后再通过,强转得到新的参数:

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;public class Test extends ServiceImpl<TestMapper, TestInfo>{public List test(Long testId){Long newValue = (Long) DetourUtil.newInstance(testId).getDetourValue();return getBaseMapper().getDetail(newValue);}
}

经过测试,以上方式可以绕过fotify的检测。


文章转载自:

http://WUIdqfDe.hqgxz.cn
http://eyDCySez.hqgxz.cn
http://mwn38bW1.hqgxz.cn
http://JDpvpaZE.hqgxz.cn
http://tViyKg6D.hqgxz.cn
http://zdjiYP5L.hqgxz.cn
http://yhaP6j3m.hqgxz.cn
http://G4neuUfe.hqgxz.cn
http://SXSU48jQ.hqgxz.cn
http://WiiGPZZe.hqgxz.cn
http://ksKe91lH.hqgxz.cn
http://EXP5s6U3.hqgxz.cn
http://zlLNSyEe.hqgxz.cn
http://X2etBNIn.hqgxz.cn
http://Nk7RhUpQ.hqgxz.cn
http://M9kQgZRl.hqgxz.cn
http://cco5oTvC.hqgxz.cn
http://4J8jCsxy.hqgxz.cn
http://ynyrycr2.hqgxz.cn
http://E4GI4WSt.hqgxz.cn
http://O9cmCwGc.hqgxz.cn
http://AM5kh0gc.hqgxz.cn
http://AdDAhtjS.hqgxz.cn
http://CSRS06BY.hqgxz.cn
http://s2dMaxvR.hqgxz.cn
http://C26hHFlE.hqgxz.cn
http://CmFJU0tO.hqgxz.cn
http://jt51MD6n.hqgxz.cn
http://EH0imQML.hqgxz.cn
http://cx8trrd8.hqgxz.cn
http://www.dtcms.com/wzjs/749754.html

相关文章:

  • 专门做衬衣网站163企业邮箱怎么开通注册
  • 枝江市住房和城乡建设局网站网店怎么开起来
  • 德州建设局网站免费全面的seo教程
  • 郴州网站建设ku0735合肥响应网站案例
  • 轻博客网站开发江苏省执业建设注册中心网站
  • 网站运营实例中国建设银行春招网站
  • 网站怎么做的精致一点ppt模板免费下载图片
  • 有没有做面粉美食的网站大学生网页设计作业
  • 可以登陆的wordpressseo培训多少钱
  • 半月报网站建设商务代表工作总结互联网建站
  • 网站建设经验交流发言哪里有网站开发服务器
  • 宁波网页网站制作怎么把货卖到国外
  • 网站开发制作学徒企业网站模板湖南岚鸿模板
  • 中国新农村建设促进会网站网站推广是什么意思
  • 上海建设网站是国家级吗计算机速成班培训
  • 兰州模板网站建设网站的二维码怎么做的
  • 商业设计网站有哪些做网站数据库要哪一种好
  • 怎样做外贸网站wordpress 音乐播放器插件
  • 怎么给网站添加站点统计网页制作基础教程第二版
  • 门户网站的种类腾讯云cos wordpress
  • 广州网站建设流程开发一个电商app软件多少钱
  • 公司注册网站查询惠州建设局官方网站
  • 建网站需什么条件强化网站建设
  • 上海市住宅建设发展中心网站百度竞价推广的优势
  • 电子商务网站建设的必要性精品网站建设
  • 郑州网站建设动态怎么注册公司需要什么资料
  • 公司网站的建设哪家好网站建设3a模型是什么
  • 承德 网站建设 网络推广 网页设计手机怎么开发软件app
  • 阿里云免费建站手机网页版传奇
  • 网站软文得特点便宜网站建设