入侵oracle数据库的一些技巧(7)
# get fun data
# 1st 12 bytes have some meaning which so far eludes me
if (defined($main::logfile))
{
open(REC, ">$main::logfile.rec") || die "can't write $main::logfile.rec: $!";
}
my ($buf, $recvbuf);
# read until socket EOF
while (sysread($tns_sock, $buf, 128))
{
print REC $buf if (defined($main::logfile));
$recvbuf .= $buf;
}
close (REC) if (defined($main::logfile));
close ($tns_sock);
return $recvbuf;
}
sub viewtns
{
my ($response) = shift @_;
# should have a hexdump option . . .
if ($main::raw)
{
print $response;
}
else
{
$response =~ tr/\200-\377/\000-\177/; # strip high bits
$response =~ tr/\000-\027/\./;
$response =~ tr/\177/\./;
if ($main::indent)
{
parenify($response);
}
else
{
print $response;
}
print "\n";
}
}
sub parenify
{
my ($buf) = shift @_;
my ($i, $c);
my ($indent, $o_indent);
for ($i=0;$i<length($buf);$i++)
{
$c = substr($buf, $i, 1);
内容版权声明:除非注明,否则皆为本站原创文章。