Created
July 6, 2017 12:51
-
-
Save jackyshan/b587daac8ae90e445cb9f43914f49f7b to your computer and use it in GitHub Desktop.
检查ss客户端ip地址
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import re | |
file = open('shadowsocks.log') | |
list = file.readlines() | |
file.close() | |
pattern = re.compile(r'INFO.+(\d+\.){3}\d+') | |
clists = [] | |
for index in range(700000, len(list)): | |
info = list[index] | |
m = pattern.search(info) | |
if m: | |
m = m.group() | |
pp = re.compile(r'from (\d+\.){3}\d+') | |
m = pp.search(m) | |
if m: | |
m = m.group() | |
try: | |
clists.index(m) | |
except: | |
print info | |
clists.append(m) | |
#print clists |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment