Nali tool parses the ip source
I. background
In daily operation and maintenance, we often need to parse the ip source of each service access, or find and locate the ip access source. Today, we introduce an open source query tool, nali, which can be queried using a pure ip database.
II. Installation
1. Download and compile the installation
Wget https://qqwry.googlecode.com/files/nali-0.2.tar.gz # cannot be accessed or fails, please move to https://pan.baidu.com/s/1eS276kq tar xvf nali-0.2.tar.gzcd nali-0.2makemake install
2. Update the ip database
Cd / usr/local/share/
Update QQWry.Dat pure ip database
Method 1:
Download https://pan.baidu.com/s/1eS276kq this package includes an ip database by default, but it may be a little old
Decompress it and put it here.
Method 2:
Download from the official website http://www.cz88.net of innocence.
Install the software to update the database after windows step down and upload it to / user/local/share to complete the update.
Third, use nali tools to complete ip parsing.
1. Script parsing
The script reads as follows:
Cat nali.sh
#! / bin/bashcat ip.txt | while read linedo echo $line `nali $line | awk-F "['{print $2}'| awk-F']''{print $1}'| awk-F'{print $1} '`done
Description: put the ip to be parsed into ip.txt and save it one by one, and then run nali.sh
2. Test and use