I recently performed a security scan in my environment and I noticed a that on one application in particular( name withheld to protect the vendor) an error message was generated when I scanned a particular, listening port. I wanted to investigate this further so I put together a quick perl script to connect to the suspect port repeatedly.
#!d:/perl/bin/perl -w
use strict;
use Socket;
my $line = "A" x 1000;
my ($iaddr, $sin, $proto);
my $max = 2000;
my $port = <suspect port here>;
while (1) {
$proto = getprotobyname('tcp');
socket(SOCK, PF_INET, SOCK_STREAM, $proto);
$iaddr = gethostbyname('IP address of device');
$sin = sockaddr_in($port, $iaddr);
connect(SOCK, $sin);
send(SOCK,$line,0,$iaddr);
}
This resulted in killing the application listening to this port and the processor utilization shot to 100%. I'm interested in knowing if there is a better way to stress test network applications with Perl and, in particular, the experiences of other monks when working on a problem such as this. I will also be notifying the vendor but I want to spend a few more days looking at this.
cheers, -semio
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.