- 阿部 博
- 所属
- (察して)
- 情報通信研究機構 協力研究員
- Interop Tokyo ShowNet NOCメンバー(2015年〜)
- 阿部 博
- 肩書き・所属
- 北陸先端科学技術大学院大学 博士(情報科学)
- 株式会社レピダム 研究員
- 阿部 博
- 所属
- 株式会社レピダム 研究員
- ココン株式会社 社長補佐/技術研究室 研究員
- 阿部 博
- https://hirolovesbeer.github.io/
- 所属
- 株式会社レピダム 研究員
- 情報通信研究機構 協力研究員
- 北陸先端科学技術大学院大学 博士後期課程 4年
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, request, jsonify, json, abort | |
from flask_cors import CORS, cross_origin | |
import pandas as pd | |
app = Flask(__name__) | |
cors = CORS(app) | |
app.config['CORS_HEADERS'] = 'Content-Type' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os.path | |
import sqlite3 | |
#import time | |
#start = time.time() | |
db_file = 'test2.db' | |
log_file = '1m.log' | |
#db_file = 'test3.db' | |
#log_file = 'monitor_syslog.log' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os.path | |
import sqlite3 | |
db_file = 'test2.db' | |
if not os.path.exists(db_file): | |
conn = sqlite3.connect(db_file) | |
conn.execute("create virtual table syslog using fts3(logs)"); | |
conn = sqlite3.connect(db_file) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CentOS 7.2におけるiptablesを用いたsyslog転送設定 | |
+-----+ +-----+ +-----+ | |
|host1| -> |host2| -> |host3| | |
+-----+ +-----+ +-----+ | |
- host1(10.0.0.1) = syslogを送信するホスト(send-syslog.py <- 自作syslog送信pythonプログラム) | |
- host2(10.0.0.2) = syslogを転送するホスト(iptablesのNAT設定) | |
- host3(10.0.0.3) = syslogを受信するホスト(rsyslog) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import netsyslog | |
import syslog | |
logger = netsyslog.Logger() | |
logger.add_host("192.168.0.1") | |
for i in range(0, 99): | |
msg = "Hey, it works " + str(i) | |
# logger.log(syslog.LOG_USER, syslog.LOG_NOTICE, "Hey, it works!", pid=True) | |
logger.log(syslog.LOG_USER, syslog.LOG_NOTICE, msg, pid=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
import sys | |
from scapy.all import sniff | |
#sniff(iface="en0", prn=lambda x: x.show(), filter="udp") | |
sniff(iface="en0", prn=lambda x: x.show(), filter="udp and ( port 514 )") | |
#sniff(iface="en0", prn=lambda x: x.summary(), filter="udp and ( port 514 )") |
NewerOlder