How do I use http tunneling with Covenant c2 framework? - http

I'm having a hard time setting up ngrok http tunnel with the Coventant listener.
First I have setup a http tunnel with ngrok to localhost:4444, then setup a listener on the Covenant ui with bind port 4444 and connect port 80. I also used the ngrok url (blablabla. eu.ngrok. io) for the connect. When I tested the reverse shell it just didn't work... any ideas of what I'm doing wrong?

Related

How to create TCP tunnels with Pagekite

I am a complete beginner when it comes to networking and I am trying to set up a TCP tunnel on my machine using pagekite. I want to route all traffic from a TCP address to a port on my localhost, let's say 8080. I would then start a handler on localhost:8080 to deal with the incoming traffic. I can get this to work with ngrok simply by doing ngrok tcp 8080, but on a free ngrok plan I cannot reserve tcp addresses and ngrok is rather slow, so I opted to try and use pagekite.
Pagekite normally allows easy tunnelling to an HTTP address, but they have a guide here about how to use PuTTY along with Pagekite to create a TCP tunnel proxied by HTTP.
I followed their guide but could use some help figuring out if it does what I want it to do.
I am working on a Linux VM, so I first set up an SSH server with openssh like this: sudo service ssh start
I then exposed that SSH server using pagekite like this: python3 pagekite.py 22 ssh:user.pagekite.me
I then started PuTTY, and configured the Host Name to be user.pagekite.me on port 22, setup an HTTP proxy with the proxy hostname user.pagekite.me on port 443 and finally created a tunnel from the PuTTY machine with source port 8080 and destination localhost:8080.
Now I am not sure what this actually accomplished. I know that the PuTTY machine connected to the ssh server running on my VM and I am able to use the linux terminal from the PuTTY terminal but has this actually created a TCP tunnel from user.pagekite.me:8080 to localhost:8080? Additionally after doing this, if I try to setup the handler on localhost:8080 I get the following error:
Handler failed to bind to 0.0.0.0:8080
Rex::BindFailed The address is already in use or unavailable: (0.0.0.0:8080).
Again I am completely clueless when it comes to networking so if anyone could explain what it is I'm doing and if it is even possible to do what I want the way that I am doing it, that would be quite helpful.

How to get IP of incoming requests while using ngrok?

I am using ngrok to tunnel 8000 port, on which my django project is running. ngrok prints all incoming requests on the console, I want it to print the IP address of source of incoming requests as well.
You can see verbose information about each and every request on ngrok's web interface at http://127.0.0.1:4040
It's not as conventient as having it on the CLI directly but it's a way.

How to perform CONNECT HTTP request to a Host on specific port?

How can I perform CONNECT HTTP requests to a Host on specific port?
If there is a tool to achieve this I'd appreciate mentioning it.
You can use telnet to send HTTP requests and accomplish connection to hosts.
For example, start with the following cmd through shell:
telnet www.server.com 80
Then, after connection has established you may send HTTP requests.
Read more

port forward http port (80) on virgin super hub

I am currently working on a project to make my apache server live, which is new me so this is the first time I am doing anything like this. basically I have gone in to the router and requested port forwarding on port 80 for my local IP address, but to no effect. when I test it with a web tool which tells you if a port is open or not it says it's closed. More confusingly when I run a netstsat -a command it shows http as listening. I'm not sure if its a firewall issue or I'm going about it all wrong. any Ideas would be much appreciated. Thanks
You need to be testing from outside your local network. If you run netstat on your server, of course it is going to say "listening". Is your web testing tool being run from outside your firewall? You should also be able to turn off wifi on your phone and test hitting your broadband IP address:80. Are you forwarding from port 80 on your router to port 80 on your server? Is it possible that your provider is blocking port 80 for residential accounts?
First google for an online port scanner and ask it to scan port 80.
Second if you're using Ubuntu ufw (firewall) is probably running default deny rules so do this: sudo ufw allow 80
To check it's working just plug your WAN IP into your browser URL bar, it should connect to your test page in /var/www/html/index.html

How to try out HTTP, FTP, SMTP etc. application protocols

I am reading Computer Networking: A Top-Down Approach 5th (fifth) edition. I have reached chapter two and I wonder if it is possible to actually try out the different application protocols by writing the requests etc? I am using Windows if that matter if you need a tool for doing that, and if I need a tool, what does the tool do behind the scenes for connecting?
You should use telnet to connect to all of these protocol, do your request, reading the answer and so on.
I'm reading that telnet is disabled by default on newer windows version (unbelievable, why? Thank goodness I stopped using it!)... Follow this guide to re-enable it if you're using a windows version newer than xp.
Telnet was used to remotely login to a host. Today it's completely unsafe to use it in this way, as long as a telnet connection isn't encrypted and we have such a better tool like ssh for remote connection. However, you can think to Telnet as a generic TCP client. It can establish TCP connection on every port.
By default, it will try to attempt to connect to port 23 (that is the telnet port) but you can easily change that.
For example, if you want to test HTTP, you can write in your command line:
~$ telnet www.example.com 80
Trying 192.0.43.10...
Connected to www.example.com.
Escape character is '^]'.
Where 80 is the http port (of course, if you're running it locally, you should connect to localhost). Other lines state the connection is ready to receive a request. Now you can type any http command you want.
GET /
HTTP/1.0 302 Found
Location: http://www.iana.org/domains/example/
Server: BigIP
Connection: close
Content-Length: 0
Where GET / is the command I typed and the rest is the http response.
Changing the port number, you can speak to (almost?) every protocol in the internet.
Well you can them out like this.... just to name a few...
Ftp : ftp ip_addr or ftp domain_name
Telnet : telnet ip_addr or telnet ip_addr:port_no or tracert domain_name
tracert : tracert ip_addr or tracert domain_name
ping : ping ip_addr or ping domain_name

Resources