Running WCF Service Host on a different port - wcf

Is it possible to run WcfSvcHost.exe (WCF Service Host) that ships with Visual Studio to run on a port other than port 80? I am trying to debug a WCF service, but my machine is already running Apache on port 80.
I could go and set Apache to use a different port, but it would be easier if there is a way to do it in WcfSvcHost.
Currently when I try to run my service project, it gives me the dreaded "port in use" message:
'HTTP could not register URL http://+:80/Temporary_Listen_Addresses/a655b03e-30ff-4818-b561-ef52e4cb1e3d/ because TCP port 80 is being used by another application.'

Related

Metasploit handler failed to bind to port 4444

I am running Kali Linux on VMware. The host operating system is windows 7, and I'm using NAT for connectivity.
In my metasploit console, when I typed 'exploit' at the msf prompt,(where I am using windows/meterpreter/reverse_tcp as the payload) it showed me the error
Handler failed to bind to My IP:4444
(My IP is my external IP address.)
So in the VMware virtual network editor, I have port forwarded port 4444 of host PC to port 4444 of the virtual PC. Then I allowed inbound packets in the firewall of the host PC, for port 4444 of the host PC.
To ensure that everything is alright, I set up an apache server on the virtual PC, that serves a webpage when accessed via port 4444. The server served flawlessly when I accessed it with an external browser. Satisfied, I shut down the server.
But guess what? Metasploit console has thrown up the same error when I typed 'exploit' again in the msf prompt.
What to do now?
What did it say the reason for failing was.
I'm assuming the full error was failed to bind to port 4444 port is already in use.
You can not run a server on the same port you are trying to bind to.
The correct way to do this is to port forward through your router. Open your router settings and port forward port 4444 to your machines local ip.

firewall disabled, program is listening: No connection could be made because the target machine actively refused it

I am running out of Ideas. I did look for others similar subject but almost all suggest firewall or checking if program is really listening on this port.
Because my internet provider su__, their equipment can not forward port 80, I am running my Apache on port 10080, later also try 10081. Because the page never opened I started to investigate with Wireshark. I get some record on this port so I continue testing with writing own TCPServer and TCPClient. I am using the same code except for host and port. In console I get error:
SocketException: System.Net.Sockets.SocketException (0x80004005): No
connection could be made because the target machine actively refused
it 193.77..:10080 at System.Net.Sockets.TcpClient..ctor(String
hostname, Int32 port) at Client.Program.Connect(String server,
String message) in d:\Projekti\ASP.N
ET\Tests\Client\Client\Program.cs:line 33
At this point I can say, that Apache and demo program worked when using for host localhost, but not when I use home.mydomain.si. Of course subdomain is routed to my static ip (because remote desktop is working). Both ports are routed to 192.168.1.27. I use static IP not DHCP.
I add exception for inbound and outbound rules for port 10080 and 10081. Then I even disable firewall. No antivirus is installed. Using Windows 7. Netstat shows that someone is listening on port 10080. Wireshark shows some activity on port 10080. Screenshot Wireshark is for TCPListener program not Apache.
Please share some ideas. I am desperate.

How to prevent WCF service to register non 127.0.0.1 adresses?

When registering a WCF Service I get
HTTP could not register URL http://+:8080/ because TCP port 8080 is being used by another application
Looking at the used ports with
netstat -an | grep 8080
I can see that TCP 127.0.0.2:8080 is used (I'm using ssh to tunnel from 127.0.0.2:8080 to a remote service).
Probably the WCF service tries not only to register at 127.0.0.1 and the network ips but also on 127.0.0.2.
How can I configure the WCF service to not try to listen to 127.0.0.2:8080 but only to 127.0.0.1:8080 and the network ip adresses? Or can I configure the init process that adresses where the service can not be registered are just ignored?
whole 127/8 block signifies localhost. so both 127.0.0.1 and 127.0.0.2 point to local machine. which implies 127.0.0.1:8080 is same as specifying 127.0.0.2:8080.
they both point to same service which in this case is ssh tunnel . hence WCF fails to register
solution is to change port number.

Cannot bind to TCP port 443 because it is in use by another process Virtual Machine Manager

i created a Template with my Virtual Machine Manager. ( SystemCenter 2012 SP1 ) I am trying to deploy this to my hyper-v host. After a wihle , the process is going to stop with an error:
Error (22042) The service (123) was not successfully deployed. Review
the event log to determine the cause before you take corrective
action.
Recommended Action The deployment can be restarted by retrying the
job.
Error (12702) Cannot bind to TCP port 443 because it is in use by
another process on the vmmanger.de.myserver.corp server.
Recommended Action Wait until the other process is completed, and then
try the operation again.
Error (12702) Cannot bind to TCP port 443 because it is in use by
another process on the vmmanger.de.myserver.corp server.
Recommended Action Wait until the other process is completed, and then
try the operation again.
Do you have any other network applications running? You can check this with netstat on the command prompt. Port 443 is the default port for HTTPS servers, do you have one running on your computer? When you've found the process with netstat, end it and try this again - it should work afterwards.
port 443 is bound for https web communications.

Net.tcp binding using port 80

We are trying to run a wcf service with net.tcp binding using port 80. When we try to start the service we get error 10013.
The service worked fine on port 8099 untill operations blocked the port :)
Our alternative is to switch to basichttpbinding.
What I am wondering is: Is there some fundamental reason why nettcp binding does not work with port 80.
Port 80 is probably being used already by IIS. You'd need to disable the websites running on that port.
Try checking if there's any application already using port 80, or try running it as administrator. Firewall rules can make this problem appear too.
See if it helps.