April 2009 Archives

I implemented the http channel, and the http proxy feature.

Let me give you an example of the proxy feature works:

First, we open a connection in kelvin to the http channel (the details doesnt interest us here).
I also activate the http proxy option ("proxy_on").

kelvin_open_http_channel.png


To illustrate the standard behaviour, lets send a http request to the http server of the rootkitet box (192.168.3.2):
dobin@unreal ~ $ export http_proxy="localhost:8080"
dobin@unreal ~ $ wget  -O - --no-cookies -S http://192.168.3.2:/index.html | cat
--2009-04-24 19:33:56--  http://192.168.3.2/index.html
Resolving localhost... 127.0.0.1, ::1
Connecting to localhost|127.0.0.1|:8080... connected.
Proxy request sent, awaiting response...
  HTTP/1.1 200 OK
  Date: Fri, 24 Apr 2009 15:33:55 GMT
  Server: Apache/2.2.11 (FreeBSD) mod_ssl/2.2.11 OpenSSL/0.9.7e-p1 DAV/2
  Last-Modified: Fri, 17 Apr 2009 22:58:53 GMT
  ETag: "5c220-2c-467c81fe40540"
  Accept-Ranges: bytes
  Content-Length: 44
  Connection: close
  Content-Type: text/html
Length: 44 [text/html]
Saving to: `STDOUT'

100%[========================================>] 44          --.-K/s   in 0s     
2009-04-24 19:33:56 (15.4 MB/s) - `-' saved [44/44]

<html><body><h1>It works!</h1></body></html>

As you can see, wget retrieves index.html from the standard apache installation, with cookies disabled, and prints the http header and html sourcecode to stdout. It uses our local rheya proxy (localhost:8080). No cookies sent or received, as this is just a normal .html file.

Now, we want to call the "test" method in Kelvin. The "test" commands just transfers 100 bytes of data to rheya, and expects 100 bytes in return in the reply.
kelvin_test_start.png

Kelvin creates the solyaris request, and is waiting (blocks) to receive an suitable HTTP request. Nothing has been sent for this command until now.

We generate the http traffic with the same wget command from earlier:
dobin@unreal ~ $ wget  -O - --no-cookies -S http://192.168.3.2:/index.html?ABCD | cat
--2009-04-24 19:37:24--  http://192.168.3.2/index.html?ABCD
Resolving localhost... 127.0.0.1, ::1
Connecting to localhost|127.0.0.1|:8080... connected.
Proxy request sent, awaiting response...
  HTTP/1.1 200 OK
  Date: Fri, 24 Apr 2009 15:37:23 GMT
  Server: Apache/2.2.11 (FreeBSD) mod_ssl/2.2.11 OpenSSL/0.9.7e-p1 DAV/2
  Last-Modified: Fri, 17 Apr 2009 22:58:53 GMT
  ETag: "5c220-2c-467c81fe40540"
  Accept-Ranges: bytes
  Content-Length: 44
  Connection: close
  Content-Type: text/html
  Set-Cookie: statusCode=1; requestID=0; dataLen=100; data=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA;
Length: 44 [text/html]
Saving to: `STDOUT'

100%[========================================>] 44          --.-K/s   in 0s
2009-04-24 19:37:24 (17.0 MB/s) - `-' saved [44/44]

<html><body><h1>It works!</h1></body></html>
The only difference between this wget request and the one earlier is the "Set-Cookie:" line.

What happened?

As you can see, rheya replied with an "Set-Cookie" line, which is the answer for our solyaris request. The line was inserted in the kernel, after apache created its reply (the standard page doesnt include any cookies, of course).

The reason it inserted the "Set-Cookie" line was because Kelvin intercepted the http request from wget in its proxy, and transparently added a "Cookie:" line, which's content is the solyaris request it generated.
wireshark_http_request.png

Additional to wget, Kelvin also interpreted the http reply, and found the answer for his rheya "test" request:
kelvin_test_reply.png


This is just the PoC. There are a lot of rough edges, which will be cleaned out in the next few weeks.

Of course, instead of wget, one can also use a normal browser like firefox, or even a web site crawler, to automate the transfer of data to and from the rootkit.


soderberghsolaris2.jpg

Rheya:
  • SNMP Channel implemented
  • cleaned node (removed m, static answer)
  • Implemented basic fragmentation handling
  • Function names cleanup
  • Fixed various crashes
  • Collect port statistics
Kelvin:
  • Rudimentary implementation of SNMP Channel
  • removed anyoption, now use boost::program_options
  • Various updates and bugfixes
  • Updated and bugfixed DNS Channel
  • Use Boost::ASIO for SNMP UDP channel in kelvin, instead of packet sniffing
  • Works without config file, again
  • Works on FreeBSD 6
  • ChannelChardev works again
There's still lot of things to do. Wont release in the next few months.

Steampunk ?!

| | Comments (0) | TrackBacks (0)
Monitorvirginia.jpg

Ein wunderbares Bild des ersten Kampfes von zwei Ironclads Warships (CSS Virginia/Merrimac und USS Monitor). Diese hatten nicht mehr einen Rumpf aus Holz, sondern aus (oder mit) Metall. Man bemerke das grossartige Design der beiden, um möglichst wenig Trefferfläche zu exponieren. Das schien auch grossartig zu funktionieren: 
the two ironclads repeatedly tried to ram one another while shells bounced off their armor
Ein anderes, die USS Cairo:
Uss_Cairo_h61568.jpg


Aber insbesondere ist mir die ähnlichkeit zu heutigen "Stealth" Ships aufgefallen. Back to the roots?


4-swedens-visby.jpg
Eine Visby Class Corvett, Schweden

01-267.jpg
M80 Stiletto

About this Archive

This page is an archive of entries from April 2009 listed from newest to oldest.

March 2009 is the previous archive.

August 2009 is the next archive.

Find recent content on the main index or look in the archives to find all content.