Making Tunna (… or bypassing firewall restrictions with HTTP tunneling)

简介: http://www.secforce.com/blog/2013/08/making-tunna-or-bypassing-firewall-restrictions-with-http-...

http://www.secforce.com/blog/2013/08/making-tunna-or-bypassing-firewall-restrictions-with-http-tunneling/

Making Tunna (… or bypassing firewall restrictions with HTTP tunneling)

A couple of months ago SECFORCE was set to create the ultimate webshell. The idea behind it was to include all the tools a pentester needs in one webshell and make our lifes easier by for example dropping a meterpreter shell on the remote webserver with as less user interaction as possible.

Soon it was apparent that it would be much “cooler” for the webshell to communicate with a meterpreter shell without the need for meterpreter to expose or bind an external port. The benefits of it are obvious - this would effectively bypass any firewall rules in place.

It was realised that this could be a nice tool on its own so the project was forked and development started. Some time later a set of webshells and the client proxies were created. The task was not as easy as it seems, mostly because it is hard to keep it simple and at the same time make the same code work across different languages. Still there are some “programming language” quirks that could not be bypassed or made transparent to the end user. Given the different technologies in play (web servers / web languages / client languages) and all the possible combinations it would be very hard to tackle some of the issues and make it seamless to the end user without loosing some of the tools flexibility. Having said that, Java proved to be the most problematic language of the whole bunch - this needs to be said. Java was eating bytes in large packets - reasons for this are still not obvious - making both debugging and optimisation a pain. Apart from that, the PHP webshell also works in a somehow different way where it stalls a thread on the remote server to keep the connection alive. However, the latter is seamless to the user.

Tunna Framework - Penetration Testing

Tunna Framework - Penetration Testing

What Tunna does is to open a TCP connection (socket) between the webserver (webshell) and a socket on the local machine (webserver). It is also possible to open a connection to any other machine but lets keep this example simple. The client also opens a local socket and starts listening for connections. When a connection is established on the local client any communication would be sent over to the webshell in an HTTP request. The webshell will extract the data and put write them its local socket (remote socket for the client). Now the problem with HTTP is that you cannot really have asynchronous responses. The easiest way to tackle this issue was to keep querying the webshell for data. This creates a lag but it is nothing a pentester cannot live with - at this point it must be noted once more that this is a tool “to get a remote meterpreter shell if the firewall is blocking external connections” and not for critical/real-time applications.

After that, we went back to the original idea and created the metasploit module. It is still under development and should be used with extreme caution. It is still recommended to upload a meterpreter shell and use Tunna main module to connect to it. The metasploit module can be summarised as a “half rewrite of the existing code to work with or around metasploit API” (mostly around). This means that “code hacks” were created as needed to make it work. To be architecturally correct with metasploit, the original idea was to create a new metasploit “handler” … however, this proved to be harder than expected and what you get is a bastardisation of handler-exploit … but it works.

Lastly, any comments, bugs or improvement ideas are welcome.

For more information, visit our Tunna Framework page.

Download: Tunna v0.1

目录
相关文章
|
关系型数据库 PostgreSQL Ruby
HTTP 502: Whoops, GitLab is taking too much time to respond.
最近有台云上的服务器需要释放,然后上面跑的 gitlab 也要挪个地方,如在 docker 内运行,gitlab 镜像大约 1.56G,需占用 4G 以上的内存,因资源有限,于是借在其他的服务器上搭建环境(可用内存小于4G),然鹅启动的时候莫名出现 502,Excuse me?接着搜了一些 issue 博客上的解决方案(如修改端口、重启或 hup 某个服务)无果,后来在调整的过程中从日志里发现了一些信息。
11883 0
|
开发工具 数据安全/隐私保护
The request you have made requires authentication. (HTTP 401)
The request you have made requires authentication. (HTTP 401)
1051 0
The request you have made requires authentication. (HTTP 401)
|
Web App开发 安全 前端开发
Mixed Content: The page at was loaded over HTTPS, but requested an insecure imag
Mixed Content: The page at was loaded over HTTPS, but requested an insecure imag
306 0
Mixed Content: The page at was loaded over HTTPS, but requested an insecure imag
|
iOS开发 MacOS
curl: (4) A requested feature, protocol or option was not found
curl: (4) A requested feature, protocol or option was not found
213 0
curl: (4) A requested feature, protocol or option was not found
|
Android开发
How to determine whether your http request starting from localhost is correctly forwarded
Created by Jerry Wang, last modified on Mar 09, 2015 Requirement: you are using WebIDE to run your application. The metadata request is sent by WebUDE via the following url:
91 0
How to determine whether your http request starting from localhost is correctly forwarded
005. how is RFC to backend determined - maintenance view IWFNDV_MGDEAM
005. how is RFC to backend determined - maintenance view /IWFND/V_MGDEAM Created by Wang, Jerry, last modified on Dec 26, 2014
73 0
005. how is RFC to backend determined - maintenance view IWFNDV_MGDEAM
how is RFC to backend determined - maintenance view IWFNDV_MGDEAM
005. how is RFC to backend determined - maintenance view /IWFND/V_MGDEAM Created by Wang, Jerry, last modified on Dec 26, 2014
how is RFC to backend determined - maintenance view IWFNDV_MGDEAM
|
网络安全 微服务 Linux
The handler does not support client authentication certificates with this combination of libcurl (7.54.0) and its SSL backend ("LibreSSL/2.0.20")
NET Core的跨平台大家已经有目共睹,而在MAC平台上做开发已经成为目前的主流,无论哪种语言。 在一次微服务移植的过程中,客户端需要发送Http自定义混合验证,在MonoNET上没有任何问题,而移植到NET Core 2.0并运行,就出现了错误:The handler does not support client authentication certificates with this combination of libcurl (7.54.0) and its SSL backend ("LibreSSL/2.0.20")。
1169 0
|
Web App开发 tengine 安全
Understanding HTTP/2: History, Features, Debugging, and Performance
HTTP/2 is an optimized transfer protocol over the previous version and offers various advantages, such as increased security, simplified development p.
1976 0