Python 网站后台扫描脚本
#!/usr/bin/python #coding=utf-8 import sys import urllib import time url = "http://123.207.123.228/" txt = open(r"C:\Users\ww\Desktop\houtaiphp.txt","r") open_url = [] all_url = [] def search_url(url,txt): with open(r"C:\Users\ww\Desktop\houtaiphp.txt","r") as f : for each in f: each = each.replace(‘\n‘,‘‘) urllist = url+each all_url.append(urllist) print("查找:"+urllist+‘\n‘) try: req = urllib.urlopen(urllist) if req.getcode() == 200: open_url.append(urllist) if req.getcode() == 301: open_url.append(urllist) except: pass def main(): search_url(url,txt) if open_url: print("后台地址:") for each in open_url: print("[+]"+each) else: print("没有找到网站后台") if __name__ == "__main__": main()
#!/usr/bin/python #coding=utf-8 import sys import urllib import time url = "http://123.207.123.228/" txt = open(r"C:\Users\ww\Desktop\houtaiphp.txt","r") open_url = [] all_url = [] def search_url(url,txt): with open(r"C:\Users\ww\Desktop\houtaiphp.txt","r") as f : for each in f: each = each.replace(‘\n‘,‘‘) urllist = url+each all_url.append(urllist) handle_url(urllist) def handle_url(urllist): print("查找:"+urllist+‘\n‘) try: req = urllib.urlopen(urllist) if req.getcode() == 200: open_url.append(urllist) if req.getcode() == 301: open_url.append(urllist) except: pass def main(): search_url(url,txt) if open_url: print("后台地址:") for each in open_url: print("[+]"+each) else: print("没有找到网站后台") if __name__ == "__main__": main()
原文地址:https://www.cnblogs.com/Oran9e/p/9011749.html
时间: 2024-11-09 09:24:11