1
How do I read this output?
curl http://127.0.0.1:8775/scan/3730f9794bffb6aa /log
{
"log": [
{
"message": "testing connection to the target URL",
"level": "INFO",
"time": "10:24:05"
},
{
"message": "checking if the target is protected by some kind of WAF/ IPS/IDS",
"level": "INFO",
"time": "10:24:07"
},
I tried it, but it didn’t work
<?php
$json_file = file_get_contents("http://127.0.0.1:8775/scan/3730f4794bffb6fb/log");
$json_str = json_decode($json_file, true);
$itens = $json_str['nodes'];
foreach ( $itens as $e )
{ echo $e['"message"']."<br>"; }
php?>
It seems that in your json does not exist
'nodes'
, maybe the right thing is$itens = $json_str['log'];
and this also feels wrong['"message"']
, the correct should be$e['message']
– Guilherme Nascimento