Techniques
Sample rules
PostgreSQL COPY PROGRAM Command Execution
- source: elastic
- technicques:
- T1059
Description
Identifies PostgreSQL “COPY” statements that invoke an operating-system command through the “PROGRAM” option. A superuser or role with “pg_execute_server_program” can use this feature to execute arbitrary commands as the PostgreSQL service account, a technique used after credential compromise and by cryptomining campaigns.
Detection logic
any where data_stream.dataset == "network_traffic.pgsql" and
(
network_traffic.pgsql.query like~ "*copy*from*program*" or
network_traffic.pgsql.query like~ "*copy*to*program*"
)