forked from JMousqueton/ransomware.live
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate-negotiation.py
199 lines (169 loc) Β· 8.65 KB
/
create-negotiation.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
import json
import os
import glob
import logging
import sys
from datetime import datetime as dt
logging.basicConfig(
format='%(asctime)s,%(msecs)d %(levelname)-8s %(message)s',
datefmt='%Y-%m-%d:%H:%M:%S',
level=logging.INFO
)
def stdlog(msg):
'''standard infologging'''
logging.info(msg)
def dbglog(msg):
'''standard debug logging'''
logging.debug(msg)
def errlog(msg):
'''standard error logging'''
logging.error(msg)
def honk(msg):
'''critical error logging with termination'''
logging.critical(msg)
sys.exit()
def parse_group(group_name):
# Specify the directory path
directory_path = group_name
stdlog('Processing Group : ' + group_name )
group_name = os.path.basename(os.path.normpath(directory_path))
create_directory('./docs/negotiation/' + group_name.lower())
# Use glob to get all files with .json extension
json_files = glob.glob(os.path.join(directory_path, '*.json'))
# Process each JSON file
for file_path in json_files:
# Extract the file name without extension
file_name = os.path.splitext(os.path.basename(file_path))[0]
# Replace underscores with dots
name = file_name.replace('_', '.')
# Print the modified file name
stdlog("[" + group_name + "] Processing " + name + " from file : " + file_name)
with open(file_path) as file:
data = json.load(file)
codeHTML = f'''
<!DOCTYPE html>
<!--
βββββββ ββββββ ββββ βββββββββββ βββββββ ββββ βββββββ βββ ββββββ βββββββ ββββββββ βββ ββββββ βββββββββββ
βββββββββββββββββββββ βββββββββββββββββββββββββ ββββββββ βββββββββββββββββββββββββββ βββ ββββββ βββββββββββ
ββββββββββββββββββββββ ββββββββββββββ βββββββββββββββββ ββ βββββββββββββββββββββββββ βββ ββββββ βββββββββ
βββββββββββββββββββββββββββββββββββββ ββββββββββββββββββββββββββββββββββββββββββββββ βββ βββββββ ββββββββββ
βββ ββββββ ββββββ ββββββββββββββββββββββββββ βββ ββββββββββββββββ ββββββ βββββββββββββββββββββββββ βββββββ ββββββββ
βββ ββββββ ββββββ βββββββββββββ βββββββ βββ βββ ββββββββ βββ ββββββ βββββββββββββββββββββββββ βββββ ββββββββ
version 2023-04
by Julien Mousqueton https://julien.io
-->
<html lang="en">
<head>
<meta charset="UTF-8">
<title>{group_name} Negotiations</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="description" content="Ransomware.live : Ransomware Groups {group_name} Negotiations">
<meta name="keywords" content="ransomware, breach, leak, post, gang, data, cybersecurity, victims, ransom, julien, mousqueton, julien mousqueton, CyberSoc, CTI, negotiation, ransom">
<!-- Open Graph / Facebook -->
<meta property="og:type" content="website">
<meta property="og:url" content="https://chat.ransomware.live">
<meta property="og:title" content="Ransomware.live π">
<meta property="og:description" content="Ransomware.live : Ransomware Groups {group_name} Negotiations">
<meta property="og:image" content="https://chat.ransomware.live/ransomware.png">
<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:url" content="https://chat.ransomware.live/">
<meta property="twitter:title" content="Ransomware.live π">
<meta property="twitter:description" content="Ransomware.live : Ransomware Groups {group_name} Negotiations">
<meta property="twitter:image" content="https://chat.ransomware.live/ransomware.png">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
<link rel="canonical" href="https://chat.ransomware.live">
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="https://static.ransomware.live/negotiation.css"></head><body><div class="container">
'''
codeHTML += '''
<style>
/* Remove the border from the link */
.logo-link {
text-decoration: none;
border: none;
}
#Copyright {
font-size: 15px;
font-weight: bold;
font-family: 'Comic Sans MS', cursive;
color: #808080; /* Darker text color */
margin-top: 15px;
margin-bottom: 10px;
text-align: center;
}
#Copyright a {
text-decoration: none;
}
#Copyright a:visited {
color: #808080;
}
</style>
</head>
<body>
'''
if group_name == 'lockbit3.0':
id='lockbit3'
else:
id=group_name
chat_id = data['chat_id']
try:
date_object = dt.strptime(chat_id, "%Y%m%d")
chat_id = 'Date: ' + date_object.strftime("%Y-%m-%d")
except:
pass
if data['chat_id'] == '':
try:
date_object = dt.strptime(name[:8], "%Y%m%d")
chat_id = 'Date: ' + date_object.strftime("%Y-%m-%d")
except:
pass
codeHTML += '<h1>π¬ Negotiation with <a href="https://www.ransomware.live/#/group/' + id.lower() + '">' + group_name + '</a></h1><BR>'
codeHTML += '<h2> ID: ' + name + '</h2>'
codeHTML += '<p class="comment">' + chat_id + '</p><div class="imessage">'
for message in data['messages']:
party = message['party']
content = message['content']
timestamp = message['timestamp']
if party == 'Victim':
codeHTML += '<p class="from-victim">' + content + '<br></br><i>' + timestamp + '</i></p>'
else :
codeHTML += '<p class="from-gang">' + content + '<br></br><i>' + timestamp + '</i></p>'
codeHTML += '''
</div></div><footer>
<p id="Copyright">Source : <a href="https://github.com/Casualtek/Ransomchats" target=_blank>ValΓ©ry Marchive</a></p>
</footer></body></html>
'''
with open('./docs/negotiation/' + group_name.lower() + '/' + file_name+'.html', 'w') as output:
# Write the variable's value to the file
output.write(codeHTML)
def get_gangs(directory_path):
directories = []
for entry in os.listdir(directory_path):
entry_path = os.path.join(directory_path, entry)
if os.path.isdir(entry_path):
directories.append(entry_path)
return directories
def create_directory(directory_path):
if not os.path.exists(directory_path.lower()):
os.makedirs(directory_path.lower())
print(
'''
_______________ |*\_/*|________
| ___________ | ||_/-\_|______ |
| | | | | | | |
| | 0 0 | | | | 0 0 | |
| | - | | | | - | |
| | \___/ | | | | \___/ | |
| |___ ___| | | |___________| |
|_____|\_/|_____| |_______________|
_|__|/ \|_|_.............π.............._|________|_
/ ********** \ / ********** \
/ ************ \ ransomware.live / ************ \
-------------------- --------------------
'''
)
for gang in get_gangs('./data'):
if gang not in ['./data/parsers', './data/.git']:
parse_group(gang)