Add support for fake client IP address (Janne Snabb)

git-svn-id: https://kippo.googlecode.com/svn/trunk@176 951d7100-d841-11de-b865-b3884708a8e2
This commit is contained in:
desaster
2010-10-25 14:57:14 +00:00
parent 34a99b876f
commit 05b7471708
2 changed files with 12 additions and 1 deletions

View File

@@ -13,9 +13,11 @@ private_key = private.key
password = 123456
;out_addr = 0.0.0.0
;sensor_name=myhostname
;fake_addr = 192.168.66.254
;[database_mysql]
;host = localhost
;database = kippo
;username = kippo
;password = secret

View File

@@ -160,7 +160,16 @@ class HoneyPotProtocol(recvline.HistoricRecvLine):
# You are in a maze of twisty little passages, all alike
p = self.terminal.transport.session.conn.transport.transport.getPeer()
self.clientIP = p.host
# real source IP of client
self.realClientIP = p.host
# source IP of client in user visible reports (can be fake or real)
cfg = config()
if cfg.has_option('honeypot', 'fake_addr'):
self.clientIP = cfg.get('honeypot', 'fake_addr')
else:
self.clientIP = self.realClientIP
self.logintime = time.time()
self.keyHandlers.update({