Skip to content

HAProxy

Overview

HAProxy is a free, open source software that provides a high availability load balancer and proxy server for TCP and HTTP-based applications that spreads requests across multiple servers. HAProxy has a lot of features and because it is located between your infrastructure and your clients, it can give you a lot of information about either of them.

The following Sekoia.io built-in rules match the intake HAProxy. This documentation is updated automatically and is based solely on the fields used by the intake which are checked against our rules. This means that some rules will be listed but might not be relevant with the intake.

SEKOIA.IO x HAProxy on ATT&CK Navigator

Burp Suite Tool Detected

Burp Suite is a cybersecurity tool. When used as a proxy service, its purpose is to intercept packets and modify them to send them to the server. Burp Collaborator is a network service that Burp Suite uses to help discover many kinds of vulnerabilities (vulnerabilities scanner).

  • Effort: intermediate
CVE-2018-11776 Apache Struts2

Apache Struts versions 2.3 to 2.3.34 and 2.5 to 2.5.16 suffer from possible Remote Code Execution when alwaysSelectFullNamespace is true (either by user or a plugin like Convention Plugin) and then: results are used with no namespace and in same time, its upper package have no or wildcard namespace and similar to results, same possibility when using url tag which doesn't have value and action set and in same time, its upper package have no or wildcard namespace.

  • Effort: intermediate
CVE-2018-13379 Fortinet Exploit

Detects the successful exploitation of the Fortinet FortiOS CVE-2018-13379. This CVE is one of the most exploited CVEs since 2018. It is exploited by APT threat actors as well as cybercriminals. The exploitation of this CVE lead an unauthenticated user to get full access to FortiOS system file through SSL VPN via specially crafted HTTP resource requests. The exploit read /dev/cmdb/sslvpn_websession file, that contains login and passwords in (clear/text). An HTTP response status code = 200, means the file was successfully accessed. This vulnerability affects FortiOS 5.6.3 to 5.6.7 and FortiOS 6.0.0 to 6.0.4.

  • Effort: advanced
CVE-2019-0604 SharePoint

Detects the exploitation of the SharePoint vulnerability (CVE-2019-0604).

  • Effort: advanced
CVE-2019-11510 Pulse Secure Exploit

Detects the successful exploitation of the Pulse Secure vulnerability CVE-2019-11510. This CVE is one of the most exploited CVEs since 2019. It is exploited by diverse threat actors, leading sometimes in ransomware deployement among these groups: Maze, Conti, Egregor, DoppelPaymer, NetWalker and REvil. But also APT actors such as APT29. The exploitation of this CVE allows a remote, unauthenticated attacker to compromise a vulnerable VPN server. The attacker may be able to gain access to all active users and their plain-text credentials. It may also be possible for the attacker to execute arbitrary commands on each VPN client as it successfully connects to the VPN server. The exploit reads /etc/passwd file to get access to login and passwords in (clear/text). An HTTP response status code = 200, means the file was successfully accessed. This vulnerability affects 8.1R15.1, 8.2 before 8.2R12.1, 8.3 before 8.3R7.1, and 9.0 before 9.0R3.4 products.

  • Effort: elementary
CVE-2019-19781 Citrix NetScaler (ADC)

Detects CVE-2019-19781 exploitation attempt against Citrix NetScaler (ADC), Application Delivery Controller and Citrix Gateway Attack.

  • Effort: elementary
CVE-2019-2725 Oracle Weblogic Exploit

Detects the successful exploitation of a deserialization vulnerability in Oracle Weblogic Server, CVE-2019-2725. This vulnerability affects versions 10.X and 12.1.3 of WebLogic that have the components wls9_async_response.war and wls-wsat.war enabled. It is a remote code execution which can be exploited without authentication via HTTP. An HTTP response status code = 202, means the target is vulnerable, the analyst then has to look in depth to check if a webshell has been uploaded or something else has been done.

  • Effort: elementary
CVE-2020-0688 Microsoft Exchange Server Exploit

Detects the exploitation of CVE-2020-0688. The POC exploit a .NET serialization vulnerability in the Exchange Control Panel (ECP) web page. The vulnerability is due to Microsoft Exchange Server not randomizing the keys on a per-installation basis resulting in them using the same validationKey and decryptionKey values. With knowledge of these, values an attacker can craft a special viewstate to use an OS command to be executed by NT_AUTHORITY\SYSTEM using .NET deserialization. To exploit this vulnerability, an attacker needs to leverage the credentials of an account it had already compromised to authenticate to OWA.

  • Effort: elementary
CVE-2020-1147 SharePoint

Detection of SharePoint vulnerability CVE-2020-1147.

  • Effort: advanced
CVE-2020-14882 Oracle WebLogic Server

Detects the exploitation of the Oracle WebLogic Server vulnerability (CVE-2020-16952).

  • Effort: advanced
CVE-2020-17530 Apache Struts RCE

Detects the exploitation of the Apache Struts RCE vulnerability (CVE-2020-17530).

  • Effort: intermediate
CVE-2020-5902 F5 BIG-IP Exploitation Attempts

Detects the exploitation attempt of the vulnerability found in F5 BIG-IP and described in CVE-2020-5902.

  • Effort: elementary
CVE-2021-20021 SonicWall Unauthenticated Administrator Access

Detects the exploitation of SonicWall Unauthenticated Admin Access.

  • Effort: advanced
CVE-2021-20023 SonicWall Arbitrary File Read

Detects Arbitrary File Read, which can be used with other vulnerabilities as a mean to obtain outputs generated by attackers, or sensitive data.

  • Effort: advanced
CVE-2021-21972 VMware vCenter

The vSphere Client (HTML5) contains a remote code execution vulnerability in a vCenter Server plugin. A malicious actor with network access to port 443 may exploit this issue to execute commands with unrestricted privileges on the underlying operating system that hosts vCenter Server. This affects VMware vCenter Server (7.x before 7.0 U1c, 6.7 before 6.7 U3l and 6.5 before 6.5 U3n) and VMware Cloud Foundation (4.x before 4.2 and 3.x before 3.10.1.2). POST request on the following PATH "/ui/vropspluginui/rest/services/uploadova". If in response body (500) the words it has "uploadFile", that means the vCenter is available to accept files via POST without any restrictions.

  • Effort: intermediate
CVE-2021-21985 VMware vCenter

The VMware vSphere Client (HTML5) contains a remote code execution vulnerability due to lack of input validation in the Virtual SAN Health Check plug-in which is enabled by default in vCenter Server. A malicious actor with network access to port 443 may exploit this issue to execute commands with unrestricted privileges on the underlying operating system that hosts vCenter Server. This affects VMware vCenter Server (7.0 before 7.0 U2b, 6.7 before 6.7 U3n and 6.5 before 6.5 U3p) and VMware Cloud Foundation (4.x before 4.2.1 and 3.x before 3.10.2.1).

  • Effort: advanced
CVE-2021-22123 Fortinet FortiWeb OS Command Injection

Detects Fortinet FortiWeb OS Command Injection (August 2021) vulnerability exploitation attempt. A remote, authenticated attacker can execute arbitrary commands on the system hosting a vulnerable FortiWeb WAF by sending a POST request with the command in the name field. At the time of writing this rule, it would appear that the request would respond in code 500 for a successful exploitation attempt.

  • Effort: advanced
CVE-2021-22893 Pulse Connect Secure RCE Vulnerability

Detects potential exploitation of the authentication by-pass vulnerability that can allow an unauthenticated user to perform remote arbitrary file execution on the Pulse Connect Secure gateway. It is highly recommended to apply the Pulse Secure mitigations and seach for indicators of compromise on affected servers if you are in doubt over the integrity of your Pulse Connect Secure product.

  • Effort: intermediate
CVE-2021-26855 Exchange SSRF

Detects the exploitation of ProyxLogon vulerability on Exchange servers.

  • Effort: advanced
CVE-2021-34473 ProxyShell Attempt

Detects CVE-2021-34473 ProxyShell attempt against Microsoft Exchange Server, Remote Code Execution Vulnerability.

  • Effort: advanced
CVE-2021-41773 Apache 2.4.49 Path Traversal

Detects successful exploitation of the Apache Path Traversal CVE-2021-41773.

  • Effort: advanced
CVE-2021-43798 Grafana Directory Traversal

Grafana version 8.x has a 0day arbitrary file read (with no fix yet) based on a directory traversal vulnerability

  • Effort: intermediate
Cobalt Strike HTTP Default GET beaconing

Detects GET HTTP queries from known Cobalt Strike beacons (source code 4.3)

  • Effort: advanced
Cobalt Strike HTTP Default POST Beaconing

Detects POST HTTP queries from known Cobalt Strike beacons (source code 4.3)

  • Effort: advanced
Detect requests to Konni C2 servers

This rule detects requests to Konni C2 servers. These patterns come from an analysis done in 2022, September.

  • Effort: elementary
Download Files From Suspicious TLDs

Detects download of certain file types from hosts in suspicious TLDs

  • Effort: master
FoggyWeb HTTP Default GET/POST Requests

Detects GET or POST request pattern observed within the first FoggyWeb campaign detected by Microsoft.

  • Effort: advanced
GitLab CVE-2021-22205

Detects GitLab vulnerability CVE-2021-22205 exploitation success. It allows an attacker to do some remote code execution with user git. The HTTP return code 422 indicates a successfull exploitation.

  • Effort: intermediate
Koadic MSHTML Command

Detects Koadic payload using MSHTML module

  • Effort: intermediate
LokiBot Default C2 URL

Detects default C2 URL for trojan LokiBot

  • Effort: elementary
Nimbo-C2 User Agent

Nimbo-C2 Uses an unusual User-Agent format in its implants.

  • Effort: intermediate
Possible Malicious File Double Extension

Detects request to potential malicious file with double extension

  • Effort: elementary
Potential Azure AD Phishing Page (Adversary-in-the-Middle)

Detects an HTTP request to an URL typical of the Azure AD authentication flow, but towards a domain that is not one the legitimate Microsoft domains used for Azure AD authentication.

  • Effort: intermediate
Potential Bazar Loader User-Agents

Detects potential Bazar loader communications through the user-agent

  • Effort: elementary
Potential DNS Tunnel

Detects domain name which is longer than 95 characters. Long domain names are distinctive of DNS tunnels.

  • Effort: advanced
Potential Lemon Duck User-Agent

Detects LemonDuck user agent. The format used two sets of alphabetical characters separated by dashes, for example "User-Agent: Lemon-Duck-[A-Z]-[A-Z]".

  • Effort: elementary
Privilege Escalation Awesome Scripts (PEAS)

Detect PEAS privileges escalation scripts and binaries

  • Effort: elementary
ProxyShell Microsoft Exchange Suspicious Paths

Detects suspicious calls to Microsoft Exchange resources, in locations related to webshells observed in campaigns using this vulnerability.

  • Effort: elementary
SEKOIA.IO Intelligence Feed

Detect threats based on indicators of compromise (IOCs) collected by SEKOIA's Threat and Detection Research team.

  • Effort: elementary
SharePoint Authenticated SSRF

Detects succesful SSRF from an authenticated SharePoint user.

  • Effort: elementary
Suspicious URI Used In A Lazarus Campaign

Detects suspicious requests to a specific URI, usually on an .asp page. The website is often compromised.

  • Effort: intermediate
Telegram Bot API Request

Detects suspicious DNS queries to api.telegram.org used by Telegram Bots of any kind

  • Effort: advanced

Event Categories

The following table lists the data source offered by this integration.

Data Source Description
Web logs HAProxy logs provide information about the connected client and the requested resource

In details, the following table denotes the type of events produced by this integration.

Name Values
Kind access
Category ``
Type ``

Event Samples

Find below few samples of events and how they are normalized by Sekoia.io.

{
    "message": "1.1.1.1:65276 [29/Feb/2024:15:01:18.909] HTTP~ Store/OpenIP-MyHa-Front-Tomcat-1 0/0/0/5/5 200 7500 - - --VN 409/407/0/0/0 0/0 \"GET /css/datatables.css?b=206 HTTP/1.1\"\n",
    "event": {
        "kind": "access"
    },
    "http": {
        "request": {
            "method": "GET"
        },
        "response": {
            "bytes": 7500,
            "status_code": 200
        },
        "version": "1.1"
    },
    "related": {
        "ip": [
            "1.1.1.1"
        ]
    },
    "source": {
        "address": "1.1.1.1",
        "ip": "1.1.1.1",
        "port": 65276
    },
    "url": {
        "original": "/css/datatables.css?b=206",
        "path": "/css/datatables.css",
        "query": "b=206"
    }
}
{
    "message": " 1.1.1.1:64772 [29/Feb/2024:14:01:19.832] fe_exchange~ be_exchange_mapi/dnrsmsg03 0/0/0/67/73 200 397387 - - ---- 1186/1186/1124/1125/0 0/0 \"POST \n/mapi/emsmdb/?MailboxId=676395c0-caac-4df4-afa1-a6037b150194@corp.com HTTP/1.1\"\n",
    "event": {
        "kind": "access"
    },
    "http": {
        "request": {
            "method": "POST"
        },
        "response": {
            "bytes": 397387,
            "status_code": 200
        },
        "version": "1.1"
    },
    "related": {
        "ip": [
            "1.1.1.1"
        ]
    },
    "source": {
        "address": "1.1.1.1",
        "ip": "1.1.1.1",
        "port": 64772
    },
    "url": {
        "original": "/mapi/emsmdb/?MailboxId=676395c0-caac-4df4-afa1-a6037b150194@corp.com",
        "path": "/mapi/emsmdb/",
        "query": "MailboxId=676395c0-caac-4df4-afa1-a6037b150194@corp.com"
    }
}
{
    "message": "90.83.225.109:54761 [10/Apr/2024:15:41:58.284] frontend_https~ backend_lb/LB100 1796/0/0/28/1824 200 1060 - - --VN 296/296/33/6/0 0/0 {saas.ms.example.com} \"GET /path/get/resource HTTP/1.1\" TLSv1.2\n",
    "event": {
        "kind": "access"
    },
    "http": {
        "request": {
            "method": "GET"
        },
        "response": {
            "bytes": 1060,
            "status_code": 200
        },
        "version": "1.1"
    },
    "related": {
        "ip": [
            "90.83.225.109"
        ]
    },
    "source": {
        "address": "90.83.225.109",
        "ip": "90.83.225.109",
        "port": 54761
    },
    "tls": {
        "version": "1.2",
        "version_protocol": "TLS"
    },
    "url": {
        "original": "/path/get/resource",
        "path": "/path/get/resource"
    }
}
{
    "message": "hapee-lb[16320]: [ACCESS] 2022 {\"ctn\":\"html\",\"ctj\":\"text\",\"ssl\":false,\"ti\":1991,\"code\":200,\"tc\":0,\"trr\":0,\"qs\":\"1570172897\",\"backend\":\"backoffice.corp.fr\",\"meth\":\"GET\",\"country\":\"FR\",\"fingerprint\":\"y-faecbg--p-x-x-00000000-c40cb9ee-e1fe6ca8-e1fe6ca8-cf70e9fb-n-s-1.1-y-n-n-n\",\"date\":1570173201.114,\"uniqueid\":\"waf-06-5376CF7E:BA07_B9C7B823:0050_5D96F111_339D7F:3FC0\",\"tw\":0,\"ipqual\":\"{\\\"al\\\":\\\"fr-FR\\\",\\\"san\\\":{\\\"anomalies\\\":{},\\\"score\\\":0},\\\"uaqual\\\":{\\\"dt\\\":\\\"Desktop\\\"},\\\"signals\\\":{\\\"is_ip_auth\\\":true,\\\"is_crawler\\\":false},\\\"ipqual\\\":{\\\"country\\\":\\\"FR\\\"}}\",\"port\":47623,\"status\":\"ip-safe\",\"path\":\"\\/session.php\",\"th\":0,\"to3\":11,\"vers\":\"HTTP\\/1.1\",\"ip\":\"83.118.207.126\",\"tr\":31,\"pn\":\"Windows\",\"action\":\"forward\",\"fssl\":false,\"pv\":\"10.0\",\"fqdn\":\"backoffice.corp.fr\",\"bytes\":363,\"browser\":\"Chrome\",\"ua\":\"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/77.0.3865.90 Safari\\/537.36\",\"trtt\":8,\"state\":\"----\",\"tt\":2022}",
    "event": {
        "kind": "access",
        "outcome": "ip-safe"
    },
    "action": {
        "name": "forward",
        "outcome": "ip-safe"
    },
    "destination": {
        "address": "backoffice.corp.fr",
        "domain": "backoffice.corp.fr",
        "registered_domain": "corp.fr",
        "size_in_char": 18,
        "subdomain": "backoffice",
        "top_level_domain": "fr"
    },
    "host": {
        "name": "B96f1GJTxDUKbh2l"
    },
    "http": {
        "request": {
            "method": "GET"
        },
        "response": {
            "bytes": 363,
            "status_code": 200
        },
        "version": "1.1"
    },
    "log": {
        "hostname": "B96f1GJTxDUKbh2l"
    },
    "os": {
        "name": "Windows",
        "version": "10.0"
    },
    "related": {
        "hosts": [
            "backoffice.corp.fr"
        ],
        "ip": [
            "83.118.207.126"
        ]
    },
    "source": {
        "address": "83.118.207.126",
        "ip": "83.118.207.126",
        "port": 47623
    },
    "url": {
        "original": "backoffice.corp.fr/session.php",
        "path": "/session.php"
    },
    "user_agent": {
        "device": {
            "name": "Other"
        },
        "name": "Chrome",
        "original": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36",
        "os": {
            "name": "Windows",
            "version": "10"
        },
        "version": "77.0.3865"
    }
}
{
    "message": " 127.0.0.1:59692 [03/Oct/2019:15:05:32.500] http-in backend1/web-server1 0/0/0/0/0 304 134 - - ---- 1/1/0/0/0 0/0 \"GET /icons/openlogo-75.png HTTP/1.1\"",
    "event": {
        "kind": "access"
    },
    "host": {
        "name": "B96f1GJTxDUKbh2l"
    },
    "http": {
        "request": {
            "method": "GET"
        },
        "response": {
            "bytes": 134,
            "status_code": 304
        },
        "version": "1.1"
    },
    "log": {
        "hostname": "B96f1GJTxDUKbh2l"
    },
    "related": {
        "ip": [
            "127.0.0.1"
        ]
    },
    "source": {
        "address": "127.0.0.1",
        "ip": "127.0.0.1",
        "port": 59692
    },
    "url": {
        "original": "/icons/openlogo-75.png",
        "path": "/icons/openlogo-75.png"
    }
}

Extracted Fields

The following table lists the fields that are extracted, normalized under the ECS format, analyzed and indexed by the parser. It should be noted that infered fields are not listed.

Name Type Description
destination.domain keyword The domain name of the destination.
destination.size_in_char number Size of the domain name
event.kind keyword The kind of the event. The highest categorization field in the hierarchy.
http.request.method keyword HTTP request method.
http.response.bytes long Total size in bytes of the response (body and headers).
http.response.status_code long HTTP response status code.
http.version keyword HTTP version.
os.name keyword OS name
os.version keyword OS name
source.address keyword Source network address.
source.ip ip IP address of the source.
source.port long Port of the source.
tls.version keyword Numeric part of the version parsed from the original string.
tls.version_protocol keyword Normalized lowercase protocol name parsed from original string.
url.original wildcard Unmodified original url as seen in the event source.
url.path wildcard Path of the request, such as "/search".
user_agent.original keyword Unparsed user_agent string.

HAProxy Configuration

HAProxy Configuration file is created by default when HAProxy is setup on the machine

Note

HAProxy configuration default file haproxy.cfg will be found in the directory /etc/haproxy

By default events are forwarded to /var/lib/haproxy/dev/log then processed by a local rsyslog to store them on /var/log/haproxy.log.

Forward the HAProxy logs to a concentrator

After HAProxy has been setup and configured, the logs have to be sent to a syslog concentrator then forwarded to Sekoia.io.

By default, at HAProxy first installation, an rsyslog configuration is created on the repository /etc/rsyslog.d/, it contains the following lines:

# Create an additionnal socket in haproxy's chroot in order to allow logging via 
# /dev/log to chroot'ed HAProxy processes
$AddUnixListenSocket /var/lib/haproxy/dev/log

# Send HAProxy messages to a dedicated logfile
:programname, startswith, "haproxy" {
    /var/log/haproxy.log
    stop
}

You only have to replace the configuration by the following lines:

# Create an additionnal socket in haproxy's chroot in order to allow logging via 
# /dev/log to chroot'ed HAProxy processes
$AddUnixListenSocket /var/lib/haproxy/dev/log

# Use a condition that identifies specifically HaProxy logs that send them to a syslog concentrator
if ($programname startswith 'haproxy') then {
    # Log events locally
    /var/log/haproxy.log

    # Forward HAProxy logs to a concentrator
    action(
    type="omfwd"
    protocol="tcp"
    target="<Concentrator_FQDN_or_IP>"
    port="<Remote_Port>"
    TCP_Framing="octet-counted"
    )
}

For more information on Rsyslog configuration, please consult the next section.

Rsyslog

The reader is invited to consult the Rsyslog Transport documentation to forward these logs to Sekoia.io.

Further Reading