First Commit

This commit is contained in:
brotoskyj
2025-07-29 10:51:21 -04:00
commit 67330e4017
5 changed files with 223 additions and 0 deletions
+49
View File
@@ -0,0 +1,49 @@
import datetime
import dotenv
import json
import requests
import socket
import utils.database
import utils.teamsconnector
def main():
utils.database.createdatabasefile()
current_date = datetime.date.today()
month = current_date.month
year = current_date.year
try:
response = requests.get(f'https://api.ransomware.live/v2/victims/{year}/{month}')
except Exception as e:
print(e)
json_parse = json.loads(response.content)
format_date_string = "%Y-%m-%d %H:%M:%S.%f"
for vic in json_parse:
date_object = datetime.datetime.strptime(vic['discovered'], format_date_string)
date = date_object.date()
if current_date == date:
sqlresult = utils.database.checkdatabase(vic['victim'], vic['discovered'])
if sqlresult is False:
vendor = vic['victim']
date_added = vic['discovered']
domain = vic['domain']
group = vic['group']
try:
if domain != "" and " " not in domain:
ip_address = socket.getaddrinfo(domain, 0, 0, 0, 0)
unique_ips = list(set([addr[-1][0] for addr in ip_address]))
else:
unique_ips = "Unknown"
except:
unique_ips = "Unknown"
print("=== Victim Added ===")
print(f"""
Vendor: {vendor}
Date: {date_added}
Domain: {domain}
IP Addresses: {str(unique_ips).replace('[','').replace(']', '')}
Attack Group: {group}
""")
utils.teamsconnector.teamswebhook(vic['victim'], vic['discovered'], vic['domain'], vic['group'], unique_ips, vic['description'])
if __name__ == "__main__":
main()