Skip to content

Commit

Permalink
fix for issue in #298f89f
Browse files Browse the repository at this point in the history
  • Loading branch information
milo2012 committed Sep 5, 2018
1 parent 57255c7 commit e177d4e
Showing 1 changed file with 34 additions and 34 deletions.
68 changes: 34 additions & 34 deletions pathBrute.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ var currentCount int = 0
var currentCount1 int = 0
var ContinueNum int = 0
var proxyMode = false
var enableDebug = false
var enableDebug = true
var lookupMode = false

var totalListCount int = 0
Expand Down Expand Up @@ -1753,14 +1753,14 @@ func testURL(newUrl string) {
tmpTitle=strings.Replace(tmpTitle,"\n"," ",1)
if tmpStatusCode=="200"{
i, err :=strconv.Atoi(initialStatusCode)
if (Excludecode!=0 && Excludecode!=i) || (Statuscode!=0 && Statuscode==i) {
if (Excludecode==0 && Excludecode!=i) || (Statuscode!=0 && Statuscode==i) {
fmt.Printf("%s [code:%s] [%d] [%s] [%d of %d]\n",newUrl, color.BlueString(initialStatusCode), lenBody, tmpTitle,currentListCount,totalListCount)
log.Printf("%s [code:%s] [%d] [%s] [%d of %d]\n",newUrl, color.BlueString(initialStatusCode), lenBody, tmpTitle, currentListCount,totalListCount)
}
_=err
} else if tmpStatusCode=="401"{
i, err :=strconv.Atoi(initialStatusCode)
if (Excludecode!=0 && Excludecode!=i) || (Statuscode!=0 && Statuscode==i) {
if (Excludecode==0 && Excludecode!=i) || (Statuscode!=0 && Statuscode==i) {
fmt.Printf("%s [code:%s] [%d] [%s] [%d of %d]\n",newUrl, color.GreenString(initialStatusCode), lenBody, tmpTitle, currentListCount,totalListCount)
log.Printf("%s [code:%s] [%d] [%s] [%d of %d]\n",newUrl, color.GreenString(initialStatusCode), lenBody, tmpTitle, currentListCount,totalListCount)
}
Expand All @@ -1771,7 +1771,7 @@ func testURL(newUrl string) {
log.Printf("%s [code:%s] [%d] [%s] [%d of %d]\n",newUrl, color.RedString(""), lenBody, tmpTitle, currentListCount,totalListCount)
} else {
i, err :=strconv.Atoi(initialStatusCode)
if (Excludecode!=0 && Excludecode!=i) || (Statuscode!=0 && Statuscode==i) {
if (Excludecode==0 && Excludecode!=i) || (Statuscode!=0 && Statuscode==i) {
fmt.Printf("%s [code:%s] [%d] [%s] [%d of %d]\n",newUrl, color.RedString(initialStatusCode), lenBody, tmpTitle, currentListCount,totalListCount)
log.Printf("%s [code:%s] [%d] [%s] [%d of %d]\n",newUrl, color.RedString(initialStatusCode), lenBody, tmpTitle, currentListCount,totalListCount)
}
Expand All @@ -1794,7 +1794,7 @@ func testURL(newUrl string) {
tmpResultList = append(tmpResultList,a...)
} else if (resp.StatusCode!=401 && initialStatusCode=="401") {
i, err :=strconv.Atoi(initialStatusCode)
if (Excludecode!=0 && Excludecode!=i) || (Statuscode!=0 && Statuscode==i) {
if (Excludecode==0 && Excludecode!=i) || (Statuscode!=0 && Statuscode==i) {
fmt.Printf("%s [code:%s] [%d of %d]\n",newURL2, color.RedString(initialStatusCode), currentListCount,totalListCount)
log.Printf("%s [code:%s] [%d of %d]\n",newURL2, color.RedString(initialStatusCode), currentListCount,totalListCount)
}
Expand All @@ -1804,22 +1804,22 @@ func testURL(newUrl string) {
} else {
if tmpStatusCode=="200"{
i, err :=strconv.Atoi(initialStatusCode)
if (Excludecode!=0 && Excludecode!=i) || (Statuscode!=0 && Statuscode==i) {
if (Excludecode==0 && Excludecode!=i) || (Statuscode!=0 && Statuscode==i) {
fmt.Printf("%s [code:%s] [%d] [%s] [%d of %d]\n",newUrl, color.BlueString(initialStatusCode), lenBody, tmpTitle,currentListCount,totalListCount)
log.Printf("%s [code:%s] [%d] [%s] [%d of %d]\n",newUrl, color.BlueString(initialStatusCode), lenBody, tmpTitle, currentListCount,totalListCount)
}
_=err
} else if tmpStatusCode=="401"{
i, err :=strconv.Atoi(initialStatusCode)
if (Excludecode!=0 && Excludecode!=i) || (Statuscode!=0 && Statuscode==i) {
if (Excludecode==0 && Excludecode!=i) || (Statuscode!=0 && Statuscode==i) {
fmt.Printf("%s [code:%s] [%d] [%s] [%d of %d]\n",newUrl, color.GreenString(initialStatusCode), lenBody, tmpTitle, currentListCount,totalListCount)
log.Printf("%s [code:%s] [%d] [%s] [%d of %d]\n",newUrl, color.GreenString(initialStatusCode), lenBody, tmpTitle, currentListCount,totalListCount)
}
_=err
} else {
i, err :=strconv.Atoi(initialStatusCode)
if (Excludecode!=0 && Excludecode!=i) || (Statuscode!=0 && Statuscode==i) {
fmt.Printf("%s [code:%s] [%d] [%s] [%d of %d]\n",newUrl, color.RedString(initialStatusCode), lenBody, tmpTitle, currentListCount,totalListCount)
if (Excludecode==0 && Excludecode!=i) || (Statuscode!=0 && Statuscode==i) {
fmt.Printf("3%s [code:%s] [%d] [%s] [%d of %d]\n",newUrl, color.RedString(initialStatusCode), lenBody, tmpTitle, currentListCount,totalListCount)
log.Printf("%s [code:%s] [%d] [%s] [%d of %d]\n",newUrl, color.RedString(initialStatusCode), lenBody, tmpTitle, currentListCount,totalListCount)
}
_=err
Expand All @@ -1830,26 +1830,26 @@ func testURL(newUrl string) {
tmpStatusCode := strconv.Itoa(resp.StatusCode)
if Statuscode!=0 {
if resp.StatusCode==Statuscode {
i, err :=strconv.Atoi(initialStatusCode)
if (Excludecode!=0 && Excludecode!=i) || (Statuscode!=0 && Statuscode==i) {
fmt.Printf("%s [code:%s] [%d] [%s] [%d of %d]\n",newUrl, color.RedString(tmpStatusCode), lenBody, tmpTitle, currentListCount,totalListCount)
i, err :=strconv.Atoi(initialStatusCode)
if (Excludecode==0 || Excludecode!=i) && (Statuscode==0 || Statuscode==i) {
fmt.Printf("2%s [code:%s] [%d] [%s] [%d of %d]\n",newUrl, color.RedString(tmpStatusCode), lenBody, tmpTitle, currentListCount,totalListCount)
log.Printf("%s [code:%s] [%d] [%s] [%d of %d]\n",newUrl, color.RedString(tmpStatusCode), lenBody, tmpTitle, currentListCount,totalListCount)
}
_=err
var a = [][]string{{newUrl, tmpStatusCode, strconv.Itoa(lenBody),tmpTitle}}
tmpResultList = append(tmpResultList,a...)
} else {
i, err :=strconv.Atoi(initialStatusCode)
if (Excludecode!=0 && Excludecode!=i) || (Statuscode!=0 && Statuscode==i) {
fmt.Printf("%s [code:%s] [%d] [%s] [%d of %d]\n",newUrl, color.BlueString(initialStatusCode), lenBody, tmpTitle,currentListCount,totalListCount)
if (Excludecode==0 || Excludecode!=i) && (Statuscode==0 || Statuscode==i) {
fmt.Printf("1%s [code:%s] [%d] [%s] [%d of %d]\n",newUrl, color.BlueString(initialStatusCode), lenBody, tmpTitle,currentListCount,totalListCount)
log.Printf("%s [code:%s] [%d] [%s] [%d of %d]\n",newUrl, color.BlueString(initialStatusCode), lenBody, tmpTitle,currentListCount,totalListCount)
}
_=err
}
} else {
if tmpStatusCode=="200"{
i, err :=strconv.Atoi(initialStatusCode)
if (Excludecode!=0 && Excludecode!=i) || (Statuscode!=0 && Statuscode==i) {
if (Excludecode==0 || Excludecode!=i) && (Statuscode==0 || Statuscode==i) {
fmt.Printf("%s [code:%s] [%d] [%s] [%d of %d]\n",newUrl, color.BlueString(tmpStatusCode), lenBody, tmpTitle,currentListCount,totalListCount)
log.Printf("%s [code:%s] [%d] [%s] [%d of %d]\n",newUrl, color.BlueString(tmpStatusCode), lenBody, tmpTitle,currentListCount,totalListCount)
}
Expand All @@ -1858,7 +1858,7 @@ func testURL(newUrl string) {
tmpResultList = append(tmpResultList,a...)
} else if tmpStatusCode=="401"{
i, err :=strconv.Atoi(initialStatusCode)
if (Excludecode!=0 && Excludecode!=i) || (Statuscode!=0 && Statuscode==i) {
if (Excludecode==0 || Excludecode!=i) && (Statuscode==0 || Statuscode==i) {
fmt.Printf("%s [code:%s]\n",newUrl, color.GreenString(tmpStatusCode))
log.Printf("%s [code:%s]\n",newUrl, color.GreenString(tmpStatusCode))
}
Expand All @@ -1867,8 +1867,8 @@ func testURL(newUrl string) {
tmpResultList = append(tmpResultList,a...)
} else {
i, err :=strconv.Atoi(initialStatusCode)
if (Excludecode!=0 && Excludecode!=i) || (Statuscode!=0 && Statuscode==i) {
fmt.Printf("%s [code:%s] [%d] [%s] [%d of %d]\n",newUrl, color.RedString(tmpStatusCode), lenBody, tmpTitle, currentListCount,totalListCount)
if (Excludecode==0 || Excludecode!=i) && (Statuscode==0 || Statuscode==i) {
fmt.Printf("4%s [code:%s] [%d] [%s] [%d of %d]\n",newUrl, color.RedString(tmpStatusCode), lenBody, tmpTitle, currentListCount,totalListCount)
log.Printf("%s [code:%s] [%d] [%s] [%d of %d]\n",newUrl, color.RedString(tmpStatusCode), lenBody, tmpTitle, currentListCount,totalListCount)
}
_=err
Expand Down Expand Up @@ -2055,14 +2055,14 @@ func getUrlWorker(urlChan chan string) {
tmpTitle=strings.Replace(tmpTitle,"\n"," ",1)
if tmpStatusCode=="200"{
i, err :=strconv.Atoi(initialStatusCode)
if (Excludecode!=0 && Excludecode!=i) || (Statuscode!=0 && Statuscode==i) {
if (Excludecode==0 || Excludecode!=i) && (Statuscode==0 || Statuscode==i) {
fmt.Printf("%s [code:%s] [%d] [%s] [%d of %d]\n",newUrl, color.BlueString(initialStatusCode), lenBody, tmpTitle,currentListCount,totalListCount)
log.Printf("%s [code:%s] [%d] [%s] [%d of %d]\n",newUrl, color.BlueString(initialStatusCode), lenBody, tmpTitle, currentListCount,totalListCount)
}
_=err
} else if tmpStatusCode=="401"{
i, err :=strconv.Atoi(initialStatusCode)
if (Excludecode!=0 && Excludecode!=i) || (Statuscode!=0 && Statuscode==i) {
if (Excludecode==0 || Excludecode!=i) && (Statuscode==0 || Statuscode==i) {
fmt.Printf("%s [code:%s] [%d] [%s] [%d of %d]\n",newUrl, color.GreenString(initialStatusCode), lenBody, tmpTitle, currentListCount,totalListCount)
log.Printf("%s [code:%s] [%d] [%s] [%d of %d]\n",newUrl, color.GreenString(initialStatusCode), lenBody, tmpTitle, currentListCount,totalListCount)
}
Expand All @@ -2073,7 +2073,7 @@ func getUrlWorker(urlChan chan string) {
log.Printf("%s [code:%s] [%d] [%s] [%d of %d]\n",newUrl, color.RedString(""), lenBody, tmpTitle, currentListCount,totalListCount)
} else {
i, err :=strconv.Atoi(initialStatusCode)
if (Excludecode!=0 && Excludecode!=i) || (Statuscode!=0 && Statuscode==i) {
if (Excludecode==0 || Excludecode!=i) && (Statuscode==0 || Statuscode==i) {
fmt.Printf("%s [code:%s] [%d] [%s] [%d of %d]\n",newUrl, color.RedString(initialStatusCode), lenBody, tmpTitle, currentListCount,totalListCount)
log.Printf("%s [code:%s] [%d] [%s] [%d of %d]\n",newUrl, color.RedString(initialStatusCode), lenBody, tmpTitle, currentListCount,totalListCount)
}
Expand All @@ -2091,7 +2091,7 @@ func getUrlWorker(urlChan chan string) {
var newURL2=u.Scheme+"://"+u.Host
if resp.StatusCode==401 && initialStatusCode=="401" {
i, err :=strconv.Atoi(initialStatusCode)
if (Excludecode!=0 && Excludecode!=i) || (Statuscode!=0 && Statuscode==i) {
if (Excludecode==0 || Excludecode!=i) && (Statuscode==0 || Statuscode==i) {
fmt.Printf("%s [code:%s] [%d of %d]\n",newURL2, color.RedString(initialStatusCode), currentListCount,totalListCount)
log.Printf("%s [code:%s] [%d of %d]\n",newURL2, color.RedString(initialStatusCode), currentListCount,totalListCount)
}
Expand All @@ -2100,7 +2100,7 @@ func getUrlWorker(urlChan chan string) {
tmpResultList = append(tmpResultList,a...)
} else if (resp.StatusCode!=401 && initialStatusCode=="401") {
i, err :=strconv.Atoi(initialStatusCode)
if (Excludecode!=0 && Excludecode!=i) || (Statuscode!=0 && Statuscode==i) {
if (Excludecode==0 || Excludecode!=i) && (Statuscode==0 || Statuscode==i) {
fmt.Printf("%s [code:%s] [%d of %d]\n",newURL2, color.RedString(initialStatusCode), currentListCount,totalListCount)
log.Printf("%s [code:%s] [%d of %d]\n",newURL2, color.RedString(initialStatusCode), currentListCount,totalListCount)
}
Expand All @@ -2110,21 +2110,21 @@ func getUrlWorker(urlChan chan string) {
} else {
if tmpStatusCode=="200"{
i, err :=strconv.Atoi(initialStatusCode)
if (Excludecode!=0 && Excludecode!=i) || (Statuscode!=0 && Statuscode==i) {
if (Excludecode==0 || Excludecode!=i) && (Statuscode==0 || Statuscode==i) {
fmt.Printf("%s [code:%s] [%d] [%s] [%d of %d]\n",newUrl, color.BlueString(initialStatusCode), lenBody, tmpTitle,currentListCount,totalListCount)
log.Printf("%s [code:%s] [%d] [%s] [%d of %d]\n",newUrl, color.BlueString(initialStatusCode), lenBody, tmpTitle, currentListCount,totalListCount)
}
_=err
} else if tmpStatusCode=="401"{
i, err :=strconv.Atoi(initialStatusCode)
if (Excludecode!=0 && Excludecode!=i) || (Statuscode!=0 && Statuscode==i) {
if (Excludecode==0 || Excludecode!=i) && (Statuscode==0 || Statuscode==i) {
fmt.Printf("%s [code:%s] [%d] [%s] [%d of %d]\n",newUrl, color.GreenString(initialStatusCode), lenBody, tmpTitle, currentListCount,totalListCount)
log.Printf("%s [code:%s] [%d] [%s] [%d of %d]\n",newUrl, color.GreenString(initialStatusCode), lenBody, tmpTitle, currentListCount,totalListCount)
}
_=err
} else {
i, err :=strconv.Atoi(initialStatusCode)
if (Excludecode!=0 && Excludecode!=i) || (Statuscode!=0 && Statuscode==i) {
if (Excludecode==0 || Excludecode!=i) && (Statuscode==0 || Statuscode==i) {
fmt.Printf("%s [code:%s] [%d] [%s] [%d of %d]\n",newUrl, color.RedString(initialStatusCode), lenBody, tmpTitle, currentListCount,totalListCount)
log.Printf("%s [code:%s] [%d] [%s] [%d of %d]\n",newUrl, color.RedString(initialStatusCode), lenBody, tmpTitle, currentListCount,totalListCount)
}
Expand All @@ -2137,7 +2137,7 @@ func getUrlWorker(urlChan chan string) {
if Statuscode!=0 {
if resp.StatusCode==Statuscode {
i, err :=strconv.Atoi(initialStatusCode)
if (Excludecode!=0 && Excludecode!=i) || (Statuscode!=0 && Statuscode==i) {
if (Excludecode==0 || Excludecode!=i) && (Statuscode==0 || Statuscode==i) {
fmt.Printf("%s [code:%s] [%d] [%s] [%d of %d]\n",newUrl, color.RedString(tmpStatusCode), lenBody, tmpTitle, currentListCount,totalListCount)
log.Printf("%s [code:%s] [%d] [%s] [%d of %d]\n",newUrl, color.RedString(tmpStatusCode), lenBody, tmpTitle, currentListCount,totalListCount)
}
Expand All @@ -2146,7 +2146,7 @@ func getUrlWorker(urlChan chan string) {
tmpResultList = append(tmpResultList,a...)
} else {
i, err :=strconv.Atoi(initialStatusCode)
if (Excludecode!=0 && Excludecode!=i) || (Statuscode!=0 && Statuscode==i) {
if (Excludecode==0 || Excludecode!=i) && (Statuscode==0 || Statuscode==i) {
fmt.Printf("%s [code:%s] [%d] [%s] [%d of %d]\n",newUrl, color.BlueString(initialStatusCode), lenBody, tmpTitle,currentListCount,totalListCount)
log.Printf("%s [code:%s] [%d] [%s] [%d of %d]\n",newUrl, color.BlueString(initialStatusCode), lenBody, tmpTitle,currentListCount,totalListCount)
}
Expand All @@ -2155,7 +2155,7 @@ func getUrlWorker(urlChan chan string) {
} else {
if tmpStatusCode=="200"{
i, err :=strconv.Atoi(initialStatusCode)
if (Excludecode!=0 && Excludecode!=i) || (Statuscode!=0 && Statuscode==i) {
if (Excludecode==0 || Excludecode!=i) && (Statuscode==0 || Statuscode==i) {
fmt.Printf("%s [code:%s] [%d] [%s] [%d of %d]\n",newUrl, color.BlueString(tmpStatusCode), lenBody, tmpTitle,currentListCount,totalListCount)
log.Printf("%s [code:%s] [%d] [%s] [%d of %d]\n",newUrl, color.BlueString(tmpStatusCode), lenBody, tmpTitle,currentListCount,totalListCount)
}
Expand All @@ -2164,7 +2164,7 @@ func getUrlWorker(urlChan chan string) {
tmpResultList = append(tmpResultList,a...)
} else if tmpStatusCode=="401"{
i, err :=strconv.Atoi(initialStatusCode)
if (Excludecode!=0 && Excludecode!=i) || (Statuscode!=0 && Statuscode==i) {
if (Excludecode==0 || Excludecode!=i) && (Statuscode==0 || Statuscode==i) {
fmt.Printf("%s [code:%s]\n",newUrl, color.GreenString(tmpStatusCode))
log.Printf("%s [code:%s]\n",newUrl, color.GreenString(tmpStatusCode))
}
Expand All @@ -2173,7 +2173,7 @@ func getUrlWorker(urlChan chan string) {
tmpResultList = append(tmpResultList,a...)
} else {
i, err :=strconv.Atoi(initialStatusCode)
if (Excludecode!=0 && Excludecode!=i) || (Statuscode!=0 && Statuscode==i) {
if (Excludecode==0 || Excludecode!=i) && (Statuscode==0 || Statuscode==i) {
fmt.Printf("%s [code:%s] [%d] [%s] [%d of %d]\n",newUrl, color.RedString(tmpStatusCode), lenBody, tmpTitle, currentListCount,totalListCount)
log.Printf("%s [code:%s] [%d] [%s] [%d of %d]\n",newUrl, color.RedString(tmpStatusCode), lenBody, tmpTitle, currentListCount,totalListCount)
}
Expand All @@ -2186,7 +2186,7 @@ func getUrlWorker(urlChan chan string) {
tmpStatusCode := strconv.Itoa(resp.StatusCode)
if resp.StatusCode==Statuscode {
i, err :=strconv.Atoi(initialStatusCode)
if (Excludecode!=0 && Excludecode!=i) || (Statuscode!=0 && Statuscode==i) {
if (Excludecode==0 || Excludecode!=i) && (Statuscode==0 || Statuscode==i) {
fmt.Printf("%s [code:%s]\n",newUrl, color.BlueString(tmpStatusCode))
log.Printf("%s [code:%s]\n",newUrl, color.BlueString(tmpStatusCode))
}
Expand All @@ -2207,7 +2207,7 @@ func getUrlWorker(urlChan chan string) {
tmpStatusCode := strconv.Itoa(resp.StatusCode)
if resp.StatusCode==200 {
i, err :=strconv.Atoi(initialStatusCode)
if (Excludecode!=0 && Excludecode!=i) || (Statuscode!=0 && Statuscode==i) {
if (Excludecode==0 || Excludecode!=i) && (Statuscode==0 || Statuscode==i) {
fmt.Printf("%s [code:%s]\n",newUrl, color.BlueString(tmpStatusCode))
log.Printf("%s [code:%s]\n",newUrl, color.BlueString(tmpStatusCode))
}
Expand All @@ -2224,7 +2224,7 @@ func getUrlWorker(urlChan chan string) {
}
} else {
i, err :=strconv.Atoi(initialStatusCode)
if (Excludecode!=0 && Excludecode!=i) || (Statuscode!=0 && Statuscode==i) {
if (Excludecode==0 || Excludecode!=i) && (Statuscode==0 || Statuscode==i) {
fmt.Printf("%s [code:%s]\n",newUrl, color.RedString(tmpStatusCode))
log.Printf("%s [code:%s]\n",newUrl, color.RedString(tmpStatusCode))
}
Expand Down

0 comments on commit e177d4e

Please sign in to comment.