Added str representation of hosts.

This commit is contained in:
daniel goldberg 2016-09-05 21:10:17 +03:00
parent 397c4f82ca
commit 6e76162b8f
1 changed files with 11 additions and 0 deletions

View File

@ -32,6 +32,17 @@ class VictimHost(object):
def __repr__(self):
return "<VictimHost %s>" % (self.ip_addr, )
def __str__(self):
victim = "Victim Host %s: " % self.ip_addr
victim += "OS - ["
for k, v in self.os.iteritems():
victim += "%s-%s " % (k, v)
victim += "] Services - ["
for k, v in self.services.iteritems():
victim += "%s-%s " % (k, v)
victim += ']'
return victim
def learn_credentials(self, username, password):
self.cred[username.lower()] = password