Skip to content

Commit

Permalink
Fixed GeolocationMap API
Browse files Browse the repository at this point in the history
  • Loading branch information
joanbono committed Nov 28, 2023
1 parent 1736d15 commit 5ad3576
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions checks.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"net/url"
"os"
"regexp"
"strings"
"time"

"github.com/fatih/color"
Expand Down Expand Up @@ -412,9 +413,9 @@ func GeolocationAPI(api, proxy string, poc bool) {
}

resp := c.Send()
value := gjson.Get(resp.String(), "error.status")
value := gjson.Get(resp.String(), "error.message")

if (resp.Code() == 403 && value.String() == "PERMISSION_DENIED") || (resp.Code() == 400 && value.String() == "INVALID_ARGUMENT") {
if (resp.Code() == 403 && strings.Contains(value.String(), "PERMISSION_DENIED")) || (resp.Code() == 400 && value.String() == "INVALID_ARGUMENT") {
fmt.Printf("%v\n", green.Sprintf("✅ Not vulnerable to GeolocationAPI"))
} else {
fmt.Printf("%v\n", red.Sprintf("❌ Vulnerable to GeolocationAPI"))
Expand Down Expand Up @@ -518,7 +519,6 @@ func NearbySearchPlacesAPI(api, proxy string, poc bool) {

resp := c.Send()
value := gjson.Get(resp.String(), "status")
print(resp.Code(), "\n", value.String(), "\n")
if resp.Code() == 200 && (value.String() == "OK" || value.String() == "ZERO_RESULTS") {
fmt.Printf("%v\n", red.Sprintf("❌ Vulnerable to NearbySearchPlacesAPI"))
if poc {
Expand Down

0 comments on commit 5ad3576

Please sign in to comment.