有没有开源网络应用工具http://network-tools.com/?
我想要执行 DIG、traceroute、ping、telnet、whois 等。
答案1
这是我为了自己的邪恶目的而编造的一个小东西,它能完成你正在考虑的大部分工作。它不像 network-tools.com 那样华丽,但它能完成工作。它用 PHP 编写:
<?php
/*
Network Toolbox:
This script runs various Linux-based command line utilities against a
given domain name and returns the results of those programs.
Copyright (C) 2011 Justin Pearce ([email protected])
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
?>
<html>
<head>
<title>
Network Toolbox on: <?php echo $_SERVER['HTTP_HOST'];?>
</title>
<script type="text/javascript">
function doQuerySet(){
document.getElementById("resultset").innerHTML="";
document.getElementById("resultset").innerHTML="Querying...please stand by...";
}
</script>
<style>
body{
font-family: Arial, Tahoma, Verdana, sans-serif;
font-size: 12px;
color: #000000;
background-color: #FFFFFF;
}
</style>
</head>
<body>
<h1>Network Toolbox</h1>
Enter the domain name or IP address you wish to query, select the deisred operation(s) and click "Query".<br>
(Please allow some time for the operations to complete)<br>
<form method="post">
<input type="text" name="domain" value="<?php if(isset($_REQUEST['domain'])){echo $_REQUEST['domain']; } ?>" onClick="this.select();"/>
<input type="submit" name="submit" value="Query" onclick="doQuerySet();"/>
<table>
<tr>
<td><input type="checkbox" name="ping" value="1" <?php echo (isset($_REQUEST['ping']))?'checked':''; ?> /> Ping</td>
<td><input type="checkbox" name="trace" value="1" <?php echo (isset($_REQUEST['trace']))?'checked':''; ?> /> Trace</td>
<td><input type="checkbox" name="whois" value="1" <?php echo (isset($_REQUEST['whois']))?'checked':''; ?> /> Whois</td>
<td><input type="checkbox" name="query" value="1" <?php echo (isset($_REQUEST['query']))?'checked':''; ?> /> Domain Query</td>
</tr>
</table>
</form>
<div id="resultset">
<?php
if(isset($_REQUEST['submit'])){
$domain = $_REQUEST['domain'];
$domain = str_replace('&', '', $domain);
$domain = str_replace('|', '', $domain);
$domain = str_replace('>', '', $domain);
$domain = str_replace('<', '', $domain);
$domain = str_replace('http://', '', $domain);
$domain = str_replace('/', '', $domain);
$output="<h2>Results for ".$domain."</h2>\n\n";
if(isset($_REQUEST['domain'])){
if(isset($_REQUEST['ping']))
$output .= "<b>Ping results</b>:"."\n".shell_exec("ping -c10 ".$domain)."\n";
if(isset($_REQUEST['trace']))
$output .= "<b>Trace results:</b>"."\n".shell_exec("traceroute ".$domain)."\n";
if(isset($_REQUEST['whois']))
$output .= "<b>WHOIS results:</b>"."\n".shell_exec("whois ".$domain)."\n";
if(isset($_REQUEST['query'])){
$output .= "<b>DIG results:</b>"."\n".shell_exec("dig any ".$domain)."\n";
$output .= "<b>NSLookup Results:</b>"."\n".shell_exec("nslookup -class=ANY -querytype=ANY ".$domain)."\n";
$output .= "<b>Host results:</b>"."\n".shell_exec("host -a ".$domain)."\n";}
$output = nl2br($output);
echo $output;
}
}
?>
</div>
</body>
</html>
根据需要进行修改等等。