Skip to content

Instantly share code, notes, and snippets.

<?php
/*
* The pcap file is the results of the following...
* tcpdump -G 60 -v arp and 'arp[7]==2' -w test_%M.pcap
*
*/
function sender_mac_address($pcapfilename,$packetstart){
$bincap = file_get_contents($pcapfilename);
@maakunh
maakunh / ping.php
Last active October 24, 2017 08:14
<?php
require_once "parse_arp_from_pcap.php";
//センサーネットワークアドレスを取得する
$network_addr = sensor_network_addr();
list($network_ip, $mask) = explode('/', $network_addr);
$imax = pow(2, 32 - $mask) - 2;
<?php
require_once "parse_arp_from_pcap.php";
//センサーネットワークアドレスを取得する
$network_addr = sensor_network_addr();
list($network_ip, $mask) = explode('/', $network_addr);
$imax = pow(2, 32 - $mask) - 2;
$sensor_ip_addr = sensor_ip_addr();
<?php
require_once "parse_arp_from_pcap.php";
//センサー操作指示を取得する
echo sensor_operation();
//センサー情報をサーバへ通知する
//echo arp_sensor();
$dir = sensor_system_root()."/pcap";
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <getopt.h>
#include <errno.h>
#include <sys/socket.h>
#include <net/ethernet.h>
#include <net/if_arp.h>
#include <netinet/ip.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <getopt.h>
#include <errno.h>
#include <sys/socket.h>
#include <net/ethernet.h>
#include <net/if_arp.h>
#include <netinet/ip.h>
set be_db_path="C:\Documents and Settings\All Users\Application Data\2SE"
set tool_path=C:\tools\OWL
copy /y %be_db_path%\be.db %tool_path%\
cd /d C:\tools\OWL
powershell.exe C:\tools\OWL\owl_SQLite.ps1
rem php %tool_path%\owl_SQLite.phpset be_db_path="C:\Documents and Settings\All Users\Application Data\2SE"
set tool_path=C:\tools\OWL