Blocking Tracking JavaScript at the Function Granularity Abdul Haddi Amjad, Shaoor Munir, Zubair Shafiq, Muhammad Ali Gulzar ACM Conference on Computer and Communications Security (CCS), 2024
This is a public repository and zenodo (https://zenodo.org/records/12775210), accessible to everyone.
We have generated a Dockerfile to run end-to-end Node.js and follow the methodology mentioned in the paper. You need to input the website to be crawled, and you will receive output in the form of surrogate scripts for the website with tracking functions neutralized.

We reproduce the results illustrated in the figures and tables from the paper as follows:
- Table 3
- Table 4
- Table 5
- Figure 7
- Figure 8
These artifacts are rigrously tested on Macbook with following configuration:
- Intel core i7 processor
- 4-core CPU
- 16 GB Ram
- 500 GB SSD
Note that the Docker base image in the dockerfile supports
amd64i.e, x86-64 machines.
git clone https://github.com/hadiamjad/Not.js.git and move in the directory using cd Not.js command
Note that the Docker base image in the dockerfile supports
amd64i.e, x86-64 machines.
-
This command
docker build -t notjs .will build docker image using Dockerfile. Expected time: 50 seconds
-
Try running
lscommand in the docker terminal and it will list all the files inside this repository.
In this tutorial we will be using tmux sessions to create server and client sessions for testing. Some important commands:
- To create new session
tmux new -s {session-name} - To leave existing session
Cntrl + bfollowed byd - To join existing session
tmux a -t {session-name}
Make sure your docker build was successful.
-
Create new tmux session for running the server
tmux new -s serverThis will automatically join the session as well. -
Run the following command
bash server.shThis will install the necessary pakages and start the server.
-
Leave the
serversession usingCntrl + bfollowed byd.
-
Create new tmux session for running the client
tmux new -s clientThis will automatically join the session as well. -
Run the following command:
bash client.shThis will perform the following actions:- Crawl the website listed in
test.csv. Currently, it has two websites:canvas.comandbidtheatre.com. - Install the
not.jsmodel. - Generate a
page graphfor the website. - Extract
featuresfrom the graphs. - Generate
surrogatesfor the websites. - Map the surrogates into a
folder structure compatible with Google Chrome.
Expected time: Approximately 7 minutes. This time may increase depending on the number of websites and their activity, which directly impacts the time required for graph generation.
Note: Some websites might crash beacuse they prevent the attachment of hooks to their APIs.
- Crawl the website listed in
- Now, within the same tmux session named client, run
tree server/surrogatesto print the surrogates into a folder structure compatible with Google Chrome.
Make sure your docker build was successful.
-
Run
bash reproducible.shto generate the tables and figures. It will do the following:The last two rows are the accuracies of other tools.
In this table last-row is the standard one already computed above.

You can run to see plots are generated
tree plots
You can run the following command in LOCAL REPOSITORY SHELL to copy the plots folder to local machine:
docker cp {container_id}:/Crawler/plots .The container id is located on the docker shell:
root@{container-id}:/Crawler/plots#
- contact: [email protected]









