AnsweredAssumed Answered

Qualys APIv2 Host list function using perl

Question asked by alex setiadi on Dec 11, 2013
Latest reply on Dec 12, 2013 by alex setiadi

Hi,

 

Here's the code that I'm using, and I'm not sure why it doesnt return me XML result of Host List for that asset group. instead it redirect me to here https://qualysguard.qualys.com/qwebhelp/fo_help/index.htm

 

Can anyone help me ?

I'm not entirely sure what I did wrong here.

 

Thanks,

Alex Setiadi

 

 

my $url = "https://$apiurl/api/2.0/fo/asset/host/?action=list&echo_request=1&details=All&ag_titles=All+Compliance";

 

my $username = "obviously";

my $passwd = "thisisafake";

 

my $browser = LWP::UserAgent->new;

$browser->credentials( $apiurl.':443','MSP Front Office', $username => $passwd);

$browser->agent("libwww - script");

 

my $response = $browser->get($url);

my $content = $response->content;

open( XMLOUT, ">output.xml" );

print XMLOUT $content;

close( XMLOUT );

Outcomes