Compare 2 Lists of IP Addresses

#!/bin/bash
# Written by: Leon Trappett
#
# This script will take 2 lists of IP addresses from text files and then list the IP addresses that are common amongst them
# For example from a firewall log and a list of known compromised hosts

countLoopA=0
countLoopB=0

while read unusualIP
do

        while read firewallIP
        do

                if [[ $unusualIP == $firewallIP ]]; then
                        echo "***" $firewallIP
                        break
                fi

                let countLoopA=countLoopA+1

        done < filename1.txt


        let countLoopB=countLoopB+1

#       echo $countLoopB " " $countLoopA


done < filename2.txt

Comments

Popular posts from this blog

Netflix Streaming Blocked by Sophos UTM

BSides 2016 Hackers Challenge

VBA - Script to Download a file from a URL

Python - Vega Conflict Script to Maximize Fleet Sizes based on Fleet Mass

IoT Malware Analysis - CnC Server - Part 3