summaryrefslogtreecommitdiff
path: root/conf/dionaea.conf.dist
blob: b9960d6ab0ddbbf0eda56d31236e2f52f80794a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
logging = {
	default = {
		// file not starting with / is taken relative to LOCALESTATEDIR (e.g. /opt/dionaea/var)
		file = "log/dionaea.log"
		levels = "all"
		domains = "*"
    }

	errors = {
		// file not starting with / is taken relative to LOCALESTATEDIR (e.g. /opt/dionaea/var)
		file = "log/dionaea-errors.log"
		levels = "warning,error"
		domains = "*"
	}
}

processors = 
{ 
	filter-emu = 
	{
		config = {
			allow = [{ protocol = ["smbd","epmapper","nfqmirrord","mssqld"] }]
		}
		next = {
			emu = 
			{
				config = {
					emulation = {
						limits = {
							files = "3"
							filesize = "524288" // 512 * 1024
							sockets = "3"
							sustain = "120"
							idle = "30"
							listen = "30"
							cpu = "120"
							steps = "1073741824" // 1024 * 1024 * 1024
						}

						/**
						 * api default arguments for development 
						 * disabled by default
						 * not working yet 
						 */
						api = {
							connect = {
								host = "127.0.0.1"
								port = "4444"
							}
						}
					}
				}
			}
		}
	}

	filter-streamdumper = 
	{
		config = {
			allow = [
				{ type = ["accept"] }
				{ type = ["connect"] protocol=["ftpctrl"] }
			]
			deny = [
				{ protocol = ["ftpdata", "ftpdatacon","xmppclient"] }
			]
		}
		next = {
			streamdumper = {
				config = {
					path = "var/dionaea/bistreams/%Y-%m-%d/"
				}
			}
		}
	}

/*	filter-sessions = 
	{
		config = {
			allow = [ { protocol = ["ftpctrl","remoteshell"] } ]
		}
		next = {
			python = {
				incident = "true"
			}
		}
	}
*/
}

downloads =
{
	dir = "var/dionaea/binaries"
	tmp-suffix = ".tmp"
}

bistreams =
{
	python = 
	{
		dir = "var/dionaea/bistreams"
	}
}

submit = 
{
	defaults = {
		urls = ["http://anubis.iseclab.org/nepenthes_action.php",
				"http://onlineanalyzer.norman.com/nepenthes_upload.php", 
				"http://luigi.informatik.uni-mannheim.de/submit.php?action=verify"]
		email = "nepenthesdev@gmail.com"
		file_fieldname = "upfile"
		MAX_FILE_SIZE = "1500000"
		submit        = "Submit for analysis"
	}

	/**
	 * joebox is special, due to the TOS you can lookup here
	 * http://www.joebox.org/resources/service%20terms.txt
	 * therefore untested and disabled by default
	 */
/*
	joebox = {
		urls = ["http://analysis.joebox.org/submit"]
		email = "nepenthesdev@gmail.com"
		file_fieldname = "upfile"
		MAX_FILE_SIZE = "1500000"
		submit        = "Submit for analysis"
		service       = "agree"
		xp            = "1"
		vista         = "1"
		w7            = "1"
		pcap          = "1"
	}
*/

/*
	yoursection = 
	{
		urls = ["http://127.0.0.1/submit"]
		email = "yourmail"
		user = "yourusername"
		pass = "yourpassword"
	}
*/
}

listen = 
{
	/* basically we have 3 modes
	   - getifaddrs - auto
	     will get a list of all ips and bind a service to each ip
	   - manual - your decision
	     addrs has to be provided, and should look like this
		 addrs = { eth0 = ["1.1.1.1", "1.1.1.2"], eth1 = ["2.1.1.1", "2.1.1.2"] }
		 you get the idea ...
		 for most cases with more than one address
		 addrs = { eth0 = ["0.0.0.0"] }
		 will do the trick
		 if you want to throw in ipv6 support as well ...
		 addrs = { eth0 = ["::"] }
		 note: ipv6 does not work with surfids yet, 
		 as ipv6 addresses are mapped to ipv4 and surfids fails to retrieve the sensor id for ::ffff:1.2.3.4
	   - nl, will require a list of interfaces 
	     fnmatch is possible like
		 interfaces = ["ppp*","tun*"]
		 and loading the nl module AFTER the python module in the modules section below
		 nl will use the kernel netlink interface to figure out which addresses exist 
		 at runtime, and start/stop services dynamically per address per interface
	*/
	     
	mode = "getifaddrs"
	addrs = { eth0 = ["::"] }
}

modules = {

	curl = 
	{
		protocol = "http"
	}

	emu = {
		detect = "1"
		profile = "1"
	}

	pcap = 
	{
		/** 
       	 * libpcap 1.0.0 
       	 *  
       	 * "Arithmetic expression against transport layer headers, like 
       	 * tcp[0], does not work  against  IPv6  packets. It  only looks 
       	 * at IPv4 packets."
       	 * 
       	 * As a consequence, the default filter can not match 
       	 * ipv6 tcp rst packets.
       	 * 
       	 * If you want to go for rejected ipv6, remove the tcp matching part of the filter
       	 * The code is capable to checking the tcp-rst flag and seq number itself, but 
       	 * matching every packet in userspace is expensive.
       	 * Therefore you'll have to hack the code if you want to track ipv6 rejected connections
       	 * 
		 * Format is IFACE = { addrs = MODE }
		 * currently mode is ignored
       	 */

		any = {
			addrs = "auto"
		}
	}

	nfq =
	{ 
		/** 
		 * queue has to be the nfqueue num 
		 * refer to http://dionaea.carnivore.it/#nfq_python
		 * if you do not specify a queue-num with iptables, 0 is the default
		 */
		queue = "0"
	}

	python = {
		// default expands to PREFIX/lib/dionaea/python/
		// ordering is granted
		// useful for development
		// simply add your devel directory to the list, avoids a make install for new python code
		sys_path = ["default"]

		// python imports
		imports	= [	"log",
					"services",
					"ihandlers"]
		ftp = {
			root = "var/dionaea/wwwroot"

			/* ftp client section
			 */

			/* ports for active ftp
			 * string indicating a range 
			 */
			active-ports = "63001-64000"

			/* host for active ftp via NAT
			 * 0.0.0.0 - the initiating connection ip is used for active ftp
			 * not 0.0.0.0 - gets resolved as hostname and used
			 */
			active-host = "0.0.0.0"
		}
		tftp = {
			root = "var/dionaea/wwwroot"
		}
		http = {
			root = "var/dionaea/wwwroot"
			max-request-size = "32768" // maximum size in kbytes of the request (32MB)
		}
		sip = {
			udp = {
				port = "5060"
			}
			tcp = {
				port = "5060"
			}
			tls = {
				port = "5061"
			}
			users = "var/dionaea/sipaccounts.sqlite"
			rtp = {
				enable = "yes"
				/* how to dump the rtp stream
				   bistream = dump as bistream
				*/
				mode = ["bistream", "pcap"]

				pcap = {
					path = "var/dionaea/rtp/{personality}/%Y-%m-%d/"
					filename = "%H:%M:%S_{remote_host}_{remote_port}_in.pcap"
				}
			}
			personalities = {
				default = {
					domain = "localhost"
					name = "softphone"
					personality = "generic"
				}
				/*
				next-server = {
					domain = "my-domain"
					name = "my server"
					personality = "generic"
					serve = ["10.0.0.1"]
					default_sdp = "default"
					handle = ["REGISTER", "INVITE", "BYE", "CANCEL", "ACK"]
				}

				*/
			}
			actions = {
				bank-redirect = {
					do = "redirect"
					params = {
					}
				}
				play-hello = {
					do = "play"
					params = {
						file = "var/dionaea/.../file.ext"
					}
				}
			}
		}
		surfids = {
			sslmode = "require"
			host = "surfids.example.com" // change this
			port = "5432"                // maybe this
			username = "surfids"         // this
			password = "secret"          // and this
			dbname = "idsserver"
		}
		virustotal = {
			apikey = "........." // grab it from your virustotal account at My account -> Inbox -> Public API
			file = "var/dionaea/vtcache.sqlite"
		}
		mwserv = {			// ask your mwserv backend provider for needed values
			url = "" 		// the url to send the submission requests to
			maintainer = ""	// username of the maintainer of this sensor
			guid = "" 		// guid of this sensor, as generated serverside; typically 8 chars
			secret = ""		// shared secret used for authentication aka password; typically 48 chars
		}
		mysql = {
			databases = {
				information_schema = {
					path = ":memory:"
				}

				// example how to extend this
				// just provide a databasename and path to the database
				// the database can be altered by attackers, so ... better use a copy
//				psn = {
//					path = "/path/to/cc_info.sqlite"
//				}

			}
		}
		submit_http = {			// ask your submit_http backend provider for needed values
			url = "" 		// the url to send the submission requests to
			email = ""		// optional
			user = "" 		// username (optional)
			pass = ""		// password (optional)
		}
		logsql = {
			mode = "sqlite" // so far there is only sqlite
			sqlite = {
				file = "var/dionaea/logsql.sqlite"
			}
		}
		logxmpp = {
			/**
			 * this section defines a single xmpp logging target
			 * you can have multiple
			 */
			carnivore = {
				server = "sensors.carnivore.it"

				/**
				 * as dionaea does not support starttls (xmpp on port 5223), 
				 * we rely on 'legacy ssl' for the xmpp connection (port 5222)
				 */
				port = "5223"
				muc = "dionaea.sensors.carnivore.it"

				/**
				 * if the server exists, this is a valid account
				 */
				username = "anonymous@sensors.carnivore.it"
				password = "anonymous"

				/**
				 * setting a resource is possible, but you should not do it
				 * the default resource is a random string of 8 chars
				 */
				// resource = "theresource"
				config = 
				{
					/**
					 * this defines a muc channel
					 */
					anon-events = 
					{
						/**
						 * incidents matching these events will get relayed to the channel
						 */ 
						events = ["^dionaea\x5c.connection\x5c..*",
									"^dionaea\x5c.modules\x5c.python\x5c.smb.dcerpc\x5c.*",
									"^dionaea\x5c.download\x5c.offer$",
									"^dionaea\x5c.download\x5c.complete\x5c.hash$",
									"^dionaea\x5c.module\x5c.emu\x5c.profile$",
									"^dionaea\x5c.modules\x5c.python\x5c.mysql\x5c.*",
									"^dionaea\x5c.modules\x5c.python\x5c.sip\x5c.*",
									"^dionaea\x5c.modules\x5c.python\x5c.p0f\x5c.*",
									"^dionaea\x5c.modules\x5c.python\x5c.virustotal\x5creport",
									]

						/**
						 * anonymous removes the local host information from all connection messages
						 * so you can report without getting identified
						 */
						anonymous = "yes"
					}

					anon-files =
					{ 
						events = ["^dionaea\x5c.download\x5c.complete\x5c.unique"]
					}
				}
			}
		}
		nfq = {
			/** 
			 * nfq can intercept incoming tcp connections during the tcp handshake
			 * giving your honeypot the possibility to provide service on  
			 * ports which are not served by default.
			 * refer to the documentation (http://dionaea.carnivore.it/#nfq_python) 
			 * BEFORE using this
			 */

			nfaction = "0" // DROP

			throttle = {
				window = "30"
				limits = {
					total = "30"
					slot = "30"
				}
			}

			timeouts = {
				server = {
					listen = "5"
				}
				client = {
					idle = "10"
					sustain = "240"
				}
			}
		}
		p0f = {
			/**
			 * start p0f with 
			 * sudo p0f -i any -u root -Q /tmp/p0f.sock -q -l
			 */
			path = "un:///tmp/p0f.sock"
		}

		fail2ban = {
			downloads = "var/dionaea/downloads.f2b"
			offers = "var/dionaea/offers.f2b"
		}

		ihandlers = {
			handlers = ["ftpdownload", "tftpdownload", "emuprofile", "cmdshell", "store", "uniquedownload", 
			"logsql",
//			"virustotal",
//			"mwserv",
//			"submit_http",
//			"logxmpp",
//			"nfq",
//			"p0f",
//			"surfids",
//			"fail2ban"
			]
		}

		services = {
			serve = ["http", "https", "tftp", "ftp", "mirror", "smb", "epmap", "sip","mssql", "mysql"]
		}

	}

	nl = 
	{
		lookup_ethernet_addr = "no" // set to yes in case you are interested in the mac address  of the remote (only works for lan)

	}


	/* nc is a test module */
/*	nc = 
	{
		services = [
			{
				proto = "redir"
				type = "tcp"
				host = "::"
				port = "4711"
			},
			{
				proto = "redir"
				type = "tcp"
				host = "::"
				port = "12344"
			},
			{
				proto = "sink"
				type = "tcp"
				host = "::"
				port = "12345"
				throttle = {
					in = "8192"
				}
				timeout = {
					listen = "15"
					connect = "15"
				}
			},
			{
				proto = "source"
				type = "tcp"
				host = "::"
				port = "12346"
				throttle = {
					out = "8192"
				}
				timeout = {
					listen = "15"
					connect = "15"
				}
			},
			{
				proto = "redir"
				type = "tcp"
				host = "::"
				port = "12347"
				throttle = {
					in = "8192"
					out = "8192"
				}
				timeout = {
					listen = "15"
					connect = "15"
				}
			},			
			{
				proto = "redir"
				type = "tls"
				host = "::"
				port = "12444"
				timeout = {
					listen = "15"
					connect = "15"
				}
			},

			{
				proto = "sink"
				type = "tls"
				host = "::"
				port = "12445"
				throttle = {
					in = "8192"
				}
				timeout = {
					listen = "15"
					connect = "5"
				}
			},
			{
				proto = "source"
				type = "tls"
				host = "::"
				port = "12446"
				throttle = {
					out = "8192"
				}
				timeout = {
					listen = "15"
					connect = "15"
				}
			},
			{
				proto = "redir"
				type = "tls"
				host = "::"
				port = "12447"
				throttle = {
					in = "8192"
					out = "8192"
				}
				timeout = {
					listen = "15"
					connect = "15"
				}
			},
			{
				proto = "source"
				type = "udp"
				host = "::"
				port = "12544"
				timeout = {
					connect = "15"
				}
			},
			{
				proto = "sink"
				type = "udp"
				host = "::"
				port = "12545"
				timeout = {
					connect = "15"
				}
			},
			{
				proto = "redir"
				type = "udp"
				host = "::"
				port = "12546"
				timeout = {
					connect = "15"
				}
			}
		]

		clients = [
			{
				proto = "source"
				type = "tcp"
				host = "127.0.0.1"
				port = "13344"
				timeout = {
					connecting = "5"
					connect = "15"
					reconnect = "5"
				}
			},
			{
				proto = "redir"
				type = "tcp"
				host = "ip6-localhost"
				port = "13345"
				timeout = {
					connecting = "5"
					connect = "15"
					reconnect = "5"
				}
			},
			{
				proto = "redir"
				type = "tls"
				host = "localhost"
				port = "13346"
				timeout = {
					connecting = "5"
					connect = "15"
					reconnect = "5"
				}
			}, 
			{
				proto = "source"
				type = "tls"
				host = "ip6-localhost"
				port = "12445"
				timeout = {
					reconnect = "1"
					connect = "1"
				}
			}
		]
	}
 */
}