返回文章列表文章索引阅读全文
STARBLOG / 阅读手记
Linux

Deploy an SSH honeypot for fun, which can both enhance security and serve as an electronic cricket.

Deploy SSH honeypot? Change the port, install fakessh to freeload off password dictionaries, use sshesame as a digital cricket to log operations. Typora plugin updates are a hassle; real skill is in security testing.

曦远 (DealiAxy)约 8 分钟
目录6 个章节

Preface

Recently, an SSL certificate on an old server of mine expired. Applying for SSL certificates every time is too much hassle, so I directly deployed the Swag solution onto it.

Then I noticed this server had some security oversights, so I reinforced it. For the SSH part, I recalled a honeypot I had used before, which is perfect to deploy for some practice.

Modify SSH Server Port

The default SSH port is 22. First, modify the original SSH port to free up port 22 for honeypot use.

sudo nano /etc/ssh/sshd_config

Modify the following line:

#Port 22

Remove the comment and change it to your desired port number.

Then restart the SSH service.

sudo systemctl restart ssh

Note: Before modifying the port, ensure you have another method (such as physical access or console access) to connect to the server in case of issues with the new port configuration.

fakessh

FakeSSH is a Docker-based honeypot SSH server written in Go. Its main function is to record login attempts; all password authentication will fail, thus not providing attackers with terminal access.

Project address: https://github.com/fffaraz/fakessh

services:
  fakessh:
    container_name: fakessh
    image: fffaraz/fakessh
    restart: always
    ports:
      - 22:22
    command: /log
    volumes:
      - ./volumes/fakessh:/log

After deployment, if someone attempts a brute-force attack, I can get a password dictionary for free~

sshesame

SSHSame is a very simple and user-friendly SSH honeypot that can be quickly set up and deployed. Its main function is to simulate a fake SSH server, allowing anyone to connect while recording their activities. SSHSame does not perform any actions on the host, such as running commands or initiating network requests, ensuring system security. By logging connections and activities (e.g., channels, requests), SSHSame provides security researchers with an excellent tool to analyze and understand SSH attack behaviors.

https://github.com/jaksi/sshesame

services:
  sshesame:
    image: ghcr.io/jaksi/sshesame
    restart: always
    ports:
      - "2022:2022"
    volumes:
      - ./sshesame-data:/data
      #- ./sshesame.yaml:/config.yaml

After deployment, I tried it out. You can log in with any username and password, but once inside the shell, any command returns "not found."

Meanwhile, the logs will output what the incoming users are doing. It's quite amusing, like an electronic cricket 😃

Additionally

I've been using Typora to write articles recently, and while browsing today, I discovered two plugins/themes that enhance the Typora editing experience. I'd like to recommend them here:

  • typora_plugin - It has a lot of features and I'm still exploring, but it feels quite useful. The only issue is that I installed Typora using scoop, and it seems the plugin needs to be reinstalled after every update.
  • VLOOK - This is purely a theme. The plugin part works after exporting HTML, similar to VuePress, and it offers many features.

References

_EOF_

Deploy an SSH honeypot for fun, which can both enhance security and serve as an electronic cricket.

本文作者:
程序设计实验室
版权声明:
本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!

相关文章

Linux编译安装Python3-6,理论上各个发行版通用

前言 最近笔者把一个django项目部署到一个新的服务器上,而这个服务器给的是CentOS6版本的系统,官方源很旧,还被运维把源搞坏了,没办法通过源安装Python3.6以及pip,所以只好用最原始的方法,编译安装! 注意 如果本机安装了python2,尽量不要管他,使用python3运行python脚本就好,因为可能有程序依赖目前的python2环境,不要动现有的python2环境! 官网下载的

2022-06-17 · Linux · 约 1 分钟

讨论

共 0 条

良言一句三冬暖,恶语伤人六月寒。

加载评论中…

Deploy an SSH honeypot for fun, which can both enhance security and serve as an electronic cricket. · StarBlog