Giter VIP home page Giter VIP logo

mhn's Introduction

Project Status

This project is undergoing a partial rewrite for Python 3 targeting Ubuntu 20.04 as the primary platform. The last stable commit would be be58cbf8c726c29c4c0f993023688fdbd026ee05 for Ubuntu 18.04, although you may still encounter dependency issues. Please continue to report any bugs found. Pull requests are encouraged!


Modern Honey Network

Centos 6 Ubuntu 16.04 Ubuntu 18.04

MHN is a centralized server for management and data collection of honeypots. MHN allows you to deploy sensors quickly and to collect data immediately, viewable from a neat web interface. Honeypot deploy scripts include several common honeypot technologies, including Snort, Cowrie, Dionaea, and glastopf, among others.

For questions regarding troubleshooting your installation, please review the MHN Troubleshooting Guide, search past questions on the modern-honey-network Google Group, or send emails to [email protected].

Features

MHN is a Flask application that exposes an HTTP API that honeypots can use to:

  • Download a deploy script
  • Connect and register
  • Download snort rules
  • Send intrusion detection logs

It also allows system administrators to:

  • View a list of new attacks
  • Manage snort rules: enable, disable, download

Installation

  • The MHN server is supported on Ubuntu 18.04, Ubuntu 16.04, and Centos 6.9.
  • Other versions of Linux may work but are generally not tested or supported.

Note: if you run into trouble during the install, please checkout the troubleshooting guide on the wiki. If you only want to experiment with MHN on some virtual machines, please check out the Getting up and Running with Vagrant guide on the wiki.

Install Git

# on Debian or Ubuntu
$ sudo apt install git -y

Install MHN

$ cd /opt/
$ sudo git clone https://github.com/pwnlandia/mhn.git
$ cd mhn/

Run the following script to complete the installation. While this script runs, you will be prompted for some configuration options. See below for how this looks.

$ sudo ./install.sh

Configuration

===========================================================
MHN Configuration
===========================================================
Do you wish to run in Debug mode?: y/n n
Superuser email: [email protected]
Superuser password: 
Server base url ["http://1.2.3.4"]: 
Honeymap url ["http://1.2.3.4:3000"]:
Mail server address ["localhost"]: 
Mail server port [25]: 
Use TLS for email?: y/n n
Use SSL for email?: y/n n
Mail server username [""]: 
Mail server password [""]: 
Mail default sender [""]: 
Path for log file ["mhn.log"]: 

Running

If the installation scripts ran successfully, you should have a number of services running on your MHN server. See below for checking these.

user@precise64:/opt/mhn/scripts$ sudo /etc/init.d/nginx status
 * nginx is running
user@precise64:/opt/mhn/scripts$ sudo /etc/init.d/supervisor status
 is running
user@precise64:/opt/mhn/scripts$ sudo supervisorctl status
geoloc                           RUNNING    pid 31443, uptime 0:00:12
honeymap                         RUNNING    pid 30826, uptime 0:08:54
hpfeeds-broker                   RUNNING    pid 10089, uptime 0:36:42
mhn-celery-beat                  RUNNING    pid 29909, uptime 0:18:41
mhn-celery-worker                RUNNING    pid 29910, uptime 0:18:41
mhn-collector                    RUNNING    pid 7872,  uptime 0:18:41
mhn-uwsgi                        RUNNING    pid 29911, uptime 0:18:41
mnemosyne                        RUNNING    pid 28173, uptime 0:30:08

Running MHN Behind a Proxy

For directions on running MHN behind a web proxy, follow the directions in the wiki.

Running MHN Over HTTPS

By default MHN will run without HTTPS, to configure your installation to use SSL certificates directions can be found in the wiki.

Running MHN with Docker (not maintained)

Running MHN in docker is not officially supported, but it might work. The container takes a few minutes to start at the first launch to initialize. Splunk, ArcSight and ELK are not yet supported in Docker.

Build it

$ docker build -t mhn .

Run it

$ docker run -d -p 10000:10000 -p 80:80 -p 3000:3000 -p 8089:8089 \
$ --restart unless-stopped \
$ --name mhn \
$ -e SUPERUSER_EMAIL=root@localhost \
$ -e SUPERUSER_PASSWORD=password \
$ -e SERVER_BASE_URL="http://mhn" \
$ -e HONEYMAP_URL="http://mhn:3000" \
$ mhn

Environment variables

SUPERUSER_EMAIL
SUPERUSER_PASSWORD
SERVER_BASE_URL
HONEYMAP_URL
DEBUG_MODE
SMTP_HOST
SMTP_PORT
SMTP_TLS
SMTP_SSL
SMTP_USERNAME
SMTP_PASSWORD
SMTP_SENDER
MHN_LOG

Deploying honeypots with MHN

MHN was designed to make scalable deployment of honeypots easier. Here are the steps for deploying a honeypot with MHN:

  1. Login to your MHN server web app.
  2. Click the "Deploy" link in the upper left hand corner.
  3. Select a type of honeypot from the drop down menu (e.g. "Ubuntu Dionaea").
  4. Copy the deployment command.
  5. Login to a honeypot server and run this command as root.

If the deploy script successfully completes you should see the new sensor listed under your deployed sensor list. For a full list of supported sensors, check the list here: List of Supported Sensors

Integration with Splunk and ArcSight

hpfeeds-logger can be used to integrate MHN with Splunk and ArcSight.

Splunk

cd /opt/mhn/scripts/
sudo ./install_hpfeeds-logger-splunk.sh

This will log the events as key/value pairs to /var/log/mhn-splunk.log. This log should be monitored by the SplunkUniversalForwarder.

Arcsight

cd /opt/mhn/scripts/
sudo ./install_hpfeeds-logger-arcsight.sh

This will log the events as CEF to /var/log/mhn-arcsight.log

Data

NOTICE This section is out of date. Community data is not collected by Anomali although MHN still attempts to send this data to Anomali servers.

The MHN server reports anonymized attack data back to Anomali, Inc. (formerly known as ThreatStream). If you are interested in viewing this data, get details in the wiki. This data reporting can be disabled by running the following command from the MHN server after completing the initial installation steps outlined above: /opt/mhn/scripts/disable_collector.sh

Support or Contact

MHN is an open source project that relies on community involvement. Please check out our troubleshooting guide on the wiki. We will also lend a hand, if needed. Find us at: [email protected].

Credit and Thanks

MHN was originally created by Anomali, Inc.

MHN leverages and extends upon several awesome projects by the Honeynet project. Please show them your support by way of donation.

LICENSE

Modern Honeypot Network

This program free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

mhn's People

Contributors

aabed avatar andrewsmhay avatar antelox avatar bafbomb avatar birkan-d avatar bjh7242 avatar ch40s avatar cloughrm avatar d1str0 avatar dependabot-support avatar ducky1987 avatar erwanlr avatar gregcmartin avatar h0ffayyy avatar hiperesfera avatar jatrost avatar joeneldeasis avatar karlnewell avatar maf23 avatar mattcarothers avatar miqueet avatar mwollenweber avatar notmike avatar orhiee avatar s-maloney avatar sbilly avatar serpulga avatar ttarnowski avatar wrharding avatar zeroq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mhn's Issues

Sensor IP address change is not reflected on the server.

My end goal with your software is to be able to deploy a honeypot onto a raspberry pi, then ship those devices to our branch locations and have local IT plug the sensors into the network there for monitoring.

The issue appears after the initial setup phase. After running the deploy script on my sensor, the IP address of the sensor is recorded in MHN. If I then power down the sensor and take it to a different subnet the IP address of that sensor changes, however the MHN server has no idea this change has taken place. I can simulate alerts on the sensor and I will receive no updates on the server side. Is there any way to update this manually or preferably automatically?

CSRF vulnerability in change admin password form

POST /auth/changepass/?user_id=1 HTTP/1.1
...
Accept: /
Content-Type: application/json
{"password":"NewPassFromHacker","password_repeat":"NewPassFromHacker"}

Vulnerability discovered by:
Laurent Oudot from TEHTRI-Security

Honeymap: render events from private IP space if Geo is known

Users want to see events from private IP rendered on honeymap and they often know the GEO info for their private IPs.

Enable users to create a private IP space IP geo source.

Enrich events with this IP geo source so they can be rendered on honeymap.

conpot Dst port

Really appreciate this project. I want to verify if other has conpot sensor reports back to the dashboard with 'Dst port' = 502 regardless of which actual port was used. Tested with wget (Dst port = 502, Protocol=http); Tested with NMAP/modbus-discover.nse (Dst port=502, Protocol=modbus) Thanks.

Blank superuser email and password fails

If the superuser email and password are left blank when configuration takes place in install_mhnserver.sh, you cannot login with blank email and password and cannot change them by rerunning the install script.

The fields should be marked required and sanity checked for input.

Thank you.

Incomplete doc "Deploying Dionaea on a Raspberry Pi"

HI

I try to follow your guide to install MHN/Dionaea on my Raspberry Pi.

But i don't find how to install MHN.

"Go to the MHN web interface. For example, if I followed this guide, I would type in http://10.254.254.100 into my web browser. Click on the "Deploy" tab and select "Raspberry Pi Dionaea" from the drop down menu."

This part isn't clear for me. Should I install Vagrant ?

CEF support

You have mentioned CEF will be supported.
Is somebody actively working on it? Is there any estimated date maybe?

Attacks Report only shows the first 10

My "Sensors" screen shows 14 attacks for a 'snort' sensor, but drilling in to that '14' number gets me to the Attacks Report - where I see just 10 entries with no "Next" or scrollbar to see more. (Tested on both Chrome 35.0.1916.153 m and Firefox 30.0)

No attacks shown in MHN dashboard from Snort sensor

  • Snort sensor has been deployed and is listed under sensors (/ui/sensors/)
  • Sensor is an internal honeypot, so following the troubleshooting guide I configured mnemosyne appropriately (ignore_rfc1918 = False)
  • Server and sensor are behind a web proxy which is bypassed for local addresses
  • I generated traffic and alerts are logged locally on the sensor under /var/log/snort
  • services on MHN server are up and running
  • no problem with IPTables
  • tcpdump showed me the traffic to/from port 10000 between the sensor and the server
  • db.session.find() of mnemosyne DB is empty
  • hpfeeds DB contains the correct identifier and secret
  • mnemosyne.err log continuously writes this:

2014-07-17 14:05:26,857 (feedpuller.feedpuller) No activity for 15 seconds, forcing reconnect
2014-07-17 14:05:41,858 (feedpuller.feedpuller) No activity for 15 seconds, forcing reconnect
2014-07-17 14:05:56,859 (feedpuller.feedpuller) No activity for 15 seconds, forcing reconnect

  • No other suspicious entries in the other logs

Do you have any idea why /ui/attacks/ is empty and I do not see any attacks in the MHN dashboard?

Attacks Report, More Details

The Attacks Report page contains 7 fields: number, date, country, IP, port, protocol, honeypot.
On the Map page, when an event happens I get slightly more detail (at least from dionaea) to include: event type (connection vs capture), and if its a capture, I get a hash and link to VT.

This event type (connection vs capture) and hash of uploaded file are not available on any page except the Map. The data on the map is volatile, therefore a refresh or lot of activity would make this data disappear from the GUI.

In the Attacks Report, I'd like to have this information. I realize it may vary for each type of sensor, so maybe an Attack Type field (this could be connection vs capture. for snort maybe the category of hit?), and a Details field (this could have the file hash link, maybe diff info for each sensor type).

I don't necessarily require the ability to search/filter on these fields. I think that gets more in to the splunk realm, but just showing the data would be useful.

Changing mhnserver config?

I've deployed the server using the Vagrant method but the private network IP 10.254.254.100 wouldn't be accessible from other machine for deployment.
I've changed the Vagrant config so that the server and honeypot get their IP from the LAN DHCP, but I can't find a way to update the mhnserver config.
Re-running the install_mhnserver.sh script produces an error.

Is their a simple way to update the server config? Or just to replace the old IP with a new one?

Glastopf not reporting back to mhn?

Hi again,
I just deploy mhn server in a Xubuntu 14.04, and everything was ok. After that I deploy a glastopf honeypot with the script in a Xubuntu 12.04.

If I access from the Xubuntu 12.04 I can see the website deploy by glastopf and attacks appear from localhost(127.0.0.1) in mhn server but if I access to this website from a different machine nothing appear in mhn server.

I can see the access from the third machine in te glastopf log, but this attack is not sent to mhn server.

Any ideas?

Thanks for all,
Carlos

No attack reported after nmap on diaonea honeypot

i don't get any attack report after following the basic vagrant install and launching nmap on both raspberrypi-dionaea and mhn-honeypot-dionaea connected sensors.

Am I missing something?

I guess there's no problem in installing other sensor types on the same devices on which Dionea has been deployed, right?

Conpot not reporting back to mhn?

Executed this command on conpot host: snmpwalk -Os -c public -v 1 localhost system and I saw activity in the /opt/conpot/conpot.log... Netstat shows that conpot has a connect back to mhn on port 10000... Should the snmp walk be enough to trigger an event? Is there a better way to test conpot?

ERROR (abnormal termination) - mnemosyne & hpfeeds-broker

Hi guys !

Just did a fresh install on Ubuntu Server 14.04 and get this error :
" FATAL - ERROR (abnormal termination)"
on mnemosyne & hpfeeds-broker (others are good).

Tryed to stop/start but still the same problem.

Thanks for your help !

dionaea honeypot isn't listening?

Ubuntu 12.04 LXC container running on top of Ubuntu 14.04. Deployed a dionaea honeypot and was expecting it to listen on multiple ports, like 3306. Is there a config problem or is it supposed to do this?

root@dionaea:/usr/local/bin# netstat -lp | grep dionaea
udp        0      0 *:47582                 *:*                                 318/dionaea   

Port 8080 not open on mhn server

I've been wrestling with an issue where port 8080 doesn't appear to be listening on the mhn server, which blocks me from installing remote sensors.

My test server and test sensor are Ubuntu 12.0.4 (Precise) VM guests running on the same virtual host. I created a bridged connection for the mhn server, and I can access the management page (port 80) and honeynet page (port 3000) from the local network. The status checks (described under "Running" in the readme) match the known good configuration. In every case, the output of netstat --listen shows that port 8080 is not listening, and nmap run from another system shows the same result.
image

Also, the log files I found don't contain any data obviously relevant to this issue.
image

Any ideas?

Check Repositories in scripts

Make sure multiverse is enabled in /etc/apt/sources.list for at least the Conpot script. Perhaps also add some 'sudo's where necessary in the scripts.

Cuckoo support

It would be a major plus if the malware captured by a honeypot like Dionaea could be sent to a Cuckoo sandbox running behind it.

nginx "504 Gateway Time-out" error for dashboard/attacks pages

When I open "ui/dashboard/" or "/ui/attacks/" pages I get "504 - Gateway time-out" errors while navigating through the rest of the site I don't have any problem.
I have 1 sensor connected with 356 attacks logged.

The error.log of nginx contains the following lines:

2014/07/18 13:48:30 [error] 3068#0: *1 upstream timed out (110: Connection timed out) while reading response header from upstream, client: A.B.C.D, server: _, request: "GET /ui/dashboard/ HTTP/1.1", upstream: "uwsgi://unix:/tmp/uwsgi.sock:", host: "127.0.0.1:X"
2014/07/18 13:55:48 [error] 3107#0: *1 upstream timed out (110: Connection timed out) while reading response header from upstream, client: A.B.C.D, server: _, request: "GET /ui/attacks/ HTTP/1.1", upstream: "uwsgi://unix:/tmp/uwsgi.sock:", host: "127.0.0.1:X"

I tried restarting the nginx and other services, I increased some thresholds in nginx.conf, I rebooted the server, I added "proxy_read_timeout 150;" in "/etc/nginx/sites-available/default" under "location @mhnserver" but none of the above resolved the problem.

CRC check failed after sudo ./install_mhnserver.sh

Exact error:
IOError: CRC ceck failed 0x808f37b != 0x9423e077L

I get the above error while running the install_mhnserver.sh, after filling in the MHN configuration info. This happens on both the Vagrant Install, and a fresh Ubuntu 14.04.1 Server VBox Install.

Change dionaea deploy to use GH

It might be better to deploy dionaea from a fork on GH with all the patches and config pre-applied. This one looks like a good start https://github.com/rep/dionaea since it has the hpfeeds patch applied I will make a GH issue for this. It seems like a better cross Ubuntu version way to install.

HoneyMap Javascript Uncaught TypeError: Cannot read property 'name' of undefined

Console Error Dump from Chrome:


Uncaught TypeError: Cannot read property 'name' of undefined (jquery-jvectormap-1.0.min.js:7)
jvm.WorldMap.getRegionName (jquery-jvectormap-1.0.min.js:7)
Honeymap.regionName (VM158 honeymap.js:100)
Marker.regionName (VM158 honeymap.js:268)
Feed.addLog (VM158 honeymap.js:349)
Feed.handler (VM158 honeymap.js:338)
(anonymous function) (VM158 honeymap.js:12)
socket.onmessage (VM158 honeymap.js:302)
REventTarget.dispatchEvent (sockjs-0.3.js:84)
SockJS._dispatchMessage (sockjs-0.3.js:1025)
SockJS._didMessage (sockjs-0.3.js:1083)
that.ws.onmessage (sockjs-0.3.js:1215)


I'm not sure why this exception is being thrown but I'm almost positive that the feeds are being created properly. This exception is also thrown every time an event comes into the geoloc.events feed.

Add support for Project Nova

https://github.com/DataSoft/Nova

I have the deploy script all set up and everything installs/runs properly, I just have no idea how to integrate hpfeeds into the whole thing. The actual honeypots in use for project nova is honeyd, however the information compiled together from Nova is more useful than the actual honeyd logs.

Anyways, this is just an idea if anyone wants to help out I can give you the deploy code I have already written.

Can't get Attacks to display

I can't seem to get the dionaea sensor to show up under attacks in the web console. I've followed all of the troubleshooting steps. Port 10000 seems to be open, displays banner in netcat, and I can see the traffic in tcpdump on both the server and sensor. hpfeeds-broker.err last entries are:

INFO:root:Database ready.
INFO:root:Auth success by .
INFO:root:Auth success by honeymap.
INFO:root:Auth success by .
INFO:root:Auth success by collector.
INFO:root:Auth success by geoloc.
INFO:root:Auth success by mnemosyne.

I turned DEBUG on in the /opt/mhn/server/config.py and restarted but still just that.

I have 80/tcp, 8181/tcp, 3000/tcp, 10000/tcp open from sensor to server, and all tcp and udp the other way. I tried opening everything from sensor to server also, just in case, but no effect.

What else can I do?

MHN Server Website interface only map

Hi,
I was trying to install mhn in a Xubuntu 14.04 64 bits. I run all the scripts and everything was installed correctly.

But when I access to website I only can see the map. The top banner with settings and login does not appear. Any idea about that?, I tried access from different browsers and it´s the same.

All the services are running:
geoloc RUNNING pid 35687, uptime 0:43:18
honeymap RUNNING pid 35688, uptime 0:43:18
hpfeeds-broker RUNNING pid 15643, uptime 0:51:13
mhn-celery-beat RUNNING pid 38140, uptime 0:03:08
mhn-celery-worker RUNNING pid 38141, uptime 0:03:07
mhn-collector RUNNING pid 38142, uptime 0:03:07
mhn-uwsgi RUNNING pid 38147, uptime 0:03:07
mnemosyne RUNNING pid 33769, uptime 0:46:49

Thanks for all and the incredible project

Need to disable a rule, impossible to find it

This is a DHCP broadcast from nodes on the same subnet... Snort is interpreting it as an attack. We'd like to disable this rule, but we can't find it in the interface. Is there an easy way to find this rule?

2014-09-09T08:08:48.726006  fc0446ee-1c0e-11e4-aa64-00163eec95e2    0.0.0.0 67  2   Potentially Bad Traffic BAD-TRAFFIC same SRC/DST

Add support for Ansible playbook deployment of "sensors"

"Ansible is an open-source software platform for configuring and managing computers. It combines multi-node software deployment, ad hoc task execution, and configuration management. It manages nodes over SSH and does not require any additional remote software (except Python 2.4 or later)[2] to be installed on them"
-- http://en.wikipedia.org/wiki/Ansible_(software)

It would be great to have the ability to add sensors with Ansible instead of the actual script.

I can help if needed.

Shockpot Socket Error

The default shockpot.conf file starts it up on port 80 but port 80 will be in-use already for the mhn interface. This casues shockpot to throw a "socket.error: [Errno 98] Address already in use". Is this a bug in the installation or somehow the way I have installed mhn+shockpot? I will test on a fresh system when I have time

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.