Detection proposal: Windows ssh-keygen loading an unsigned PKCS#11 provider DLL

Abierto
#4,382 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
30/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Área
security

Línea de trabajo

Start by checking the existing Sysmon Event ID 7 analytics in the detections folder to see which conditions they already cover and where a new Anomaly analytic would sit. The proposal depends on whether maintainers accept it, so confirm that before building. Done means a new experimental analytic that fires on the 13 provider loads and none of the 2 negative controls in the attached dataset, and that contentctl-ng build passes.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

enhancement

Is your feature request related to a problem? Please describe.
Windows OpenSSH ssh-keygen -D <provider> passes the provider path straight to LoadLibraryW, so the DLL's code runs inside the trusted ssh-keygen.exe process with no child shell. The technique is publicly documented (Sean Pesce, 2023; LOLBAS lists the related ssh.exe/scp.exe PKCS11Provider variant), but nothing in security_content mentions ssh-keygen or PKCS11. The existing Event ID 7 analytics need a Temp, UNC, same-directory or known-DLL-name condition, so they miss a provider loaded from a user's Downloads folder.

Describe the solution you'd like
A new experimental Anomaly analytic using Sysmon EID 7: ssh-keygen.exe loading a module from outside the Windows and Program Files directories that is unsigned or not validly signed. The command line from EID 1 is attached by process GUID for context. Detection does not depend on parsing -D: on native Windows, relative paths, bare file names, missing .dll extensions, forward slashes, .. segments and -qD/-vvvD clusters all executed the provider while logging the same canonical module path.

Describe alternatives you've considered
Matching the -D argument against the loaded path. I built and tested that version first, and it caught only 2 of 9 working variants. The image-load approach caught 9 of 9.

Additional context
Validated on Windows x64, OpenSSH 9.5.6.2, Sysmon 15.22, with a benign marker provider. The test data has 15 process runs (488 anonymized events): 13 provider loads, including a self-signed DLL, which Sysmon reports as Signed=false, plus 2 negative controls. Results: 13/13 detected, 0 false hits on the negatives. contentctl-ng build passes on develop. Proposed mapping: Living Off The Land, T1129 / T1218. No new OpenSSH vulnerability is claimed.

Would this fit as a new analytic? If so, I'll open the PR and publish the dataset to attack_data.

Lenguaje dominante
Python
Estrellas
1.7k
Forks
505
Merge medio
2 d 11 h
PR fusionados (30 d)
43

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de splunk/security_content

Todos los issues de splunk/security_content

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.