本文主要是介绍Burpsuite - Extension: Import Links into Sitemap,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
How to import Links into Sitemap ?
Please select “Import Links from a file” in the right menu.
Note: If the links file is too large, it may cost too much !
Code
from burp import IBurpExtender
from burp import IContextMenuFactoryfrom javax.swing import JMenuItem
from java.util import List, ArrayList
from java.net import URL
from javax import swing
# from javax.swing import JOptionPane
from javax.swing.filechooser import FileNameExtensionFilter
import threading
import osclass BurpExtender(IBurpExtender, IContextMenuFactory):"""Import urls into sitemap from a file."""def registerExtenderCallbacks(self, callbacks):self.callbacks = callbacksself.helpers = callbacks.getHelpers()self.context = Nonecallbacks.setExtensionName("Sitemap Importer")callbacks.registerContextMenuFactory(self)def createMenuItems(self, context_menu):self.context = context_menumenu_list = ArrayList()menu_list.add(JMenuItem("Import Links from a file", actionPerformed=self.custom_menu))return menu_listdef custom_menu(self, event):self.sitemap_importer_from_file()returndef custom_dialog(self):filename = NonefChooser = swing.JFileChooser()extfilter = swing.filechooser.FileNameExtensionFilter("OK", ["*"])fChooser.addChoosableFileFilter(extfilter)files = fChooser.showDialog(None, "URLs files")if files == swing.JFileChooser.APPROVE_OPTION:filename = fChooser.getSelectedFile().getPath()return filenamedef sitemap_importer_from_file(self):filename = self.custom_dialog()# filename = JOptionPane.showInputDialog("Import Links from a file")if filename and os.path.exists(filename):for url in open(filename): # Not to large.url = url.strip()t = threading.Thread(target=self.sitemap_importer, args=[url])t.daemon = Truet.start()self.callbacks.printOutput('[*] All urls imported.')else:self.callbacks.printOutput('[*] Please select a urls file.')def sitemap_importer(self, http_url):java_URL = URL(http_url)port = 443 if java_URL.protocol == 'https' else 80port = java_URL.port if java_URL.port != -1 else porthttpService = self.helpers.buildHttpService(java_URL.host, port, java_URL.protocol)httpRequest = self.helpers.buildHttpRequest(URL(http_url))self.callbacks.addToSiteMap(self.callbacks.makeHttpRequest(httpService, httpRequest))# Platform: Mac OS X / Windows 7
# Brupsuite Version: 1.7.11
# Author: Nixawk
# https://portswigger.net/burp/help/extender.html
# https://portswigger.net/burp/extender/api/index.html
# https://portswigger.net/burp/extender/api/burp/IHttpService.html
# https://support.portswigger.net/customer/en/portal/topics/719885-burp-extensions/questions?page=8
# http://docs.oracle.com/javase/7/docs/api/java/net/URL.html#URL(java.lang.String)
# http://stackoverflow.com/questions/12810460/joptionpane-input-dialog-box-program
这篇关于Burpsuite - Extension: Import Links into Sitemap的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!