Python java.io.PrintWriter() Examples
The following are 12
code examples of java.io.PrintWriter().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
java.io
, or try the search function
.
![](https://www.programcreek.com/common/static/images/search.png)
Example #1
Source File: multi-browser.py From burp-multi-browser-highlighting with MIT License | 6 votes |
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
Example #2
Source File: off-by-slash.py From off-by-slash with MIT License | 6 votes |
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!")
Example #3
Source File: protobuf_decoder.py From protobuf-decoder with GNU General Public License v2.0 | 6 votes |
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
Example #4
Source File: FransLinkfinder.py From BurpJSLinkFinder with MIT License | 6 votes |
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")
Example #5
Source File: CTFhelper.py From CTFHelper with MIT License | 6 votes |
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 #
Example #6
Source File: HeadlessScannerDriver.py From headless-scanner-driver with Apache License 2.0 | 6 votes |
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
Example #7
Source File: hmac.py From snippets with MIT License | 5 votes |
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
Example #8
Source File: hmac.py From snippets with MIT License | 5 votes |
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
Example #9
Source File: identitycrisis.py From Identity-Crisis with MIT License | 5 votes |
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
Example #10
Source File: zxtest.py From medicare-demo with Apache License 2.0 | 5 votes |
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)
Example #11
Source File: zxtest.py From CTFCrackTools-V2 with GNU General Public License v3.0 | 5 votes |
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)
Example #12
Source File: zxtest.py From CTFCrackTools with GNU General Public License v3.0 | 5 votes |
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)