info: name: Sophos Firewall SQL injection - CVE-2020-12271 author: redperfect1847 severity: critical description: | A SQL injection issue was found in SFOS 17.0, 17.1, 17.5, and 18.0 before 2020-04-25 on Sophos XG Firewall devices, as exploited in the wild in April 2020. This affected devices configured with either the administration (HTTPS) service or the User Portal exposed on the WAN zone. A successful attack may have caused remote code execution that exfiltrated usernames and hashed passwords for the local device admin(s), portal admins, and user accounts used for remote access (but not external Active Directory or LDAP passwords). tags: sql-injection reference: - https://news.sophos.com/en-us/2020/04/26/asnarok/
http: -raw: - | GET /sp/Install.sh HTTP/1.1 Host: {{Hostname}} matchers-condition:or matchers: -type: word part: body words: -"#!/bin/bash" -"chmod +x" -type: regex part: header regex: -"content-type: application/x-sh"
-raw: - | GET /sh_guard/lc HTTP/1.1 Host: {{Hostname}} matchers-condition:or matchers: -type: word part: body words: -"#!/bin/bash" -"downloaded lp" -type: regex part: header regex: -"content-type: application/x-sh"
-raw: - | GET /sp/sophos.dat HTTP/1.1 Host: {{Hostname}} matchers-condition:or matchers: -type: word part: body words: -"ELF" -"binaries" -type: regex part: header regex: -"content-type: application/octet-stream"
-raw: - | GET /sp/ae.sh HTTP/1.1 Host: {{Hostname}} matchers-condition:or matchers: -type: word part: body words: -"#!/bin/bash" -"Modified scripts" -type: regex part: header regex: -"content-type: application/x-sh"
-raw: - | GET /sp/patch.sh HTTP/1.1 Host: {{Hostname}} matchers-condition:or matchers: -type: word part: body words: -"#!/bin/bash" -"patching system" -type: regex part: header regex: -"content-type: application/x-sh"
-raw: - | GET /bkin HTTP/1.1 Host: {{Hostname}} matchers-condition:or matchers: -type: word part: body words: -"ELF" -"Executable" -type: regex part: header regex: -"content-type: application/octet-stream"