diff --git a/.gitignore b/.gitignore index d851524..a7daec3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ main -result.txt \ No newline at end of file +result.txt +.idea/vcs.xml +.idea/workspace.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml index c61e7f7..1a351c8 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -1,7 +1,11 @@ - + + + + + + + @@ -24,6 +31,7 @@ + @@ -79,5 +87,9 @@ + + + + \ No newline at end of file diff --git a/core/hostscan.go b/core/hostscan.go index 17bbde9..6ecc9db 100644 --- a/core/hostscan.go +++ b/core/hostscan.go @@ -55,10 +55,10 @@ func goScan(taskChan chan [2]string, wg *sync.WaitGroup){ result.Title = title resultStr, _ := json.Marshal(result) if len(title) > 0{ - elog.Info(fmt.Sprintf("Uri: %s, Host: %s --> %s", uri, host, title)) + elog.Notice(fmt.Sprintf("Uri: %s, Host: %s --> %s", uri, host, title)) utils.WriteLine(string(resultStr), *vars.OutFile) }else{ - elog.Warn(fmt.Sprintf("Uri: %s, Host: %s not reached", uri, host)) + elog.Warn(fmt.Sprintf("Uri: %s, Host: %s No title found", uri, host)) } } } diff --git a/utils/http.go b/utils/http.go index 783a5fb..188c976 100644 --- a/utils/http.go +++ b/utils/http.go @@ -1,8 +1,7 @@ package utils import ( - "fmt" - "hostscan/elog" + "crypto/tls" "hostscan/vars" "io/ioutil" "net/http" @@ -10,18 +9,22 @@ import ( ) func GetHttpBody(url, host string) string{ + tr := &http.Transport{ + TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, + } client := &http.Client{ + Transport: tr, Timeout: time.Duration(*vars.Timeout) * time.Second, } reqest, err := http.NewRequest("GET", url, nil) if err != nil { - elog.Error(fmt.Sprintf("DoGet: %s [%s]", url, err)) + //elog.Error(fmt.Sprintf("DoGet: %s [%s]", url, err)) return "" } - reqest.Header.Add("Host", host) + reqest.Host = host reqest.Header.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0") response, err := client.Do(reqest) if response != nil{ @@ -29,7 +32,7 @@ func GetHttpBody(url, host string) string{ } if err != nil { - elog.Error(fmt.Sprintf("DoGet: %s [%s]", url, err)) + //elog.Error(fmt.Sprintf("DoGet: %s [%s]", url, err)) return "" } bodyByte, _ := ioutil.ReadAll(response.Body)