addr_script_src = "tmp/change_ip_addr.bat"
addr_script_dst = "C:\\Users\\avtest\\Desktop\\change_ip_addr.bat"

# puppet installer path
puppet_path = "C:\\Users\\avtest\\Desktop\\puppet-3.1.0-rc1.msi"

# vSphere creds
host = ""
user = ""
passwd = ""

#
#   Defining VM Manager
#
#vmman = VMManagerVS(vmrun_path, host, user, passwd)
vmman = VMManagerFus(vmrun_path)
#
#   Defining all vms you need
#
avg = VMachine(conf_file, sys.argv[1])

print avg

#
#   Generate scripts for that vm 
#
f = open(addr_script_src, 'wb')
f.write('C:\\Windows\\system32\\netsh.exe interface ip set address "Local Area Connection" static %s 255.255.255.0' %
        sys.argv[2])
f.close()
Example #2
0
    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")
        |/  |     |     |  \|
       />   |     |     |   <\
           _;     |     ;_
         <`_\     |     /_`>
         |\  `._  |  _.'  /|
         \|     `"""`    |/
          |\            /|
    jgs    \\          //
           /_>        <_\
'''


#
# Defining VM Manager
#
vmman = VMManagerFus(vmrun_path)

#
# Defining all vms you need
#
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)