Skip to content

Commit

Permalink
Added IP address to config options
Browse files Browse the repository at this point in the history
  • Loading branch information
amerck committed Aug 6, 2018
1 parent 4e4229e commit ba14545
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cowrie.run.j2
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ register () {
local chnserver="${2:-localhost}"
local json="${3:-cowrie}"
local hostname="$(hostname -f)"
local ip="${4:-}"
local honeypot="cowrie"

if [[ -z ${deploy_key} ]]
Expand All @@ -30,6 +31,7 @@ register () {
--data "{
\"name\": \"${hostname}-${honeypot}\",
\"hostname\": \"$hostname\",
\"ip\": \"${ip}\",
\"deploy_key\": \"$deploy_key\",
\"honeypot\": \"$honeypot\"
}" ${chnserver}/api/sensor/
Expand Down Expand Up @@ -76,6 +78,7 @@ main () {
local feeds_server=${FEEDS_SERVER:-localhost}
local feeds_server_port=${FEEDS_SERVER_PORT:-10000}
local json=${COWRIE_JSON:-cowrie.json}
local ip=${IP_ADDRESS:-}
local ssh_port=${SSH_LISTEN_PORT:-2222}
local telnet_port=${TELNET_LISTEN_PORT:-2223}

Expand All @@ -90,7 +93,7 @@ main () {
# If it doesn't exist or is empty
if [[ ! -f ${json} ]] || [[ ! -s ${json} ]]
then
register ${deploy_key} ${chn_server} ${json}
register ${deploy_key} ${chn_server} ${json} ${ip}

return=$?

Expand Down
4 changes: 4 additions & 0 deletions cowrie.sysconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

DEBUG=false

# IP Address of the honeypot
# Leaving this blank will default to the docker container IP
IP_ADDRESS=

# CHN Server api to register to
CHN_SERVER="http://chnserver"

Expand Down

0 comments on commit ba14545

Please sign in to comment.