rsmusllp / king-phisher

Phishing Campaign Toolkit
BSD 3-Clause "New" or "Revised" License
2.23k stars 538 forks source link

Landingpage not accessible (KP in Azure) #302

Closed Tssjimp closed 6 years ago

Tssjimp commented 6 years ago

Issue Description

Hello, I'm really now to Linux and KP and hope you can help. I created a VM in Azure. The installation went well. I can create a campaign and mail is being sent. However, I'm not able tot create a landing page. I copied the "WWW" contents from a KP website template to /var/www and checked the server_config file. I also set require_id to false, but i still get ERR_CONNECTION_TIMED_OUT message. Also testing te url in the client results in an error message.

Should I be able to reach my landing page just by typing my IP adress and '/login' (The landing page of the template? (Credentials/Anti-virus_update)

Reproduction Steps

  1. Try to reach my landing page

Environment Details

Host OS: Ubuntu 18.04 LTS in Azure King Phisher Version: Latest from Github

Error Details / Stack Trace

There are no recent entries in the log (4/6/2018)

2018-05-31 20:04:29,682 KingPhisher.GeoIP WARNING the specified geoip database does not exist, downloading a new copy 2018-05-31 20:27:32,246 KingPhisher.Server.WebSocket.EventPublisher WARNING there was a socket error while processing web socket messages 2018-05-31 20:27:32,246 AdvancedHTTPServer WARNING IOError encountered in finish_request 2018-05-31 21:50:35,698 KingPhisher.Server WARNING processing shutdown request 2018-06-01 05:13:54,348 KingPhisher.Server WARNING processing shutdown request 2018-06-01 09:25:19,170 KingPhisher.Server WARNING processing shutdown request 2018-06-01 17:27:24,712 KingPhisher.Server WARNING processing shutdown request 2018-06-01 19:55:51,865 KingPhisher.Server.WebSocket.EventPublisher WARNING there was a socket error while processing web socket messages 2018-06-01 19:55:51,865 AdvancedHTTPServer WARNING IOError encountered in finish_request

Thanks! Tim.

zeroSteiner commented 6 years ago

Couple of things. If you changed the require_id option to false that should help you trouble shoot the issue but the server must be restarted for the change to take affect. You didn't mention if you did this or not, but you'll need to restart the service whenever you make server config changes.

Secondly, what exactly are you seeing when you do try to visit the landing page? Does the connection fail or do you see a white 404 page saying the content wasn't found? Also check the server logs as you visit the landing page to see if anything shows up. You can increase the server verbosity by following these steps in the FAQ.

Tssjimp commented 6 years ago

Thanks for your reply! I restarted the server, but doesn't help. The server logs doesn't show information when visiting the landingpage. When i visit the page I see a 504 Gateway time out. I cannot ping my Azure IP-adres either. It looks like the Azure machine is not reachable, but I can connnect with the King Phisher Client from my Windows Machine.

Tssjimp commented 6 years ago

This is the result when I try to generate verbose log output:

./KingPhisherServer -f -L DEBUG server_config DEBUG king phisher version: 1.11.1 (rev: f6a12c21ae55) python version: 3.6.5 ERROR failed to bind server to address (socket error #98) ERROR socket error #98 (Address already in use) Traceback (most recent call last): File "/opt/king-phisher/king_phisher/server/build.py", line 145, in server_from_config server = KingPhisherServer(config, plugin_manager, handler_klass, addresses=addresses, ssl_certfile=ssl_certfile, ssl_keyfile=ssl_keyfile) File "/opt/king-phisher/king_phisher/server/server.py", line 868, in init super(KingPhisherServer, self).init(handler_klass, *args, kwargs) File "/usr/local/lib/python3.6/dist-packages/advancedhttpserver.py", line 1780, in init server = server_klass((address[0], address[1]), handler_klass, config=self.config) File "/usr/local/lib/python3.6/dist-packages/advancedhttpserver.py", line 703, in init super(ServerNonThreaded, self).init(*args, **kwargs) File "/usr/lib/python3.6/socketserver.py", line 453, in init__ self.server_bind() File "/usr/local/lib/python3.6/dist-packages/advancedhttpserver.py", line 771, in server_bind super(ServerNonThreaded, self).server_bind(*args, kwargs) File "/usr/lib/python3.6/http/server.py", line 136, in server_bind socketserver.TCPServer.server_bind(self) File "/usr/lib/python3.6/socketserver.py", line 467, in server_bind self.socket.bind(self.server_address) OSError: [Errno 98] Address already in use CRITICAL server failed to build with error: socket error #98 (Address already in use) INFO unloading 0 plugins g.ym

zeroSteiner commented 6 years ago

Ok so the 504 error would not be King Phisher, it wouldn't generate that. I'm not sure what to tell you about that but I'd guess it's an Azure configuration issue.

The error in your second log is showing that something is already running and it can't start the server. This would be the case if you started a second instance of King Phisher while another one was still running.

Tssjimp commented 6 years ago

You were right. It was an Azure configuration issue. Got it working now by opening some ports on the Azure VM. Thanks for pointing me in the right direction!

zeroSteiner commented 6 years ago

Hooray, that's fantastic news. If it's not too much trouble, could you provide us a description of the changes you had to make and where we could find them? We could then add it to the wiki to help the next person that has the same problem.

Tssjimp commented 6 years ago

By default port 80 is not added to the inbound port rules in the network interface after installing a Ubuntu VM. You have to add this rule by going to Azure management portal --> Network Settings. Here you can add port 80 to the inbound port rules.