예제 #1
0
파일: Task.py 프로젝트: BwRy/test-av2
    def run(self):
        exe_path_dst = "c:\\Users\\avtest\\Desktop\\arg.exe"

        vmman = VMManagerFus(self.vmrun_path)

        # 0. revert to snapshot
        vmman.revertSnapshot(self.vm)

        # 1. startup vm
        vmman.startup(self.vm)

        # 2. copy file
        vmman.copyFileToGuest(self.vm, self.exe_path, exe_path_dst)

        # 3. infection
        c = raw_input("[>] Press Enter to executing infection...\n")
        x = vmman.executeCmd(self.vm, exe_path_dst)

        if x is not True:
            sys.stdout.write("[!] Execution failed\n")
            vmman.shutdown(self.vm)
            sys.exit(0)

        # 4. wait for reboot
        c = raw_input("[>] Wait 5 min and reboot (press enter when ok)...\n")
        #sleep(300)
        vmman.reboot(self.vm)

        # n. finally shutdown
        c = raw_input("[>] Press enter to end Analysis and shutdown current VM...\n")
g = open(host_script_src, 'wb')
g.write("wmic computersystem where caption='avtagent' rename win7%s" % sys.argv[1])
g.close()

c = raw_input("[>] Ready... Press enter to start")

# 1. startup vm
#vmman.startup(avg)
#
# 2. copy files
vmman.copyFileToGuest(avg, addr_script_src, addr_script_dst)
vmman.copyFileToGuest(avg, host_script_src, host_script_dst)

#
# 3. run scripts
x = vmman.executeCmd(avg, addr_script_dst)
if x is not True:
    sys.stdout.write("[!] error executing %s\n" % addr_script_dst)
    #vmman.shutdown(avg)
    #sys.exit(0)
'''
x = vmman.executeCmd(avg, addr_script_dst)
if x is not True:
    sys.stdout.write("[!] error executing %s\n" % addr_script_dst)
    #vmman.shutdown(avg)
    #sys.exit(0)

#
# 4. wait for reboot
#vmman.reboot(avg)
예제 #3
0
#
avg = VMMachine(conf_file, "avg")


# 0. revert to snapshot
#
vmman.revertSnapshot(avg)
# 1. startup vm
vmman.startup(avg)
#
# 2. copy file
vmman.copyFileToGuest(avg, exe_path_src, exe_path_dst)
#
# 3. infection
c = raw_input("[>] Press Enter to executing infection...\n")
x = vmman.executeCmd(avg, exe_path_dst)

if x is not True:
    sys.stdout.write("[!] Execution failed\n")
    vmman.shutdown(avg)
    sys.exit(0)
#
# 4. wait for reboot
c = raw_input("[>] Wait 5 min and reboot (press enter when ok)...\n")
#sleep(300)
vmman.reboot(avg)
#
# n. finally shutdown
c = raw_input("[>] Press enter to end Analysis and shutdown current VM...\n")
#vmman.shutdown(avg)