Skip to content

Instantly share code, notes, and snippets.

@jsiwek
Created August 5, 2014 14:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jsiwek/2a7692aa9f24e197ca9c to your computer and use it in GitHub Desktop.
Save jsiwek/2a7692aa9f24e197ca9c to your computer and use it in GitHub Desktop.
ssh-login-watch.bro
@load base/frameworks/notice
@load base/protocols/ssh
module SSH;
export {
const watched_servers: set[addr] = {
192.168.1.100,
192.168.1.101,
192.168.1.102,
} &redef;
redef enum Notice::Type += {
Watched_Login
};
}
redef Notice::emailed_types += { Watched_Login };
event heuristic_successful_login(c: connection)
{
if ( c$id$resp_h in watched_servers )
NOTICE([$note=Watched_Login,
$msg=fmt("Possible SSH login to watched server: %s:%s",
c$id$resp_h, c$id$resp_p),
$conn=c]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment