Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

ilyaglow/udpspoof

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GoDoc

About

This is an experimental library that allows you to send packets with an arbitrary source IP-address and doesn't depend on gopacket. The code is heavily based on the work by @chrisnc.

It will truncate your payload if the maximum length is exceeded.

Usage example

package main

import (
	"log"
	"net"

	"ilya.app/udpspoof"
)

func main() {
	conn, err := udpspoof.NewUDPConn("127.0.0.1:5000")
	if err != nil {
		log.Fatal(err)
	}

	_, err = conn.WriteAs(net.ParseIP("8.8.8.8"), uint16(53), []byte("Hello\n"))
	if err != nil {
		log.Fatal(err)
	}
}

About

Spoof IPv4 address in UDP packet

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages