Skip to content

Commit 5711456

Browse files
bkrumnowvringar
authored andcommitted
Add OpenWPM_hide instructions
1 parent bfea93d commit 5711456

File tree

1 file changed

+115
-1
lines changed

1 file changed

+115
-1
lines changed

README.md

Lines changed: 115 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,117 @@
1+
OpenWPM<sub>hide</sub>
2+
======================
3+
Full details are described in our paper, which can be found
4+
on our [website](https://bkrumnow.github.io/openwpm-reliability/).
5+
6+
Deployment
7+
----------
8+
1. Follow the instructions from the original description
9+
to install OpenWPM ([see below](#installation)).
10+
2. Adjuste the [settings.js](https://github.com/bkrumnow/OpenWPM/blob/stealth_extension/Extension/firefox/stealth.js/settings.js)
11+
to determine which properties shall be instrumented.
12+
3. Recompile the extension if you do any changes to make them effective
13+
4. Add the new features to your OpenWPM clients, as described in the next section
14+
5. Run your OpenWPM client as
15+
16+
To recompile the extension run the following commands:
17+
18+
```sh
19+
cd Extension/firefox && npm install && run build && cp dist/*.zip ./openwpm.xpi && cd ../..
20+
```
21+
22+
Main features
23+
------------
24+
1. Adjusting the window position
25+
2. Adjusting screen resolution
26+
3. Hardened JavaScript instrument
27+
4. Overwriting the _webdriver_ attribute
28+
29+
30+
### Window position & screen resolution
31+
OpenWPM<sub>hide</sub> introduces two new parameters to the BrowserParams object.
32+
Using both parameters works as follows:
33+
34+
```javascript
35+
NUM_BROWSERS = 2
36+
browser_params = [BrowserParams(display_mode="native") for _ in range(NUM_BROWSERS)]
37+
for browser_param in browser_params:
38+
browser_param.resolution = (1520, 630)
39+
browser_param.position = (50, 100)
40+
```
41+
42+
### Hardened JavaScript instrument
43+
Set _stealth_js_instrument_ to _True_ to activate the hardened version (similar as above):
44+
45+
```javascript
46+
NUM_BROWSERS = 2
47+
browser_params = [BrowserParams(display_mode="native") for _ in range(NUM_BROWSERS)]
48+
for browser_param in browser_params:
49+
browser_param.stealth_js_instrument = True
50+
```
51+
52+
Use the [settings.js](https://github.com/bkrumnow/OpenWPM/blob/stealth_extension/Extension/firefox/stealth.js/settings.js) file to
53+
define which properties will be recorded. While there is a number of properties already listed in the sample settings.js, you may
54+
want to add others. Adding new properties requires to determine a property's position in the property chain. The position can be
55+
retrieved in a Firefox browser via JavaScript reflect.
56+
57+
In your browser, add this function via the console:
58+
59+
```javascript
60+
Object.getPropertyNamesPerDepth = function (subject, maxDepth=10) {
61+
if (subject === undefined) {
62+
throw new Error("Can't get property names for undefined");
63+
}
64+
let res = [];
65+
let depth = 0;
66+
let properties = Object.getOwnPropertyNames(subject);
67+
res.push({"depth": depth, "propertyNames":properties, "object":subject});
68+
let proto = Object.getPrototypeOf(subject);
69+
70+
while (proto !== null, depth < maxDepth) {
71+
depth++;
72+
properties = Object.getOwnPropertyNames(proto);
73+
res.push({"depth": depth, "propertyNames":properties, "object":proto});
74+
proto = Object.getPrototypeOf(proto);
75+
if (proto==null){
76+
return res;
77+
}
78+
}
79+
return res;
80+
}
81+
```
82+
Then check for property levels (this example checks the navigator object):
83+
```javascript
84+
Object.getPropertyNamesPerDepth(Object.getPrototypeOf(navigator))
85+
````
86+
87+
### Overwriting webdriver attribute
88+
Overwriting is done by default when activating stealth_js_instrument. However, you may not want to use the JS recording, but
89+
overwrite the property anyway. In this case, remove all entries settings.js, except the [default entry](https://github.com/bkrumnow/OpenWPM/blob/stealth_extension/Extension/firefox/stealth.js/settings.js#L172-L184) for the Navigator object.
90+
91+
92+
Cite
93+
-----
94+
You can refer to our work as follows:
95+
96+
How gullible are web measurement tools? A case study analysing and strengthening OpenWPM’s reliability. Benjamin Krumnow, Hugo Jonker, and Stefan Karsch. In Proc. 18th International Conference on emerging Networking EXperiments and Technologies (CoNEXT’22). ACM, 16 pages, doi: 10.1145/3555050.3569131, 2022.
97+
98+
or
99+
100+
```bibtex
101+
@inproceedings{KJK22,
102+
author = {Krumnow, Benjamin and Jonker, Hugo and
103+
Karsch, Stefan},
104+
title = {How gullible are web measurement tools? {A} case study
105+
analysing and strengthening {OpenWPM}’s reliability},
106+
booktitle = {Proc.\ 18th International Conference on emerging Networking
107+
EXperiments and Technologies {(CoNEXT ’22)}},
108+
publisher = { {ACM} },
109+
year = {2022},
110+
address = {New York, NY, USA},
111+
pages = {16},
112+
doi = {10.1145/3555050.3569131}
113+
}
114+
```
1115

2116
# OpenWPM [![Documentation Status](https://readthedocs.org/projects/openwpm/badge/?version=latest)](https://openwpm.readthedocs.io/en/latest/?badge=latest) [![Build Status](https://github.com/openwpm/OpenWPM/workflows/Tests%20and%20linting/badge.svg?branch=master)](https://github.com/openwpm/OpenWPM/actions?query=branch%3Amaster) [![OpenWPM Matrix Channel](https://img.shields.io/matrix/OpenWPM:mozilla.org?label=Join%20us%20on%20matrix&server_fqdn=mozilla.modular.im)](https://matrix.to/#/#OpenWPM:mozilla.org?via=mozilla.org) <!-- omit in toc -->
3117

@@ -199,7 +313,7 @@ For each of the data classes we offer a variety of storage providers, and you ar
199313
to implement your own, should the provided backends not be enough for you.
200314

201315
We have an outstanding issue to enable saving content generated by commands, such as
202-
screenshots and page dumps to unstructured storage (see [#232](https://github.com/openwpm/OpenWPM/issues/232)).
316+
screenshots and page dumps to unstructured storage (see [#232](https://github.com/openwpm/OpenWPM/issues/232)).
203317
For now, they get saved to `manager_params.data_directory`.
204318

205319
### Local Storage

0 commit comments

Comments
 (0)