# ipinfo **Repository Path**: wss434631143/ipinfo ## Basic Information - **Project Name**: ipinfo - **Description**: IP归属地信息分析 - **Primary Language**: Shell - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2017-01-06 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README IP归属地信息分析 一.工作原理: 脚本首先是从http://ip.taobao.com/ 的数据接口获取IP地址的JSON格式的数据信息,在使用一个python脚本来把Unicode字符转换成UTF-8编码 二.将两个脚本放在一个目录下,再将需要分析的IP地址一行一个写入在ip_list.txt文件中,执行shell脚本即可 三.实例演示: 1.分析最近暴力破解服务器密码的ip来源: cat /var/log/secure | awk '/Failed/ {print $(NF-3)}' | sort -u > ip_list.txt 2.从apache/nginx日志分析ip的来源: awk '{print $1}' /usr/local/nginx/logs/access.log | sort | uniq -c | sort -rn | head -n 50 | awk '{print $2}' > ip_list.txt