package main import ( "fmt" "log" "net/http" "github.com/projectdiscovery/rawhttp" ) func main() { webserver := "" hostname := "" fmt.Println("Target server: " + webserver) fmt.Println("Hostname: " + hostname) clientOptions := rawhttp.DefaultOptions clientOptions.AutomaticHostHeader = false clientOptions.FollowRedirects = false client := rawhttp.NewClient(clientOptions) req, err := http.NewRequest("GET", webserver, nil) req.Method = "GET" req.Header.Set("Host", " " + hostname) req.Host = hostname req.Header.Set("User-Agent", " Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.61 Safari/537.36") req.Header.Set("Connection", " close") req.Header.Set("Accept", " */*") req.Proto = "HTTP/1.1" //fmt.Printf("%+v\n\n", req) resp, err := client.Do(req) if err != nil { fmt.Printf("Error while requesting %s with %s\n", webserver, hostname) log.Fatalf("Error: %s", err) } fmt.Printf("Status: %s, Content-Length: %d\n", resp.Status, int64(resp.ContentLength)) fmt.Printf("\n%s / HTTP/1.1\n", req.Method) for name, values := range req.Header { // Loop over all values for the name. for _, value := range values { fmt.Printf("%s:%s\n", name, value) } } }