Hallo,
ich habe lighttpd und php installiert.
Dieser Code geht nicht:
[code=php]<html>
<head>
<title>PHP System Call Demo</title>
</head>
<body>
<?php
exec("/sbin/ifconfig", $netinfo);
$netregex='/inet addr:(\d+\.\d+\.\d+\.\d+)/';
print "$netinfo[1] <br><br><br>";
preg_match($netregex, $netinfo[1], $matches);
$ips=$matches[1];
$ips=preg_replace('/(\d+\.\d+\.\d+\.)\d+/', '${1}*', $ips);
print "$ips <br><br><br>";
$nmapresults=system("nmap -sT $ips");
print "$nmapresults";
?>
</body>
</html>[/php]
Ist hier geklaut: http://insilicobiotechnologies.com/tutorials/PHPsystemcalls.htm
Offensichtlich stört sich das an der Zeichenkombination >" die ein paarmal vorkommt. Sowohl nano als auch php machen diese Stellen nicht mit.
Was ist falsch?
Marcus