本文整理匯總了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)