最近開始直接向各國回報攻擊我們的ip
今天終於有一個國家回信 是日本
好感動
請我再提供log的時區及純文字檔
snort base 無法直接匯出
記錄一下sql語法
select event.cid,signature,sig_name,inet_ntoa(iphdr.ip_src),tcphdr.tcp_sport,inet_ntoa(iphdr.ip_dst),tcphdr.tcp_dport,timestamp from iphdr,event,signature,tcphdr where event.signature=signature.sig_id and event.cid=iphdr.cid and event.cid=tcphdr.cid and event.timestamp like '2015-12-04%' and inet_ntoa(iphdr.ip_src)="133.208.26.134" into outfile '/tmp/133.208.26.134.log';
事件的唯一值是 event裡的cid 其他table都要參考這個值
iphdr 放的是ip資料
tcphdr 放的是tcp的相關port 資料
udphdr 放的是udp的相關port 資料
2015/07/07
今天接到一個工作
要把snort裡的資料匯出成文字檔給外面的單位
因為BASE沒辦法一次全部匯出
所以要自己寫sql了
select event.cid,signature,sig_name,inet_ntoa(iphdr.ip_src),inet_ntoa(iphdr.ip_dst),timestamp from iphdr,event,signature where event.signature=signature.sig_id and event.cid=iphdr.cid into outfile '/tmp/sqloutput.txt';
http://www.andrew.cmu.edu/user/rdanyliw/snort/acid_db_er_v102.html
http://sgros.blogspot.tw/2012/07/querying-snort-sql-database.html
http://note.tc.edu.tw/670.html
要把snort裡的資料匯出成文字檔給外面的單位
因為BASE沒辦法一次全部匯出
所以要自己寫sql了
select event.cid,signature,sig_name,inet_ntoa(iphdr.ip_src),inet_ntoa(iphdr.ip_dst),timestamp from iphdr,event,signature where event.signature=signature.sig_id and event.cid=iphdr.cid into outfile '/tmp/sqloutput.txt';
http://www.andrew.cmu.edu/user/rdanyliw/snort/acid_db_er_v102.html
http://sgros.blogspot.tw/2012/07/querying-snort-sql-database.html
http://note.tc.edu.tw/670.html
2012/01/28
改善 BASE 的效能
理由: 瀏覽網頁時很慢
因為: 每次更新是把 snort 的資料抓取至 base 自已的 table 裡,隨著 event 資料量愈來愈大,需要固定時間更新 event cache
[1.] 安裝 lynx
[2.] 指令
/usr/bin/lynx -source http://localhost/base_maintenance.php?submit=Update+Alert+Cache
[3.] 排程
vi /etc/crontab
*/5 * * * * root /usr/bin/lynx -source http://localhost/base/base_maintenance.php?submit=Update+Alert+Cache > /dev/null
[4.] 用了排程的話,如此也就不用讓 BASE自動更新
vi base_config.php
$event_cache_auto_update = 0;
DNS and Whois cache
/usr/bin/lynx -source http://localhost/base/base_maintenance.php?submit=Update+IP+Cache
/usr/bin/lynx -source http://localhost/base/base_maintenance.php?submit=Update+Whois+Cache
ref: http://www.andrew.cmu.edu/user/rdanyliw/snort/acid_faq.html
更多内容 http://ssorc.tw/rewrite.php/read-270.html#ixzz1kjadFHfC
http://ssorc.tw/rewrite.php/read-270.html
理由: 瀏覽網頁時很慢
因為: 每次更新是把 snort 的資料抓取至 base 自已的 table 裡,隨著 event 資料量愈來愈大,需要固定時間更新 event cache
[1.] 安裝 lynx
[2.] 指令
/usr/bin/lynx -source http://localhost/base_maintenance.php?submit=Update+Alert+Cache
[3.] 排程
vi /etc/crontab
*/5 * * * * root /usr/bin/lynx -source http://localhost/base/base_maintenance.php?submit=Update+Alert+Cache > /dev/null
[4.] 用了排程的話,如此也就不用讓 BASE自動更新
vi base_config.php
$event_cache_auto_update = 0;
DNS and Whois cache
/usr/bin/lynx -source http://localhost/base/base_maintenance.php?submit=Update+IP+Cache
/usr/bin/lynx -source http://localhost/base/base_maintenance.php?submit=Update+Whois+Cache
ref: http://www.andrew.cmu.edu/user/rdanyliw/snort/acid_faq.html
更多内容 http://ssorc.tw/rewrite.php/read-270.html#ixzz1kjadFHfC
http://ssorc.tw/rewrite.php/read-270.html
訂閱:
文章 (Atom)