Subversion Repositories ALCASAR

Rev

Rev 2887 | Rev 2906 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2887 Rev 2888
Line 46... Line 46...
46
	$l_mac_allowed = "@MAC autorisée";
46
	$l_mac_allowed = "@MAC autorisée";
47
	$l_mac_temporarily_allowed = "@MAC autorisée temporairement";
47
	$l_mac_temporarily_allowed = "@MAC autorisée temporairement";
48
	$l_action = "Action";
48
	$l_action = "Action";
49
	$l_dissociate = "Dissocier @IP";
49
	$l_dissociate = "Dissocier @IP";
50
	$l_disconnect = "Déconnecter";
50
	$l_disconnect = "Déconnecter";
51
	$l_stop_capture_disconnect = "Arrêter la capture et se déconnecter";
51
	$l_stop_capture_disconnect = "Arrêter la capture et déconnecter";
52
	$l_refresh = "Cette page est rafraichie toutes les 30 secondes";
52
	$l_refresh = "Cette page est rafraichie toutes les 30 secondes";
53
	$l_edit_user = "Editer l'utilisateur";
53
	$l_edit_user = "Editer l'utilisateur";
54
	$l_connect = "Autoriser temporairement";
54
	$l_connect = "Autoriser temporairement";
55
	$l_captureon = "Autoriser et capturer";
55
	$l_captureon = "Autoriser et capturer";
56
	$l_captureoff = "Arrêter la capture";
56
	$l_captureoff = "Arrêter la capture";
Line 168... Line 168...
168
			$detail = explode (" ", $ligne);
168
			$detail = explode (" ", $ligne);
169
			$nb_ligne ++;
169
			$nb_ligne ++;
170
			echo "<tr valign=\"middle\">";
170
			echo "<tr valign=\"middle\">";
171
			echo "<td>".$nb_ligne."</td>";
171
			echo "<td>".$nb_ligne."</td>";
172
			echo "<td>".$detail[1]."</td>";
172
			echo "<td>".$detail[1]."</td>";
173
			if(file_exists('/usr/share/arp-scan/ieee-oui.txt')) // for each device on LAN, retrieve the MAC manufacturer
173
			if(file_exists('/usr/local/share/nmap-mac-prefixes')) // for each device on LAN, retrieve the MAC manufacturer
174
			{
174
			{
175
				$oui_id = substr(str_replace("-","",$detail[0]),0,6);
175
				$oui_id = substr(str_replace("-","",$detail[0]),0,6);
176
				exec ("grep $oui_id /usr/share/arp-scan/ieee-oui.txt | cut -f2", $mac_manufacturer);
176
				exec ("grep $oui_id /usr/local/share/nmap-mac-prefixes | cut -f2", $mac_manufacturer);
177
				if(empty($mac_manufacturer[0]))
177
				if(! empty($mac_manufacturer[0]))
178
				{
178
				{
179
					$mac_manufacturer[0] = "Unknown";
-
 
180
				}
-
 
181
				echo "<td>$detail[0] <font size=\"1\">($mac_manufacturer[0])</font>";
179
				echo "<td>$detail[0] <font size=\"1\">($mac_manufacturer[0])</font>";
-
 
180
				}
182
				unset($mac_manufacturer);
181
				unset($mac_manufacturer);
183
			}
182
			}
184
			else
183
			else
185
			{
184
			{
186
				echo "<td>$detail[0]";
185
				echo "<td>$detail[0]";
Line 212... Line 211...
212
						else { #MAC is temporarily allowed
211
						else { #MAC is temporarily allowed
213
							echo "<b>$l_mac_temporarily_allowed</b>";
212
							echo "<b>$l_mac_temporarily_allowed</b>";
214
							echo "</td><td>";
213
							echo "</td><td>";
215
							echo "<FORM action=\"".$_SERVER['PHP_SELF']."\" method=\"POST\">";
214
							echo "<FORM action=\"".$_SERVER['PHP_SELF']."\" method=\"POST\">";
216
							echo "<INPUT type=\"hidden\" name=\"mac_addr\" value=\"$detail[0]\">";
215
							echo "<INPUT type=\"hidden\" name=\"mac_addr\" value=\"$detail[0]\">";
217
 
-
 
218
							if($IoT_capture == "on")
216
							if($IoT_capture == "on")
219
							{
217
							{
220
								if(exec('sudo /usr/local/bin/alcasar-iot_capture.sh -i '.$detail[0]) == "CaptureON")
218
								if(exec('sudo /usr/local/bin/alcasar-iot_capture.sh -i '.$detail[0]) == "CaptureON")
221
								{
219
								{
222
									echo "<INPUT type=\"submit\" name=\"action\" value=\"$l_stop_capture_disconnect\">";
220
									echo "<INPUT type=\"submit\" name=\"action\" value=\"$l_stop_capture_disconnect\">";
Line 224... Line 222...
224
								}
222
								}
225
 								else
223
 								else
226
								{
224
								{
227
									echo "<INPUT type=\"submit\" name=\"action\" value=\"$l_disconnect\">";
225
									echo "<INPUT type=\"submit\" name=\"action\" value=\"$l_disconnect\">";
228
									echo "<BR><INPUT type=\"submit\" name=\"action\" value=\"$l_captureonly_on\">";
226
									echo "<BR><INPUT type=\"submit\" name=\"action\" value=\"$l_captureonly_on\">";
229
									$file = '/var/Save/iot_captures/'.$mac.'.pcap';
227
									$file = '/var/Save/iot_captures/'.$detail[0].'.pcap';
230
									if (file_exists($file))
228
									if (file_exists($file))
231
										{
229
										{
232
										echo "<BR><a href=\"/save/iot_captures/$mac.pcap\">$mac.pcap</a> (";echo taille_fichier("/var/Save/iot_captures/".$mac.".pcap");echo ")";
230
										echo "<BR><center><a href=\"/save/iot_captures/$detail[0].pcap\">$detail[0].pcap</a> (";echo taille_fichier("/var/Save/iot_captures/".$detail[0].".pcap");echo ")</center>";
233
										}
231
										}
234
								}
232
								}	
235
							}
233
							}
236
							else
234
							else
237
								echo "<INPUT type=\"submit\" name=\"action\" value=\"$l_disconnect\">";
235
								echo "<INPUT type=\"submit\" name=\"action\" value=\"$l_disconnect\">";
238
 
236
 
239
							echo "</FORM></TD>";
237
							echo "</FORM></TD>";
Line 279... Line 277...
279
					}
277
					}
280
					else
278
					else
281
					{
279
					{
282
						echo "<BR><INPUT type=\"submit\" name=\"action\" value=\"$l_captureon\">";
280
						echo "<BR><INPUT type=\"submit\" name=\"action\" value=\"$l_captureon\">";
283
						echo "<INPUT type=\"submit\" name=\"action\" value=\"$l_captureonly_on\">";
281
						echo "<INPUT type=\"submit\" name=\"action\" value=\"$l_captureonly_on\">";
284
						$file = '/var/Save/iot_captures/'.$mac.'.pcap';
282
						$file = '/var/Save/iot_captures/'.$detail[0].'.pcap';
285
						if (file_exists($file))
283
						if (file_exists($file))
286
							{
284
							{
287
							echo "<BR><a href=\"/save/iot_captures/$mac.pcap\">$mac.pcap</a> (";echo taille_fichier("/var/Save/iot_captures/".$mac.".pcap");echo ")";
285
							echo "<BR><center><a href=\"/save/iot_captures/$detail[0].pcap\">$detail[0].pcap</a> (";echo taille_fichier("/var/Save/iot_captures/".$detail[0].".pcap");echo ")</center>";
288
							}
286
							}
289
					}
287
					}
290
				}
288
				}
291
				echo "</FORM></TD>";
289
				echo "</FORM></TD>";
292
			}
290
			}
Line 296... Line 294...
296
		?>
294
		?>
297
	</table>
295
	</table>
298
	</td></tr>
296
	</td></tr>
299
</table>
297
</table>
300
</html>
298
</html>
301
 
-