Skip to content

Commit 90783c8

Browse files
committed
settings.php, WSO 2.5 with novel obfuscation
1 parent bc91d28 commit 90783c8

File tree

9 files changed

+2725
-0
lines changed

9 files changed

+2725
-0
lines changed

webshells/settings.php/185.39.199.9XROF7FvHX6iRiPgAkp5yTAAAAAM.0.file

Lines changed: 54 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
2+
_SERVER
3+
Array
4+
(
5+
[UNIQUE_ID] => XROF7FvHX6iRiPgAkp5yTAAAAAM
6+
[SCRIPT_URL] => /wp-content/plugins/apikey/apikey.php
7+
[SCRIPT_URI] => http://stratigery.com/wp-content/plugins/apikey/apikey.php
8+
[HTTP_HOST] => stratigery.com
9+
[HTTP_CONNECTION] => keep-alive
10+
[HTTP_USER_AGENT] => Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3198.0 Safari/537.36 OPR/49.0.2711.0
11+
[CONTENT_TYPE] => multipart/form-data; boundary=----WebKitFormBoundaryCRqsB91phZodYsQd
12+
[CONTENT_LENGTH] => 195629
13+
[HTTP_ACCEPT_ENCODING] => identity
14+
[HTTP_ACCEPT] => */*
15+
[PATH] => /usr/local/sbin:/usr/local/bin:/usr/bin
16+
[SERVER_SIGNATURE] =>
17+
[SERVER_SOFTWARE] => Apache/2.4.39 (Unix) PHP/7.3.6
18+
[SERVER_NAME] => stratigery.com
19+
[SERVER_ADDR] => 162.246.45.144
20+
[SERVER_PORT] => 80
21+
[REMOTE_ADDR] => 185.39.199.9
22+
[DOCUMENT_ROOT] => /srv/http/stratigery/htdocs
23+
[REQUEST_SCHEME] => http
24+
[CONTEXT_PREFIX] =>
25+
[CONTEXT_DOCUMENT_ROOT] => /srv/http/stratigery/htdocs
26+
[SERVER_ADMIN] => [email protected]
27+
[SCRIPT_FILENAME] => /srv/http/stratigery/htdocs/fake_wp/wso.php
28+
[REMOTE_PORT] => 63025
29+
[GATEWAY_INTERFACE] => CGI/1.1
30+
[SERVER_PROTOCOL] => HTTP/1.1
31+
[REQUEST_METHOD] => POST
32+
[QUERY_STRING] =>
33+
[REQUEST_URI] => /wp-content/plugins/apikey/apikey.php
34+
[SCRIPT_NAME] => /wp-content/plugins/apikey/apikey.php
35+
[PHP_SELF] => /wp-content/plugins/apikey/apikey.php
36+
[REQUEST_TIME_FLOAT] => 1561560556.535
37+
[REQUEST_TIME] => 1561560556
38+
)
39+
40+
_REQUEST
41+
Array
42+
(
43+
)
44+
45+
_COOKIE
46+
Array
47+
(
48+
)
49+
50+
_FILES
51+
52+
UPLOADED FILE filename
53+
Array
54+
(
55+
[name] => settings.php
56+
[type] => application/octet-stream
57+
[tmp_name] => /tmp/phphGrWpC
58+
[error] => 0
59+
[size] => 195426
60+
)
61+
62+
END UPLOADED FILE filename
63+
Uploaded file: /var/tmp/185.39.199.9XROF7FvHX6iRiPgAkp5yTAAAAAM.0.file
64+
65+
END _FILES
66+
$my_blog=http://stratigery.com/wp-content/plugins/apikey
67+
Acting as apikey.php, uploaded file.
68+
Acting as apikey.php

webshells/settings.php/README.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# WSO 2.5 webshell download via apikey.php
2+
3+
An instance of Web Shell by oRb version 2.5,
4+
uniquely-obfuscated,
5+
and downloaded via [apikey.php](/apikey.php).
6+
7+
## Origin
8+
9+
### IP Address 185.39.199.9
10+
11+
185.39.199.9 → Kolomiec-gw.solomenskaya3-sw.kv.wnet.ua
12+
13+
185.39.199.9 belongs to:
14+
15+
inetnum: 185.39.199.0 - 185.39.199.255
16+
netname: WNET-KYIV
17+
address: Wnet LLC
18+
address: Bohdana Khmelnitskoho 48A
19+
address: Kyiv, 01030
20+
address: Ukraine
21+
22+
Looks like wnet.ua is a high end ISP that can provide network consulting
23+
and services, and maybe even write a little software.
24+
25+
`p0f3` is [convinced](p0f.dat) that "Windows 7 or 8" drives this IP address.
26+
27+
### Download
28+
29+
Looks like the attacker(s) thought that someone had installed
30+
a working [apikey.php](/apikey.php) file downloader.
31+
I added `apikey.php` emulation to my honey pot
32+
on 2019-04-05, added emulation of `apikey.php` access test,
33+
and 2019-05-27, added file download capability.
34+
35+
The file downloaded would have ended up named `settings.php`
36+
37+
The download user agent says:
38+
39+
Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3198.0 Safari/537.36 OPR/49.0.2711.0
40+
41+
The "Accept" and "Accept-Encoding" are "*/*" and "identity" respectively.
42+
This seems to be something that Chrome browsers send,
43+
which lines up with the user agent string.
44+
45+
## Deobfuscation
46+
47+
The [downloaded code](dc1.php) can be made into a decoder by changing "eval" to "print",
48+
and cleaning up some of the "<?" PHP short tags.
49+
Since a lot of PHP installations no longer allow short tags, their use seems self-limiting.
50+
51+
The [next stage](dc2.php) is a visual dog's breakfast.
52+
PHP comments interspersed through PHP code obscured by calls to `function eltelt()`,
53+
with a number as the argument.
54+
The `eltelt()` base64-decodes a string from an array based on the numerical argument.
55+
56+
The obfuscation is simpler than it immediately appears.
57+
All string literals in the original code got replaced by calls to `function eltelt()`.
58+
The numeric argument to `eltelt()` constitutes a count:
59+
the first string literal gets replaced by `eltelt(1)`, the second by `eltelt(2)`,
60+
the hundreth by `eltelt(100)` and so forth.
61+
Each string literal got base64-encoded, and the resulting string becomes an array element
62+
in `eltelt()`.
63+
The obfuscators made no attempt to re-use strings already in the `eltelt()` internal array.
64+
65+
## Analysis
66+
67+
The obfuscation seems odd.
68+
It does encode strings like "FilesMAn" and "WSO_VERSION"
69+
which are probably widely used in malware signatures.
70+
The obfuscation doesn't keep a human from looking at the code
71+
for a few seconds and recognizing that the obfuscated code
72+
is probably a version of WSO.
73+
Typical WSO function names ("WSOsetcookie", "wsoEx", "actionPhp") are still present,
74+
as they aren't string literals.
75+
Signatures of function names will not get fooled by this obfuscation.
76+
If you've gone to the work of extracting all string literals
77+
and replacing them with a function call,
78+
why not "compact" the string literal data by keeping track of strings?
79+
This would minimize the data needed by the string-literal-recovery
80+
function, and possibly make the code even less visually appealing.
81+
82+
It's just another WSO web shell.
83+
I've already [seen it used]() to download [extendable back door]() malware.
84+
The unique aspects are:
85+
86+
* Download via `apikey.php`
87+
* Encoding of string literals

webshells/settings.php/dc1.php

Lines changed: 57 additions & 0 deletions
Large diffs are not rendered by default.

webshells/settings.php/dc2.php

Lines changed: 679 additions & 0 deletions
Large diffs are not rendered by default.

webshells/settings.php/dc3.php

Whitespace-only changes.

webshells/settings.php/eltelt.php

Lines changed: 6 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)