Commit changes in script3
This commit is contained in:
		
							parent
							
								
									78db6b79cf
								
							
						
					
					
						commit
						785f699243
					
				
							
								
								
									
										47
									
								
								script3.sh
									
									
									
									
									
								
							
							
						
						
									
										47
									
								
								script3.sh
									
									
									
									
									
								
							| @ -1,23 +1,55 @@ | |||||||
| #!/bin/bash | #!/bin/bash | ||||||
| 
 | 
 | ||||||
|  | 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)"` | ||||||
|  | 
 | ||||||
|  | echo "$DOMAINS" | ||||||
|  | 
 | ||||||
| source ./ephemeral-x.sh | source ./ephemeral-x.sh | ||||||
| source ./annotate_header.sh | source ./annotate_header.sh | ||||||
| source ./utils.sh | source ./utils.sh | ||||||
| 
 | 
 | ||||||
| start_firefox | start_firefox | ||||||
|  | grab start_firefox | ||||||
| prepare_firefox | prepare_firefox | ||||||
| load_website "biedronka.pl" | grab prepare_firefox | ||||||
|  | load_website "$URL" | ||||||
|  | grab load_website | ||||||
| open_network_inspector | open_network_inspector | ||||||
| network_inspector_search "method:GET domain:adocean.pl" # can filter with more granularity: https://developer.mozilla.org/en-US/docs/Tools/Network_Monitor/request_list#filtering_by_properties | grab open_network_inspector | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
| index=0 |  | ||||||
| 
 | 
 | ||||||
| declare -a pids; | declare -a pids; | ||||||
| pids=() | pids=() | ||||||
| 
 | 
 | ||||||
|  | echo DOMAINS: "$DOMAINS" | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 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 |     while network_inspector_has_more_entries | ||||||
|     do |     do | ||||||
|   filename="${index}.png" |       filename="/opt/static/$ID/${index}.png" | ||||||
|       scrot "$filename" |       scrot "$filename" | ||||||
|       annotate_header "$filename" \ |       annotate_header "$filename" \ | ||||||
|         "set-cookie" "identyfikator internetowy z cookie" \ |         "set-cookie" "identyfikator internetowy z cookie" \ | ||||||
| @ -26,12 +58,15 @@ do | |||||||
|       pids+=($!) |       pids+=($!) | ||||||
|       network_inspector_next_entry |       network_inspector_next_entry | ||||||
|       ((index++)) |       ((index++)) | ||||||
|  |       ((count++)) | ||||||
|  |       if [ $count -gt 10 ]; then | ||||||
|  |         break; | ||||||
|  |       fi | ||||||
|     done |     done | ||||||
|  | done <<< "$DOMAINS" | ||||||
| 
 | 
 | ||||||
| echo "starting wait..." | echo "starting wait..." | ||||||
| 
 | 
 | ||||||
| jobs -l |  | ||||||
| 
 |  | ||||||
| for PID in "${pids[@]}" | for PID in "${pids[@]}" | ||||||
| do | do | ||||||
|      wait $PID |      wait $PID | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user