I'm trying to write some code in Go which should connect spin up a telnet client to connect to a telnet and send a get request to the device (i.e. do a simple banner grab). This is the code that I have so far:
conn, _:= telnet.DialTo("ipaddress:23")
resp, _:= conn.Write([]byte("GET / HTTP/1.0\r\n\r\n")
fmt.Printf("\n Response: %v", resp)
I know that this code makes a connection to the device, however I don't seem to be able to get anything back other than 18. Does anyone know what this means and how I can actually get a proper banner grab back from the device / what I'm doing wrong?