From debfb699faeff171cf03ead8b6561c9f65507f1a Mon Sep 17 00:00:00 2001 From: Michel Oosterhof Date: Sun, 13 Aug 2017 18:08:38 +0000 Subject: [PATCH] add SQL instructions --- doc/sql/README.md | 49 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 doc/sql/README.md diff --git a/doc/sql/README.md b/doc/sql/README.md new file mode 100644 index 00000000..705b9150 --- /dev/null +++ b/doc/sql/README.md @@ -0,0 +1,49 @@ +# How to send Cowrie output to MySQL database + +## Prerequisites + +* Working Cowrie installation +* Working MySQL database + +## Installation + +``` +su - cowrie +source cowrie/cowrie-env/bin/activate +pip install MySQL-python +``` + +## mySQL configuration + +First create the database and grant access to the Cowrie user account: +``` +mysql -u root -p +CREATE DATABASE cowrie; +GRANT ALL ON cowrie.* TO 'cowrie'@'localhost' IDENTIFIED BY 'PASSWORD HERE'; +FLUSH PRIVILEGES; +exit +``` + +Next load the database schema: +``` +cd /opt/cowrie/ +mysql -u cowrie -p +USE cowrie; +source ./doc/sql/mysql.sql; +exit +``` + +## cowrie configuration + +* Add the following entries to ~/cowrie/cowrie.cfg + +``` +[output_mysql] +host = localhost +database = cowrie +username = cowrie +password = PASSWORD HERE +port = 3306 +debug = false +``` +