14 lines
655 B
PHP
14 lines
655 B
PHP
<?php
|
|
header("Content-Type: application/json");
|
|
header("Access-Control-Allow-Origin: *");
|
|
$t = isset($_GET["target"]) ? $_GET["target"] : "";
|
|
if (empty($t)) { echo json_encode(["error"=>"target required"]); exit; }
|
|
$cmd = "timeout 30 nuclei -u ".escapeshellarg($t)." -severity low,medium,high,critical -silent -json 2>/dev/null | head -10";
|
|
$out = shell_exec($cmd);
|
|
$f = [];
|
|
if ($out) { foreach (explode("\n", trim($out)) as $l) {
|
|
$j = json_decode($l, true);
|
|
if ($j) $f[] = ["id"=>$j["template-id"]??"","sev"=>$j["info"]["severity"]??""];
|
|
}}
|
|
echo json_encode(["ok"=>true,"target"=>$t,"findings"=>$f,"count"=>count($f),"scanner"=>"Nuclei+Strix"]);
|