HWaddr dynamic (#819)

* HWaddr dynamic

* Update ifconfig.py
This commit is contained in:
Danilo Vargas 2018-07-19 05:28:44 -05:00 committed by Michel Oosterhof
parent 3a918fd971
commit fb642455c6
1 changed files with 5 additions and 2 deletions

View File

@ -5,13 +5,16 @@
from __future__ import division, absolute_import
from cowrie.shell.command import HoneyPotCommand
from random import randint
HWaddr = "%02x:%02x:%02x:%02x:%02x:%02x" % (randint(0, 255), randint(0, 255), randint(0, 255), randint(0, 255), randint(0, 255), randint(0, 255))
commands = {}
class command_ifconfig(HoneyPotCommand):
def call(self):
l = """eth0 Link encap:Ethernet HWaddr 04:01:16:df:2d:01
l = """eth0 Link encap:Ethernet HWaddr %s
inet addr:%s Bcast:%s.255 Mask:255.255.255.0
inet6 addr: fe80::601:16ff:fedf:2d01/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
@ -29,7 +32,7 @@ lo Link encap:Local Loopback
TX packets:110 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:19932 (19.9 KB) TX bytes:19932 (19.9 KB)""" % \
(self.protocol.kippoIP,
(HWaddr, self.protocol.kippoIP,
self.protocol.kippoIP.rsplit('.', 1)[0])
self.write('{0}\n'.format(l))