-
Notifications
You must be signed in to change notification settings - Fork 0
/
SCAN2.PHP
executable file
·125 lines (56 loc) · 1.79 KB
/
SCAN2.PHP
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<?php
include('../header.php');
if(!$step) {
$step = "1";
}
if($step == "1") {
?>
<center>
<form method=post action="<?php echo $SCRIPT_NAME; ?>">
<h4>This scanner will scan all common service ports, and then
return a report, based on it's results. It will give you advice
on your activated ports, and some dianostics.</h4>
<font face=helvetica size=2>
<table border=0 WIDTH=50%>
<tr>
<td><b>Host address:</b></td>
<td><input type=text size=20 name=host value="<?php echo $REMOTE_ADDR;?>"></td>
</tr>
<tr>
<td><input type=hidden name=step value=2>
<input type=submit value=scan!></td>
</tr>
</table>
</form>
</center>
<?
} else if($step == "2") {
if(!$host) {
echo("Duh! You must fill in all feilds.");
}
//arrays and crap
$decimals =
array("21", "22", "23", "25", "79", "80", "107", "110", "139", "1080", "27374");
$service =
array("FTP", "SSH", "Telnet", "SMTP", "Finger", "HTTP", "rTelnet", "pop3", "Netbios", "Socks", "Subseven");
require('alerts.php'); // has all of the of the fixes etc..
$alert =
array("$ftp", "$ssh", "$telnet", "$smtp", "$finger", "$http", "$rtelnet", "$pop3", "$netbios", "$socks", "$subseven");
//timeout
$timeout = "30"; //30 secs
//loops
echo "<table border=0><tr><td>";
for($i=0; $i<=count($decimals); $i++){
echo $decimal[$i];
$fp = fsockopen($host, $decimals[$i]);
if($fp) {
socket_set_timeout($fp, 2);
echo "$decimals[$i] - $service[$i] is <font color=red>activated</font><br>";
echo $alert[$i]; // echo the alert
fclose($fp);
}
}
echo "</td></tr></table>";
}
include('../footer.php');
?>