A week or so ago I created a SSH tarpit in Golang -
https://github.com/bentasker/Golang-SSH-Tarpit
I've had that running on a public connection since, so it'd be interesting to analyse the logs and see what behaviour's observed.
In particular
- Do tarpitted clients all seem to have sane timeouts configured?
- What country is the worst offender?
- Any other interesting patterns?
Activity
2021-01-12 11:58:09
Extracting logs:
Log start and end date
So that's 8 days
How many entries?
So, on average, that's a rate of 1818 day / 76 hour going into the tarpit
5 shortest tarpit durations
5 longest
41456 seconds is just a little under 12 hours.
Those figures, of course, ignore any connections currently still stuck in the tarpit. Lets see how many of those there are, and when they connected
How many unique IPs are there
How many distinct
What countries?
So, Vietnam is by far the worst offender.
2021-01-12 12:14:08
We've seen that there are bots out there that don't have client-side timeouts configured, and get stuck in the tarpit for quite a while.
We've also seen that the majority of tarpitted clients geolocate to Vietnam, but - is that true for the majority of poorly configured clients?
Taking a sample of the 1000 longest tarpits.
The shortest/longest tarpit duration was
Country distribution:
Ok, what if we switch it around to be anything longer than 60s?
The share of connections from
Much the same if we adjust down to 20s
So, based on this (admittedly, relatively small) sample:
- You're most likely to see connections from Vietnam
- However, if the client is poorly configured it's statistically more likely to originate from China than Vietnam
2021-05-26 08:45:22
2021-05-26 08:45:22
2021-05-26 08:45:29