Where I'm stuck is that I will need to determine the ip address of the machine from which the login attempt failed.
On a non-production machine that you don't care about
try the following very evil code:
#!/usr/bin/perl -w
use CGI qw/ :standard /;
my $cgi=new CGI;
print header,start_html;
print h1("Environment");
print table(
Tr(th("Environment Variable"),th("Value")),
map { Tr(td($_),td($ENV{$_})) } sort keys %ENV );
print hr;
print h1('CGI Varialbes');
print table (
Tr(th("parameter"),th("parameter value")),
map { Tr(td($_),td($cgi->param($_))) } sort $cgi->param ) ;
print end_html;
I call this evil because besides what you are looking for
is some information that you really don't want to leak to
the "public."
Of particular interest in your case is the following
key and value that are found in the %ENV
hash:
REMOTE_ADDR 68.37.227.52
There's other information there as well but, this was
what you specifically asked for.
Update: (GAH!) ikegami got his post out there before I
hit "submit" Oh well, the code I put up there
is good stuff anyway if you want to "play."
Peter L. Berghold -- Unix Professional
Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.