Database Reference
In-Depth Information
{
print "match succeeded ~ 10g SID gained!\n";
print MYFILE "match succeeded ~ 10g SID gained!\n";
$OraCheck[8] =~ s/_/ /;
$OraCheck[8] =~ s/\|/ /;
$OraCheck[8] =~ s/ //g; #strips out whitespace
}
else
{
#if we cannot brute the 10g SID then lets read it from EM web page if installed.
print "could not brute the 10g SID so let's try and scrap it from EM page\n";
my $raw_url="https://$host:1158/em/console/logon/logon" or die "usage: $0 url\n";
my $url = URI::Heuristic::uf_urlstr($raw_url);
$| = 1;
printf "%s =>\n\t", $url;
my $ua = LWP::UserAgent->new( );
$ua->agent("Mozilla 3.0");
my $response = $ua->get($url, Referer => " http://audit-team.com " );
if ($response->is_error( ))
{
printf " %s\n", $response->status_line;
printf "no 10g sid was obtained. Secure SID and EM secured. Good!\n";
}
else
{
my $content = $response->content( );
my $bytes = length $content;
my $count = ($content =~ tr/\n/\n/);
printf "%s (%d lines, %d bytes)\n",
$response->title( ) || "(no title)", $count, $bytes;
if ($content=~ m/Login to Database:(.*?)</)
{
#printf " $content\n";
printf "matched enterprise manager\n";
$OraCheck[8]=$1;
printf "the sid is $OraCheck[8]\n";
}
}
}
print "@OraCheck\n";#this should be a good sid
(@OraResult) = `./oralogonsid.pl -h $host -l orapwshort.csv -S $OraCheck[8]`;#change
var names here
print "@OraResult\n";
#Note if get a negative result from the attempt to get the sid from oralogonsid then
invoke titlebytes to try and read the sid from enterprise manager.
print MYFILE "@OraCheck\n";
}
Search WWH ::




Custom Search