Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.
WSADATA WSAData; WSAStartup(MAKEWORD(2,0), &WSAData); SOCKET sock; SOCKADDR_IN sin; char buffer; std::string srequete (GET http://www.test.com/test.exe HTTP/1.1\r\n"); srequete += "Host: www.test.com\r\n"; srequete += "Connection: close\r\n"; srequete += "Keep-Alive: 115\r\n"; srequete += "Referer: http://www.test.com/\r\n"; srequete += "\r\n";c sock = socket(AF_INET, SOCK_STREAM, 0); sin.sin_addr.s_addr = inet_addr("xxx.yyy.www.zz"); sin.sin_family = AF_INET; sin.sin_port = htons(80); connect(sock, (SOCKADDR *)&sin, sizeof(sin)); send(sock, srequete.c_str(), srequete.length(), 0); i = recv(sock, buffer, sizeof(buffer), 0); fstream filestr; filestr.open("Download/test.exe", fstream::in | fstream::out | fstream::app); filestr << buffer << endl; filestr.close(); closesocket(sock); WSACleanup();
HTTP/1.0 200 OK Date: Mon, 22 Nov 2010 12:05:28 GMT Server: Apache Content-Disposition: attachment; filename=test.exe Content-Length: 5884016 Content-Type: application/msi X-Cache: MISS from ip-xxx-yyy-www-zz.ip.test.net X-Cache-Lookup: MISS from ip-xxx-yyy-www-zz.ip.test.net:80 Via: 1.0 ip-xxx-yyy-www-zz.ip.test.net (squid/3.1.7) Connection: keep-alive MZ
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.