Hacking Articles Tips Tricks Videos Tutorials
468 subscribers
65.9K photos
15 videos
157 files
132K links
Exploit
Pentesting
Hacking
Red Team
Blue Team
Kali Linux
Bug Bounty
Black Hat
Cyber security etc

@Hacking_Video
@Hacking_attack
Download Telegram
public void rebind(java.lang.String $param_String_1, java.rmi.Remote $param_Remote_2): rebind() replaces the binding of the passed name with the supplied remote reference, also returns void, Ermir returns an exception just like bind(). public void unbind(java.lang.String $param_String_1): unbind() unbinds a remote object by name in the RMI registry, this one also returns void. PoC

___________________________
@hacking_Attack
@Hacking_Video
Contributing Bug reports and pull requests are welcome on GitHub at https://github.com/hakivvi/ermir. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct (https://github.com/hakivvi/ermir/blob/main/CODE_OF_CONDUCT.md). License The gem is available as open source under the terms of the MIT License (https://opensource.org/licenses/MIT). Code of Conduct Everyone interacting in the Ermir project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct (https://github.com/hakivvi/ermir/blob/main/CODE_OF_CONDUCT.md).

Download Ermir (https://github.com/hakivvi/ermir)

___________________________
@hacking_Attack
@Hacking_Video
Hacking Articles Tips Tricks Videos Tutorials
Photo
KitPloit - PenTest Tools!
Ermir - An Evil Java RMI Registry

https://blogger.googleusercontent.com/img/a/AVvXsEi5M-qQI0jAEcuuEEaopyFsMT-DMUz_w8NCvWLibYBeKWmHqfFEISZ1QrpwKYbDsj9O2cETouE06Wb9Wr-l92evRmVVr7m8-WuwFUlIBfB8fut9CBzNd8O1_MtnY6KP74dSl93h-wphZJe1kp9PnDkcAhekIREIf6gWToGMGaZR0NCPtqsuSCMOZZKSug=w640-h310 Ermir is an Evil/Rogue RMI Registry, it exploits unsecure deserialization on any Java code calling standard RMI methods on it (list()/lookup()/bind()/rebind()/unbind()). Requirements* Ruby v3 or newer. InstallationInstall Ermir from rubygems.org: $ gem install ermir or clone the repo and build the gem: $ git clone https://github.com/hakivvi/ermir.git
$ rake install
UsageErmir is a cli gem, it comes with 2 cli files ermirand gadgetmarshal, ermiris the actual gem and the latter is just a pretty interface to GadgetMarshaller.java file which rewrites the gadgets of Ysoserial to match MarshalInputStreamrequirements, the output should be then piped into ermiror a file, in case of custom gadgets use MarshalOutputStreaminstead of ObjectOutputStreamto write your serialized object to the output stream. ermirusage:

RMI Registry which exploits unsecure Java deserialization on any Java code calling standard RMI methods on it. Usage: ermir [options] -l, --listen bind the RMI Registry to this ip and port (default: 0.0.0.0:1099). -f, --file path to file containing the gadget to be deserialized. -p, --pipe read the serialized gadget from the standard input stream. -v, --version print Ermir version. -h, --help print options help. Example: $ gadgetmarshal /path/to/ysoserial.jar Groovy1 calc.exe | ermir --listen 127.0.0.1:1099 --pipe" dir="auto">➜ ~ ermir
Ermir by @hakivvi * https://github.com/hakivvi/ermir.
Info:
Ermir is a Rogue/Evil RMI Registry which exploits unsecure Java deserialization on any Java code calling standard RMI methods on it.
Usage: ermir [options]
-l, --listen bind the RMI Registry to this ip and port (default: 0.0.0.0:1099).
-f, --file path to file containing the gadget to be deserialized.
-p, --pipe read the serialized gadget from the standard input stream.
-v, --version print Ermir version.
-h, --help print options help.
Example:
$ gadgetmarshal /path/to/ysoserial.jar Groovy1 calc.exe | ermir --listen 127.0.0.1:1099 --pipe
gadgetmarshalusage: ➜ ~ gadgetmarshal
Usage: gadgetmarshal /path/to/ysoserial.jar Gadget1 cmd (optional)/path/to/output/file
How does it work?java.rmi.registry.Registryoffers 5 methods: list(), lookup(), bind(), rebind(), unbind():

* public Remote lookup(String name): lookup() searches for a bound object in the registry by its name, the registry returns a Remoteobject which references the remote object that was looked up, the returned object is read using MarshalInputStream.readObject()which is just another layer on top of ObjectInputStream, basically it excpects after each class/proxy descriptor (TC_CLASSDESC/TC_PROXYCLASSDESC) an URL that will be used to load this class or proxy class. this is the same wild bug that was fixed in jdk7u21. (Ermir does not specify this URL as only old Java version are vulnerable, instead it just write null). as Ysoserial gadgets are being serialized using ObjectOutputStream, Ermir uses gadgetmarshal-a wrapper around GadgetMarshaller.java- to serialize the specified gagdet to match MarshalInputStreamrequirements. https://blogger.googleusercontent.com/img/a/AVvXsEi5M-qQI0jAEcuuEEaopyFsMT-DMUz_w8NCvWL[...]

___________________________
@hacking_Attack
@Hacking_Video
Hacking Articles Tips Tricks Videos Tutorials
KitPloit - PenTest Tools! Ermir - An Evil Java RMI Registry https://blogger.googleusercontent.com/img/a/AVvXsEi5M-qQI0jAEcuuEEaopyFsMT-DMUz_w8NCvWLibYBeKWmHqfFEISZ1QrpwKYbDsj9O2cETouE06Wb9Wr-l92evRmVVr7m8-WuwFUlIBfB8fut9CBzNd8O1_MtnY6KP74dSl93h-wphZJe1kp…
ibYBeKWmHqfFEISZ1QrpwKYbDsj9O2cETouE06Wb9Wr-l92evRmVVr7m8-WuwFUlIBfB8fut9CBzNd8O1_MtnY6KP74dSl93h-wphZJe1kp9PnDkcAhekIREIf6gWToGMGaZR0NCPtqsuSCMOZZKSug=w640-h310 * public String[] list(): list() asks the registry for all the bound objects names, while Stringtype cannot be subsitued with a malicious gadget as it is not like any ordinary object and it is not read using readObject()but rather readUTF(), however as list()returns String[]which is an actual object and it is read using readObject(), Ermir sends the gadget instead of this String[]type. https://blogger.googleusercontent.com/img/a/AVvXsEj93Qx7mmrlzWQ87KJmdGmkJzluP6DjaA5tZ6hAMOD-ijZyY9xxGRJv9u6PH_ugtdGiAwMHuH91UxhLhLH5XdmJFkRvNuqGFktkEbblWiSftuF7cS1eqWXtPQJnc0eyMEJ8Gk7qLFhcq3vCJrpqd99pO0rM_kqvoSJRCb9nEAkK8qQYKVC--5_vsqo3Ow=w640-h266 * public void bind(java.lang.String $param_String_1, java.rmi.Remote $param_Remote_2): bind() binds an object to a name on the registry, in bind() case the return type is voidand there is nothing being returned, however if the registry specifies in the RMI return data packet that this return is an execptional return, the client/server client will call readObject()despite the return type is void, this is how the regitry sends exceptions to its client (usually java.lang.ClassNotFoundException), once again Ermir will deliver the serialized gadget instead of a legitimate Exception object. https://blogger.googleusercontent.com/img/a/AVvXsEjoE87SuTKFsZT_34AoMztCeFwP2G6yxoQeNSor2bl7mrxnYEwxMSCgjVBSUOk7gtBmnh2dCOTP2dxrQTPdvkVos3VxXK7gpcAllslTJcPc6jiuYekVZKKyTtSXVpPZmzssuh5dRo4qqqIH8AD72eCfEUvqcBnayzrL6bAy7LE-_T5agvw8do8y1QKf7g=w640-h282 * public void rebind(java.lang.String $param_String_1, java.rmi.Remote $param_Remote_2): rebind() replaces the binding of the passed name with the supplied remote reference, also returns void, Ermir returns an exception just like bind().

* public void unbind(java.lang.String $param_String_1): unbind() unbinds a remote object by name in the RMI registry, this one also returns void. PoChttps://blogger.googleusercontent.com/img/a/AVvXsEj2ZO33eAXzM617JjH2u1Oez0aCH-VPGy1au_v9xoBdkFg4E3N5rm7OcKt3_CdTsdJ1rsXlyUD6v9KIDuKNTP2DxWdesAEq6AUTNAbVtQmyNrA6HlWXCOBAZmjQYhDVZ44S4e-LxcfONRwEi_h0b7JYuLVh_rlvzCFDiDqA4Tn7y1OSXYLOnpoCu6cxqA=w640-h332 ContributingBug reports and pull requests are welcome on GitHub at https://github.com/hakivvi/ermir. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct. LicenseThe gem is available as open source under the terms of the MIT License. Code of ConductEveryone interacting in the Ermir project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct. Download Ermir

___________________________
@hacking_Attack
@Hacking_Video