[19825] in bugtraq
Re: SurfControl Bypass Vulnerability
daemon@ATHENA.MIT.EDU (Dag-Erling Smorgrav)
Fri Mar 23 19:44:41 2001
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Message-ID: <xzpbsqslt63.fsf@aes.thinksec.com>
Date: Fri, 23 Mar 2001 10:40:36 +0100
Reply-To: des@THINKSEC.COM
From: Dag-Erling Smorgrav <des@THINKSEC.COM>
X-To: "Chris St. Clair" <chris_stclair@HOTMAIL.COM>
To: BUGTRAQ@SECURITYFOCUS.COM
In-Reply-To: "Chris St. Clair"'s message of "Thu, 22 Mar 2001 15:18:15 -0000"
Content-Transfer-Encoding: 8bit
"Chris St. Clair" <chris_stclair@HOTMAIL.COM> writes:
> 0xc0.168.000000001.1
>
> Coming up with an effective regex to match that might be tough.
Not really. Here's a Perl regexp that matches the general syntax:
/^(0x[\dA-F]+|\d+)(\.(0x[\dA-F]+|\d+)){3}$/i
Strings matching this regexp can be converted to a struct in_addr
using inet_aton() on OSes whose libc provide it; those stuck with
inferior OSes can obtain the code from e.g. FreeBSD's CVS tree:
http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libc/net/inet_addr.c
DES
--
Dag-Erling Smørgrav - des@thinksec.com