Pages

Saturday, March 13, 2010

உபுண்டுவில் ஒரு இணைய தளத்தைப்பற்றி தெரிந்துகொள்ள

உபுண்டுவில் நாம் பார்க்கும் இணையதளத்தின் ip owner,county,domain name தெரிந்துகொள்ள ஒரு script.

டெர்மினலில் script.sh என்று ஒரு கோப்பினை உருவாக்கிக்கொள்ளவேண்டும்.

sudo gedit /usr/bin/script.sh என்று தட்டச்சு செய்து ஒரு காலியான கோப்பினை திறந்து அதில் கீழ்கண்ட வரிகளை காப்பி செய்து விடவும்.

#!/bin/bash
# A sample shell script to print domain ip address hosting information such as
# Location of server, city, ip address owner, country and network range.
# This is useful to track spammers or research purpose.
# -------------------------------------------------------------------------
# Last updated on Mar/05/2010
# -------------------------------------------------------------------------

# Get all domains
_dom=$@

# Die if no domains are given
[ $# -eq 0 ] && { echo "Usage: $0 domain1.com domain2.com ..."; exit 1; }
for d in $_dom
do
_ip=$(host $d | grep 'has add' | head -1 | awk '{ print $4}')
[ "$_ip" == "" ] && { echo "Error: $d is not valid domain or dns error."; continue; }
echo "Getting information for domain: $d [ $_ip ]..."
whois "$_ip" | egrep -w 'OrgName:|City:|Country:|OriginAS:|NetRange:'
echo ""
done

பின்னர் சேமித்து வேளியேறவேண்டும்.

டெர்மினலில்

sudo chmod +x /usr/bin/script.sh என்று தட்டச்சு செய்து script.sh ஐ இயங்ககூடியதாக மாற்றவேண்டும். இதை செயல்படுத்த டெர்மினலில்

/usr/bin/script.sh google.com என்று தட்டச்சு செய்தால் google.com ன் ஐபி முகவரி, நாடு மற்றும் டொமைன் பெயர் ஆகியவை திரையில் தெரியும்.

No comments: