forked from tanjiti/packet_analysis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
print_tcp_session.py
48 lines (40 loc) · 1.79 KB
/
print_tcp_session.py
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
import logging
from lib.ServerConf import ServerConf
from stream_handler.StreamHandler import StreamHandler
def main():
"""
:return:
"""
co = ServerConf(mills.path("etc/server.yaml"))
sho = StreamHandler(pcap_file=co.pcap_file,
device=co.device,
bpf_filter=co.bpf_filter,
dst_tcp_ip_filter=co.dst_tcp_ip_filter,
dst_tcp_port_filter=co.dst_tcp_port_filter,
src_tcp_ip_filter=co.src_tcp_ip_filter,
src_tcp_port_filter=co.src_tcp_port_filter,
udp_ip_filter=co.udp_ip_filter,
udp_port_filter=co.udp_port_filter,
data_level=co.data_level,
data_stream_direct=co.data_stream_direct,
std_output_enable=co.std_output_enable,
file_output_path=co.file_output_path,
protocol_parse_conf=co.protocol_parse_conf,
is_handle_ip=co.is_handle_ip,
is_handle_tcp=co.is_handle_tcp,
is_handle_udp=co.is_handle_udp,
sqlite3_output_enable=co.sqlite3_output_enable,
sqlite3_output_path=co.sqlite3_output_path,
sqlite3_output_schema=co.sqlite3_output_schema,
sqlite3_renew=co.sqlite3_renew)
sho.run()
if __name__ == "__main__":
"""
"""
import lib.mills as mills
import lib.logger as logger
logger.generate_special_logger(level=logging.DEBUG,
logtype="tcpsession",
curdir=mills.path("./log"),
ismultiprocess=False)
main()