2022-05-05 21:54:34 +02:00
#!/bin/bash
2022-02-24 00:24:13 +01:00
2022-04-24 18:09:36 +02:00
INPUT = " $1 "
ID = $2
unquote( ) {
echo $1 | sed 's/"//g'
}
URL = $( unquote $( echo $INPUT | jq .url) )
DOMAINS = ` node array-to-lines.js " $( echo $INPUT | jq .third_party_domains) " `
2022-02-13 22:30:56 +01:00
source ./ephemeral-x.sh
2022-04-20 23:23:48 +02:00
source ./annotate_header.sh
2022-04-21 22:20:44 +02:00
source ./utils.sh
2022-02-13 22:30:56 +01:00
2022-05-05 21:54:34 +02:00
# (while true; do
# grab_screen_to_public $ID
# sleep 1
# done) &
# refresher_pid=$!;
2022-04-24 19:57:01 +02:00
2022-04-21 22:20:44 +02:00
start_firefox
2022-04-24 18:09:36 +02:00
grab start_firefox
2022-04-21 22:20:44 +02:00
prepare_firefox
2022-04-24 18:09:36 +02:00
grab prepare_firefox
load_website " $URL "
grab load_website
2022-04-21 22:20:44 +02:00
open_network_inspector
2022-04-24 18:09:36 +02:00
grab open_network_inspector
2022-02-24 00:24:13 +01:00
2022-04-21 22:20:44 +02:00
declare -a pids;
pids = ( )
2022-02-24 00:24:13 +01:00
2022-02-14 22:10:01 +01:00
2022-04-24 18:09:36 +02:00
index = 0
mkdir -p " /opt/static/ $ID "
while IFS = read -r DOMAIN; do
if [ " $DOMAIN " = "" ] ; then
continue
fi
echo "============"
echo SCANNING DOMAIN $DOMAIN
network_inspector_search " domain: $DOMAIN " # can filter with more granularity: https://developer.mozilla.org/en-US/docs/Tools/Network_Monitor/request_list#filtering_by_properties
grab ni_search
scrot
count = 0
while network_inspector_has_more_entries
do
filename = " /opt/static/ $ID / ${ index } .png "
scrot " $filename "
2022-05-05 21:54:34 +02:00
annotate_header " $filename " " $DOMAIN " " $count " \
2022-04-24 18:09:36 +02:00
"set-cookie" "identyfikator internetowy z cookie" \
"Cookie" "identyfikator internetowy z cookie" \
"Referer" "Część mojej historii przeglądania" &
pids += ( $! )
network_inspector_next_entry
( ( index++) )
( ( count++) )
if [ $count -gt 10 ] ; then
break;
fi
done
done <<< " $DOMAINS "
2022-05-05 21:54:34 +02:00
# kill $refresher_pid;
2022-04-24 19:57:01 +02:00
2022-04-24 18:09:36 +02:00
echo "starting wait..."
2022-02-13 22:30:56 +01:00
2022-04-21 22:20:44 +02:00
for PID in " ${ pids [@] } "
2022-02-24 00:24:13 +01:00
do
2022-04-21 22:20:44 +02:00
wait $PID
2022-02-24 00:24:13 +01:00
done
2022-02-13 22:30:56 +01:00
kill -2 %%;
cleanup
2022-02-24 00:24:13 +01:00
2022-04-21 22:20:44 +02:00
echo "Done!"