Is there a way to protect your ports via winsock?? Sort of like ZoneAlarm does - I'm fairly new to winsock so I don't know much about it.
Is there a way to protect your ports via winsock?? Sort of like ZoneAlarm does - I'm fairly new to winsock so I don't know much about it.
I think personal firewall software attatches itself to the tcp/ip stack in some way to inspect it. Similar to some virus software with real-time scanners.
Don't ask me how it's done progmatically though, because I don't have a clue.
Lookup Layered Service Providers at MSDN
HI am new to the board and winsock too
i had the same idea for a program; only problem i dont know that much about winsock so i made this last monday it listen on a port when some one connect it print the person ip;
i think i will work to make it work how i want it to plus i got a win c++ networking ebook;
and if u put it on a listening port it will not work :-()
have to include winsock stuff
#include "stdafx.h"
WSADATA WD;
struct sockaddr_in tcpaddr,enemy;
#include <stdlib.h>
int main()
{
WSAStartup(MAKEWORD(1,1),&WD);
cout<<" Pleast enter the port you want this I am sillyI am sillyI am sillyI am silly to listen on"<<endl;
int port;
cin>>port;
SOCKET G;
G=socket (AF_INET,SOCK_STREAM,IPPROTO_TCP);
tcpaddr.sin_family = AF_INET;
tcpaddr.sin_port = htons(port);
tcpaddr.sin_addr.s_addr = htonl(INADDR_ANY);
bind(G, (SOCKADDR *)&tcpaddr, sizeof(tcpaddr));
listen(G,SOMAXCONN);
while (1)
{
int A =sizeof(enemy);
accept (G,(SOCKADDR *)&enemy,&A);
cout<<"the ip"<<inet_ntoa(enemy.sin_addr)<<"the port"<<ntohs(enemy.sin_port)<<endl;
}
return 0;
}
BlackBird, I don't think that's what he's looking for.
The 'hacker' trying to connect wouldn't be able to connect anyways unless there's a trojan or something listening on that port. If there is, then your call to bind() and listen() will fail anyways, because *surprise* that port has already been taken. Then you will be utterly helpless to do anything while the hacker proceeds to destroy your computer and burn down your house, after murdering your wife and children by programmatically unplugging them from the Matrix.
Just Google It. √
(\ /)
( . .)
c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.