SSH入侵者密码转为文本

pshitt的Python项目详细描述


简介

pshitt(用于将SSH入侵者的密码转换为文本)是一个轻量级的 设计用于收集入侵者发送的身份验证数据的伪造SSH服务器。 它主要收集SSH bruteforce软件使用的用户名和密码 并将提取的数据写入JSON格式的文件中。在

pshitt是用Python编写的,并使用paramiko实现SSH层。在

运行pshitt

进入源目录并运行

./pshitt -o passwords.json

这将运行一个监听端口2200的伪SSH服务器来捕获身份验证 入侵者发送的数据。有关SSH连接尝试的信息将是 以JSON格式存储在passwords.json

^{pr2}$

通过'-h'选项提供完整选项

usage: pshitt [-h] [-o OUTPUT] [-k KEY] [-l LOG] [-p PORT] [-t THREADS] [-v]
              [-D]

Passwords of SSH Intruders Transferred to Text

optional arguments:
  -h, --help            show this help message and exit
  -o OUTPUT, --output OUTPUT
                        File to export collected data
  -k KEY, --key KEY     Host RSA key
  -l LOG, --log LOG     File to log info and debug
  -p PORT, --port PORT  TCP port to listen to
  -t THREADS, --threads THREADS
                        Maximum number of client threads
  -v, --verbose         Show verbose output, use multiple times increase
                        verbosity
  -D, --daemon          Run as unix daemon

使用pshitt数据

由于格式是JSON,所以很容易在数据分析中使用数据 Splunk或Logstash等软件。在

下面是logstash的配置示例

input {
   file {
      path => [ "/var/log/pshitt.log" ]
      codec =>   json
      type => "json-log"
   }
}

filter {
    # warn logstash that timestamp is the one to use
    if [type] == "json-log" {
        date {
            match => [ "timestamp", "ISO8601" ]
        }
    }

    # optional but geoip is interesting
    if [src_ip]  {
        geoip {
            source => "src_ip"
            target => "geoip"
            add_field => [ "[geoip][coordinates]", "%{[geoip][longitude]}" ]
            add_field => [ "[geoip][coordinates]", "%{[geoip][latitude]}"  ]
        }
        mutate {
            convert => [ "[geoip][coordinates]", "float" ]
        }
    }
}

output {
  elasticsearch {
       host => "localhost"
  }
}

基本上,只要提到pshitt.log文件是 使用JSON格式。在

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java两个构造函数?   java for(inti:x)做什么?   java如何将一个bean的构造函数参数传递给嵌套bean   java从易趣链接提取项目ID   java多线程BufferedReader   安卓全新应用程序在R.java中抛出“语法错误,插入“}”以完成类体”   java Spring启动依赖注入请求范围的bean   java给定的时间,然后约定和异常处理。和莫基托和朱尼特在一起   与Android Studio的java Oracle数据库连接   在web服务器(Heroku)上承载可运行jar文件(Discord bot)的java   java如何每隔n秒在imageview中更改图像   java不理解“volatile”关键字   java使用JPA编写自定义SQL查询   java如何使用filechannel作为参数来编写对象