Skip to content

Commit

Permalink
Merge pull request #1115 from sundowndev/feat/googlecse-scanner
Browse files Browse the repository at this point in the history
Add googlecse scanner
  • Loading branch information
sundowndev authored Sep 4, 2022
2 parents 21eb5ac + 36a87c9 commit 2dd7657
Show file tree
Hide file tree
Showing 8 changed files with 1,048 additions and 9 deletions.
38 changes: 37 additions & 1 deletion docs/getting-started/scanners.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Numverify provide standard but useful information such as country code, location

Googlesearch uses the Google search engine and [Google Dorks](https://en.wikipedia.org/wiki/Google_hacking) to search phone number's footprints everywhere on the web. It allows you to search for scam reports, social media profiles, documents and more. **This scanner does only one thing:** generating several Google search links from a given phone number. You then have to manually open them in your browser to see results. So the tool may generate links that do not return any result. This is a design choice we made to avoid technical limitation around [Google scraping](https://en.wikipedia.org/wiki/Search_engine_scraping).

You can however, use this scanner through the REST API in addition with another tool to fetch the result automatically.
You can however, use this scanner through the REST API in addition with another tool to fetch the result automatically. If you wish to retrieve results automatically, see [Googlecse scanner](#googlecse) instead.

??? info "Configuration"

Expand Down Expand Up @@ -173,6 +173,42 @@ You can however, use this scanner through the REST API in addition with another
URL: https://www.google.com/search?q=%28ext%3Adoc+OR+ext%3Adocx+OR+ext%3Aodt+OR+ext%3Apdf+OR+ext%3Artf+OR+ext%3Asxw+OR+ext%3Apsw+OR+ext%3Appt+OR+ext%3Apptx+OR+ext%3Apps+OR+ext%3Acsv+OR+ext%3Atxt+OR+ext%3Axls%29+intext%3A%224176418xxxx%22+OR+intext%3A%22%2B4176418xxxx%22+OR+intext%3A%22076418xxxx%22
```

## Googlecse

Google custom search is a Google product allowing users to create Programmable Search Engines for programmatic usage.
This scanner takes an existing search engine you created to perform search queries on a given phone number.

Custom Search JSON API provides 100 search queries (~50 scans) per day for free. If you need more, you may sign up for billing in the API Console. **Additional requests cost $5 per 1000 queries (~500 scans), up to 10k queries per day (~5000 scans)**.

Follow the steps below to create a new search engine :

1. Go to [GCP console](https://console.cloud.google.com/apis/api/customsearch.googleapis.com/metrics) and enable the custom search API.
2. Go to the [credentials page](https://console.cloud.google.com/apis/credentials) and create a new API token. You can restrict this token to the Custom Search API.
3. [Follow this link](https://programmablesearchengine.google.com/controlpanel/all) and click on "Add" to create a new search engine.
4. Fill the form and make sure you select "Search the entire web".
5. Use the Search Engine ID and the API token to configure the scanner as per the configuration tab below.

??? info "Configuration"

| Environment variable | Default | Description |
|-----------------------|---------|------------------------------------------------------------------------|
| GOOGLECSE_CX | | Search engine ID. |
| GOOGLE_API_KEY | | API key to authenticate to the Google API. |
| GOOGLECSE_MAX_RESULTS | 10 | Maximum results for each request. Each 10 results requires an additional request. This value cannot go above 100. |

??? example "Output example"

```shell
$ phoneinfoga scan -n +1241325xxxx

Results for googlecse
Homepage: https://cse.google.com/cse?cx=<redacted>
Result count: 1
Items:
Title: Info about +1241325xxxx
URL: https://example.com/1241325xxxx
```

## OVH

OVH, besides being a web and cloud hosting company, is a telecom provider with several VoIP numbers in Europe. Thanks to their API-key free REST API, we are able to tell if a number is owned by OVH Telecom or not.
Expand Down
18 changes: 15 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ require (
github.com/stretchr/testify v1.7.1
github.com/sundowndev/dorkgen v1.2.0
github.com/swaggo/swag v1.7.0
google.golang.org/api v0.92.0
gopkg.in/h2non/gock.v1 v1.0.16
)

require (
cloud.google.com/go/compute v1.7.0 // indirect
github.com/KyleBanks/depth v1.2.1 // indirect
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
Expand All @@ -29,7 +31,11 @@ require (
github.com/go-playground/locales v0.13.0 // indirect
github.com/go-playground/universal-translator v0.17.0 // indirect
github.com/go-playground/validator/v10 v10.4.1 // indirect
github.com/golang/protobuf v1.3.4 // indirect
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.1.0 // indirect
github.com/googleapis/gax-go/v2 v2.4.0 // indirect
github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 // indirect
github.com/hashicorp/go-immutable-radix v1.1.0 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
Expand All @@ -45,11 +51,17 @@ require (
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/objx v0.1.1 // indirect
github.com/ugorji/go/codec v1.1.7 // indirect
go.opencensus.io v0.23.0 // indirect
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 // indirect
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b // indirect
golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e // indirect
golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2 // indirect
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/tools v0.0.0-20201120155355-20be4ac4bd6e // indirect
golang.org/x/tools v0.1.5 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f // indirect
google.golang.org/grpc v1.47.0 // indirect
google.golang.org/protobuf v1.28.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect
)
Loading

0 comments on commit 2dd7657

Please sign in to comment.