英文:
Fuzzer in go replicating Python one
问题
我正在为这个教程重新创建一个模糊测试器(实际的模糊测试器在链接中,用Python编写)。我的问题更多是关于正确的做事方式,代码中的增量数字越来越慢。有人知道是否有一个接口/库可以做到这一点?或者在Go中是否有任何功能可以更好地完成这个任务?
package main
import (
"fmt"
"net"
"strings"
)
const payload = "\x41"
func main() {
//Banner
fmt.Printf("\nLauching Fuzzer..\n")
payL := strings.Repeat(payload, 50)
for {
payL += strings.Repeat(payload, 50)
conn, err := net.Dial("tcp", "localhost:21")
if err != nil {
fmt.Println("Crash Error: ", err)
}
final_payload := fmt.Sprint("User " + payL + "\r\n")
_, err = conn.Write([]byte(final_payload))
if err != nil {
fmt.Println("Error: ", err)
break
} else {
fmt.Println("Sending buffer with length: ", final_payload)
conn.Close()
}
}
}
英文:
I'm recreating a fuzzer(the actual fuzzer is on the link and it's written in python) for this tutorial:
> well actually the objective is to do all of the code but using Go.
**My question is more in terms of a correct way to do things the process to reach big incremental numbers in the code are getting slower and slower. Anyone have any ideia if there of a interface/lib that does this. Or any functionality that i´m forgeting in Go that could be use to do it better.:
package main
import (
"fmt"
"net"
"strings"
)
const payload = "\x41"
func main() {
//Banner
fmt.Printf("\nLauching Fuzzer..\n")
payL := strings.Repeat(payload, 50)
for {
payL += strings.Repeat(payload, 50)
conn, err := net.Dial("tcp", "localhost:21")
if err != nil {
fmt.Println("Crash Error: ", err)
}
final_payload := fmt.Sprint("User " + payL + "\r\n")
_, err = conn.Write([]byte(final_payload))
if err != nil {
fmt.Println("Error: ", err)
break
} else {
fmt.Println("Sending buffer with length: ", final_payload)
conn.Close()
}
}
答案1
得分: 3
> 导入 "github.com/google/gofuzz" 包
>
> fuzz 包是一个用于为 Go 对象填充随机值的库。
关于一个高效的 Go 模糊器的示例,请参阅 Go 包 fuzz。
英文:
> package fuzz
>
> import "github.com/google/gofuzz"
>
> Package fuzz is a library for populating go objects with random
> values.
For an example of an efficient Go fuzzer, see the Go package fuzz.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论