You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+19-66Lines changed: 19 additions & 66 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,20 +2,20 @@
2
2
3
3
## DShield Raspberry Pi Sensor
4
4
5
-
This is a set of scripts to setup a Raspberry Pi as a DShield Sensor.
5
+
This is a set of scripts to set up a Raspberry Pi as a DShield Sensor.
6
6
7
7
Current design goals and prerequisites for using the automated installation procedure:
8
8
- use of a __dedicated__ device (Raspberry Pi 3 or later, n100 mini PC or a virtual machine work fine)
9
9
- minimum of 1GB of RAM and 16GB of Disk (SD Card for Raspberry Pis). 4GB of RAM works better. Larger SD Cards (e.g. 64 GB) are recommended for longevity and to prevent logs from filling up the disk.
10
10
- current Raspberry Pi OS ("Lite" version will suffice) or current version of Ubuntu Linux
11
-
- easy installation / configuration (and therefore not that much configurable)
12
-
- disposable (when something breaks (e.g. during upgrade): re-install from scratch)
13
-
- minimize complexity and overhead (e.g. no virtualization like docker)
11
+
- easy installation/configuration (and therefore not that configurable)
12
+
- disposable (when something breaks (e.g., during upgrade): re-install from scratch)
13
+
- minimize complexity and overhead (e.g., no virtualization like Docker)
14
14
- support for IPv4 only (for the internal net)
15
-
- one interface only (e.g. eth0)
15
+
- one interface only (e.g,. eth0)
16
16
17
17
The current version is only tested on Raspberry Pi OS and Ubuntu 22.04 LTS Server, not on other distros, sorry.
18
-
If there is the need for other distros, "someone" has to check and maintain the installation script.
18
+
If there is a need for other distros, "someone" has to check and maintain the installation script.
19
19
20
20
## Installation
21
21
@@ -29,17 +29,18 @@ Reference the following files for OS-specific installation instructions:
29
29
30
30
This script will:
31
31
32
-
- disable IPv6 on the Pi
33
-
- enable firewall logging and submitting of logs to DShield
34
-
- change your ssh server to listen on port 12222
35
-
- install the ssh honeypot cowrie (for ssh)
36
-
- install needed environment (e.g. MySQL server, Python packages, ...)
32
+
- Disable IPv6 on the Pi
33
+
- enable firewall logging and submission of logs to DShield
34
+
- Change your SSH server to listen on port 12222
35
+
- install the SSH honeypot Cowrie (for SSH)
36
+
- install the HTTP honeypot ("isc_agent")
37
+
- install needed environment (Python packages, stunnel for https, ...)
37
38
38
39
## Troubleshooting
39
40
40
-
-logs are sent twice an hour to the [dshield portal](https://www.dshield.org) by the cron job `/etc/cron.d/dshield`, this can be verified by ['My Account' -> 'My Reports'](https://www.dshield.org/myreports.html)
41
-
-have a look at the output from the status script: `/home/pi/install/dshield/bin/status.sh`
42
-
-if you get strange python / pip errors during installation / updates you may try the following commands as root:
41
+
-Logs are sent twice an hour to the [dshield portal](https://www.dshield.org) by the cron job `/etc/cron.d/dshield`, this can be verified by ['My Account' -> 'My Reports'](https://www.dshield.org/myreports.html)
42
+
-Have a look at the output from the status script: `/srv/dshield/status.sh`
43
+
-If you get strange Python or pip-related errors during installation or during updates, try the following commands as root:
- Check our [Trouble Shooting Guide](https://github.com/DShield-ISC/dshield/blob/main/docs/general-guides/Troubleshooting.md) for help identifying issues.
@@ -60,56 +61,8 @@ Configuration parameters like your API Key will be retained. To edit the configu
60
61
61
62
A new feature has been introduced, especially for automatic updates. At the end of the installation the install.sh script will search for the file /root/bin/postinstall.sh and execute its content, if it exists. If you need some extra changes in the newly installed files, this is the location to put them. This file NEEDS execute rights.
62
63
63
-
Please make sure to keep special port and network configuration up to date (e.g. manually configure recently added telnet / web ports in firewall config), e.g. no-log config, no-honey config, ... unfortunately this can't be done automagically as of now. If unsure delete respective lines in `/etc/dshield.ini` and re-run the installation script.
64
+
Please make sure to keep special port and network configuration up to date (e.g., manually configure recently added telnet / web ports in firewall config), e.g., no-log config, no-honey config, ... unfortunately, this can't be done automagically as of now. If unsure, delete respective lines in `/etc/dshield.ini` and re-run the installation script.
64
65
65
-
Testing of update procedure is normally done (between two releases) as follows:
66
-
- update on Pi 3 from the last version to current
67
-
- install on a current clean image of raspbian lite on a Pi 3
68
-
69
-
### Special Update Note: Versions < 0.4 to >= 0.4
70
-
71
-
The handling of Python packages had to be changed from distro package manager to pip. This means the update is pain. Sorry for that.
72
-
73
-
You have three alternatives:
74
-
75
-
#### Easy
76
-
77
-
The easiest, preferred and warmly recommended way: backup old installation (if you can't stand a complete loss), reinstall from scratch using current Raspbian image.
78
-
79
-
#### Manual
80
-
81
-
The manual procedure: uninstall all below mentioned packages and then autoremove and cross fingers:
82
-
```
83
-
sudo su -
84
-
/etc/init.d/cowrie stop
85
-
dpkg --remove python-crypto
86
-
dpkg --remove python-gmpy
87
-
dpkg --remove python-gmpy2
88
-
dpkg --remove python-mysqldb
89
-
dpkg --remove python-pip
90
-
dpkg --remove python-pyasn1
91
-
dpkg --remove python-twisted
92
-
dpkg --remove python-virtualenv
93
-
dpkg --remove python-zope.interface
94
-
apt-get autoremove
95
-
apt-get update
96
-
apt-get dist-upgrade
97
-
```
98
-
99
-
#### Automatic
100
-
101
-
The "automatic" **brutal** procedure (chances to break your system are **VERY** high, but hey, it's a disposable honeypot anyway ...): backup (if needed), uninstall all Python distro packages (and hope that's it):
102
-
```
103
-
sudo su -
104
-
/etc/init.d/cowrie stop
105
-
for PKG in `dpkg --list | grep python- | cut -d " " -f 3 | grep "^python"` ; do echo "uninstalling ${PKG}"; dpkg --force-depends --purge ${PKG}; done
106
-
apt-get update
107
-
apt-get -f install
108
-
apt-get dist-upgrade
109
-
apt-get autoremove
110
-
apt-get update
111
-
apt-get dist-upgrade
112
-
```
113
66
114
67
## Hints
115
68
@@ -133,14 +86,14 @@ To test your set up you may use a public port scanner and point it to the router
133
86
- ESC: exit the form (Cancel)
134
87
- cursor up / down: navigate through form / between input fields
135
88
- cursor left / right: navigate within an input field
136
-
- TAB: switch between input field and "buttons"
89
+
- TAB: switch between the input fields and "buttons"
137
90
- don't use Pos 1 / End
138
91
139
-
## Todos
92
+
## TODOs
140
93
141
94
- see comments in `install.sh`
142
95
- provide a script to update all Python packages to most recent version using pip
143
-
-configure a default web server and submit logs to DShield
96
+
-Configure a default web server and submit logs to DShield
144
97
- enable other honeypot ports than ssh
145
98
- do all the user input stuff at the beginning of the script so it will run the long lasting stuff afterwards
0 commit comments