def readFile(nameOfFile, helper, command): file = open(nameOfFile, 'r') list = [] # 保存目标文件中的所有ip for line in file: list.append(getip(line)[0]) file.close() for i in list: getInfo(i, helper, command) helper.close()
def tracert(Sip): # 函数参数是ip地址 outputText = os.popen('traceroute -n -m 15 -q 1 -w 2 %s' % (Sip, )).read() # -n命令取消将ip地址解析为主机名的操作,加快跟踪速度 points = [] # 存放跟踪目标ip所经过的跃点、次数 ipList = [] # 存放经过的ip list1 = [] ipList = getip(outputText) ipList = filter(lambda ip: not ip.startswith("11."), ipList) ipList = list(ipList) return ipList
</div> </div> </div> <!-- FOOTER --> <footer class="text-center"> <div class="container"> <div class="row"> <div class="col-xs-12"> <p>Copyright © Feulerloup. All rights reserved.</p> </div> </div> </div> </footer> <!-- / FOOTER --> <!-- jQuery (necessary for Bootstrap's JavaScript plugins) --> <script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script> <!-- Include all compiled plugins (below), or include individual files as needed --> <script src="//cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.js"></script> </body> </html> ''' print html % (functions.serverstatus(), functions.getip(), functions.server_port, functions.password, functions.method, functions.protocol, functions.obfs, functions.speed_limit_per_con, functions.speed_limit_per_user, functions.getssrlink(), functions.getssrlink())