Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add script for detecting Kippo SSH Honeypots #780

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions scripts/kippo-ssh-honeypot.nse
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
local shortport = require "shortport"
local comm = require "comm"
local string = require "string"
local nmap = require "nmap"

description = [[Kippo is a medium-interaction SSH honeypot written in Python.
It is used to log brute force attacks and the entire shell interaction
performed by an attacker.
]]

-- References:
-- https://x42.obscurechannel.com/?p=11


author = "Dylan Webb, Fabrizio Siciliano"
license = "Same as Nmap--See https://nmap.org/book/man-legal.html"
categories = {"discovery", "version"}

portrule = shortport.port_or_service(22, "ssh")

action = function(host, port)

local try = nmap.new_try()
local response = try(comm.exchange(host,port, "/\r\n\r\n\r\n\r\n\r\n\r\n\r\n", {lines = 100, proto = port.protocol,timeout=5000}))
local unpatched = string.find(response,"bad packet length")

if (unpatched) then
return ("HONEYPOT DETECTED\r\nAppears to be a Kippo SSH Honeypot.")
end
end