Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

SockVortx.cpp

DZone's Guide to

SockVortx.cpp

·
Free Resource
#include 
 
  
#include 
  
   

int main(int argc, char *argv[]) {
	WSADATA wd;
	SOCKET s;
	SOCKADDR_IN addr;
	HOSTENT* he;
	unsigned int tmp,sol,i;
	char pwd[256];
	
	printf("[-] pulltheplug vortex - level0\n   by netfish\n\n");
	
	// winsock start
	if (WSAStartup(MAKEWORD(2,0),&wd))
		return 0;
	printf("[-] Winsock Started\n");
	
	if (!(s = socket(AF_INET,SOCK_STREAM,0)))
		return 0;
	printf("[-] Socket Initialization\n");
	
	// Connect 
	memset(&addr,0,sizeof(SOCKADDR_IN));
	addr.sin_family = AF_INET;
	addr.sin_port = htons(5842);
	addr.sin_addr.s_addr = inet_addr("69.55.233.82");
	
	if 
((connect(s,(SOCKADDR_IN*)&addr,sizeof(SOCKADDR_IN)))==SOCKET_ERROR)
		return 0;
	printf("[-] Socket Connection Accomplished!\n");
	
	// integer hohlen
	sol=0;
	for (i=0;i!=4;i++) {
		recv(s,&tmp,sizeof(unsigned int),0);
		sol += tmp;
	}
	printf("[-] integer \n Sum: %i\n",sol);
	
	send(s,/,sizeof(unsigned int),0);
	recv(s,&pwd,255,0);
	printf("[-] pwd:\n%s",pwd);
	return 0;
}
  
 
Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}