# Google Dorking

{% hint style="info" %}
🍎 Before you begin this tutorial, make sure you've completed the [Developer Quick Start Guide](https://docs.pixiebrix.com/quick-start/mod-developer).
{% endhint %}

## Overview <a href="#block-701e6aee85de40e8a3d9a6a939464a2f" id="block-701e6aee85de40e8a3d9a6a939464a2f"></a>

In this tutorial, we’ll create a Context Menu action on the AngelList company profile page that searches for PDF files within the company's URL. (For instance, you can search for ebooks or quarterly earnings documents from a company’s name.) To do this, we'll trigger a Google search that uses Google's [advanced search operators](https://support.google.com/websearch/answer/2466433?hl=en). In the Open Source Intelligence (OSINT) community, this is called Google Dorking.

Here are three examples of Google Dork searches:

* `inurl:resume "peter parker"` (finds sites with "resume" in the URL and "peter parker" in the text)
* `related:tesla.com` (finds sites related to tesla.com)
* `site:hubspot.com filetype:PDF` (find PDFs hosted on the HubSpot website)

{% hint style="info" %}
Not interested in building, but want to have a sidebar for Google Dorking? Activate out our [Google Search Sidebar](https://www.pixiebrix.com/marketplace/b3c87293-cfac-4aa2-9f7f-2926ab3e7826/google-search-sidebar/?utm_medium=website\&utm_source=docs\&utm_campaign=google-dorking-tutorial), which allows you to set custom searches with Google Dorking. If you need more tips about dorking, read about [How to Google Dork](https://www.pixiebrix.com/blog/how-to-google-dork/?utm_medium=website\&utm_source=docs\&utm_campaign=google-dorking-tutorial).
{% endhint %}

### 1. Add a Context Menu <a href="#block-b541bc7526b54110aec53b41137dd6c4" id="block-b541bc7526b54110aec53b41137dd6c4"></a>

#### Open the Page Editor <a href="#block-3f8819315480444eb324325bb30d12cf" id="block-3f8819315480444eb324325bb30d12cf"></a>

We'll use the HubSpot AngelList profile page in this tutorial to develop our workflow.

Navigate your browser to the [HubSpot](https://angel.co/company/hubspot) profile page, and open the PixieBrix [Page Editor](https://docs.pixiebrix.com/platform-overview/page-editor).

#### Grant Access <a href="#block-4a2bdb78b1b74bc3adf04ef091251c56" id="block-4a2bdb78b1b74bc3adf04ef091251c56"></a>

The first time you open the Page Editor on a new webpage, you need to grant PixieBrix access to the page. You can grant permanent access by either:

* Clicking **Grant Permanent Access**, or
* Granting temporary access by clicking on the PixieBrix extension in the Chrome Extensions dropdown and then refreshing the page

<figure><img src="https://images.spr.so/cdn-cgi/imagedelivery/j42No7y-dcokJuNgXeA0ig/63d08277-55dc-46de-a03d-261394506eab/Untitled/w=640,quality=80" alt="" width="375"><figcaption></figcaption></figure>

{% hint style="info" %}
If you had the Page Editor open before navigating to the AngelList page, you'll need to close the Page Editor by clicking the X in the top right corner and then re-open it to provide access.
{% endhint %}

#### Add a Context Menu <a href="#block-22809cb90d334fcb8b44751a80fce614" id="block-22809cb90d334fcb8b44751a80fce614"></a>

Click **New Mod** in the top left of the Page Editor and choose Context Menu.

<figure><img src="https://2274778196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq123bF1HPQPV35s5vHa1%2Fuploads%2FVOrTKMvo3dF2JoFDBirC%2FCleanShot%202024-10-16%20at%2009.31.38.png?alt=media&#x26;token=4a77e45e-3b6d-4c53-90dd-8fa6172c8c9b" alt=""><figcaption></figcaption></figure>

When you right-click on the page, you should see a PixieBrix context menu item

<figure><img src="https://images.spr.so/cdn-cgi/imagedelivery/j42No7y-dcokJuNgXeA0ig/39e52d7b-37d8-4925-b339-f105ef7b9a6f/Untitled/w=3840,quality=80" alt=""><figcaption></figcaption></figure>

#### Customize the Title <a href="#block-edd1451bc3dd4e37ba44f3ee11bcccb6" id="block-edd1451bc3dd4e37ba44f3ee11bcccb6"></a>

In the Configuration panel, change the Title from “Context menu item” to something more descriptive, such as “Google Dork”

<figure><img src="https://images.spr.so/cdn-cgi/imagedelivery/j42No7y-dcokJuNgXeA0ig/9e353b43-eac6-4a68-8f0b-230c0b6b839d/Untitled/w=3840,quality=80" alt="" width="375"><figcaption></figcaption></figure>

Now your context menu will look like this:

<figure><img src="https://images.spr.so/cdn-cgi/imagedelivery/j42No7y-dcokJuNgXeA0ig/e909fe6c-f0ca-44c3-b86f-b9c4bf6a66c7/Untitled/w=750,quality=80" alt="" width="375"><figcaption></figcaption></figure>

#### Configure the Sites <a href="#block-976b69ef0d724cfdb7f52d63ec7f006c" id="block-976b69ef0d724cfdb7f52d63ec7f006c"></a>

We only want this context menu to appear on AngelList company pages.

Therefore, we should change the **Sites** configuration from `https://angel.co/*` to `https://angel.co/company/*`

<figure><img src="https://images.spr.so/cdn-cgi/imagedelivery/j42No7y-dcokJuNgXeA0ig/e3ec4aa6-48b3-4c02-915a-35c1457b00ff/Untitled/w=3840,quality=80" alt=""><figcaption></figcaption></figure>

#### Configure the Target Mode <a href="#block-6373ccacf2494f698686b8eb7c64c32c" id="block-6373ccacf2494f698686b8eb7c64c32c"></a>

In the Advanced configuration, change the **Target Mode** to Document

<figure><img src="https://images.spr.so/cdn-cgi/imagedelivery/j42No7y-dcokJuNgXeA0ig/14f615d5-93c7-4ab2-b01d-8997bbf65764/Untitled/w=3840,quality=80" alt=""><figcaption></figcaption></figure>

### 2. Select Data <a href="#block-623948759faa47169e3e58ade08f96bf" id="block-623948759faa47169e3e58ade08f96bf"></a>

#### Select the Page Element <a href="#block-25fe94a87e504385af3a3ce449e3853a" id="block-25fe94a87e504385af3a3ce449e3853a"></a>

We'll need to add the [Extract from Page brick](https://www.pixiebrix.com/marketplace/30e54e24-79ea-43b1-b1f8-54814a1a0a11/). To add a new brick, click the + button in the Brick Actions

<figure><img src="https://images.spr.so/cdn-cgi/imagedelivery/j42No7y-dcokJuNgXeA0ig/ec3f572a-db5a-43e9-a5de-56df61dd7bc6/Untitled/w=828,quality=80" alt="" width="375"><figcaption></figcaption></figure>

Search "extract from page" and choose the brick.

<figure><img src="https://images.spr.so/cdn-cgi/imagedelivery/j42No7y-dcokJuNgXeA0ig/c44ac00c-9624-4c7e-b856-ef7e5b314fa6/Untitled/w=3840,quality=80" alt=""><figcaption></figcaption></figure>

Click the **pointer icon** below **Value** and hover your mouse over hubspot.com in the **ABOUT HUBSPOT** section until the shaded blue area looks like the image below. Then click to select this page element:

<figure><img src="https://images.spr.so/cdn-cgi/imagedelivery/j42No7y-dcokJuNgXeA0ig/ee3a5d5d-84f5-496c-a9e9-51ea58e0ba8b/Screen_Shot_2022-08-13_at_9.35.46_AM/w=640,quality=80" alt="" width="375"><figcaption></figcaption></figure>

#### Label the Property <a href="#block-45bb94b8c66f4e3ca6b9eddeacb84a75" id="block-45bb94b8c66f4e3ca6b9eddeacb84a75"></a>

Click the “Preview” tab on the right side of the Page Editor, and you’ll see the following Raw Data:

<figure><img src="https://images.spr.so/cdn-cgi/imagedelivery/j42No7y-dcokJuNgXeA0ig/1c2f3e84-bff0-4f19-9009-67889cdd425a/Untitled/w=1080,quality=80" alt="" width="375"><figcaption></figcaption></figure>

In the Selectors section of the Input configuration, change `property` to `companyUrl`

The Raw Data section will now look like this:

<figure><img src="https://images.spr.so/cdn-cgi/imagedelivery/j42No7y-dcokJuNgXeA0ig/73859201-b23c-452b-bef0-bd94a39c8569/Untitled/w=3840,quality=80" alt=""><figcaption></figcaption></figure>

Note that the selector value should be `#main dl div > ul`. If not, you can manually type this in or choose it from the dropdown.

In the Preview tab, click the page icon next to `companyUrl` to copy its property path, `@data.companyUrl`, to your clipboard.

<figure><img src="https://images.spr.so/cdn-cgi/imagedelivery/j42No7y-dcokJuNgXeA0ig/81ae1fab-3c9c-45f3-a2d0-2f4a2f44721c/Untitled/w=1080,quality=80" alt="" width="563"><figcaption></figcaption></figure>

### 3. Construct a Search <a href="#block-3ad5bb3969cc431ebca9b2f470539d3a" id="block-3ad5bb3969cc431ebca9b2f470539d3a"></a>

#### Create Your Search <a href="#block-aa3860dd019a4f35ba5cbd137c000225" id="block-aa3860dd019a4f35ba5cbd137c000225"></a>

We'll need to add the [Google Search in new tab brick](https://www.pixiebrix.com/marketplace/35a1a589-dcaa-46f2-98d5-66a57e135660/).

* Click the **+** button and search for this brick, and select it.

<figure><img src="https://images.spr.so/cdn-cgi/imagedelivery/j42No7y-dcokJuNgXeA0ig/81fce6d8-7236-45b7-88be-043b81a58e60/Untitled/w=3840,quality=80" alt=""><figcaption></figcaption></figure>

The Google Dork for searching PDFs on a website is:

1. site:\<domain>
2. filetype:PDF

We can express this Goole search as:

```javascript
site:{{@data.companyUrl}} filetype:PDF
```

<figure><img src="https://images.spr.so/cdn-cgi/imagedelivery/j42No7y-dcokJuNgXeA0ig/ff68f433-553a-4d71-8b9a-39a7e399166f/Untitled/w=3840,quality=80" alt=""><figcaption></figcaption></figure>

### 4. Test Your Search <a href="#block-eb7b7984257a42bca8657316a6bdf4fd" id="block-eb7b7984257a42bca8657316a6bdf4fd"></a>

Press the Google Dork context menu item to test your search. It should open Google in a new tab and execute the following search:

<figure><img src="https://images.spr.so/cdn-cgi/imagedelivery/j42No7y-dcokJuNgXeA0ig/f49d576d-666a-47ae-ac65-b1551bd942e6/Screen_Shot_2022-08-13_at_11.10.18_AM/w=3840,quality=80" alt=""><figcaption></figcaption></figure>

Try it from different AngelList company pages to see how the search dynamically changes. Once you're happy with the button, click **Save** to use this search in the future.

<figure><img src="https://images.spr.so/cdn-cgi/imagedelivery/j42No7y-dcokJuNgXeA0ig/ed7807ba-966d-4442-9b12-59a5507b700c/Untitled/w=3840,quality=80" alt=""><figcaption></figcaption></figure>

Clicking the **Save** icon will bring up a modal for [packaging-a-mod](https://docs.pixiebrix.com/developing-mods/sharing-mods/packaging-a-mod "mention"). Set an alias (like a username) if you haven't already and give the mod a unique ID and description, then click **Create**.

### Continued Learning <a href="#block-975eaffaa781465e915c93db1c24f406" id="block-975eaffaa781465e915c93db1c24f406"></a>

You can modify this search by changing the Google Dork expression. Check out these sites for inspiration:

* [OSINT Curious Blog](https://osintcurio.us/2019/12/20/google-dorks/)
* [Google Search Operators: The Complete List](https://ahrefs.com/blog/google-advanced-search-operators/)
* [Google Hacking Database](https://www.exploit-db.com/google-hacking-database)
* [How to Google Dork](https://www.pixiebrix.com/blog/how-to-google-dork/?utm_medium=website\&utm_source=docs\&utm_campaign=google-dorking-tutorial)

{% hint style="info" %}
🙋Need some help with building? [Head over to the Slack Community](https://slack.pixiebrix.com/), and we’ll gladly help you!
{% endhint %}
