1

So I'm trying to get a response from a server that has udp port 1900 open.

This is the command im entering and the data im sending it:

root$ nc -uvv <ip of server> 1900
M-SEARCH * HTTP/1.1
HOST:239.255.255.250:1900
MAN:"ssdp:discover"
MX:5
ST:ssdp:all

But I don't get any response from the server, at least none thats outputted to the screen. I know for sure that udp port 1900 is open on this IP. If anyone could provide any help for getting a response from a server with udp port 1900 open, that would be greatly appreciated. Thanks

RandomUser
  • 77
  • 6

1 Answers1

1

HTTPU as used here is based on HTTP and therefore the line end must be CR LF and not a simple LF as done in your case - although servers might ignore this. Also, the request header must end with a line consisting only of CR LF too - although servers might ignore this too. But it is important that the whole request is contained in a single UDP message since UDP is a datagram and not a stream protocol like TCP. Only, if you just enter the request on the terminal nc will create a new packet for each line you enter.

It works for me if the whole request is put into a file (with proper CR LF as line end and empty line as end of header) and then pipe it into nc:

cat request | nc -uvv <ip-address> 1900
...
HTTP/1.1 200 OK
LOCATION: http://.../igd2desc.xml
SERVER: FRITZ!Box ...
Steffen Ullrich
  • 114,247
  • 10
  • 131
  • 172
  • Thanks for answering! I hadn't thought about UDP isn't a stream protocol like TCP. So I created a text file and added "\r\n" to last line in the file, and ran the command you said, but I still didn't get a response. Am I adding the CR LF wrong? – RandomUser Oct 13 '18 at 20:26
  • @RandomUser: just from the description I cannot see anything wrong. But if you could provide the original unchanged file you use (or maybe a hexdump of it to be sure that nothing gets somehow changed when providing the fiile) I could take a closer look if it looks ok. And are you sure that the server should actually respond? Port open with UDP does only means that it does not reject any packets, not that it will respond. – Steffen Ullrich Oct 13 '18 at 20:29