CookieViz on Mac OS X in more than 128 words

CookieViz is a visualization tool that measures the impact of cookies on your own browsing.

https://linc.cnil.fr/fr/cookieviz-une-dataviz-en-temps-reel-du-tracking-de-votre-navigation

The page is git is https://github.com/LINCnil/CookieViz

I install MAMP: https://www.mamp.info/en/downloads/

MAMP is a compilation of free open source software to manage dynamic websites on computers running macOS or Windows: Apache, the web server; MySQL, the database management system; phP, Perl or Python, programming languages used for web development.

Install Homebrew: Homebrew is a free open source software management system that simplifies the installation of software on Apple's macOS and Linux operating system.

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

The script asks to switch to superuser mode via the sudo command and asks to type the password several times.

At the end of the installation you get a successful installation!

I install mitmdump which is in the mitmproxy package

brew install mitmproxy

Validate the installation by tapping mitmdump –version

mitmdump --version
 Mitmproxy: 4.0.4
 Python: 3.7.5
 OpenSSL: OpenSSL 1.1.1d 10 Sep 2019
 Platform: Darwin-17.7.0-x86_64-i386-64bit

I start MAMP and not MAMP PRO which is paid

I get the home page of my Apache web server that is booted on port 8888 by default I can reach by typing localhost:8888 as url in my browser.

If I go into the MAMP -Preferences menu I can change the ports used.

I downloaded from the github source of cookieViz https://github.com/LINCnil/CookieViz via the Clone and download link. It is also possible to start a terminal and place yourself at the root of the WEB Apache server.

By default the root is in /Applications/MAMP/htdocs/ but you can change it via the MAMP graphical interface

cd /Applications/MAMP/htdocs/
git clone https://github.com/LINCnil/CookieViz.git

By default the default user of the database is "root" and password "root" To change t
he password by default: https://docume
ntation.mamp.info/en/MAMP-Mac/How-Tos/Change-the-password-of-the-MySQL-root-user/ /App
lications/MAMP/Library/bin/mysqladmin -u root -p password

Adding a user phpmyadmin – mysql – user 'add a user' tab User Accounts

I added a user 'cookvi' with password 'cookvi'

I edited the settings.inc file via a text editor or nano control

/**
 The database server used by CookieViz.
 Default is 'localhost' and should be fine for most cases.
 If 'localhost' doesn't work and the database runs locally, try '127.0.0.1'.
 */
define ('DB_SERVER', '127.0.0.1:8889');

...

define ('DB_USER', 'cookvi');

/**
 The password of the CookieViz database user.
 */
define ('DB_PASSWD', 'cookvi');

I then edited the nano monitor_mitmdump.php file of the directory /soft

cd /Applications/MAMP/htdocs/CookieViz/soft/
nano monitor_mitmdump.php 

I went to http://localhost:8888/phpmyadmin/ and I created a new CookieViz base

I clicked on the created database and i used the "import" function and loaded the file /Applications/MAMP/htdocs/CookieViz/cookieviz/sql/url_referer-1.sql which contains the table structure

Edit the four values below
$PROXY-HOST – "localhost"; Proxy server addre
ss $PROXY-PORT – "8082"; Proxy server p
ort $PROXY-USER -""; Userna
me $PROXY-PASS -""; Password

CookieViz is php5 compatible and not phpt7 you should expect changes in the code:

Replacing:

$link - mysql_connect ('localhost', '', '') by $link - mysqli_connect ('127.0.0.1:8889', 'cookvi', 'cookvi','CookieViz') 
mysql_select_db ('CookieViz') by mysqli_select_db ($link, 'CookieViz')
mysql_error() by mysqli_connect_error()
mysql_query ($query) by mysqli_query ($link, $query)
mysql_fetch_assoc ($result) by mysqli_fetch_assoc ($result) 
mysql_close ($link) by mysqli_close ($link)  

Start a server mitmdump on port 8082: mit
mdump -p 8082 -w mitmdump.log

I am now launching the php script /Applications/MAMP/htdocs/CookieViz/soft/monitor_mitmdump.php

At the firefox level I went into network preference sets in the general settings and I configured the proxy

We find that we have connections that pass through the proxy Prox
y server listening at http://:8081 127.0.0.1:
49915: clientconnect 127.0.0.1:4991
5: CONNECT www.youtube.com:443< cannot="" establis
h="" tls="" with="" client="" (sni:="" www.youtube.com):="" tlsexception("ssl="" handshake="" error:="" error()")="[(‘SSL routines’, ‘ssl3_read_bytes’, ‘sslv3 alert bad certificate’)]" 1
27.0.0.1:49917:="" clientconnect=""
127.0.0.1:49915:="" clientdisconnect=
"" 127.0.0.1:49917:="" get="" http://detectportal.firefox.com/success.tx
t="">< 200="" ok="" 8b="" 127.0
.0.1:49919:="" clientconnect="" 12
7.0.0.1:49920:="" clientconnect=""
127.0.0.1:49919:="" get="" http://detectportal.firefox.com/success.txt?ipv4=""
>< 200="" ok="" 8b="" 127.0.0.
1:49920:="" get="" http://detectportal.firefox.com/success.txt?ipv6="">< 200 O
K 8b 200="" ok=""></ 200 OK 8b>

The results can then be viewed on the web server http://localhost:8888/CookieViz/cookieviz/