亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? windows internet programming part 3.html

?? a collection of mega hacking tools
?? HTML
?? 第 1 頁 / 共 5 頁
字號:
    printf("Message Sent\n");



    // Close socket and WinSock

    closesocket(sock);

    WSACleanup();

    return 0;

}



/********************* icmp.c source file ************************/



Well start up your compiler and link to the Ws2_32.lib file then

add the icmp.c and icmp.h files to a new project. Compile and run

this program by typing icmp 127.0.0.1 at the command line. The

program takes the argument passed to it, 127.0.0.1 or any other

IP Address you want and sends an ICMP message with a type of 13 and

a code of 0, this setting is an ICMP echo request. Now remember

that whatever values you enter in the code for the ICMP headers

fields, that is the type of ICMP Message that is sent. For example,

if we were to change the type to 17 then we would be sending a ICMP

Netmask request, the target machine would then send back a Netmask

Reply which we could use to map a target network. Or say if we went

to www.tlsecurity.com and browsed for vulnerabilities and the words

ICMP and Win98 were to catch our eye, here we would find a

vulnerability for Windows 98 called p-smash. Now this advisory

tells us that if we sent an icmp message to a computer running

Windows 98 that had a Type of 9 and a code of 0 then the thing

halt and stop responding. Therefore all we have to do with the

above program is change:



#define ICMP_ECHOREQ		13



	to



#define ICMP_ECHOREQ		19



in the header file, then when we send this to a Windows 98 machine

the thing halts, an icmp DoS tool.



Lamer Alert: I was using the above as an example DoS tools are

indeed very lame!! and just shouldn't be used or designed, advisories

are of course a good thing, they prompt vendors to do something about

security vulnerabilities and promote security awareness, don't be

lame, don't use DoS tools, otherwise you'll give Steve Gibson more

stuff to prattle on about and ill have to bore ya to death with more

flaming of 'the prick' (yes by flaming of the prick i am refering to

Giving out about Gibson not medical conditions, I know what you were

thinking cyberwolf!).





6.2 TCP ACK PACKET

=======================================



/*********************** ip.h header file *************************/



#include <winsock2.h&gt

#include <windows.h&gt

#include <ws2tcpip.h&gt

#include <stdio.h&gt



struct tcpheader {

 unsigned short int th_sport;

 unsigned short int th_dport;

 unsigned int th_seq;

 unsigned int th_ack;

 unsigned char th_x2:4, th_off:4;

 unsigned char th_flags;

 unsigned short int th_win;

 unsigned short int th_sum;

 unsigned short int th_urp;

}; /* total tcp header length: 20 bytes (=160 bits) */



struct ipheader {

 unsigned char ip_hl:4, ip_v:4; /* this means that each member is 4 bits */

 unsigned char ip_tos;

 unsigned short int ip_len;

 unsigned short int ip_id;

 unsigned short int ip_off;

 unsigned char ip_ttl;

 unsigned char ip_p;

 unsigned short int ip_sum;

 unsigned int ip_src;

 unsigned int ip_dst;

}; /* total ip header length: 20 bytes (=160 bits) */



// Psuedo Header



typedef struct ps_hdr

{

    unsigned int   source_address;   // Source Address		 =>	  4 Bytes

    unsigned int   dest_address;     // Destination Address	 =>	  4 Bytes

    unsigned char  placeholder;	     // Place Holder		 =>	  1 Bytes

    unsigned char  protocol;	     // Protocol		 =>	  1 Bytes

    unsigned short tcp_length;	     // TCP Length		 =>    +  2 Bytes

				     //				       = 12 Bytes

    struct tcpheader tcp;



}PS_HDR;



// IP/TCP/UDP Checksum Function



USHORT checksum(USHORT *buffer, int size)

{

    unsigned long cksum=0;

    while (size > 1)

    {

        cksum += *buffer++;

        size  -= sizeof(USHORT);   

    }

    if (size)

    {

        cksum += *(UCHAR*)buffer;   

    }

    cksum = (cksum >> 16) + (cksum & 0xffff);

    cksum += (cksum >>16); 

    return (USHORT)(~cksum); 

}



/*********************** ip.h header file *************************/



Well that header file contained a few #define's, these dealt with

TCP's control bits like ack and sequence and so on to make things

more readable later. We then setup up the structures for the IP,

TCP and Psuedo Headers and the function to calculate the checksum.

Now lets put the header to use with the ack program, this program

will send a single ACK packet to whatever computer you specify.



/********************** main.c source file ************************/



#include "ip.h"



#define PORT 25



int main (void)

{



	WSADATA wsd;

	char datagram[4096];

	bool bOpt = 1;



    if (WSAStartup(MAKEWORD(2,2), &wsd) != 0)

    {

	   printf("WSAStartup() failed: %d\n", GetLastError());

	   return -1;

    }



// Create a raw socket



    SOCKET s = socket(AF_INET, SOCK_RAW, IPPROTO_RAW);

    if (s == INVALID_SOCKET)

    {

       printf("WSASocket() failed: %d\n", WSAGetLastError());

       return -1;

    }



  struct ipheader *iph = (struct ipheader *) datagram;

  struct tcpheader *tcph = (struct tcpheader *) datagram + sizeof (struct ipheader);

  struct sockaddr_in sin;



  PS_HDR pseudo_header;



  sin.sin_family = AF_INET;

  sin.sin_port = htons (PORT);

  sin.sin_addr.s_addr = inet_addr ("127.0.0.1");



  memset (datagram, 0, 4096);	/* zero out the buffer */



  iph->ip_hl		 = 5;

  iph->ip_v			 = 4;

  iph->ip_tos		 = 0;

  iph->ip_len		 = sizeof (struct ipheader) + sizeof (struct tcpheader);

  iph->ip_id		 = 1;

  iph->ip_off		 = 0;

  iph->ip_ttl		 = 255;

  iph->ip_p			 = 6;

  iph->ip_sum		 = 0;

  iph->ip_src		 = inet_addr ("1.2.3.4");

  iph->ip_dst		 = sin.sin_addr.s_addr;



  tcph->th_sport	 = htons (1234);

  tcph->th_dport	 = htons (PORT);

  tcph->th_seq		 = rand();

  tcph->th_ack		 = 0;

  tcph->th_x2		 = 0;

  tcph->th_off		 = 0;

  tcph->th_flags	 = 2; // SYN

  tcph->th_win		 = htons(65535);

  tcph->th_sum		 = 0;

  tcph->th_urp		 = 0;



  // Build the Psuedo Header



  pseudo_header.source_address    = inet_addr ("1.2.3.4");

  pseudo_header.dest_address	  = sin.sin_addr.s_addr;

  pseudo_header.placeholder		  = 0;

  pseudo_header.protocol		  = IPPROTO_TCP;

  pseudo_header.tcp_length		  = htons(sizeof(tcpheader));



// Calculate Checksum



  tcph->th_sum = checksum((unsigned short *)&pseudo_header, sizeof(pseudo_header));

  iph->ip_sum  = checksum((unsigned short *)&iph, sizeof(ipheader));

// ENABLE IPHDRINCL 



    if (setsockopt(s, IPPROTO_IP, IP_HDRINCL, (char *)&bOpt, sizeof(bOpt)) == SOCKET_ERROR)

    {

	   printf("setsockopt(IP_HDRINCL) failed: %d\n", WSAGetLastError());

	   return -1;

    }



  while (1)

    {

      // Send The Packet



    if (sendto(s, datagram, sizeof(datagram), 0, (SOCKADDR *)&sin, sizeof(sin)) == SOCKET_ERROR)

    {

       	   printf("sendto() failed: %d\n", WSAGetLastError());

	   return -1;

    }

    }



  return 0;

}



/********************** main.c source file ************************/



This program sends a tcp SYN packet to a target (you), it is a simple

program but a very powerful one. You can edit all of the header fields

enabling us to spoof our ip address amongst other things.



Notice that we can also set the port numbers, some firewalls will

let a packet with a port of 53 trough and not even log it, by knowing

security tid bits like this we can build better more sophisticated

programs.





7.0 RECIEVING RAW PACKETS

=======================================



Recieving Raw Packets was never dealt with in the Berkeley Raw Socket

specification, so far only linux 2.2.3 and up I believe ever dealt

with them, it is of course therefore surprising that Microsoft has

indeed supported a way to recieve raw packets with our programs! Yes

indeed I am starting to like the guy who came up with the idea of

supporting raw sockets in Windows more and more! But how do we do it?

Well what we do is this: sniff all incomming packets on our computer

and filter them for the packet we are looking for. This method can

be used for, obviously, creating a packet sniffer and also for a

firewall or some port redirection tool. Very good idea.



We do it by creating a new raw socket and binding it to the interface,

go into promiscuous mode and grab all the incomming packets.



As usual we would set up our socket with something like the following:



    SOCKET        sniffsock;

    SOCKADDR_IN   if0;





    sniffsock = socket(AF_INET, SOCK_RAW, IPPROTO_IP);





and then call bind() with this raw socket:





    bind(sniffsock, (SOCKADDR *)&if0, sizeof(if0));





we then go into Promiscuous mode and recieve all of the packets by

calling WSAIoctl() with SIO_RCVALL set:





   WSAIoctl(sniffsock, SIO_RCVALL, &optval, sizeof(optval), NULL, 0, &dwBytesRet, NULL,	NULL);





we can then use the WSARecv() function to grab the packets and feed

them into a buffer like so:





   recv(sniffsock, RecvBuf, sizeof(RecvBuf), 0);





We then use our own filterpacket() function to look for the particular

packet that we want.





So now for some example source code, this program will capture all packets

sent to your computer for as long as the program is running, to do this well

use a while loop to capture the packets then pass the packet to a function

called filterpacket() in order to get the information from the packets

headers. First create a new project and add a .cpp c++ source file.

Here comes the science bit.





/********************** recv.c source file ************************/



#include <winsock2.h&gt

#include <windows.h&gt

#include <ws2tcpip.h&gt

#include <stdio.h&gt



void outtie(char *p)

{

	FILE *fp = fopen("Sniffer1.txt","a+");

	fprintf(fp,"%s\n",p);

	fclose(fp);

}



#define SIO_RCVALL _WSAIOW(IOC_VENDOR,1)

#define MAX_ADDR_LEN 16

#define MAX_HOSTNAME_LAN 255



typedef struct _iphdr

{

unsigned char	h_lenver;

unsigned char	tos;

unsigned short	total_len;

unsigned short	ident;

unsigned short	frag_and_flags;

unsigned char	ttl;

unsigned char	proto;

unsigned short	checksum;

unsigned int	sourceIP;

unsigned int	destIP;

}IP_HDR;



void RecvPacket();

int filterpacket(char *buf);



char     output[500];



void main()

{

RecvPacket();

}



void RecvPacket()

{

    SOCKET        sock;

    WSADATA       wsd;

    char RecvBuf[65535] = {0};

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
综合久久综合久久| 亚洲成人动漫在线免费观看| 亚洲最新视频在线观看| 国产精品一区二区x88av| 欧美午夜精品一区二区三区| 国产欧美日韩一区二区三区在线观看| 亚洲va欧美va天堂v国产综合| 国产精品一区二区黑丝| 日韩欧美国产小视频| 一区二区三区不卡视频| 99久久婷婷国产| 久久精品欧美日韩| 看片的网站亚洲| 6080亚洲精品一区二区| 亚洲国产成人va在线观看天堂| youjizz国产精品| 久久在线观看免费| 精品一区中文字幕| 欧美一区二区三区啪啪| 丝袜国产日韩另类美女| 欧美色区777第一页| 一区二区三区.www| 欧洲一区二区三区免费视频| 中文字幕一区在线| 成人av网站大全| 欧美极品另类videosde| 国产成人免费在线| 国产午夜亚洲精品不卡| 国产成人aaa| 国产精品久久久久毛片软件| 成人免费视频免费观看| 国产精品家庭影院| av成人免费在线| 亚洲欧洲av在线| 色素色在线综合| 亚洲人成小说网站色在线| 91美女片黄在线观看91美女| 亚洲综合精品自拍| 欧美日韩电影在线播放| 日韩高清欧美激情| 日韩精品一区国产麻豆| 国产真实乱子伦精品视频| 国产欧美精品一区aⅴ影院 | 韩国欧美一区二区| 久久午夜老司机| 国产99久久久久| 亚洲天堂a在线| 欧美日韩在线播放一区| 亚洲国产精品天堂| 欧美一区二区三区视频| 国产成人亚洲精品青草天美| 久久人人爽爽爽人久久久| 国产1区2区3区精品美女| ㊣最新国产の精品bt伙计久久| 欧美中文字幕不卡| 久久成人av少妇免费| 国产日本欧美一区二区| 色www精品视频在线观看| 天天操天天综合网| 久久天天做天天爱综合色| 91日韩在线专区| 日本不卡视频一二三区| 欧美国产一区二区| 欧美视频一区二区| 国产91精品一区二区麻豆亚洲| 一区二区三区中文字幕| 精品国产自在久精品国产| 99久久免费国产| 久草在线在线精品观看| 亚洲视频精选在线| 精品免费日韩av| 色中色一区二区| 激情欧美一区二区三区在线观看| 一区在线中文字幕| 日韩精品中文字幕一区二区三区| 一本色道久久综合精品竹菊| 美洲天堂一区二卡三卡四卡视频 | 日本中文字幕一区二区视频| 国产片一区二区| 欧美福利视频导航| av激情亚洲男人天堂| 色网站国产精品| 国模娜娜一区二区三区| 亚洲一区二区不卡免费| 中文字幕第一区二区| 日韩欧美在线一区二区三区| 日本高清成人免费播放| 福利视频网站一区二区三区| 日本美女视频一区二区| 亚洲在线观看免费视频| 国产精品乱码一区二区三区软件| 欧美一区2区视频在线观看| 日本乱码高清不卡字幕| 不卡在线观看av| 国产乱对白刺激视频不卡| 免费人成网站在线观看欧美高清| 亚洲国产日产av| 亚洲视频免费观看| 亚洲私人影院在线观看| 国产精品久久一级| 久久色在线视频| 精品国产欧美一区二区| 日韩午夜激情电影| 日韩欧美一区二区三区在线| 欧美日韩精品三区| 欧美日韩免费视频| 欧美天堂一区二区三区| 91麻豆视频网站| 色呦呦国产精品| 91污片在线观看| 99re这里只有精品首页| 99国产精品久久| 97精品久久久久中文字幕| 91日韩在线专区| 91国内精品野花午夜精品| 色欧美日韩亚洲| 欧美综合视频在线观看| 欧美视频中文一区二区三区在线观看| www.欧美.com| 在线免费观看一区| 欧美三级日韩在线| 欧美一区永久视频免费观看| 日韩你懂的电影在线观看| 337p日本欧洲亚洲大胆色噜噜| 精品免费国产一区二区三区四区| 久久久久久一二三区| 亚洲国产高清不卡| 中文字幕一区二区在线播放| 亚洲精品中文在线观看| 亚洲国产日韩一区二区| 免费在线观看一区| 国产精品资源站在线| 成人动漫一区二区在线| 91国偷自产一区二区三区成为亚洲经典| 欧美性xxxxxxxx| 欧美精品aⅴ在线视频| 欧美大片顶级少妇| 国产精品每日更新在线播放网址| 自拍av一区二区三区| 午夜精品福利视频网站| 激情欧美一区二区| 一本到不卡精品视频在线观看| 欧美一区二区私人影院日本| 久久久久88色偷偷免费| 综合婷婷亚洲小说| 欧美aaaaa成人免费观看视频| 风间由美一区二区av101 | 99久久99久久精品免费观看| 欧美色综合天天久久综合精品| 欧美一级欧美三级在线观看| 中文一区二区在线观看| 亚洲在线免费播放| 国产成人精品影院| 欧美日本在线一区| 国产精品久久久久久久久免费桃花 | 制服丝袜在线91| 国产亚洲视频系列| 亚洲国产精品一区二区久久恐怖片| 狠狠色丁香久久婷婷综合_中| 91丨porny丨在线| 精品国产三级a在线观看| 亚洲乱码国产乱码精品精的特点| 久久国产精品色| 在线一区二区视频| 国产日本一区二区| 久久99精品一区二区三区三区| 在线免费观看不卡av| 国产欧美日韩三级| 久色婷婷小香蕉久久| 欧美在线一区二区三区| 欧美国产精品劲爆| 精品一区二区三区久久| 欧美日韩视频一区二区| 最新国产の精品合集bt伙计| 国产成人精品aa毛片| 日韩一区二区高清| 午夜精品福利在线| 欧美性感一类影片在线播放| 1000精品久久久久久久久| 国产精品中文有码| 亚洲精品在线免费播放| 日韩av不卡一区二区| 欧美裸体bbwbbwbbw| 亚洲午夜一二三区视频| 91亚洲国产成人精品一区二区三 | 成人免费视频播放| 久久婷婷国产综合精品青草| 老司机免费视频一区二区三区| 91.com视频| 日韩成人伦理电影在线观看| 欧美日韩国产片| 午夜国产不卡在线观看视频| 欧美性生交片4| 亚洲一区二区偷拍精品| 欧美在线播放高清精品| 亚洲天堂免费在线观看视频| 91在线观看高清| 亚洲人吸女人奶水| 日本久久精品电影| 亚洲第一在线综合网站|