aboutsummaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorauth12 <[email protected]>2020-07-24 16:26:07 -0700
committerauth12 <[email protected]>2020-07-24 16:26:07 -0700
commit10a1f83f57d61cd6776eaf8dbcefd4814a63b649 (patch)
tree31466d7bf480c8b489b3b1f4b82e881b858e4de5 /client
parentInjection process changes and server improvements. (diff)
downloadloader-10a1f83f57d61cd6776eaf8dbcefd4814a63b649.tar.xz
loader-10a1f83f57d61cd6776eaf8dbcefd4814a63b649.zip
Compile fix.
Fixed x64 image support server side.
Diffstat (limited to 'client')
-rw-r--r--client/src/client/packet.h2
-rw-r--r--client/src/injection/mapper.cpp16
-rw-r--r--client/src/main.cpp5
3 files changed, 10 insertions, 13 deletions
diff --git a/client/src/client/packet.h b/client/src/client/packet.h
index b8d9ecf..ebefe46 100644
--- a/client/src/client/packet.h
+++ b/client/src/client/packet.h
@@ -24,8 +24,8 @@ namespace tcp {
struct packet_t {
std::string message;
std::string session_id;
+ uint16_t seq;
int id;
- int seq;
packet_t() {}
packet_t(const std::string_view msg, const packet_type type,
diff --git a/client/src/injection/mapper.cpp b/client/src/injection/mapper.cpp
index 68f0f6e..0b993a0 100644
--- a/client/src/injection/mapper.cpp
+++ b/client/src/injection/mapper.cpp
@@ -6,7 +6,7 @@
void mmap::thread(tcp::client& client) {
while (client.mapper_data.imports.empty()) {
- std::this_thread::sleep_for(std::chrono::milliseconds(100));
+ std::this_thread::sleep_for(std::chrono::seconds(2));
}
std::vector<util::process> process_list;
@@ -45,8 +45,6 @@ void mmap::thread(tcp::client& client) {
return;
}
- client.mapper_data.image_size = 0;
-
io::logger->info("image base : {:x}", image);
auto imports = nlohmann::json::parse(client.mapper_data.imports);
@@ -81,8 +79,8 @@ void mmap::thread(tcp::client& client) {
client.mapper_data.imports.clear();
io::logger->info("please wait...");
- while (client.mapper_data.image.empty()) {
- std::this_thread::sleep_for(std::chrono::seconds(1));
+ while (client.mapper_data.image.size() != client.mapper_data.image_size) {
+ std::this_thread::sleep_for(std::chrono::seconds(2));
}
if (!needle->write(image, client.mapper_data.image.data(), client.mapper_data.image.size())) {
@@ -102,12 +100,6 @@ void mmap::thread(tcp::client& client) {
*reinterpret_cast<uint32_t*>(&shellcode[8]) = image;
*reinterpret_cast<uint32_t*>(&shellcode[13]) = entry;
- /*static std::vector<uint8_t> shellcode = { 0x48, 0x83, 0xEC, 0x28, 0x48, 0xB9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0xC7, 0xC2, 0x01,
- 0x00, 0x00, 0x00, 0x4D, 0x31, 0xC0, 0x48, 0xB8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xD0, 0x48, 0x83, 0xC4, 0x28, 0xC3 };
-
- *reinterpret_cast<uint64_t*>(&shellcode[6]) = image;
- *reinterpret_cast<uint32_t*>(&shellcode[26]) = entry;*/
-
auto code = needle->allocate(shellcode.size(), MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE);
if (!needle->write(code, shellcode.data(), shellcode.size())) {
io::logger->error("failed to write shellcode.");
@@ -124,5 +116,7 @@ void mmap::thread(tcp::client& client) {
io::logger->info("done");
+ client.shutdown();
+
client.state = tcp::client_state::injected;
} \ No newline at end of file
diff --git a/client/src/main.cpp b/client/src/main.cpp
index 441118a..718b728 100644
--- a/client/src/main.cpp
+++ b/client/src/main.cpp
@@ -173,7 +173,10 @@ int main(int argc, char* argv[]) {
}
- while (client.state != tcp::client_state::injected) {
+ while (client) {
std::this_thread::sleep_for(std::chrono::seconds(1));
}
+
+
+ std::cin.get();
}