fixed unknown function

This commit is contained in:
Vomitblood 2025-01-24 10:19:37 +08:00
parent 8eb90e9f42
commit 8ece1eeaa4
2 changed files with 4 additions and 2 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
cve-2022-46169

View file

@ -3,6 +3,7 @@ package main
import ( import (
"flag" "flag"
"fmt" "fmt"
"io"
"net/http" "net/http"
"net/url" "net/url"
"strings" "strings"
@ -61,7 +62,7 @@ func checkVuln(vulnUrl string) bool {
// read the response body for vulnerability check // read the response body for vulnerability check
buf := new(strings.Builder) buf := new(strings.Builder)
_, err = buf.ReadFrom(resp.Body) _, err = io.Copy(buf, resp.Body)
if err != nil { if err != nil {
fmt.Println("Error reading response body:", err) fmt.Println("Error reading response body:", err)
return false return false
@ -93,7 +94,7 @@ func bruteForcing(vulnURL string) (bool, int, int) {
defer resp.Body.Close() defer resp.Body.Close()
buf := new(strings.Builder) buf := new(strings.Builder)
_, err = buf.ReadFrom(resp.Body) _, err = io.Copy(buf, resp.Body)
if err != nil { if err != nil {
fmt.Println("Error reading response body:", err) fmt.Println("Error reading response body:", err)
return false, 1, 1 return false, 1, 1