31 lines
600 B
Go
31 lines
600 B
Go
|
package checks
|
||
|
|
||
|
import (
|
||
|
"io/ioutil"
|
||
|
"log"
|
||
|
"strings"
|
||
|
)
|
||
|
|
||
|
func (c *Checks) CheckIndex(domain string) {
|
||
|
url := "https://" + domain + "/"
|
||
|
res, err := c.get(url)
|
||
|
if err != nil {
|
||
|
//log.Println(domain + " error: " + err.Error())
|
||
|
return
|
||
|
}
|
||
|
|
||
|
bbody, err := ioutil.ReadAll(res.Body)
|
||
|
if err != nil {
|
||
|
//log.Println(domain + " read error: " + err.Error())
|
||
|
return
|
||
|
}
|
||
|
|
||
|
body := string(bbody)
|
||
|
|
||
|
if strings.Contains(body, "Index of /") && !strings.Contains(body, "Proudly Served by LiteSpeed Web Server at") {
|
||
|
c.Message("znalazło debila z indeksowaniem\n" + url)
|
||
|
log.Println("DEBIL " + url)
|
||
|
}
|
||
|
}
|
||
|
|