https://github.com/cispa/webrec
This repository provides the code is used in the Usenix paper "Web Execution Bundles: Reproducible, Accurate, and Archivable Web Measurements".
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.5%) to scientific vocabulary
Repository
This repository provides the code is used in the Usenix paper "Web Execution Bundles: Reproducible, Accurate, and Archivable Web Measurements".
Basic Info
Statistics
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
- Releases: 1
Metadata Files
README.md
WebREC
This project provides a framework for crawling websites using Brave's pagegraph crawl. A combination of warcprox and mitmproxy collects web archives (WARC), HTTP Archives (HAR), and JavaScript execution traces. The collected data can then be replayed to analyze the recorded interactions.
This code is used in the paper "Web Execution Bundles: Reproducible, Accurate, and Archivable Web Measurements".
All relevant detailed steps to run the pipeline are also described in the AE PDF.
Requirements
- Python 3.x
- Brave Nightly executable path defined in
config.py. warcproxandmitmdumpinstalled in your environment.npmandgitinstalled to manage the pagegraph crawl repository.pip install -r requirements.txt
Make sure you have all the required dependencies installed before running the project.
Pagegraph-crawl Patches
For our research, we added two additions to the pagegraph-crawl version we were working with (commit 0758ba99697afd7d3e30f92688430fe5c4faa69d).
1. Bypass CSP.
In order to hook into the JS calls, we had to bypass CSP. Puppeteer provides a method to do so (see here). We added this in our crawler via await page.setBypassCSP(true) before the first goto call.
2. Xvfb retries.
Since we run the crawler in parallel, we had issues with xvfb sessions that took longer to close. Therefore, we added a wait and retry function to pagegraph crawler when starting or stopping xvfb.
Both additions, plus test code that was not relevant for the final analysis, can be found in the pagegraph patches.
Even without the patchs, we expect the newest version of pagegraph-crawl to work with our framework for test runs.
The newer version only uses --logging verbose instead of --debug debug which is set in the pageggraph-crawl call.
Installation
Clone the repository
git clone git@github.com:FHantke/hwpg.git cd hwpg/srcInstall Python dependencies
pip install -r requirements.txt
Example config.py
TELEGRAM_API_KEY = 'secret'
TELEGRAM_CHAT_ID = 1
JS_HOOKING = True
SCRIPT_PATH = "./js_injections/js_hooks.js"
INITIALIZATION_BREAK = 60
BRAVE_EXEC_PATH = "/opt/brave.com/brave-nightly/brave-browser-nightly"
Usage
``` usage: main.py [-h] [--output OUTPUT] [--workers WORKERS] [--origins [ORIGINS ...]] [--replay-warc-path REPLAYWARCPATH] [--replay-har-path REPLAYHARPATH] [--clean]
Process some integers.
options: -h, --help show this help message and exit --output OUTPUT output path to store archives --workers WORKERS number of workers --origins [ORIGINS ...] origins that the crawler should visit --replay-warc-path REPLAYWARCPATH path to the crawl that you want to replay --replay-har-path REPLAYHARPATH path to the crawl that you want to replay --clean Clean zombie processes ```
Running a Crawl
To start a crawl, run the following command:
python main.py --output ./output --workers 4 --origins https://example.com
Replaying a WARC or HAR Archive
To replay a previously collected WARC or HAR archive, specify the path
to the earlier collected output. replay-warc-path replays WARC files,
replay-har-path replays har files.
python main.py --replay-warc-path ./output/2024-09-25_113507
Output Example
output
└── 2024-09-25_113507
└── https_example.com
├── example.com.har
├── example.com.warc
├── logs
│ ├── mitmd_15001.log
│ ├── warcp_16001.log
│ └── pagegraph.log
├── mitmd_replay
│ ├── log-p1.txt
│ ├── logs
│ │ ├── mitmd_15001.log
│ │ └── pagegraph.log
│ └── page_graph_https___fhantke_de_1727271635.graphml
├── warc_replay
│ ├── log-p1.txt
│ ├── logs
│ │ ├── mitmd_15001.log
│ │ ├── warcp_16001.log
│ │ └── pagegraph.log
│ ├── collections/...
│ └── page_graph_https___fhantke_de_1727269058.graphml
└── page_graph_https___fhantke_de_1727264133.graphml
Owner
- Name: CISPA
- Login: cispa
- Kind: organization
- Email: front-office@cispa.de
- Location: Saarbrücken, Saarland, Germany
- Website: https://cispa.de
- Twitter: CISPA
- Repositories: 7
- Profile: https://github.com/cispa
GitHub Events
Total
- Release event: 1
- Watch event: 2
- Member event: 2
- Push event: 1
- Create event: 3
Last Year
- Release event: 1
- Watch event: 2
- Member event: 2
- Push event: 1
- Create event: 3
Dependencies
- mypy ==1.9.0
- mypy-extensions ==1.0.0
- networkx ==3.2.1
- packaging ==24.0
- pycodestyle ==2.11.1
- typing_extensions ==4.11.0
- google-cloud-bigquery *
- mitmproxy ==10.2.3
- setuptools *
- tqdm ==4.67.1
- adblockparser ==0.7
- cached-property ==2.0.1
- certifi ==2024.12.14
- charset-normalizer ==3.4.1
- filelock ==3.16.1
- haralyzer ==2.4.0
- idna ==3.10
- ipywidgets ==8.1.5
- matplotlib ==3.10.1
- networkx ==3.4.2
- numpy ==2.2.1
- packaging ==24.2
- pandas ==2.2.3
- python-dateutil ==2.9.0.post0
- pytz ==2024.2
- requests ==2.32.3
- requests-file ==2.1.0
- six ==1.17.0
- tldextract ==5.1.3
- tqdm ==4.67.1
- tzdata ==2024.2
- urllib3 ==2.3.0
- warcio ==1.7.5
- Brotli ==1.1.0
- Flask ==1.1.4
- Jinja2 ==2.11.3
- MarkupSafe ==2.0.1
- Py3AMF ==0.8.12
- PyYAML ==6.0.1
- Werkzeug ==1.0.1
- aioquic ==0.9.25
- asgiref ==3.7.2
- attrs ==23.2.0
- brotlipy ==0.7.0
- cachetools ==5.3.3
- certauth ==1.3.0
- certifi ==2024.2.2
- cffi ==1.16.0
- charset-normalizer ==3.3.2
- click ==7.1.2
- cryptography ==42.0.5
- defusedxml ==0.7.1
- fakeredis ==0.16.0
- filelock ==3.13.1
- gevent ==21.12.0
- google-api-core ==2.17.1
- google-auth ==2.28.2
- google-cloud-bigquery ==3.19.0
- google-cloud-core ==2.4.1
- google-crc32c ==1.5.0
- google-resumable-media ==2.7.0
- googleapis-common-protos ==1.63.0
- greenlet ==1.1.3.post0
- grpcio ==1.62.1
- grpcio-status ==1.62.1
- h11 ==0.14.0
- h2 ==4.1.0
- hpack ==4.0.0
- hyperframe ==6.0.1
- idna ==3.6
- itsdangerous ==1.1.0
- kaitaistruct ==0.10
- ldap3 ==2.9.1
- mitmproxy ==10.2.4
- mitmproxy_rs ==0.5.1
- msgpack ==1.0.8
- packaging ==24.0
- passlib ==1.7.4
- portalocker ==2.8.2
- protobuf ==4.25.3
- publicsuffix2 ==2.20191221
- pyOpenSSL ==24.0.0
- pyasn1 ==0.5.1
- pyasn1-modules ==0.3.0
- pycparser ==2.21
- pylsqpack ==0.3.18
- pyparsing ==3.1.2
- pyperclip ==1.8.2
- python-dateutil ==2.9.0.post0
- pywb ==2.7.4
- redis ==2.10.6
- requests ==2.31.0
- requests-file ==2.0.0
- rsa ==4.9
- ruamel.yaml ==0.18.6
- ruamel.yaml.clib ==0.2.8
- service-identity ==24.1.0
- six ==1.16.0
- sortedcontainers ==2.4.0
- surt ==0.3.1
- tldextract ==5.1.1
- tornado ==6.4
- tqdm ==4.66.2
- typing_extensions ==4.10.0
- ua-parser ==0.18.0
- urllib3 ==2.2.1
- urwid-mitmproxy ==2.1.2.1
- warcio ==1.7.4
- webassets ==2.0
- webencodings ==0.5.1
- wsgiprox ==1.5.2
- wsproto ==1.2.0
- zope.event ==5.0
- zope.interface ==6.2
- zstandard ==0.22.0