honeycomb 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,78 @@
1
+ # honeycomb - Tool to manage and analyze data from the Dionaea Honeypot
2
+ # Project
3
+ # Josh Grunzweig
4
+ # Copyright (C) 2011 Trustwave Holdings
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify it
7
+ # under the terms of the GNU General Public License as published by the
8
+ # Free Software Foundation, either version 3 of the License, or (at your
9
+ # option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful, but
12
+ # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13
+ # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14
+ # for more details.
15
+ #
16
+ # You should have received a copy of the GNU General Public License along
17
+ # with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ #
19
+
20
+ require 'dm-core'
21
+ require 'dm-types'
22
+ require 'dm-transactions'
23
+ require 'dm-validations'
24
+ require 'dm-serializer'
25
+ require 'dm-timestamps'
26
+
27
+ require 'honeycomb/model'
28
+ require 'honeycomb/environment'
29
+
30
+ module Honeycomb
31
+
32
+ module Model
33
+ module FixtureTable
34
+ def fixture_table?
35
+ true
36
+ end
37
+ end
38
+
39
+ require 'honeycomb/model/connections'
40
+ require 'honeycomb/model/logins'
41
+ require 'honeycomb/model/dcerpcbinds'
42
+ require 'honeycomb/model/dcerpcrequests'
43
+ require 'honeycomb/model/dcerpcserviceops'
44
+ require 'honeycomb/model/dcerpcservices'
45
+ require 'honeycomb/model/downloads'
46
+ require 'honeycomb/model/emu_profiles'
47
+ require 'honeycomb/model/emu_services'
48
+ require 'honeycomb/model/mssql_commands'
49
+ require 'honeycomb/model/mssql_fingerprints'
50
+ require 'honeycomb/model/offers'
51
+ require 'honeycomb/model/p0fs'
52
+ require 'honeycomb/model/resolves'
53
+ require 'honeycomb/model/virustotals'
54
+ require 'honeycomb/model/virustotalscans'
55
+
56
+ # TODO: Comment
57
+ def self.all_databases(dir = Pathname.new(__FILE__).dirname.dirname.dirname.expand_path.join('data').join('logsql/').to_s)
58
+ ret = Dir.entries(dir)
59
+ ret.delete_if {|x| x =~ /^\./}
60
+ ret
61
+ end
62
+
63
+ # Sets up the model using with the currently configured db_conn
64
+ # configuration.
65
+ def self.setup!(dir = Pathname.new(__FILE__).dirname.dirname.dirname.expand_path.join('data').join('logsql/').to_s)
66
+ num = 1
67
+ DataMapper.setup(:default, "sqlite:///#{dir}honeypot.sqlite")
68
+ self.all_databases.each do |database|
69
+ DataMapper.setup(num.to_s.to_sym, "sqlite:///#{dir}#{database}")
70
+ num = num + 1
71
+ end
72
+ DataMapper.finalize
73
+ @setup = true
74
+ end
75
+
76
+
77
+ end
78
+ end
@@ -0,0 +1,78 @@
1
+ # honeycomb - Tool to manage and analyze data from the Dionaea Honeypot
2
+ # Project
3
+ # Josh Grunzweig
4
+ # Copyright (C) 2011 Trustwave Holdings
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify it
7
+ # under the terms of the GNU General Public License as published by the
8
+ # Free Software Foundation, either version 3 of the License, or (at your
9
+ # option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful, but
12
+ # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13
+ # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14
+ # for more details.
15
+ #
16
+ # You should have received a copy of the GNU General Public License along
17
+ # with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ #
19
+
20
+ require 'honeycomb/model'
21
+
22
+ module Honeycomb
23
+ class Connections
24
+ include DataMapper::Resource
25
+ include Model::FixtureTable
26
+
27
+ def self.all_databases(dir = Pathname.new(__FILE__).dirname.dirname.dirname.dirname.expand_path.join('data').join('logsql/').to_s)
28
+ ret = Dir.entries(dir)
29
+ ret.delete_if {|x| x =~ /^\./}
30
+ ret
31
+ end
32
+
33
+ (0..self.all_databases.count).each do |num|
34
+ storage_names["#{num.to_s}".to_sym] = "connections"
35
+ end
36
+
37
+
38
+ property :connection, Integer, :key => true
39
+
40
+ property :connection_type, Text
41
+
42
+ property :connection_transport, Text
43
+
44
+ property :connection_protocol, Text
45
+
46
+ property :connection_timestamp, Integer
47
+
48
+ property :connection_root, Integer
49
+
50
+ property :connection_parent, Integer
51
+
52
+ property :local_host, Text
53
+
54
+ property :local_port, Integer
55
+
56
+ property :remote_host, Text
57
+
58
+ property :remote_hostname, Text
59
+
60
+ property :remote_port, Integer
61
+
62
+ has n, :logins, :child_key => [ :connection ]
63
+ has n, :download, :child_key => [ :connection ]
64
+ has n, :offers, :child_key => [ :connection ]
65
+ has n, :dcerpcbinds, :child_key => [ :connection ]
66
+ has n, :dcerpcrequests, :child_key => [ :connection ]
67
+ has n, :dcerpcserviceops, :child_key => [ :connection ]
68
+ has n, :dcerpcservices, :child_key => [ :connection ]
69
+ has n, :emu_profiles, :child_key => [ :connection ]
70
+ has n, :emu_services, :child_key => [ :connection ]
71
+ has n, :mssql_commands, :child_key => [ :connection ]
72
+ has n, :mssql_fingerprints, :child_key => [ :connection ]
73
+ has n, :p0fs, :child_key => [ :connection ]
74
+ has n, :resolves, :child_key => [ :connection ]
75
+ #has n, :virustotals, :child_key => [ :connection ]
76
+ #has n, :virustotalscans, :child_key => [ :connection ]
77
+ end
78
+ end
@@ -0,0 +1,46 @@
1
+ # honeycomb - Tool to manage and analyze data from the Dionaea Honeypot
2
+ # Project
3
+ # Josh Grunzweig
4
+ # Copyright (C) 2011 Trustwave Holdings
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify it
7
+ # under the terms of the GNU General Public License as published by the
8
+ # Free Software Foundation, either version 3 of the License, or (at your
9
+ # option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful, but
12
+ # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13
+ # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14
+ # for more details.
15
+ #
16
+ # You should have received a copy of the GNU General Public License along
17
+ # with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ #
19
+
20
+ module Honeycomb
21
+ class Dcerpcbind
22
+ include DataMapper::Resource
23
+ include Model::FixtureTable
24
+
25
+ def self.all_databases(dir = Pathname.new(__FILE__).dirname.dirname.dirname.dirname.expand_path.join('data').join('logsql/').to_s)
26
+ ret = Dir.entries(dir)
27
+ ret.delete_if {|x| x =~ /^\./}
28
+ ret
29
+ end
30
+
31
+ (0..self.all_databases.count).each do |num|
32
+ storage_names["#{num.to_s}".to_sym] = "dcerpcbinds"
33
+ end
34
+
35
+
36
+ property :dcerpcbind, Integer, :key => true
37
+
38
+ property :connection, Integer
39
+
40
+ property :dcerpcbind_uuid, Text
41
+
42
+ property :dcerpcbind_transfersyntax, Text
43
+
44
+ belongs_to :connections, :child_key => [:connection]
45
+ end
46
+ end
@@ -0,0 +1,45 @@
1
+ # honeycomb - Tool to manage and analyze data from the Dionaea Honeypot
2
+ # Project
3
+ # Josh Grunzweig
4
+ # Copyright (C) 2011 Trustwave Holdings
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify it
7
+ # under the terms of the GNU General Public License as published by the
8
+ # Free Software Foundation, either version 3 of the License, or (at your
9
+ # option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful, but
12
+ # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13
+ # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14
+ # for more details.
15
+ #
16
+ # You should have received a copy of the GNU General Public License along
17
+ # with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ #
19
+
20
+ module Honeycomb
21
+ class Dcerpcrequest
22
+ include DataMapper::Resource
23
+ include Model::FixtureTable
24
+
25
+ def self.all_databases(dir = Pathname.new(__FILE__).dirname.dirname.dirname.dirname.expand_path.join('data').join('logsql/').to_s)
26
+ ret = Dir.entries(dir)
27
+ ret.delete_if {|x| x =~ /^\./}
28
+ ret
29
+ end
30
+
31
+ (0..self.all_databases.count).each do |num|
32
+ storage_names["#{num.to_s}".to_sym] = "dcerpcrequests"
33
+ end
34
+
35
+ property :dcerpcrequest, Integer, :key => true
36
+
37
+ property :connection, Integer
38
+
39
+ property :dcerpcrequest_uuid, Text
40
+
41
+ property :dcerpcrequest_opnum, Integer
42
+
43
+ belongs_to :connections, :child_key => [:connection]
44
+ end
45
+ end
@@ -0,0 +1,47 @@
1
+ # honeycomb - Tool to manage and analyze data from the Dionaea Honeypot
2
+ # Project
3
+ # Josh Grunzweig
4
+ # Copyright (C) 2011 Trustwave Holdings
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify it
7
+ # under the terms of the GNU General Public License as published by the
8
+ # Free Software Foundation, either version 3 of the License, or (at your
9
+ # option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful, but
12
+ # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13
+ # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14
+ # for more details.
15
+ #
16
+ # You should have received a copy of the GNU General Public License along
17
+ # with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ #
19
+
20
+ module Honeycomb
21
+ class Dcerpcserviceop
22
+ include DataMapper::Resource
23
+ include Model::FixtureTable
24
+
25
+ def self.all_databases(dir = Pathname.new(__FILE__).dirname.dirname.dirname.dirname.expand_path.join('data').join('logsql/').to_s)
26
+ ret = Dir.entries(dir)
27
+ ret.delete_if {|x| x =~ /^\./}
28
+ ret
29
+ end
30
+
31
+ (0..self.all_databases.count).each do |num|
32
+ storage_names["#{num.to_s}".to_sym] = "dcerpcserviceops"
33
+ end
34
+
35
+ property :dcerpcserviceop, Integer, :key => true
36
+
37
+ property :dcerpcservice, Integer
38
+
39
+ property :dcerpcserviceop_opnum, Integer
40
+
41
+ property :dcerpcserviceop_name, Text
42
+
43
+ property :dcerpcserviceop_vuln, Text
44
+
45
+ belongs_to :connections, :child_key => [:connection]
46
+ end
47
+ end
@@ -0,0 +1,43 @@
1
+ # honeycomb - Tool to manage and analyze data from the Dionaea Honeypot
2
+ # Project
3
+ # Josh Grunzweig
4
+ # Copyright (C) 2011 Trustwave Holdings
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify it
7
+ # under the terms of the GNU General Public License as published by the
8
+ # Free Software Foundation, either version 3 of the License, or (at your
9
+ # option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful, but
12
+ # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13
+ # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14
+ # for more details.
15
+ #
16
+ # You should have received a copy of the GNU General Public License along
17
+ # with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ #
19
+
20
+ module Honeycomb
21
+ class Dcerpcservice
22
+ include DataMapper::Resource
23
+ include Model::FixtureTable
24
+
25
+ def self.all_databases(dir = Pathname.new(__FILE__).dirname.dirname.dirname.dirname.expand_path.join('data').join('logsql/').to_s)
26
+ ret = Dir.entries(dir)
27
+ ret.delete_if {|x| x =~ /^\./}
28
+ ret
29
+ end
30
+
31
+ (0..self.all_databases.count).each do |num|
32
+ storage_names["#{num.to_s}".to_sym] = "dcerpcservices"
33
+ end
34
+
35
+ property :dcerpcservice, Integer, :key => true
36
+
37
+ property :dcerpcservice_uuid, Text
38
+
39
+ property :dcerpcservice_name, Text
40
+
41
+ belongs_to :connections, :child_key => [:connection]
42
+ end
43
+ end
@@ -0,0 +1,46 @@
1
+ # honeycomb - Tool to manage and analyze data from the Dionaea Honeypot
2
+ # Project
3
+ # Josh Grunzweig
4
+ # Copyright (C) 2011 Trustwave Holdings
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify it
7
+ # under the terms of the GNU General Public License as published by the
8
+ # Free Software Foundation, either version 3 of the License, or (at your
9
+ # option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful, but
12
+ # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13
+ # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14
+ # for more details.
15
+ #
16
+ # You should have received a copy of the GNU General Public License along
17
+ # with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ #
19
+
20
+ module Honeycomb
21
+ class Download
22
+ include DataMapper::Resource
23
+ include Model::FixtureTable
24
+
25
+ def self.all_databases(dir = Pathname.new(__FILE__).dirname.dirname.dirname.dirname.expand_path.join('data').join('logsql/').to_s)
26
+ ret = Dir.entries(dir)
27
+ ret.delete_if {|x| x =~ /^\./}
28
+ ret
29
+ end
30
+
31
+ (0..self.all_databases.count).each do |num|
32
+ storage_names["#{num.to_s}".to_sym] = "downloads"
33
+ end
34
+
35
+ property :download, Integer, :key => true
36
+
37
+ property :connection, Integer
38
+
39
+ property :download_url, Text
40
+
41
+ property :download_md5_hash, Text
42
+
43
+ belongs_to :connections, :child_key => [:connection]
44
+ has n, :virustotals, :child_key => [ :download_md5_hash ]
45
+ end
46
+ end
@@ -0,0 +1,43 @@
1
+ # honeycomb - Tool to manage and analyze data from the Dionaea Honeypot
2
+ # Project
3
+ # Josh Grunzweig
4
+ # Copyright (C) 2011 Trustwave Holdings
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify it
7
+ # under the terms of the GNU General Public License as published by the
8
+ # Free Software Foundation, either version 3 of the License, or (at your
9
+ # option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful, but
12
+ # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13
+ # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14
+ # for more details.
15
+ #
16
+ # You should have received a copy of the GNU General Public License along
17
+ # with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ #
19
+
20
+ module Honeycomb
21
+ class EmuProfile
22
+ include DataMapper::Resource
23
+ include Model::FixtureTable
24
+
25
+ def self.all_databases(dir = Pathname.new(__FILE__).dirname.dirname.dirname.dirname.expand_path.join('data').join('logsql/').to_s)
26
+ ret = Dir.entries(dir)
27
+ ret.delete_if {|x| x =~ /^\./}
28
+ ret
29
+ end
30
+
31
+ (0..self.all_databases.count).each do |num|
32
+ storage_names["#{num.to_s}".to_sym] = "emu_profiles"
33
+ end
34
+
35
+ property :emu_profile, Integer, :key => true
36
+
37
+ property :connection, Integer
38
+
39
+ property :emu_profile_json, Text
40
+
41
+ belongs_to :connections, :child_key => [:connection]
42
+ end
43
+ end
@@ -0,0 +1,43 @@
1
+ # honeycomb - Tool to manage and analyze data from the Dionaea Honeypot
2
+ # Project
3
+ # Josh Grunzweig
4
+ # Copyright (C) 2011 Trustwave Holdings
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify it
7
+ # under the terms of the GNU General Public License as published by the
8
+ # Free Software Foundation, either version 3 of the License, or (at your
9
+ # option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful, but
12
+ # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13
+ # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14
+ # for more details.
15
+ #
16
+ # You should have received a copy of the GNU General Public License along
17
+ # with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ #
19
+
20
+ module Honeycomb
21
+ class EmuService
22
+ include DataMapper::Resource
23
+ include Model::FixtureTable
24
+
25
+ def self.all_databases(dir = Pathname.new(__FILE__).dirname.dirname.dirname.dirname.expand_path.join('data').join('logsql/').to_s)
26
+ ret = Dir.entries(dir)
27
+ ret.delete_if {|x| x =~ /^\./}
28
+ ret
29
+ end
30
+
31
+ (0..self.all_databases.count).each do |num|
32
+ storage_names["#{num.to_s}".to_sym] = "emu_services"
33
+ end
34
+
35
+ property :emu_service, Integer, :key => true
36
+
37
+ property :connection, Integer
38
+
39
+ property :emu_service_url, Text
40
+
41
+ belongs_to :connections, :child_key => [:connection]
42
+ end
43
+ end