From 0346ca77b8a0640979d425e2fc125718e083d75f Mon Sep 17 00:00:00 2001 From: yajusenpai <73378532+shinoyasan@users.noreply.github.com> Date: Sat, 21 Nov 2020 20:52:59 +0800 Subject: [PATCH] Update privacy problems --- webFinder.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/webFinder.py b/webFinder.py index 17a7ed7..42046d4 100644 --- a/webFinder.py +++ b/webFinder.py @@ -21,7 +21,8 @@ def __init__(self,addr): requestList=[] threadNumber_statistic=0 logStringRedirect="" -visitIpaddr=[] #"xxx.xxx.xx.xx" +visitIpaddr=[] #In fact I never intend to record Ip addr and just do it for PV statistics +visitTime=[] rteGroup=[] def LogPrint(astr,serious=0): @@ -44,8 +45,11 @@ def getHtmlLog(): formatStr=formatStr+"

Total Page Visit:"+str(visitIpaddr.__len__())+"

" formatStr=formatStr+"

Online Threads(non statistic):"+str(len(threading.enumerate()))+"

" formatStr=formatStr+"
" + index=0 for i in visitIpaddr: - formatStr=formatStr+"

"+i+"    "+IPGET(i)+"

" + formatStr=formatStr+"

"+i+"    "+IPGET(i) + +"    "+visitTime[index]+"

" + index=index+1 formatStr=formatStr+"
" for i in rteGroup: formatStr=formatStr+"

"+i+"

" @@ -74,6 +78,7 @@ def run(self): self.thread_num = len(threading.enumerate()) if self.client_addr[0] not in visitIpaddr: visitIpaddr.append(self.client_addr[0]) + visitTime.append(time.asctime( time.localtime(time.time()))) LogPrint("线程({},{},开启线程统计{})==用户[{},{}]连接,请求{} {}".format(self.name,self.thread_num,threadNumber_statistic,self.client_addr[0],self.client_addr[1],requestHead,\ time.strftime("%m-%d %H:%M:%S", time.localtime()))) #/getRoute?from=ZGHA&to=ZJSY&valid=1111 command=requestHead.split('?')[0] @@ -112,9 +117,15 @@ def run(self): requestList.append(requestInstance) elif command.__contains__("/getCycle"): self.client_socket.send(bytes("HTTP/1.1 200 OK\r\nContent-Type:text/html\r\n\r\n"+config.NAVDAT_CYCLE,"gbk")) - elif command.__contains__("/getlog_aiueosashisuseso"): + elif command.__contains__("/getlog_"+config.BackstageKey): self.client_socket.send(bytes("HTTP/1.1 200 OK\r\nContent-Type:text/html\r\n\r\n"+getHtmlLog(),"utf-8")) - + + elif command.__contains__("/alldatafile.zip"): + zipfile=open("alldatafile.zip","rb") + bytdata=zipfile.read() + zipfile.close() + self.client_socket.send(bytes("HTTP/1.1 200 OK\r\nContent-type:application/octet-stream\r\nAccept-Ranges:bytes\r\nAccept-Length:"+str(bytdata.__len__())+ + "\r\nContent-Disposition: attachment; filename=alldatafile.zip\r\n\r\n","utf-8")+bytdata) else: #webpagedat self.client_socket.send(bytes("HTTP/1.1 200 OK\r\nContent-Type:text/html\r\n\r\n"+webpagedat,"utf-8"))