SECFORCE / Tunna

Tunna is a set of tools which will wrap and tunnel any TCP communication over HTTP. It can be used to bypass network restrictions in fully firewalled environments.
1.24k stars 283 forks source link

how can i use it ? #4

Open mehranexpert opened 8 years ago

mehranexpert commented 8 years ago

on my Server i just run python ./webserver.py

TunnaWebServer v1.1a, for HTTP tunneling TCP connections by Nikos Vassakis
http://www.secforce.com / nikos.vassakis <at> secforce.com
###############################################################

[W] Mon Oct 10 06:51:10 2016 Web Server Starts - 0.0.0.0:8000 

now in client windows i must run Proxy.exe with proxy.exe -u MyServerIP -l 8000

seems i do it something Wrong .

360sec commented 8 years ago

--url=URL, -u URL url of the remote webshell

Buddy, you should give the webshell url but not your server IP only.

mehranexpert commented 8 years ago

and i must Run python./webserver.py on my Server ? if yes , Then what is this ?

Web Server Starts - 0.0.0.0:8000

360sec commented 8 years ago

You do not need webserver.py. Just use the proxy.py on your local computer. python proxy.py -u www.google.com/webshell.php -l 5566 A local port will be listening, then you can set a http proxy on your chrome or IE, such as 127.0.0.1:5566 Then you can access the server VLAN via your local listening port(5566).

mehranexpert commented 8 years ago

webshell.php you mean conn.php because i not Found any webshell.php

nvssks commented 8 years ago

If you have a webserver running on the Server side then you could use one of the "webshells" - conn.php/aspx/jsp

In general though the python module is more stable, especially when compared with the php one.

When you run: python ./webserver This starts a Tunna webserver on the Server side that listens at 8000

Now to connect to it you need to run: proxy.exe -u MyServerIP:8000/ -l 8000

"-l 8000" is the port for the client, as @360sec mentions: you can use that as a local "http proxy on your chrome or IE, such as 127.0.0.1:8000"

mehranexpert commented 8 years ago

@nvssks Thanks to Clearance it , i got error on Client

[-] Error: <urlopen error unknown url type: 46.101.x.x>
[!] Received Interrupt or Something Went Wrong
[-] Disconnected

Fixed i use http://Myipaddress

nvssks commented 8 years ago

Try: proxy.exe -u http://MyServerIP:8000/ -l 8000

mehranexpert commented 8 years ago

Yes , thanks Connected . can i Surf internet with this Method ?

nvssks commented 8 years ago

Yes, just set up your browser's proxy to: 127.0.0.1:8000

mehranexpert commented 8 years ago

i can't Browse any website

 |_   _|   _ _ __  _ __   __ _
   | || | | | '_ \| '_ \ / _` |
   | || |_| | | | | | | | (_| |
   |_| \__,_|_| |_|_| |_|\__,_|

Tunna v1.1a, for HTTP tunneling TCP connections by Nikos Vassakis
http://www.secforce.com / nikos.vassakis <at> secforce.com
###############################################################

[+] Spawning keep-alive thread
[-] Keep-alive thread not required
[+] Checking for proxy: True
[+] Starting Socket Server
[S]  Mon Oct 10 12:54:56 2016 Server Starts - localhost:8000
[T] Connected To Socks:  ('127.0.0.1', 62826)
[+] Starting Ping thread
←[91m An existing connection was forcibly closed by the remote host ←[0m
←[91m An existing connection was forcibly closed by the remote host ←[0m
←[91m An existing connection was forcibly closed by the remote host ←[0m
←[91m An existing connection was forcibly closed by the remote host ←[0m
←[91m An existing connection was forcibly closed by the remote host ←[0m
nvssks commented 8 years ago

Have you set it up as SOCKS 4a proxy in your browser?

On 10 Oct 2016 10:27 a.m., "mehranexpert" notifications@github.com wrote:

i can't Browse any website

| | | || | | | ' | ' \ / ` | | || || | | | | | | | (| | || ,|| ||| |_|_,|

Tunna v1.1a, for HTTP tunneling TCP connections by Nikos Vassakishttp://www.secforce.com / nikos.vassakis secforce.com ###############################################################

[+] Spawning keep-alive thread [-] Keep-alive thread not required [+] Checking for proxy: True [+] Starting Socket Server [S] Mon Oct 10 12:54:56 2016 Server Starts - localhost:8000 [T] Connected To Socks: ('127.0.0.1', 62826) [+] Starting Ping thread ←[91m An existing connection was forcibly closed by the remote host ←[0m ←[91m An existing connection was forcibly closed by the remote host ←[0m ←[91m An existing connection was forcibly closed by the remote host ←[0m ←[91m An existing connection was forcibly closed by the remote host ←[0m ←[91m An existing connection was forcibly closed by the remote host ←[0m

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/SECFORCE/Tunna/issues/4#issuecomment-252571179, or mute the thread https://github.com/notifications/unsubscribe-auth/AJZ6bXXi353x0nnOYSHPrGzFuevwwPNpks5qygUOgaJpZM4KSRix .

mehranexpert commented 8 years ago

oh , mine was Socks5 , change to sock4 now seems okey .

mehranexpert commented 8 years ago

For change Port 8000 to other like 80 must change it on webserver.py ?

nvssks commented 8 years ago

Yes,

Just add "-l 80", note that this must run with root privileges (sudo python ./webserver.py -l 80)

Then you should change the URL on the client to -u http://ServerIP/

Leave the "-l 8000" on the client if you don't want to change your browser's proxy settings

On 10 Oct 2016 10:40 a.m., "mehranexpert" notifications@github.com wrote:

For change Port 8000 to other like 80 must change it on webserver.py ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/SECFORCE/Tunna/issues/4#issuecomment-252573436, or mute the thread https://github.com/notifications/unsubscribe-auth/AJZ6beG42ITTo8wk7CkFXmORXwL5vHXKks5qyggVgaJpZM4KSRix .

briteming commented 3 years ago

@360sec i saw: https://github.com/SECFORCE/Tunna/issues/4#issuecomment-252552173 ,but:

yudeMacBook-Air:tunna brite$ python proxy.py -u http://mydomain.com/conn.php -l 5566 it shows:


| | | || | | | ' | ' \ / ` | | || || | | | | | | | (| | || _,|| ||| ||\,_|

Tunna v1.1a, for HTTP tunneling TCP connections by Nikos Vassakis http://www.secforce.com / nikos.vassakis secforce.com ###############################################################

{'verbose': False, 'ProxyFileWin': 'lib/socks4aServer.exe', 'ProxyFilePy': 'lib/socks4aServer.py', 'bauth': 'no', 'cookie': None, 'upProxy': None, 'bufferSize': 8192, 'ignoreServerCert': True, 'local_port': 5566, 'useSocks': True, 'bind': '0.0.0.0', 'interval': 0.2, 'ping_delay': 0.5, 'url': 'http://mydomain.com/conn.php', 'start_p_thread': True, 'upProxyAuth': None, 'Cookie': '', 'remote_port': 0, 'remote_ip': '127.0.0.1'} [+] Sending File [Server] File Uploaded at /tmp/977-socks4aServer.py [+] Spawning keep-alive thread ('[+] Checking for proxy:', True) [+] Starting Socket Server ('[S] ', 'Sat Apr 17 01:59:52 2021', 'Server Starts - localhost:5566') [+] Starting Ping thread ('[T] Connected To Socks: ', ('127.0.0.1', 55916))

Exception in thread Thread-1: Traceback (most recent call last): File "/usr/local/Cellar/python@2/2.7.17_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 801, in bootstrap_inner self.run() File "/usr/local/Cellar/python@2/2.7.17_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 754, in run self.target(self.args, **self.kwargs) File "/Users/yuming/tunna/lib/TunnaClient.py", line 337, in Threaded_request resp = self.HTTPreq(url) File "/Users/yuming/tunna/lib/TunnaClient.py", line 308, in HTTPreq f = opener.open(urllib2.Request(**kargs)) File "/usr/local/Cellar/python@2/2.7.17_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 435, in open response = meth(req, response) File "/usr/local/Cellar/python@2/2.7.17_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 548, in http_response 'http', request, response, code, msg, hdrs) File "/usr/local/Cellar/python@2/2.7.17_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 473, in error return self._call_chain(args) File "/usr/local/Cellar/python@2/2.7.17_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 407, in _call_chain result = func(*args) File "/usr/local/Cellar/python@2/2.7.17_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 556, in http_error_default raise HTTPError(req.get_full_url(), code, msg, hdrs, fp) HTTPError: HTTP Error 524: Origin Time-out

how to fix it?

nvssks commented 3 years ago

Seems to be a cloudflare error, not sure if anything can be done about it programmatically from the client. Using the origin servers IP (if you have it) would probably bypass cloudflare.

On Fri, 16 Apr 2021, 21:15 briteming, @.***> wrote:

@360sec https://github.com/360sec i saw: #4 (comment) https://github.com/SECFORCE/Tunna/issues/4#issuecomment-252552173 ,but:

yudeMacBook-Air:tunna brite$ python proxy.py -u http://mydomain.com/conn.php -l 5566 it shows:

| *| _ _ | || | | | '* | ' \ / ` | | || || | | | | | | | ( | | || ,|| ||| ||,|

Tunna v1.1a, for HTTP tunneling TCP connections by Nikos Vassakis http://www.secforce.com / nikos.vassakis secforce.com ###############################################################

{'verbose': False, 'ProxyFileWin': 'lib/socks4aServer.exe', 'ProxyFilePy': 'lib/socks4aServer.py', 'bauth': 'no', 'cookie': None, 'upProxy': None, 'bufferSize': 8192, 'ignoreServerCert': True, 'local_port': 5566, 'useSocks': True, 'bind': '0.0.0.0', 'interval': 0.2, 'ping_delay': 0.5, 'url': 'http://mydomain.com/conn.php', 'start_p_thread': True, 'upProxyAuth': None, 'Cookie': '', 'remote_port': 0, 'remote_ip': '127.0.0.1'} [+] Sending File [Server] File Uploaded at /tmp/977-socks4aServer.py [+] Spawning keep-alive thread ('[+] Checking for proxy:', True) [+] Starting Socket Server ('[S] ', 'Sat Apr 17 01:59:52 2021', 'Server Starts - localhost:5566') [+] Starting Ping thread ('[T] Connected To Socks: ', ('127.0.0.1', 55916))

Exception in thread Thread-1: Traceback (most recent call last): File @./2.7.17_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 801, in __bootstrap_inner self.run() File @./2.7.17_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 754, in run self.target(*self.args, self.__kwargs) File "/Users/yuming/tunna/lib/TunnaClient.py", line 337, in Threaded_request resp = self.HTTPreq(url) File "/Users/yuming/tunna/lib/TunnaClient.py", line 308, in HTTPreq f = opener.open(urllib2.Request(kargs)) File @./2.7.17_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 435, in open response = meth(req, response) File @./2.7.17_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 548, in http_response 'http', request, response, code, msg, hdrs) File @./2.7.17_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 473, in error return self._call_chain(args) File **@./2.7.17_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 407, in _call_chain result = func(args) File **@.***/2.7.17_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 556, in http_error_default raise HTTPError(req.get_full_url(), code, msg, hdrs, fp) HTTPError: HTTP Error 524: Origin Time-out

how to fix it?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/SECFORCE/Tunna/issues/4#issuecomment-821395432, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACLHU3M6PH7OD4NMDG2TBN3TJB5E7ANCNFSM4CSJDCYQ .