Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow user-spcified network interface for instance deployment, fixes … #22

Merged
merged 3 commits into from
May 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions install/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ read -e -p "Path to SSL certificate: " -i "/usr/src/pipot/server/cert/pipot.crt"
read -e -p "Path to SSL key: " -i "/usr/src/pipot/server/cert/pipot.key" config_ssl_key
read -e -p "Port for SSL Collector to listen on: " -i "1235" config_collector_ssl
read -e -p "Port for UDP Collector to listen on: " -i "1234" config_collector_udp
read -e -p "Network interface for instance deployment: " -i "'eth0'" network_interface
config_db_uri="mysql+pymysql://${db_user}:${db_user_password}@localhost:3306/${db_name}"
# Request info for creating admin account
echo ""
Expand Down Expand Up @@ -130,6 +131,7 @@ CSRF_ENABLED = True
DATABASE_URI = '${config_db_uri}'
COLLECTOR_UDP_PORT = ${config_collector_udp}
COLLECTOR_SSL_PORT = ${config_collector_ssl}
NETWORK_INTERFACE = ${network_interface}
" > "${dir}/../config.py"
echo "* Making necessary scripts executable (if they aren't already)"
chmod +x "${dir}/../bin/pipotd" "${dir}/../bin/create_image.sh" "${dir}/../../client/bin/chroot.sh" >> "$install_log" 2>&1
Expand Down
3 changes: 2 additions & 1 deletion mod_honeypot/controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ def profiles_id(id):
@check_access_rights()
@template_renderer()
def manage():
from run import app
new_deploy = NewDeploymentForm()
new_deploy.rpi_model.choices = [(key, value) for key, value in PiModels]
new_deploy.profile_id.choices = [
Expand Down Expand Up @@ -175,7 +176,7 @@ def manage():
return jsonify(result)

if sys.platform.startswith("linux"):
addrs = ni.ifaddresses('eth0')
addrs = ni.ifaddresses(app.config.get('NETWORK_INTERFACE'))
new_deploy.server_ip.data = addrs[ni.AF_INET][0]['addr']
print('Setting default ip: %s' % addrs[ni.AF_INET][0]['addr'])
else:
Expand Down