---
title: "6. Custom Crawler with Scrapy"
date: 2024-07-17
draft: false
---


## Scrapy

We will leverage Scrapy and a custom spider tailored for reconnaissance on `inlanefreight.com`. If you are interested in more information on crawling/spidering techniques, refer to the "[Using Web Proxies](https://academy.hackthebox.com/module/details/110)" module, as it forms part of CBBH as well.

```shell-session
pip3 install scrapy
```
```shell-session
wget -O ReconSpider.zip https://academy.hackthebox.com/storage/modules/144/ReconSpider.v1.2.zip
```
```shell-session
unzip ReconSpider.zip 
```

```shell-session
python3 ReconSpider.py http://inlanefreight.com
```

```bash
┌──(root㉿kali)-[~/cpts/crawler]
└─# ls -al
total 28
drwxr-xr-x 2 root root 4096 Jul 18 00:13 .
drwxr-xr-x 8 root root 4096 Jul 18 00:12 ..
-rwxrwxrwx 1 root root 4763 Jul  3 06:39 ReconSpider.py
-rw-r--r-- 1 root root 1706 Jul  3 06:42 ReconSpider.zip
-rw-r--r-- 1 root root 4219 Jul 18 00:13 results.json

┌──(root㉿kali)-[~/cpts/crawler]
└─# head results.json
{
    "emails": [
        "jeremy-ceo@inlanefreight.com",
        "freya.kartboom@inlanefreight.com",
        "info@themeansar.com",
        "info@inlanefreight.com",
        "david.jones@inlanefreight.com",
        "enterprise@inlanefreight.com",
        "samuel.dot@inlanefreight.com",
        "emma.williams@inlanefreight.com",

[.....]
```

Each key in the JSON file represents a different type of data extracted from the target website:

|JSON Key|Description|
|---|---|
|`emails`|Lists email addresses found on the domain.|
|`links`|Lists URLs of links found within the domain.|
|`external_files`|Lists URLs of external files such as PDFs.|
|`js_files`|Lists URLs of JavaScript files used by the website.|
|`form_fields`|Lists form fields found on the domain (empty in this example).|
|`images`|Lists URLs of images found on the domain.|
|`videos`|Lists URLs of videos found on the domain (empty in this example).|
|`audio`|Lists URLs of audio files found on the domain (empty in this example).|
|`comments`|Lists HTML comments found in the source code.|

