From 8ece1eeaa41de3d4c00c3b9671b27d7d9b704b0d Mon Sep 17 00:00:00 2001 From: Vomitblood Date: Fri, 24 Jan 2025 10:19:37 +0800 Subject: [PATCH] fixed unknown function --- .gitignore | 1 + main.go | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f146509 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +cve-2022-46169 \ No newline at end of file diff --git a/main.go b/main.go index 34a6b25..10bb610 100644 --- a/main.go +++ b/main.go @@ -3,6 +3,7 @@ package main import ( "flag" "fmt" + "io" "net/http" "net/url" "strings" @@ -61,7 +62,7 @@ func checkVuln(vulnUrl string) bool { // read the response body for vulnerability check buf := new(strings.Builder) - _, err = buf.ReadFrom(resp.Body) + _, err = io.Copy(buf, resp.Body) if err != nil { fmt.Println("Error reading response body:", err) return false @@ -93,7 +94,7 @@ func bruteForcing(vulnURL string) (bool, int, int) { defer resp.Body.Close() buf := new(strings.Builder) - _, err = buf.ReadFrom(resp.Body) + _, err = io.Copy(buf, resp.Body) if err != nil { fmt.Println("Error reading response body:", err) return false, 1, 1