本文整理汇总了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
示例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!")
示例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
示例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")
示例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
#
示例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
示例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
示例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
示例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
示例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)