Skip to content

Commit fda4154

Browse files
authored
Merge pull request #22 from SimonCahill/feat/fix-connection-statistics-bug
Fixed connection statistics bug
2 parents ba78ae7 + 76d3f90 commit fda4154

File tree

4 files changed

+158
-49
lines changed

4 files changed

+158
-49
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 3.10)
22

3-
project(endlessh-report VERSION 1.2.1 LANGUAGES CXX DESCRIPTION "A simple report generator for endlessh tarpits.")
3+
project(endlessh-report VERSION 1.2.2 LANGUAGES CXX DESCRIPTION "A simple report generator for endlessh tarpits.")
44
set(PROJECT_LONG_NAME "Endlessh Report Generator")
55
set(CMAKE_CXX_STANDARD 17)
66
set(CMAKE_CXX_STANDARD_REQUIRED True)

Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ HTML_FILE_EXTENSION = .html
209209
HTML_HEADER =
210210
HTML_FOOTER =
211211
HTML_STYLESHEET =
212-
HTML_EXTRA_STYLESHEET = doxygen-awesome-css/doxygen-awesome.css
212+
HTML_EXTRA_STYLESHEET = submodules/doxygen-awesome-css/doxygen-awesome.css
213213
HTML_EXTRA_FILES =
214214
HTML_COLORSTYLE_HUE = 220
215215
HTML_COLORSTYLE_SAT = 100

README.md

Lines changed: 127 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -55,20 +55,26 @@ endlessh-report
5555
## Arguments
5656

5757
```
58-
Usage: ./endlessh-report
59-
Usage: ./endlessh-report [options]
60-
Usage: cat file | ./endlessh-report--stdin
58+
endlessh-report v1.2.1 - A simple report generator for endlessh tarpits.
59+
60+
Usage:
61+
endlessh-report
62+
endlessh-report [options]
63+
endlessh-report --syslog/var/log/syslog.1
64+
cat <file> | endlessh-report --stdin
6165
6266
Switches:
63-
--no-ip-stats, -i Don't print IP statistics
64-
--no-cn-stats, -c Don't print connection statistics
65-
--stdin Read logs from stdin
66-
--abuse-ipdb, -a Enable AbuseIPDB-compatible CSV output
67-
--no-ad, -n No advertising please!
68-
--detailed, -d Provide detailed information.
69-
--help, -h Prints this message and exits
67+
--no-ip-stats, -i Don't print IP statistics
68+
--no-cn-stats, -c Don't print connection statistics
69+
--stdin, -s Read logs from stdin
70+
--abuse-ipdb, -a Enable AbuseIPDB-compatible CSV output
71+
--no-ad, -n No advertising please!
72+
--detailed, -d Provide detailed information
73+
--help, -h Show this text and exit
74+
--version, -v Display version information and exit
75+
7076
Arguments:
71-
--syslog </path/to> Override default syslog path (/var/log/syslog)
77+
--syslog [f], -S[f] Override syslog/endlessh log location
7278
```
7379

7480
## Output
@@ -89,15 +95,15 @@ Because I wrote this program for my own use on my servers, I developed it for us
8995
# Connection Statistics
9096
| Total Unique IPs | Total Accepted Connections | Total Closed Connections | Total Alive Connections |
9197
|------------------|----------------------------|--------------------------|-------------------------|
92-
| 178 | 0 | 0 | 0 |
98+
| 372 | 7843 | 7894 | 51 |
9399
```
94100

95101
Resulting in:
96102

97103
# Connection Statistics
98104
| Total Unique IPs | Total Accepted Connections | Total Closed Connections | Total Alive Connections |
99105
|------------------|----------------------------|--------------------------|-------------------------|
100-
| 178 | 0 | 0 | 0 |
106+
| 372 | 7843 | 7894 | 51 |
101107

102108
`endlessh-report -c` generates the following output:
103109
(truncated for readability)
@@ -108,11 +114,24 @@ Resulting in:
108114
# Statistics per IP
109115
| Host | Accepted | Closed |
110116
|------------------------|----------|--------|
111-
| ::ffff:112.85.42.229 | 21 | 21 |
112-
| ::ffff:112.85.42.87 | 4 | 4 |
113-
| ::ffff:112.85.42.88 | 14 | 14 |
114-
| ::ffff:122.194.229.40 | 20 | 20 |
115-
| ::ffff:122.194.229.45 | 19 | 19 |
117+
| 218.92.0.200 | 1736 | 1736 |
118+
| 218.92.0.208 | 2176 | 2226 |
119+
| 218.92.0.221 | 33 | 33 |
120+
| 219.255.1.177 | 1 | 1 |
121+
| 220.135.2.173 | 1 | 1 |
122+
| 220.83.201.167 | 1 | 1 |
123+
| 221.131.34.170 | 1 | 1 |
124+
| 221.154.190.9 | 1 | 1 |
125+
| 222.252.20.109 | 1 | 1 |
126+
| 222.64.180.116 | 1 | 1 |
127+
| 223.171.91.191 | 7 | 7 |
128+
| 223.84.249.154 | 1 | 1 |
129+
| 27.74.253.80 | 1 | 1 |
130+
| 3.6.86.93 | 41 | 41 |
131+
| 31.222.238.213 | 1 | 1 |
132+
| 31.24.10.71 | 1 | 1 |
133+
| 34.105.187.71 | 15 | 15 |
134+
| 34.133.201.109 | 20 | 20 |
116135
```
117136

118137
Resulting in:
@@ -121,11 +140,24 @@ Resulting in:
121140
# Statistics per IP
122141
| Host | Accepted | Closed |
123142
|------------------------|----------|--------|
124-
| ::ffff:112.85.42.229 | 21 | 21 |
125-
| ::ffff:112.85.42.87 | 4 | 4 |
126-
| ::ffff:112.85.42.88 | 14 | 14 |
127-
| ::ffff:122.194.229.40 | 20 | 20 |
128-
| ::ffff:122.194.229.45 | 19 | 19 |
143+
| 218.92.0.200 | 1736 | 1736 |
144+
| 218.92.0.208 | 2176 | 2226 |
145+
| 218.92.0.221 | 33 | 33 |
146+
| 219.255.1.177 | 1 | 1 |
147+
| 220.135.2.173 | 1 | 1 |
148+
| 220.83.201.167 | 1 | 1 |
149+
| 221.131.34.170 | 1 | 1 |
150+
| 221.154.190.9 | 1 | 1 |
151+
| 222.252.20.109 | 1 | 1 |
152+
| 222.64.180.116 | 1 | 1 |
153+
| 223.171.91.191 | 7 | 7 |
154+
| 223.84.249.154 | 1 | 1 |
155+
| 27.74.253.80 | 1 | 1 |
156+
| 3.6.86.93 | 41 | 41 |
157+
| 31.222.238.213 | 1 | 1 |
158+
| 31.24.10.71 | 1 | 1 |
159+
| 34.105.187.71 | 15 | 15 |
160+
| 34.133.201.109 | 20 | 20 |
129161

130162
# Detailed Statistics
131163
Since version v1.1.0 endlessh-report now allows for more detailed reports to be generated.
@@ -139,34 +171,88 @@ Examples are:
139171
# Statistics per IP
140172
| Host | Accepted | Closed | Total Time (s) | Total Bytes |
141173
|------------------------|----------|--------|----------------|-------------|
142-
| 218.92.0.206 | 3552 | 3547 | 2202334.810000 | 262224KiB |
143-
| 61.177.172.108 | 8 | 8 | 5282.840000 | 653KiB |
144-
| 61.177.173.46 | 8 | 8 | 7328.230000 | 909KiB |
174+
| 218.92.0.208 | 2176 | 2226 | 64d 15h 33m 56s| 685.00MiB |
175+
| 179.60.147.99 | 534 | 534 | 2h 52m 10s | 1.00MiB |
176+
| 61.177.173.49 | 62 | 62 | 1d 12h 1m 18s | 15.00MiB |
177+
| 218.92.0.221 | 33 | 33 | 8h 39m 45s | 3.00MiB |
178+
| 61.177.172.98 | 48 | 48 | 19h 38m 37s | 8.00MiB |
179+
| 61.177.173.47 | 56 | 56 | 1d 16h 44m 50s | 17.00MiB |
180+
| 210.97.53.178 | 2 | 2 | 6s | 333B |
181+
| 61.177.173.48 | 31 | 31 | 55m 10s | 298.00KiB |
182+
| 61.177.173.53 | 72 | 72 | 2d 6h 20m 48s | 24.00MiB |
183+
| 61.177.173.39 | 53 | 53 | 1d 13h 17m 29s | 16.00MiB |
184+
| 61.177.172.108 | 45 | 45 | 8h 4m 45s | 3.00MiB |
185+
| 61.177.173.52 | 39 | 39 | 8h 28m 24s | 3.00MiB |
186+
| 61.177.172.104 | 35 | 35 | 13h 28m 37s | 5.00MiB |
187+
| 61.177.172.19 | 48 | 48 | 23h 57m 54s | 10.00MiB |
188+
| 61.177.173.51 | 55 | 55 | 4d 6h 59m 36s | 45.00MiB |
189+
| 61.177.173.50 | 67 | 67 | 4d 9h 26s | 46.00MiB |
190+
| 61.177.172.90 | 53 | 53 | 1d 2h 14m 29s | 11.00MiB |
191+
| 61.177.173.46 | 56 | 56 | 4d 14h 44m 33s | 48.00MiB |
192+
| 61.177.172.124 | 38 | 38 | 1d 2h 57s | 11.00MiB |
193+
| 61.177.173.36 | 49 | 49 | 2d 1h 8m 47s | 21.00MiB |
194+
| 185.196.220.32 | 15 | 15 | 52s | 5.00KiB |
195+
| 141.98.10.154 | 49 | 49 | 2m 56s | 16.00KiB |
196+
| 61.177.173.35 | 45 | 45 | 1d 5h 21m 34s | 12.00MiB |
197+
| 64.62.197.197 | 2 | 2 | 8s | 668B |
145198
```
146199

200+
Resulting in:
201+
202+
### Statistics per IP
203+
| Host | Accepted | Closed | Total Time (s) | Total Bytes |
204+
|------------------------|----------|--------|----------------|-------------|
205+
| 218.92.0.208 | 2176 | 2226 | 64d 15h 33m 56s| 685.00MiB |
206+
| 179.60.147.99 | 534 | 534 | 2h 52m 10s | 1.00MiB |
207+
| 61.177.173.49 | 62 | 62 | 1d 12h 1m 18s | 15.00MiB |
208+
| 218.92.0.221 | 33 | 33 | 8h 39m 45s | 3.00MiB |
209+
| 61.177.172.98 | 48 | 48 | 19h 38m 37s | 8.00MiB |
210+
| 61.177.173.47 | 56 | 56 | 1d 16h 44m 50s | 17.00MiB |
211+
| 210.97.53.178 | 2 | 2 | 6s | 333B |
212+
| 61.177.173.48 | 31 | 31 | 55m 10s | 298.00KiB |
213+
| 61.177.173.53 | 72 | 72 | 2d 6h 20m 48s | 24.00MiB |
214+
| 61.177.173.39 | 53 | 53 | 1d 13h 17m 29s | 16.00MiB |
215+
| 61.177.172.108 | 45 | 45 | 8h 4m 45s | 3.00MiB |
216+
| 61.177.173.52 | 39 | 39 | 8h 28m 24s | 3.00MiB |
217+
| 61.177.172.104 | 35 | 35 | 13h 28m 37s | 5.00MiB |
218+
| 61.177.172.19 | 48 | 48 | 23h 57m 54s | 10.00MiB |
219+
| 61.177.173.51 | 55 | 55 | 4d 6h 59m 36s | 45.00MiB |
220+
| 61.177.173.50 | 67 | 67 | 4d 9h 26s | 46.00MiB |
221+
| 61.177.172.90 | 53 | 53 | 1d 2h 14m 29s | 11.00MiB |
222+
| 61.177.173.46 | 56 | 56 | 4d 14h 44m 33s | 48.00MiB |
223+
| 61.177.172.124 | 38 | 38 | 1d 2h 57s | 11.00MiB |
224+
| 61.177.173.36 | 49 | 49 | 2d 1h 8m 47s | 21.00MiB |
225+
| 185.196.220.32 | 15 | 15 | 52s | 5.00KiB |
226+
| 141.98.10.154 | 49 | 49 | 2m 56s | 16.00KiB |
227+
| 61.177.173.35 | 45 | 45 | 1d 5h 21m 34s | 12.00MiB |
228+
| 64.62.197.197 | 2 | 2 | 8s | 668B |
229+
147230
## Detailed Connection Statistics
148231
```markdown
149232
# Connection Statistics
150233
| Total Unique IPs | Total Accepted Connections | Total Closed Connections | Total Alive Connections | Total Bot Time Wasted | Total Bytes Sent |
151234
|------------------|----------------------------|--------------------------|-------------------------|-----------------------|------------------|
152-
| 99 | 0 | 0 | 0 | 4743646.220000 | 595462069 |
235+
| 372 | 7843 | 7895 | 52 | 180d 35m 12s | 1893.00MiB |
153236
```
154237

238+
Resulting in:
239+
240+
### Connection Statistics
241+
| Total Unique IPs | Total Accepted Connections | Total Closed Connections | Total Alive Connections | Total Bot Time Wasted | Total Bytes Sent |
242+
|------------------|----------------------------|--------------------------|-------------------------|-----------------------|------------------|
243+
| 372 | 7843 | 7895 | 52 | 180d 35m 12s | 1893.00MiB |
244+
155245
## Detailed AbuseIPDB CSV format
156246
```csv
157247
IP,Categories,ReportDate,Comment
158-
218.92.0.206,"18,14,22,15",2022-06-14T21:40:58Z,"218.92.0.206 fell into Endlessh tarpit; opened 3561, closed 3569 connections. Total time wasted: 2.21585e+06s. Total bytes sent by tarpit: 269973303B (Report generated by Endlessh Report Generator)"
159-
61.177.172.108,"18,14,22,15",2022-06-14T21:40:58Z,"61.177.172.108 fell into Endlessh tarpit; opened 8, closed 8 connections. Total time wasted: 5282.83s. Total bytes sent by tarpit: 669662B (Report generated by Endlessh Report Generator)"
160-
61.177.173.46,"18,14,22,15",2022-06-14T21:40:58Z,"61.177.173.46 fell into Endlessh tarpit; opened 8, closed 8 connections. Total time wasted: 7328.23s. Total bytes sent by tarpit: 931388B (Report generated by Endlessh Report Generator)"
161-
136.144.41.181,"18,14,22,15",2022-06-14T21:40:58Z,"136.144.41.181 fell into Endlessh tarpit; opened 1, closed 1 connections. Total time wasted: 116.022s. Total bytes sent by tarpit: 13799B (Report generated by Endlessh Report Generator)"
162-
61.177.173.50,"18,14,22,15",2022-06-14T21:40:58Z,"61.177.173.50 fell into Endlessh tarpit; opened 12, closed 12 connections. Total time wasted: 9732.31s. Total bytes sent by tarpit: 1255507B (Report generated by Endlessh Report Generator)"
163-
45.61.188.110,"18,14,22,15",2022-06-14T21:40:58Z,"45.61.188.110 fell into Endlessh tarpit; opened 5, closed 5 connections. Total time wasted: 15.004s. Total bytes sent by tarpit: 1154B (Report generated by Endlessh Report Generator)"
164-
61.177.173.35,"18,14,22,15",2022-06-14T21:40:58Z,"61.177.173.35 fell into Endlessh tarpit; opened 10, closed 10 connections. Total time wasted: 6529.89s. Total bytes sent by tarpit: 831889B (Report generated by Endlessh Report Generator)"
165-
61.177.172.98,"18,14,22,15",2022-06-14T21:40:58Z,"61.177.172.98 fell into Endlessh tarpit; opened 9, closed 9 connections. Total time wasted: 4610.36s. Total bytes sent by tarpit: 592071B (Report generated by Endlessh Report Generator)"
166-
223.71.167.164,"18,14,22,15",2022-06-14T21:40:58Z,"223.71.167.164 fell into Endlessh tarpit; opened 3, closed 3 connections. Total time wasted: 8.001s. Total bytes sent by tarpit: 598B (Report generated by Endlessh Report Generator)"
167-
45.61.185.160,"18,14,22,15",2022-06-14T21:40:58Z,"45.61.185.160 fell into Endlessh tarpit; opened 3, closed 3 connections. Total time wasted: 9.004s. Total bytes sent by tarpit: 955B (Report generated by Endlessh Report Generator)"
168-
78.142.18.204,"18,14,22,15",2022-06-14T21:40:58Z,"78.142.18.204 fell into Endlessh tarpit; opened 28, closed 28 connections. Total time wasted: 103.027s. Total bytes sent by tarpit: 9708B (Report generated by Endlessh Report Generator)"
169-
61.177.173.51,"18,14,22,15",2022-06-14T21:40:58Z,"61.177.173.51 fell into Endlessh tarpit; opened 7, closed 7 connections. Total time wasted: 3609.56s. Total bytes sent by tarpit: 463135B (Report generated by Endlessh Report Generator)"
170-
67.207.83.91,"18,14,22,15",2022-06-14T21:40:58Z,"67.207.83.91 fell into Endlessh tarpit; opened 1, closed 1 connections. Total time wasted: 6.002s. Total bytes sent by tarpit: 644B (Report generated by Endlessh Report Generator)"
171-
45.61.184.111,"18,14,22,15",2022-06-14T21:40:58Z,"45.61.184.111 fell into Endlessh tarpit; opened 7, closed 7 connections. Total time wasted: 21.004s. Total bytes sent by tarpit: 2096B (Report generated by Endlessh Report Generator)"
248+
218.92.0.208,"18,14,22,15",2022-10-15T22:43:11Z,"218.92.0.208 fell into Endlessh tarpit; 50/2276 total connections are currently still open. Total time wasted: 64d 15h 33m 56s. Total bytes sent by tarpit: 685.00MiB. Report generated by Endlessh Report Generator v1.2.1"
249+
179.60.147.99,"18,14,22,15",2022-10-15T22:43:11Z,"179.60.147.99 fell into Endlessh tarpit; 0/534 total connections are currently still open. Total time wasted: 2h 52m 10s. Total bytes sent by tarpit: 1.00MiB. Report generated by Endlessh Report Generator v1.2.1"
250+
61.177.173.49,"18,14,22,15",2022-10-15T22:43:11Z,"61.177.173.49 fell into Endlessh tarpit; 0/62 total connections are currently still open. Total time wasted: 1d 12h 1m 18s. Total bytes sent by tarpit: 15.00MiB. Report generated by Endlessh Report Generator v1.2.1"
251+
218.92.0.221,"18,14,22,15",2022-10-15T22:43:11Z,"218.92.0.221 fell into Endlessh tarpit; 0/33 total connections are currently still open. Total time wasted: 8h 39m 45s. Total bytes sent by tarpit: 3.00MiB. Report generated by Endlessh Report Generator v1.2.1"
252+
61.177.172.98,"18,14,22,15",2022-10-15T22:43:11Z,"61.177.172.98 fell into Endlessh tarpit; 0/48 total connections are currently still open. Total time wasted: 19h 38m 37s. Total bytes sent by tarpit: 8.00MiB. Report generated by Endlessh Report Generator v1.2.1"
253+
61.177.173.47,"18,14,22,15",2022-10-15T22:43:11Z,"61.177.173.47 fell into Endlessh tarpit; 0/56 total connections are currently still open. Total time wasted: 1d 16h 44m 50s. Total bytes sent by tarpit: 17.00MiB. Report generated by Endlessh Report Generator v1.2.1"
254+
210.97.53.178,"18,14,22,15",2022-10-15T22:43:11Z,"210.97.53.178 fell into Endlessh tarpit; 0/2 total connections are currently still open. Total time wasted: 6s. Total bytes sent by tarpit: 333B. Report generated by Endlessh Report Generator v1.2.1"
255+
61.177.173.48,"18,14,22,15",2022-10-15T22:43:11Z,"61.177.173.48 fell into Endlessh tarpit; 0/31 total connections are currently still open. Total time wasted: 55m 10s. Total bytes sent by tarpit: 298.00KiB. Report generated by Endlessh Report Generator v1.2.1"
256+
61.177.173.53,"18,14,22,15",2022-10-15T22:43:11Z,"61.177.173.53 fell into Endlessh tarpit; 0/72 total connections are currently still open. Total time wasted: 2d 6h 20m 48s. Total bytes sent by tarpit: 24.00MiB. Report generated by Endlessh Report Generator v1.2.1"
257+
45.141.84.126,"18,14,22,15",2022-10-15T22:43:11Z,"45.141.84.126 fell into Endlessh tarpit; 2/13 total connections are currently still open. Total time wasted: 10d 4h 5m 29s. Total bytes sent by tarpit: 107.00MiB. Report generated by Endlessh Report Generator v1.2.1"
172258
```

0 commit comments

Comments
 (0)