dshield-parser 0.1.3__tar.gz → 0.1.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dshield_parser-0.1.3 → dshield_parser-0.1.5}/PKG-INFO +2 -2
- {dshield_parser-0.1.3 → dshield_parser-0.1.5}/dshield_parser/utils/json.py +19 -6
- {dshield_parser-0.1.3 → dshield_parser-0.1.5}/dshield_parser.egg-info/PKG-INFO +2 -2
- {dshield_parser-0.1.3 → dshield_parser-0.1.5}/setup.py +2 -2
- {dshield_parser-0.1.3 → dshield_parser-0.1.5}/README.md +0 -0
- {dshield_parser-0.1.3 → dshield_parser-0.1.5}/dshield_parser/__init__.py +0 -0
- {dshield_parser-0.1.3 → dshield_parser-0.1.5}/dshield_parser/__main__.py +0 -0
- {dshield_parser-0.1.3 → dshield_parser-0.1.5}/dshield_parser/cowrie_processor/__init__.py +0 -0
- {dshield_parser-0.1.3 → dshield_parser-0.1.5}/dshield_parser/cowrie_processor/__main__.py +0 -0
- {dshield_parser-0.1.3 → dshield_parser-0.1.5}/dshield_parser/cowrie_processor/reports.py +0 -0
- {dshield_parser-0.1.3 → dshield_parser-0.1.5}/dshield_parser/firewall_processor/__init__.py +0 -0
- {dshield_parser-0.1.3 → dshield_parser-0.1.5}/dshield_parser/firewall_processor/__main__.py +0 -0
- {dshield_parser-0.1.3 → dshield_parser-0.1.5}/dshield_parser/firewall_processor/reports.py +0 -0
- {dshield_parser-0.1.3 → dshield_parser-0.1.5}/dshield_parser/test/__init__.py +0 -0
- {dshield_parser-0.1.3 → dshield_parser-0.1.5}/dshield_parser/test/test_json.py +0 -0
- {dshield_parser-0.1.3 → dshield_parser-0.1.5}/dshield_parser/utils/__init__.py +0 -0
- {dshield_parser-0.1.3 → dshield_parser-0.1.5}/dshield_parser/utils/__main__.py +0 -0
- {dshield_parser-0.1.3 → dshield_parser-0.1.5}/dshield_parser/utils/enrichment.py +0 -0
- {dshield_parser-0.1.3 → dshield_parser-0.1.5}/dshield_parser/utils/file_io.py +0 -0
- {dshield_parser-0.1.3 → dshield_parser-0.1.5}/dshield_parser/utils/graphs.py +0 -0
- {dshield_parser-0.1.3 → dshield_parser-0.1.5}/dshield_parser/utils/ml.py +0 -0
- {dshield_parser-0.1.3 → dshield_parser-0.1.5}/dshield_parser/utils/sql.py +0 -0
- {dshield_parser-0.1.3 → dshield_parser-0.1.5}/dshield_parser/utils/ssh.py +0 -0
- {dshield_parser-0.1.3 → dshield_parser-0.1.5}/dshield_parser/web_processor/__init__.py +0 -0
- {dshield_parser-0.1.3 → dshield_parser-0.1.5}/dshield_parser/web_processor/__main__.py +0 -0
- {dshield_parser-0.1.3 → dshield_parser-0.1.5}/dshield_parser/web_processor/reports.py +0 -0
- {dshield_parser-0.1.3 → dshield_parser-0.1.5}/dshield_parser.egg-info/SOURCES.txt +0 -0
- {dshield_parser-0.1.3 → dshield_parser-0.1.5}/dshield_parser.egg-info/dependency_links.txt +0 -0
- {dshield_parser-0.1.3 → dshield_parser-0.1.5}/dshield_parser.egg-info/top_level.txt +0 -0
- {dshield_parser-0.1.3 → dshield_parser-0.1.5}/pyproject.toml +0 -0
- {dshield_parser-0.1.3 → dshield_parser-0.1.5}/setup.cfg +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dshield_parser
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.5
|
|
4
4
|
Summary: This program has utilities to download, parse and enrich DSHield honeypot data
|
|
5
5
|
Home-page: https://github.com/jslagrew/dshield-parser
|
|
6
6
|
Author: Jesse La Grew
|
|
7
7
|
Author-email: jlagrew.github@proton.me
|
|
8
|
-
Requires-Python:
|
|
8
|
+
Requires-Python: >=3.12.7
|
|
9
9
|
Dynamic: author
|
|
10
10
|
Dynamic: author-email
|
|
11
11
|
Dynamic: home-page
|
|
@@ -16,6 +16,19 @@ import pandas as pd
|
|
|
16
16
|
default_datespan={'start_date': '1970-01-01', 'end_date': '3000-01-01'}
|
|
17
17
|
default_timespan={"start_time": 0, "end_time": 32516881838}
|
|
18
18
|
|
|
19
|
+
def _groupby_size(df):
|
|
20
|
+
"""
|
|
21
|
+
Compatibility wrapper for groupby().size() that works with pandas 2.x and 3.x.
|
|
22
|
+
In pandas 3.0, 'size' became a reserved GroupBy method name and can no longer
|
|
23
|
+
be used as a column selector after groupby(). This helper renames the column
|
|
24
|
+
temporarily to avoid the conflict.
|
|
25
|
+
"""
|
|
26
|
+
group_cols = df.columns.difference(['size']).tolist()
|
|
27
|
+
result = df.rename(columns={'size': '_count'})
|
|
28
|
+
result = result.groupby(result.columns.difference(['_count']).tolist(), as_index=False, dropna=False)['_count'].sum()
|
|
29
|
+
result = result.rename(columns={'_count': 'size'})
|
|
30
|
+
return result
|
|
31
|
+
|
|
19
32
|
def print_json_pretty(incoming_data):
|
|
20
33
|
for json_data in incoming_data:
|
|
21
34
|
if os.path.exists(json_data):
|
|
@@ -153,13 +166,13 @@ def get_json_values(key, incoming_data, timespan=default_timespan, exclusions=No
|
|
|
153
166
|
logging.info(f"50 days of data processed or more than 500k records found. Collapsing dataframe by date (grouping by).")
|
|
154
167
|
file_df = pd.DataFrame(values)
|
|
155
168
|
file_df = file_df.groupby(file_df.columns.tolist(),as_index=False, dropna=False).size()
|
|
156
|
-
df = pd.concat([df, file_df])
|
|
169
|
+
df = _groupby_size(pd.concat([df, file_df]))
|
|
157
170
|
values = []
|
|
158
171
|
elif end_date in file.name or (file.name == incoming_data[-1].name):
|
|
159
172
|
logging.info(f"Last day being processed: {date}")
|
|
160
173
|
file_df = pd.DataFrame(values)
|
|
161
174
|
file_df = file_df.groupby(file_df.columns.tolist(),as_index=False, dropna=False).size()
|
|
162
|
-
df = pd.concat([df, file_df])
|
|
175
|
+
df = _groupby_size(pd.concat([df, file_df]))
|
|
163
176
|
values = []
|
|
164
177
|
day_count += 1
|
|
165
178
|
|
|
@@ -200,7 +213,7 @@ def get_json_values(key, incoming_data, timespan=default_timespan, exclusions=No
|
|
|
200
213
|
logging.info(f"Undated data file finished processing: {file}")
|
|
201
214
|
file_df = pd.DataFrame(values)
|
|
202
215
|
file_df = file_df.groupby(file_df.columns.tolist(),as_index=False, dropna=False).size()
|
|
203
|
-
df = pd.concat([df, file_df])
|
|
216
|
+
df = _groupby_size(pd.concat([df, file_df]))
|
|
204
217
|
values = []
|
|
205
218
|
|
|
206
219
|
else:
|
|
@@ -220,7 +233,7 @@ def get_json_values(key, incoming_data, timespan=default_timespan, exclusions=No
|
|
|
220
233
|
logging.info(f"Firewall log finished processing: {file}")
|
|
221
234
|
file_df = pd.DataFrame(values)
|
|
222
235
|
file_df = file_df.groupby(file_df.columns.tolist(),as_index=False, dropna=False).size()
|
|
223
|
-
df = pd.concat([df, file_df])
|
|
236
|
+
df = _groupby_size(pd.concat([df, file_df]))
|
|
224
237
|
values = []
|
|
225
238
|
|
|
226
239
|
# print out variable memory usage
|
|
@@ -228,7 +241,7 @@ def get_json_values(key, incoming_data, timespan=default_timespan, exclusions=No
|
|
|
228
241
|
locals().items())), key= lambda x: -x[1])[:10]:
|
|
229
242
|
print("{:>30}: {:>8}".format(name, sizeof_fmt(size)))
|
|
230
243
|
|
|
231
|
-
df =
|
|
244
|
+
df = _groupby_size(df)
|
|
232
245
|
return df
|
|
233
246
|
|
|
234
247
|
def summarize_values(list):
|
|
@@ -482,7 +495,7 @@ def convert_to_datetime(dictionary):
|
|
|
482
495
|
return new_dates
|
|
483
496
|
|
|
484
497
|
def convert_to_epoch(date):
|
|
485
|
-
return datetime.strptime(date, "%Y-%m-%d")
|
|
498
|
+
return datetime.strptime(date, "%Y-%m-%d").timestamp()
|
|
486
499
|
|
|
487
500
|
def convert_to_date(timestamp):
|
|
488
501
|
return datetime.fromtimestamp(timestamp).strftime('%Y-%m-%d')
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dshield_parser
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.5
|
|
4
4
|
Summary: This program has utilities to download, parse and enrich DSHield honeypot data
|
|
5
5
|
Home-page: https://github.com/jslagrew/dshield-parser
|
|
6
6
|
Author: Jesse La Grew
|
|
7
7
|
Author-email: jlagrew.github@proton.me
|
|
8
|
-
Requires-Python:
|
|
8
|
+
Requires-Python: >=3.12.7
|
|
9
9
|
Dynamic: author
|
|
10
10
|
Dynamic: author-email
|
|
11
11
|
Dynamic: home-page
|
|
@@ -2,7 +2,7 @@ import setuptools
|
|
|
2
2
|
|
|
3
3
|
setuptools.setup(
|
|
4
4
|
name="dshield_parser",
|
|
5
|
-
version="0.1.
|
|
5
|
+
version="0.1.5",
|
|
6
6
|
author="Jesse La Grew",
|
|
7
7
|
author_email="jlagrew.github@proton.me",
|
|
8
8
|
description="This program has utilities to download, parse and enrich DSHield honeypot data",
|
|
@@ -13,6 +13,6 @@ setuptools.setup(
|
|
|
13
13
|
# ['summarize_urls=utils.json:summarize_urls',
|
|
14
14
|
# 'summarize_urls=utils.json:summarize_commands']
|
|
15
15
|
#},
|
|
16
|
-
python_requires='
|
|
16
|
+
python_requires='>=3.12.7'
|
|
17
17
|
#install_requires=['matplotlib', 'numpy', 'pandas', 'Requests', 'scikit_learn', 'shodan', 'SQLAlchemy']
|
|
18
18
|
)
|
|
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
|