Java alignment changes a target: Flaw epidemic survey, how to permeate and detect completely

Overview

Java alignment changes a target (Java Serialization Object, JSO) it is the mechanism that undertakes between different Java program data is exchanged in Java language, be changed through alignment and restore Java to carry out the object of voice instead, JSO brings huge to go to the lavatory to Java development, but also be a huge safety hidden danger at the same time. JSO offerred a stable and reliable carrier to aggressor, will realize the attack to Java APP and long-range control. In recent years of JSO turn over alignment to change flaw to emerge in endlessly, the attack that is aimed at JSO is increasing also. For instance Stuts 2 of famous Java frame, basically became a bolt, a head revealed a few safe flaw, it is to turn over alignment to convert hole more very among them. Near future of famous and safe Rapid7 released the near future a safe research report about JSO, discussed the safe issue of concerned JSO, turn over alignment to change the effect of flaw, JSO flaw popularity is spent, and the loophole that how uses Metasploit frame test and verify and test JSO to concern. Bug bug guides everybody to study this next safe reports together today. List above all show real data about JSO:

Mixed 2017 two years relevant flaw CVE was increasing a cent admeasure JSO substantially 2018. Inside two years fair increased probably 100, and before this came 2013 there also are 7 merely inside 4 years 2016.

The applied process that is based on JSO can be visited remotely through Internet normally. The statistic of scanning of Rapid7 Sonar safety in January 2019 (the T3 agreement that is based on JSO) show the WebLogic server that 11831 can be visited through Internet.

The use of JSO and abuse

Although be opposite,the attack defence of JSO flaw has been mixed for broad developer safe personnel is hep. But about JSO and the leak that cause as a result of JSO abuse a lot of people do not understand. So we explain above all:

About JSO

JSO allows Java to serve to leave mutual communication in the circumstance of the structure that did not define strictly. It provided a kind of means that goes to the lavatory neatly to data is exchanged between Java service, use file is normally abiding to Java object change and join through the network. Send just hand data byte code, include data structure and data type (alignment changes object JSO) , and receive debit to change a target through accepting alignment, combat its the Java boy or girl friend in memory of alignment melt into, when this process can run Java, condition and data implementation lie between empty move. JSO withholds type information and data together, use at transmitting complex Java object, and won't worry about too much its content. For example, a component of Java application process is likely compose established target of " of client of a " , include " of full name of such as " among them, "Sexual " the field that wait, include integer even model the element such as " of " consumption amount. Include a few integer and string. If package can be only, targets of these " client " caboodle reachs one case, interface does not need to know or care the actual content in object of " client " so. Need to alignment is changed and turn over its alignment to change only, need not take no account of its content, other give dispatcher and receiver are.

JSO abuse

However, be no good so. The object byte code that turns over alignment to change a process to may be received changes the string that defines for a few good kinds and integer, but if incorrect its have serious desired result, can introduce safe flaw very easily, aggressor is OK pilot course, baleful code and instruction increase to realize attack thereby before turning over alignment to change. In fact, the receiver of a lot of programs did not change byte code to undertake test and verify to the series that receive, so can compose is built from definition JSO and long-range code carries out infuse (RCE) send its turn over alignment to change interface to carry out, should turn over alignment to change be without test and verify to carry out turn over alignment to change a process to moment can introduce a "Web Shell" or carry out a few baleful script on long-range server.

JSO processing is blended in as Java standard module normally in the product, should revise its to these products this communication means normally very difficult, the rehabilitate that turns over filling alignment to convert hole so is very troublesome, the effect that cause is very big also.

The security that brings from this to alleviate is minatory, the supplier can pass the blacklist that has specific aim normally, prevent to use the RCE that specific library may bring about through blacklist, is not to undertake more comprehensive repair flaw, redesign the interface that has flaw input. So, introduce the library of attack with certain likelihood through banning when development staff, solved the fit of flaw temporarily, but the JSO communication flaw that has a problem still exists, when a new 0 Day erupts, this became a bomb.

Java alignment changes a target: Flaw epidemic survey, how to permeate and detect completely

Once aggressor identifying gives another library that possesses similar function, OK and fast and goofy the charge that change this new library. For instance such tool can use the Ysoserial of Chris Frohoff the library compose of aleatoric amount builds a JSO, will carry pouch outfit effectively to be in one of a few JSO are medium. These tools simplified greatly flaw demonstrates and the flaw related JSO checks. This is meant, the method that adopts kind of library blacklist to solve flaw only is the strategy that disables temporarily.

Java alignment changes a target: Flaw epidemic survey, how to permeate and detect completely

JSO relevant flaw (CWE-502) epidemic survey

Java turns over alignment to change charge not fresh, but aggressor discovers this kind of flaw is used increasingly will be jumped over more simple. Turn over alignment to changed flaw to become the ace that aggressor likes most, still can long use do not decline.

Distributinging statistic of CVSS year after yearJava alignment changes a target: Flaw epidemic survey, how to permeate and detect completely

CWE-502 is classification of MITRE general blemish (Common Weakness Enumeration) JSO special identifier, with will dog not to suffer trustful data to undertake alignment is changed turning over (Java or OO language language) the leak that cause. In 5 years of in the past, we see be based on the CVE that turns over alignment to change to increase quickly, include those CVSS mark prep above the tall danger flaw of 7:

Java alignment changes a target: Flaw epidemic survey, how to permeate and detect completely

These CVE in the masses software product that consist in uses extensively, for instance Oracle WebLogic, IBM WebSphere, cisco safety visits control system (ACS) , HPE intelligence management center (IMC) in the VSphere Integrated Containers with VMware.

All sorts of common flaw in can using Metasploit Framework use aggressor the without identity test and verify RCE that will get these products, can use MF module to include:

Java alignment changes a target: Flaw epidemic survey, how to permeate and detect completely

WebLogic T3 deploy is investigated

Because the flaw of the report involves agreement of Oracle WebLogic T3 recently. WebLogic itself uses all sorts of agreements besides T3 to have communication, but it and differ in a lot of other products that give port to go up to use a kind of agreement only and service. For example, the acquiescent configuration of WebLogic example offerred 7001/TCP of an acquiescent end points, it uses a few kinds of different agreements, include T3, HTTP, SNMP and LDAP.

Rapid7 uses its Project Sonar to scanned exposed in January 2019 in server of the WebLogic on public network.

Java alignment changes a target: Flaw epidemic survey, how to permeate and detect completely

Project Sonar is Rapid7 2013 year a when will initiate in September public safety analyses a project, the analysis that aims to carry activities of pair of public network network will enhance security. How be to understand WebLogic morely the open degree of public network, rapid7 used Sonar HTTP and the data that collect what HTTPS studies partly, these research scan every week about a few port. Answer a service to be responded to in order to get most WebLogic example through checking more than 120 million HTTP. The result shows the TCP port that 18693 IPv4 address opened 67 to differ, these port show for WebLogic. The result still shows, the port with the commonnest and open WebLogic is 80 (HTTP, occupy 44% ) and 7001 (acquiescent port, occupy 36% ) .

Java alignment changes a target: Flaw epidemic survey, how to permeate and detect completely

The WebLogic server on communal Internet monitors TCP port to may have 443, 80, 7001, 8001 with 8002. Through scanning to these port, send a statement, accept relevant statement to be able to identify T3 agreement with more accurate ground.

Material statement negotiates a message to send the T3 of a 23 byte:

T3 9.2.0.0nAS:2048nHL:19nn

String "t3" sponsors T3 agreement. '9.2.0.0' is our client carries WebLogic version Banner, the server needs to use it to decide compatibility. 'AS' and 'HL' parameter control size of JVM message head and near table bulk respectively, its are worth the acquiesce that the basis observes to be worth a setting.

Solid test and verify is solid, t3 end points uses similar message to answer, this message described the result that T3 negotiates, cent is two groups:

1. affirms the T3 end points that T3 negotiates successfully. From this, we can identify a server to open WebLogic.

2. affirms T3 end points, among them T3 is abortive as a result of join filter or similar restriction talk things over, the wrong configuration of certain perhaps type (allow problem and WebLogic version for example incompatible) with the condition with probable etc.

The examination comes these common WebLogic port that already identified before: 80, 443, 7001, 8001 with 8002.

The result shows the response of end points of more than 87 million IPv4, affirmatory among them 11831 affirm the system that ran WebLogic. The estimation cost that HTTP is based on before this compares us is low 35% , this differentia different has a few kinds of possible reasons, the likelihood scans as a result of average Internet scale moment network is fluctuant, or these WebLogic example deploy HTTP shield clearly T3 information. Further analysis shows 1183 servers gave negative feedback to T3 detector, because T3 undertook limitative to detector,the likelihood is.

On the 7001/TCP of acquiescent port port that uses in WebLogic, 4577 feedbacked is T3. This is compared in front be based on HTTP estimated 3439 should little. Likelihood the reason is the WebLogic example on 7001/TCP, feedbacked only T3 information, it is HTTP without demonstrate.

Port 8001/TCP also is WebLogic acquiescent installation the reserving that when can be not used in 7001/TCP or installing additional example, uses port. We have the leader that 1157 feedback are T3 on 8001/TCP. Port 8002 be WebLogic not the stage replaces port commonly usedly, it shows have probably system of 300 many WebLogic.

The HTTP in acquiesce and HTTPS port (80 and 443) go up, have respectively 5672 with 1133 IPv4 terminal, be affirmed to enable but T3 agreement.

Already affirmed cloth shows so that the WebLogic version of all T3 terminal divides involve all sorts of version: Include from 7.0.1.0 (released 2002) to 12.2.1.3 newest version (at the beginning of 2019) :

Java alignment changes a target: Flaw epidemic survey, how to permeate and detect completely

The one part that Sonar Endpoint studies, still included what IP puts in apanage 's charge to distributing relevant metadata, include but IP attributive organization and position are detailed information, for instance the country is mixed city. The IP in all T3 result puts in the statistical data of apanage 's charge to show:

The IP that those who exceed 25% expose T3 by Oracle all, webLogic issues trade, the others is had by all sorts of cloud providers for the most part.

All IP are attributive in exceed 36% to be the United States, 32% it is China, other country and area:

Java alignment changes a target: Flaw epidemic survey, how to permeate and detect completely

Distributing 10 most countries are:

10 organizations with maximum amount are:

Sink a test to the service of JSO

Serve to the WebLogic flaw that can visit remotely, can use many module of Metasploit to undertake osmotic a test. Use a hand to use a test first, can use the tool fixed position such as Burp Suite or Ysoserial to get the service of attack easily next.

For example, obtain the RCE without identity test and verify easily to the aggressor of problem WebLogic server can pass Metasploit:

Java alignment changes a target: Flaw epidemic survey, how to permeate and detect completely

More the attack with accurate essence passes website navigation or use Java application program, what at the same time monitoring network discharge is based on JSO with obtaining is interactive evidence. To including T3 mark head (or 0xACED Magic byte) the existence of the service that the simple search of discharge can show to use JSO has communication:

Java alignment changes a target: Flaw epidemic survey, how to permeate and detect completely

JSO flaw monitoring

Defence person the JSO in can checking its network depends on a service, pay close attention to those who be aimed at public network to be able to visit a service particularly. For example, examination or surveillance are foregone and serious the HTTP of the service that depends on JSO is heading. In addition, the network scanning tool such as use Nmap, they are compositive the foot identifies the T3 agreement that is based on JSO originally. Finally, monitoring uses Metasploit Framework to be opposite foregone suffer attack service easily to have real test.

Undertake passive monitoring to JSO

Continuously monitoring and answer these flaw the meeting is very drab. For beforehand defence this kind of flaw, active defence person can search the agreement that has a problem and the dactylogram that atttack in the light of this and file label. Because JSO has the structure of specific definition, because this is OK,its mark string is examined in file and network discharge. Must indicating apparently most is the alignment of " of " magic byte of JSO begin. For example, the mode in surveillant HTTP parameter and binary agreement is very useful:

Ac Ed is the alignment of " of " magic byte of label JSO is hexadecimal express.

The commonly used version that Ac Ed 00 05 expresses to Java alignment changes a pattern 5.

%C2%AC%C3%AD%00%05 and above same, nevertheless the format is URI to code.

RO0AB and above same, the format is Base64 encode.

What need makes clear is, these mode both neither are JSO must, also not be JSO is particular. Need further analysis to them, the aggressor that because they predict this,authority visits this file or network to flow can JSO of infuse ill will.

If these mode are considered as the service of JSO truly,using, need to monitor closely they, undertake to them sandbox is changed in order to reduce potential harm, perhaps undertake discussion study with the supplier, whether had used the leaky warehouse that can be used in order to understand them to exceed.

To the active scanning that JSO serves

A lot of services that are based on Web are in HTTP is heading medium or answer version string is included inside main body, allow administrator and aggressor to identify the software name that answers Web plea and version. To Oracle WebLogic, HTML answers include the following string:

Java alignment changes a target: Flaw epidemic survey, how to permeate and detect completely

Port scanning tool (like Nmap) can monitor afore-mentioned string, use T3 agreement and lead plane to talk things over next, in order to collect the more information about server version and condition.

Java alignment changes a target: Flaw epidemic survey, how to permeate and detect completely

Finally, oracle WebLogic and other the service that depends on JSO has a few common flaw. This kind of a lot of hole are included in Metasploit and can update ceaselessly.

Conclusion

The without identity test and verify RCE in the service to be based on Java kind attack, JSO is a kind of more and more reliable method. NIST CVE announcement and this kind of open flaw had 3 years in the past substantially increase. Because Java is right,the inherent accredit that file and network shed caused the potential defect of JSO relevant function, accordingly all sorts of software products that are based on Java are turned over alignment to change charge very easily. The research of Rapid7 makes clear, these products can be more very on Internet open visit, and often accept an user provide data, and not any special filter.

Undertake besides the lead plane to depending on Java and service flaw is repaired persistent with monitoring besides, defence person the sign one's name that still can consider to be the existence in JSO general affairs adds monitoring, can use the communication that is based on JSO to distinguish a service actively already, also can identify a needle to change the charge of flaw to turning over alignment.

未经允许不得转载:News » Java alignment changes a target: Flaw epidemic survey, how to permeate and detect completely