xbase-util 0.6.5__tar.gz → 0.6.6__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {xbase_util-0.6.5 → xbase_util-0.6.6}/PKG-INFO +1 -1
- {xbase_util-0.6.5 → xbase_util-0.6.6}/setup.py +1 -1
- {xbase_util-0.6.5 → xbase_util-0.6.6}/xbase_util/packet_util.py +13 -26
- {xbase_util-0.6.5 → xbase_util-0.6.6}/xbase_util.egg-info/PKG-INFO +1 -1
- {xbase_util-0.6.5 → xbase_util-0.6.6}/README.md +0 -0
- {xbase_util-0.6.5 → xbase_util-0.6.6}/setup.cfg +0 -0
- {xbase_util-0.6.5 → xbase_util-0.6.6}/xbase_util/__init__.py +0 -0
- {xbase_util-0.6.5 → xbase_util-0.6.6}/xbase_util/add_column_util.py +0 -0
- {xbase_util-0.6.5 → xbase_util-0.6.6}/xbase_util/dangerous_util.py +0 -0
- {xbase_util-0.6.5 → xbase_util-0.6.6}/xbase_util/db/__init__.py +0 -0
- {xbase_util-0.6.5 → xbase_util-0.6.6}/xbase_util/db/bean/ConfigBean.py +0 -0
- {xbase_util-0.6.5 → xbase_util-0.6.6}/xbase_util/db/bean/CurrentConfigBean.py +0 -0
- {xbase_util-0.6.5 → xbase_util-0.6.6}/xbase_util/db/bean/FlowBean.py +0 -0
- {xbase_util-0.6.5 → xbase_util-0.6.6}/xbase_util/db/bean/TaskTemplateBean.py +0 -0
- {xbase_util-0.6.5 → xbase_util-0.6.6}/xbase_util/db/bean/__init__.py +0 -0
- {xbase_util-0.6.5 → xbase_util-0.6.6}/xbase_util/db/dao/ConfigDao.py +0 -0
- {xbase_util-0.6.5 → xbase_util-0.6.6}/xbase_util/db/dao/CurrentConfigDao.py +0 -0
- {xbase_util-0.6.5 → xbase_util-0.6.6}/xbase_util/db/dao/FlowDao.py +0 -0
- {xbase_util-0.6.5 → xbase_util-0.6.6}/xbase_util/db/dao/TaskTemplateDao.py +0 -0
- {xbase_util-0.6.5 → xbase_util-0.6.6}/xbase_util/db/dao/__init__.py +0 -0
- {xbase_util-0.6.5 → xbase_util-0.6.6}/xbase_util/db/initsqlite3.py +0 -0
- {xbase_util-0.6.5 → xbase_util-0.6.6}/xbase_util/es_db_util.py +0 -0
- {xbase_util-0.6.5 → xbase_util-0.6.6}/xbase_util/esreq.py +0 -0
- {xbase_util-0.6.5 → xbase_util-0.6.6}/xbase_util/geo_util.py +0 -0
- {xbase_util-0.6.5 → xbase_util-0.6.6}/xbase_util/handle_features_util.py +0 -0
- {xbase_util-0.6.5 → xbase_util-0.6.6}/xbase_util/pcap_util.py +0 -0
- {xbase_util-0.6.5 → xbase_util-0.6.6}/xbase_util/xbase_constant.py +0 -0
- {xbase_util-0.6.5 → xbase_util-0.6.6}/xbase_util/xbase_util.py +0 -0
- {xbase_util-0.6.5 → xbase_util-0.6.6}/xbase_util.egg-info/SOURCES.txt +0 -0
- {xbase_util-0.6.5 → xbase_util-0.6.6}/xbase_util.egg-info/dependency_links.txt +0 -0
- {xbase_util-0.6.5 → xbase_util-0.6.6}/xbase_util.egg-info/not-zip-safe +0 -0
- {xbase_util-0.6.5 → xbase_util-0.6.6}/xbase_util.egg-info/top_level.txt +0 -0
- {xbase_util-0.6.5 → xbase_util-0.6.6}/xbase_util_assets/GeoLite2-City.mmdb +0 -0
- {xbase_util-0.6.5 → xbase_util-0.6.6}/xbase_util_assets/arkimeparse.js +0 -0
@@ -96,14 +96,6 @@ def get_all_packets_by_reg(packets):
|
|
96
96
|
return packet_list
|
97
97
|
|
98
98
|
|
99
|
-
def get_body(packet):
|
100
|
-
try:
|
101
|
-
return "".join([item for item in packet.split("\r\n\r\n") if "HTTP/" not in item])
|
102
|
-
except Exception:
|
103
|
-
traceback.print_exc()
|
104
|
-
return ""
|
105
|
-
|
106
|
-
|
107
99
|
def get_header_value(header_set, value):
|
108
100
|
result = [item for item in header_set if value in item]
|
109
101
|
if len(result) != 0:
|
@@ -112,23 +104,20 @@ def get_header_value(header_set, value):
|
|
112
104
|
return ""
|
113
105
|
|
114
106
|
|
115
|
-
def get_detail_by_package(
|
107
|
+
def get_detail_by_package(publicField, req_header, req_body, res_header, res_body):
|
116
108
|
"""
|
117
109
|
通过pcap的数量分离session并完善相关字段
|
118
|
-
:param packets_from_pcap: 通过PcAp解析出的包
|
119
110
|
:param publicField: 原始的session单条数据
|
111
|
+
:param req_header:请求头
|
112
|
+
:param req_body:请求体
|
113
|
+
:param res_header:响应头
|
114
|
+
:param res_body:响应体
|
120
115
|
:return: 完整的单条数据
|
121
116
|
"""
|
122
117
|
res_field = publicField.copy()
|
123
|
-
if use_regx:
|
124
|
-
req = packets_from_pcap['req_body']
|
125
|
-
res = packets_from_pcap['res_body']
|
126
|
-
else:
|
127
|
-
res = packets_from_pcap["response"]
|
128
|
-
req = packets_from_pcap["request"]
|
129
118
|
res_field["initRTT"] = firstOrZero(res_field.get("initRTT", 0))
|
130
119
|
res_field["length"] = firstOrZero(res_field.get("length", 0))
|
131
|
-
request_lines =
|
120
|
+
request_lines = req_header.strip().split("\n")
|
132
121
|
http_request_lines = [item for item in request_lines if "HTTP" in item]
|
133
122
|
if len(http_request_lines) != 0:
|
134
123
|
first_line = http_request_lines[0].split(" ")
|
@@ -144,15 +133,13 @@ def get_detail_by_package(packets_from_pcap, publicField, use_regx):
|
|
144
133
|
value="Content-Type")
|
145
134
|
res_field['http.hostTokens'] = get_header_value(header_set=request_lines, value="Host")
|
146
135
|
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
response_lines = res.strip().split("\n")
|
136
|
+
res_field['plain_body_src'] = ""
|
137
|
+
res_field['plain_body_dst'] = ""
|
138
|
+
if content_type_is_plain(req_header):
|
139
|
+
res_field['plain_body_src'] = req_body
|
140
|
+
if content_type_is_plain(res_header):
|
141
|
+
res_field['plain_body_dst'] = res_body
|
142
|
+
response_lines = res_body.strip().split("\n")
|
156
143
|
http_response_lines = [item for item in response_lines if "HTTP" in item]
|
157
144
|
if len(http_response_lines) != 0:
|
158
145
|
first_line = http_response_lines[0].strip().split(" ")
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|