diff --git a/Comint Analysis/comint_analysis.ipynb b/Comint Analysis/comint_analysis.ipynb new file mode 100644 index 0000000..b5ee507 --- /dev/null +++ b/Comint Analysis/comint_analysis.ipynb @@ -0,0 +1,250 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "from deep_translator import GoogleTranslator" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
timestampsenderreceiverbody
02024-01-12 11:24:32darkhawk@h4ckm3.onionshadowfox@crypt0n3t.onion你找到那台服务器的后门了吗?
12024-01-14 11:28:47shadowfox@crypt0n3t.oniondarkhawk@h4ckm3.onion还没有,我还在分析代码。
22024-01-12 11:31:15darkhawk@h4ckm3.onionshadowfox@crypt0n3t.onion试试社会工程学攻击?
32024-01-12 11:35:58shadowfox@crypt0n3t.oniondarkhawk@h4ckm3.onion好的,我会试试。
42024-01-12 11:38:21ghostbyte@d33pweb.oniondarkhawk@h4ckm3.onion那个新漏洞的利用工具你搞定了吗?
\n", + "
" + ], + "text/plain": [ + " timestamp sender receiver \\\n", + "0 2024-01-12 11:24:32 darkhawk@h4ckm3.onion shadowfox@crypt0n3t.onion \n", + "1 2024-01-14 11:28:47 shadowfox@crypt0n3t.onion darkhawk@h4ckm3.onion \n", + "2 2024-01-12 11:31:15 darkhawk@h4ckm3.onion shadowfox@crypt0n3t.onion \n", + "3 2024-01-12 11:35:58 shadowfox@crypt0n3t.onion darkhawk@h4ckm3.onion \n", + "4 2024-01-12 11:38:21 ghostbyte@d33pweb.onion darkhawk@h4ckm3.onion \n", + "\n", + " body \n", + "0 你找到那台服务器的后门了吗? \n", + "1 还没有,我还在分析代码。 \n", + "2 试试社会工程学攻击? \n", + "3 好的,我会试试。 \n", + "4 那个新漏洞的利用工具你搞定了吗? " + ] + }, + "execution_count": 29, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "data = pd.read_json(\"transcripts.json\")\n", + "data.head()" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": {}, + "outputs": [], + "source": [ + "data['en_translation'] = data.body.apply(\n", + " lambda message: GoogleTranslator(source=\"auto\", target=\"en\").translate(message)\n", + ")\n", + "\n", + "#handle errors\n", + "data.loc[data.en_translation == '', 'en_translation'] = 'Error in translating message. Manual review is required.'" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
bodyen_translation
0你找到那台服务器的后门了吗?Did you find the backdoor to that server?
1还没有,我还在分析代码。Not yet, I'm still analyzing the code.
2试试社会工程学攻击?Try a social engineering attack?
3好的,我会试试。OK, I'll try it.
4那个新漏洞的利用工具你搞定了吗?Have you got the tool to exploit the new vulne...
5还没,我遇到了一些问题。Not yet, I'm having some problems.
6需要帮忙吗?Do you need help?
7好的,谢谢。OK, thanks.
\n", + "
" + ], + "text/plain": [ + " body en_translation\n", + "0 你找到那台服务器的后门了吗? Did you find the backdoor to that server?\n", + "1 还没有,我还在分析代码。 Not yet, I'm still analyzing the code.\n", + "2 试试社会工程学攻击? Try a social engineering attack?\n", + "3 好的,我会试试。 OK, I'll try it.\n", + "4 那个新漏洞的利用工具你搞定了吗? Have you got the tool to exploit the new vulne...\n", + "5 还没,我遇到了一些问题。 Not yet, I'm having some problems.\n", + "6 需要帮忙吗? Do you need help?\n", + "7 好的,谢谢。 OK, thanks." + ] + }, + "execution_count": 32, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "data[['body',\"en_translation\"]]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "venv", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/Comint Analysis/csv_to_json_util.py b/Comint Analysis/csv_to_json_util.py new file mode 100644 index 0000000..404fec2 --- /dev/null +++ b/Comint Analysis/csv_to_json_util.py @@ -0,0 +1,18 @@ +import json +import csv + +def csv_to_json(csv_file_path, json_file_path): + + with open(csv_file_path, 'r', encoding="utf-8") as csvf: + + #load csv file data using csv lib + csvReader = csv.DictReader(csvf) + + json_array = [row for row in csvReader] + + + with open(json_file_path, "w", encoding="utf-8") as jsonf: + jsonString = json.dumps(json_array, ensure_ascii=False,indent=4) + jsonf.write(jsonString) + +csv_to_json("./transcripts.csv", "./transcripts.json") diff --git a/Comint Analysis/transcripts.csv b/Comint Analysis/transcripts.csv new file mode 100644 index 0000000..e6b1266 --- /dev/null +++ b/Comint Analysis/transcripts.csv @@ -0,0 +1,9 @@ +timestamp,sender,receiver,body +2024-01-12 11:24:32,darkhawk@h4ckm3.onion,shadowfox@crypt0n3t.onion,你找到那台服务器的后门了吗? +2024-01-14 11:28:47,shadowfox@crypt0n3t.onion,darkhawk@h4ckm3.onion,还没有,我还在分析代码。 +2024-01-12 11:31:15,darkhawk@h4ckm3.onion,shadowfox@crypt0n3t.onion,试试社会工程学攻击? +2024-01-12 11:35:58,shadowfox@crypt0n3t.onion,darkhawk@h4ckm3.onion,好的,我会试试。 +2024-01-12 11:38:21,ghostbyte@d33pweb.onion,darkhawk@h4ckm3.onion,那个新漏洞的利用工具你搞定了吗? +2024-01-12 11:42:46,darkhawk@h4ckm3.onion,ghostbyte@d33pweb.onion,还没,我遇到了一些问题。 +2024-01-12 11:45:33,ghostbyte@d33pweb.onion,darkhawk@h4ckm3.onion,需要帮忙吗? +2024-01-12 11:49:17,darkhawk@h4ckm3.onion,ghostbyte@d33pweb.onion,好的,谢谢。 diff --git a/Comint Analysis/transcripts.json b/Comint Analysis/transcripts.json new file mode 100644 index 0000000..39045f4 --- /dev/null +++ b/Comint Analysis/transcripts.json @@ -0,0 +1,50 @@ +[ + { + "timestamp": "2024-01-12 11:24:32", + "sender": "darkhawk@h4ckm3.onion", + "receiver": "shadowfox@crypt0n3t.onion", + "body": "你找到那台服务器的后门了吗?" + }, + { + "timestamp": "2024-01-14 11:28:47", + "sender": "shadowfox@crypt0n3t.onion", + "receiver": "darkhawk@h4ckm3.onion", + "body": "还没有,我还在分析代码。" + }, + { + "timestamp": "2024-01-12 11:31:15", + "sender": "darkhawk@h4ckm3.onion", + "receiver": "shadowfox@crypt0n3t.onion", + "body": "试试社会工程学攻击?" + }, + { + "timestamp": "2024-01-12 11:35:58", + "sender": "shadowfox@crypt0n3t.onion", + "receiver": "darkhawk@h4ckm3.onion", + "body": "好的,我会试试。" + }, + { + "timestamp": "2024-01-12 11:38:21", + "sender": "ghostbyte@d33pweb.onion", + "receiver": "darkhawk@h4ckm3.onion", + "body": "那个新漏洞的利用工具你搞定了吗?" + }, + { + "timestamp": "2024-01-12 11:42:46", + "sender": "darkhawk@h4ckm3.onion", + "receiver": "ghostbyte@d33pweb.onion", + "body": "还没,我遇到了一些问题。" + }, + { + "timestamp": "2024-01-12 11:45:33", + "sender": "ghostbyte@d33pweb.onion", + "receiver": "darkhawk@h4ckm3.onion", + "body": "需要帮忙吗?" + }, + { + "timestamp": "2024-01-12 11:49:17", + "sender": "darkhawk@h4ckm3.onion", + "receiver": "ghostbyte@d33pweb.onion", + "body": "好的,谢谢。" + } +] \ No newline at end of file