From dffaaf3eb8233e5f7020dca5bcbe8efbf1adb31b Mon Sep 17 00:00:00 2001 From: Timo Mueller Date: Fri, 5 Jun 2020 13:21:59 +0000 Subject: [PATCH 1/2] Fixed #16 --- cmd/httpx/httpx.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/httpx/httpx.go b/cmd/httpx/httpx.go index d442b9e..4a2d584 100644 --- a/cmd/httpx/httpx.go +++ b/cmd/httpx/httpx.go @@ -224,7 +224,10 @@ retry: // store responses in directory if scanopts.StoreResponse { responsePath := path.Join(scanopts.StoreResponseDirectory, domain+".txt") - ioutil.WriteFile(responsePath, []byte(resp.Raw), 0644) + err := ioutil.WriteFile(responsePath, []byte(resp.Raw), 0644) + if err != nil { + gologger.Fatalf("Could not write response, at path '%s', to disc.", responsePath) + } } output <- Result{URL: fullURL, ContentLength: resp.ContentLength, StatusCode: resp.StatusCode, Title: title, str: builder.String(), VHost: isvhost} From 27bce111745fbb50d333d2f5a8ea75a0f39863cc Mon Sep 17 00:00:00 2001 From: Timo Mueller Date: Fri, 5 Jun 2020 13:25:33 +0000 Subject: [PATCH 2/2] Fixed #16 --- cmd/httpx/httpx.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/httpx/httpx.go b/cmd/httpx/httpx.go index 4a2d584..2613e8a 100644 --- a/cmd/httpx/httpx.go +++ b/cmd/httpx/httpx.go @@ -223,7 +223,8 @@ retry: // store responses in directory if scanopts.StoreResponse { - responsePath := path.Join(scanopts.StoreResponseDirectory, domain+".txt") + var domainFile = strings.Replace(domain, "/", "_", -1) + ".txt" + responsePath := path.Join(scanopts.StoreResponseDirectory, domainFile) err := ioutil.WriteFile(responsePath, []byte(resp.Raw), 0644) if err != nil { gologger.Fatalf("Could not write response, at path '%s', to disc.", responsePath)