Skip to content

Instantly share code, notes, and snippets.

@krypted
Last active February 8, 2018 14:45
Show Gist options
  • Save krypted/e0a03d23a88ca0ff007b81a81744de29 to your computer and use it in GitHub Desktop.
Save krypted/e0a03d23a88ca0ff007b81a81744de29 to your computer and use it in GitHub Desktop.
#!/bin/bash
#Get our list of DNS servers
servers=`networksetup -getdnsservers Wi-Fi`
#Start with this set to False - we'll change it to true if needed
foundInfected=false
#For each item in $servers
for ser in $servers; do
#If the current IP matches this IP
if [ $ser == '82.163.143.135' ]; then
#We found an infection, so update the variable
foundInfected=true
fi
done
#Echo out the result
if [ $foundInfected == 'true' ]; then
echo "<result>infected</result>"
else
echo "<result>notinfected</result>"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment