当前位置: 首页>>代码示例>>Python>>正文


Python io.PrintWriter方法代码示例

本文整理汇总了Python中java.io.PrintWriter方法的典型用法代码示例。如果您正苦于以下问题:Python io.PrintWriter方法的具体用法?Python io.PrintWriter怎么用?Python io.PrintWriter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.io的用法示例。


在下文中一共展示了io.PrintWriter方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: registerExtenderCallbacks

# 需要导入模块: from java import io [as 别名]
# 或者: from java.io import PrintWriter [as 别名]
def registerExtenderCallbacks( self, callbacks):
		# keep a reference to our callbacks and helper object
		self._callbacks=callbacks
		self._helpers=callbacks.getHelpers()

		self.stdout = PrintWriter(callbacks.getStdout(), True)

		# Keep Track of Browsers
		self._browser={}
		# Colors for different browsers
		self.colors=["red", "pink", "green","magenta","cyan", "gray", "yellow"]
 
		
		self._callbacks.setExtensionName("Multi-Browser Highlighting")
		self.isEnabled=False
		
		#IExtensionHelpers helpers = callbacks.getHelpers()
		callbacks.registerProxyListener(self)
		callbacks.registerContextMenuFactory(self)
		return 
开发者ID:aurainfosec,项目名称:burp-multi-browser-highlighting,代码行数:22,代码来源:multi-browser.py

示例2: registerExtenderCallbacks

# 需要导入模块: from java import io [as 别名]
# 或者: from java.io import PrintWriter [as 别名]
def registerExtenderCallbacks(self, callbacks):
        self._callbacks = callbacks
        self._helpers = callbacks.getHelpers()
        
        callbacks.setExtensionName("NGINX Alias Traversal")

        self._stdout = PrintWriter(callbacks.getStdout(), True)
        self._callbacks.registerScannerCheck(self)

        self.enableDirectoryGuessing = True
        with open("directories.txt", "r") as f:
            self.common_directories = [x.strip() for x in f.readlines()]
            
        self._stdout.println("GitHub: https://github.com/bayotop/off-by-slash/")
        self._stdout.println("Contact: https://twitter.com/_bayotop")
        self._stdout.println("")
        self._stdout.println("Successfully initialized!") 
开发者ID:bayotop,项目名称:off-by-slash,代码行数:19,代码来源:off-by-slash.py

示例3: registerExtenderCallbacks

# 需要导入模块: from java import io [as 别名]
# 或者: from java.io import PrintWriter [as 别名]
def registerExtenderCallbacks(self, callbacks):
        sys.stdout = callbacks.getStdout()
        sys.stderr = callbacks.getStderr()
        # keep a reference to our callbacks object
        self.callbacks = callbacks
        self.stdout = PrintWriter(callbacks.getStdout(), True)
        self.stderr = PrintWriter(callbacks.getStderr(), True)      
        # obtain an extension helpers object
        self.helpers = callbacks.getHelpers()
        
        # set our extension name
        callbacks.setExtensionName("Protobuf Decoder")
        
        # register ourselves as a message editor tab factory
        callbacks.registerMessageEditorTabFactory(self)

        return 
开发者ID:nevermoe,项目名称:protobuf-decoder,代码行数:19,代码来源:protobuf_decoder.py

示例4: registerExtenderCallbacks

# 需要导入模块: from java import io [as 别名]
# 或者: from java.io import PrintWriter [as 别名]
def registerExtenderCallbacks(self, callbacks):
        self.callbacks = callbacks
        self.helpers = callbacks.getHelpers()
        callbacks.setExtensionName("BurpJSLinkFinder")

        callbacks.issueAlert("BurpJSLinkFinder Passive Scanner enabled")

        stdout = PrintWriter(callbacks.getStdout(), True)
        stderr = PrintWriter(callbacks.getStderr(), True)
        callbacks.registerScannerCheck(self)
        self.initUI()
        self.callbacks.addSuiteTab(self)
        
        print ("Burp JS LinkFinder loaded.")
        print ("Copyright (c) 2019 Frans Hendrik Botes")
        self.outputTxtArea.setText("Burp JS LinkFinder loaded." + "\n" + "Copyright (c) 2019 Frans Hendrik Botes" + "\n") 
开发者ID:InitRoot,项目名称:BurpJSLinkFinder,代码行数:18,代码来源:FransLinkfinder.py

示例5: registerExtenderCallbacks

# 需要导入模块: from java import io [as 别名]
# 或者: from java.io import PrintWriter [as 别名]
def registerExtenderCallbacks(self, callbacks):
        # keep a reference to our callbacks object
        global cbs, helpers, stdout, stderr
        cbs = callbacks

        helpers = callbacks.getHelpers()

        stdout = PrintWriter(callbacks.getStdout(), True)
        stderr = PrintWriter(callbacks.getStderr(), True)

        callbacks.setExtensionName("CTF helper")

        stdout.println("Welcome to my CTF world...")
        stdout.println('CTF helper by unamer.')

        # register ourselves as a custom scanner check
        callbacks.registerScannerCheck(backupScan())
        callbacks.registerScannerCheck(DirScan())


#
# class implementing IScanIssue to hold our custom scan issue details
# 
开发者ID:unamer,项目名称:CTFHelper,代码行数:25,代码来源:CTFhelper.py

示例6: registerExtenderCallbacks

# 需要导入模块: from java import io [as 别名]
# 或者: from java.io import PrintWriter [as 别名]
def registerExtenderCallbacks(self, callbacks):
        # keep a reference to our callbacks object
        self._callbacks = callbacks
        self._scanlist = []  # Holds scan items (Burp data structures)
        self._scantarget = []  # Holds list of URLs added to scan
        # set our extension name
        callbacks.setExtensionName("Headless Scanner Driver")
        # obtain our output stream
        self._stdout = PrintWriter(callbacks.getStdout(), True)
        self._stderr = PrintWriter(callbacks.getStderr(), True)
        # register ourselves as listeners
        callbacks.registerScannerListener(self)
        callbacks.registerProxyListener(self)
        self._stdout.println(json.dumps({"running": 1}))  # Indicate we're up
        self._stdout.flush()
        return 
开发者ID:F-Secure,项目名称:headless-scanner-driver,代码行数:18,代码来源:HeadlessScannerDriver.py

示例7: registerExtenderCallbacks

# 需要导入模块: from java import io [as 别名]
# 或者: from java.io import PrintWriter [as 别名]
def registerExtenderCallbacks(self, callbacks):
		stdout = PrintWriter(callbacks.getStdout(), True)
		self._callbacks = callbacks
		self._helpers = callbacks.getHelpers()
		callbacks.setExtensionName("HMAC Header")
		stdout.println("HMAC Header Registered OK")
		callbacks.registerSessionHandlingAction(self)
		stdout.println("Session handling started")
		return 
开发者ID:pentestpartners,项目名称:snippets,代码行数:11,代码来源:hmac.py

示例8: performAction

# 需要导入模块: from java import io [as 别名]
# 或者: from java.io import PrintWriter [as 别名]
def performAction(self, currentRequest, macroItems):
		#Update the secret key for HMAC
		Secret = "THIS-IS-A-SeCRet"

		stdout = PrintWriter(self._callbacks.getStdout(), True)
		requestInfo = self._helpers.analyzeRequest(currentRequest)
		 
		#Get URL path (the bit after the FQDN)
		urlpath = self._helpers.analyzeRequest(currentRequest).getUrl().getPath()	
		urlpath = self._helpers.urlEncode(urlpath)		
				
		#Get body
		BodyBytes = currentRequest.getRequest()[requestInfo.getBodyOffset():]
		BodyStr = self._helpers.bytesToString(BodyBytes)
		
		#Get time
		timestamp = datetime.now()
		timestamp = timestamp.isoformat() 
		 
		#Compute HMAC
		content = urlpath+BodyStr+timestamp
		stdout.println(content)
		_hmac = base64.b64encode(hmac.new(Secret, content, digestmod=hashlib.sha256).hexdigest())
		stdout.println(_hmac)
		
		#Add to headers array
		headers = requestInfo.getHeaders()
		hmacheader = "Authentication Bearer: "+_hmac+":"+timestamp
		headers.add(hmacheader)

		# Build new HTTP message with the new HMAC header
		message = self._helpers.buildHttpMessage(headers, BodyStr)
		
		# Update request with the new header and send it on its way
		currentRequest.setRequest(message)
		return 
开发者ID:pentestpartners,项目名称:snippets,代码行数:38,代码来源:hmac.py

示例9: registerExtenderCallbacks

# 需要导入模块: from java import io [as 别名]
# 或者: from java.io import PrintWriter [as 别名]
def registerExtenderCallbacks(self, callbacks):
        self.menuitems = dict()
        self._callbacks = callbacks
        self._helpers = callbacks.getHelpers()
        callbacks.setExtensionName(EXTENSION_NAME)
        callbacks.registerContextMenuFactory(self)
        self._contextMenuData = None
        self._stdout = PrintWriter(callbacks.getStdout(), True)
        self.generate_menu_items()
        return 
开发者ID:EnableSecurity,项目名称:Identity-Crisis,代码行数:12,代码来源:identitycrisis.py

示例10: testCSVPipe

# 需要导入模块: from java import io [as 别名]
# 或者: from java.io import PrintWriter [as 别名]
def testCSVPipe(self):
        """testing the CSV pipe"""
        from java.io import PrintWriter, FileWriter
        from com.ziclix.python.sql.pipe import Pipe
        from com.ziclix.python.sql.pipe.db import DBSource
        from com.ziclix.python.sql.pipe.csv import CSVSink

        try:
            src = self.connect()
            fn = tempfile.mktemp(suffix="csv")
            writer = PrintWriter(FileWriter(fn))
            csvSink = CSVSink(writer)

            c = self.cursor()
            try:
                c.execute("insert into zxtesting (id, name, state) values (?, ?, ?)", [(1000, 'this,has,a,comma', 'and a " quote')])
                c.execute("insert into zxtesting (id, name, state) values (?, ?, ?)", [(1001, 'this,has,a,comma and a "', 'and a " quote')])
                # ORACLE has a problem calling stmt.setObject(index, null)
                c.execute("insert into zxtesting (id, name, state) values (?, ?, ?)", [(1010, '"this,has,a,comma"', None)], {2:zxJDBC.VARCHAR})
                self.db.commit()
            finally:
                self.db.rollback()
                c.close()

            dbSource = DBSource(src, c.datahandler.__class__, "zxtesting", None, None, None)

            cnt = Pipe().pipe(dbSource, csvSink) - 1 # ignore the header row

        finally:
            writer.close()
            src.close()
            os.remove(fn) 
开发者ID:ofermend,项目名称:medicare-demo,代码行数:34,代码来源:zxtest.py


注:本文中的java.io.PrintWriter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。