forked from digininja/pipal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a splitter to work with the default Kippo log files and in doing
that fixed a small bug in the username splitter
- Loading branch information
Showing
3 changed files
with
38 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Split the line on a pipe with the format | ||
# password|username | ||
# | ||
# To use this script sym link it to | ||
# custom_splitter.rb in the main Pipal directory | ||
|
||
class Custom_word_splitter | ||
def self.split (line) | ||
begin | ||
|
||
# 2014-07-31 15:37:17+0100 [SSHService ssh-userauth on HoneyPotTransport,1,2.123.133.112] login attempt [root/root] failed | ||
if line =~ /^.*login attempt \[([^\]]*)\].*$/ | ||
creds = $1 | ||
# Treat everything up to the first / as username and | ||
# everything after as password. | ||
# A username could have a / in it but unlikely | ||
if creds =~ /^([^\/]*)\/(.*)$/ | ||
username = $1 | ||
password = $2 | ||
return [password, {"username" => username}] | ||
end | ||
end | ||
|
||
return [nil, {}] | ||
rescue | ||
return [nil, {}] | ||
end | ||
end | ||
end |