Exploit databaseDownload repository ZIP
GH-ea821316336f01071e5d83d15c2dd13b
opsxcq/exploit-cve-2017-7494
Sources for CVE-2017-7494
38 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files36
opsxcq/exploit-cve-2017-7494Revision 4d0bde4f1a7d
- ↑..Parent directory
- Makefile.longarg
- bigfd.c
- bigfd.exp
- domusers.exp
- envvar.exp
- finger.exp
- getent.c
- getent.exp
- getent_grent.c
- getent_pwent.c
- getent_r.sh
- getgrent_r.c
- getgrent_r.exp
- getgrgid.c
- getgrgid.exp
- getgrnam.c
- getgrnam.exp
- getpwent_r.c
- getpwent_r.exp
- getpwnam.c
- getpwnam.exp
- getpwuid.c
- getpwuid.exp
- groupmem_dom.exp
- initgroups.c
- initgroups.exp
- login.exp
- longarg.exp
- longarg_getgrnam.c
- longarg_getpwnam.c
- longarg_utils.h
- nss_winbind_syms.c
- nss_winbind_syms.exp
- pam_winbind_syms.c
- pam_winbind_syms.exp
- wbinfo.exp
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
src/testsuite/nsswitch/initgroups.c
C · 750 bytes#include <stdio.h>
#include <unistd.h>
#include <grp.h>
#include <pwd.h>
#include <sys/types.h>
int main(int argc, char **argv)
{
int result, ngroups, i;
gid_t *groups;
struct passwd *pw;
if (!(pw = getpwnam(argv[1]))) {
printf("FAIL: no passwd entry for %s\n", argv[1]);
return 1;
}
result = initgroups(argv[1], pw->pw_gid);
if (result == -1) {
printf("FAIL");
return 1;
}
ngroups = getgroups(0, NULL);
groups = (gid_t *)malloc(sizeof(gid_t) * ngroups);
ngroups = getgroups(ngroups, groups);
printf("%s is a member of groups:\n", argv[1]);
for (i = 0; i < ngroups; i++) {
struct group *grp;
grp = getgrgid(groups[i]);
printf("%d (%s)\n", groups[i], grp ? grp->gr_name : "?");
}
printf("PASS\n");
return 0;
}