Commit Graph

111 Commits

Author SHA1 Message Date
jcrew99
486a9bb329 Update copyright 2023 (#2675)
* updated copyright

* reverted gemfile lock changes
2022-12-31 15:36:07 +10:00
Brendan Coles
aa7a6f9e64 Extensions: Resolve many Rubocop violations 2022-01-22 11:16:12 +00:00
wheatley
f33e2698a0 MAINTAINABILITY: 2257 update copyright 2022 (#2259)
* 2257 updated copyright date
2021-12-31 09:48:08 +10:00
J
4ec6ecee27 updated all of the copyright information 2021-01-11 04:48:56 +10:00
Haoxi Tan
f5de5eb7c0 updated dns extension to use async-dns instead of old rubydns 2020-01-10 09:43:45 +10:00
root
1a8a8d9154 Merge branch 'active_record_fix' of https://github.com/beefproject/beef into active_record_fix 2019-12-30 11:28:38 +00:00
beep
470b3483d0 Update copyright information 2020-01-01 18:47:08 -08:00
root
e8e7ba26e4 updated the DNS rules 2019-12-30 11:25:25 +00:00
Ben Passmore
ea9c281804 Updated dns for AR 2019-11-30 15:17:11 +10:00
Jess
9b5c8e39df Syntax changes 2019-11-14 22:09:44 -08:00
Ben Passmore
9f1e8f5e8d Updated copyright 2019-01-01 11:57:28 +10:00
Wade Alcorn
fca5279f17 Updated Copyright dates 2018-01-04 09:12:47 +10:00
Brendan Coles
903d364450 Remove experimental extensions from config.yaml 2017-12-08 18:14:32 +00:00
Brendan Coles
2749d6620a Add rubydns dependency to extension 2017-10-15 08:56:19 +00:00
Brendan Coles
4f153c2de3 Support empty output messages to DNS logger 2017-08-06 22:02:55 +00:00
Brendan Coles
275153be38 Remove todo note 2017-04-20 19:56:31 +00:00
Wade Alcorn
91cc7ed873 Updated Copyright information 2016-12-29 15:50:13 +10:00
Brendan Coles
dbccb111e5 Validate empty DNS REST API JSON keys 2016-04-22 06:27:05 +00:00
Brendan Coles
43a797b36a Re-order BeEF::Filters.is_valid_ip arguments with optional last 2016-03-25 20:58:17 +00:00
Brendan Coles
8697c81ffa Replace eval with hard-coded strings 2016-02-08 08:29:52 +00:00
Wade Alcorn
ce01d9fa46 updated copyright year 2015-12-30 08:11:57 +10:00
Brendan Coles
f17ea36ca3 Rescue DNS server port unavailable - Fix #1166 2015-09-13 16:24:18 +00:00
Wade Alcorn
2fbca61368 Updated copyright dates 2014-12-30 07:44:58 +10:00
antisnatchor
d1688395ae #970 Added string to DNS requests to differentiate between normal and data-extrusion DNS requests 2014-06-29 13:04:51 +02:00
antisnatchor
fb0cd7a195 #970 started working on client-to-server DNS channel. 2014-06-28 15:23:50 +02:00
soh_cah_toa
e1c27f4feb Removed support for TXT resource record.
Like the HINFO and MINFO RR's, TXT is vulnerable to RCE attacks and has
no purpose at the moment. TXT may be needed in the future (e.g. data
exfiltration) which is why it has been removed separately.
2014-04-28 20:34:56 -04:00
soh_cah_toa
26cd0f08ad Removed support for HINFO and MINFO resource records.
These RR's are very difficult to validate and, in their current state,
are vulnerable to RCE attacks. Furthermore, BeEF does not have a use for
these RR's.
2014-04-28 20:28:47 -04:00
soh_cah_toa
c63a55962a Added unless modifier to prevent displaying no upstream servers.
Even though #print_more will display nothing since ''.split("\n").each()
iterates 0 times, it will still be called without this modifier which is
unnecessary.
2014-04-28 20:20:32 -04:00
Kevin Polulak
e8fc288ff7 Merge pull request #2 from bcoles/patch-2
Update model.rb - Throw 'UnknownDnsResourceError'
2014-04-28 20:14:48 -04:00
Brendan Coles
e6b74d5186 Update model.rb - Throw 'UnknownDnsResourceError'
Throw `UnknownDnsResourceError` instead of `InvalidDnsResourceError`

Prevents `[20:30:55][!] Internal error while adding DNS rule (uninitialized constant BeEF::Core::Models::Dns::Rule::InvalidDnsResourceError)` for invalid user supplied DNS response types.

'BeEF::Core::Models::Dns::Rule::InvalidDnsResourceError' does not exist, and it's unlikely we'll need to differentiate between invalid and unknown resource types.
2014-04-27 00:14:25 +10:00
Brendan Coles
0438cf422f use up_protocol in banner 2014-04-26 21:50:46 +10:00
soh_cah_toa
3b3d7fe95e Moved Thread/EventMachine creation inside of #run.
This cleans up the API a bit by removing the requirement of placing #run
inside a Thread.new {EventMachine.next_tick {}} block. That should not
be the caller's responsibility.
2014-04-25 13:14:43 -04:00
soh_cah_toa
9b3dfacce1 Added support for upstream nameservers.
Previously, upstream nameservers were configured by default even if the
config file did not specify them. Now upstream nameservers are only
used if they are specified. If none are given, then NXDOMAIN is
returned for unresolvable requests.
2014-04-25 13:06:33 -04:00
soh_cah_toa
82e4b1eac7 Implemented default DNS address/port/protocol values.
Even though it is unlikely that a user would remove these options from
the DNS config file, it is still good practice to have these safeguards
in place.
2014-04-25 10:32:19 -04:00
soh_cah_toa
1d5afbb81e Added Dns::Server attribute to DNS REST router.
This is primarily intended to add clarity by reducing clutter. Moreover,
it also has the side effect of improving performance very slightly by
removing the overhead of calling #instance numerous times.
2014-04-25 10:14:05 -04:00
soh_cah_toa
2e318030da Fixed typo in debug message for #process. 2014-04-25 10:09:38 -04:00
soh_cah_toa
acc6114541 Re-implemented DELETE /rule/:id handler for new API.
Removed old #format_response method since this is now handled by the
Rule model.
2014-04-24 23:35:21 -04:00
soh_cah_toa
32db367ada Refactored ID filter checks into #is_valid_id?.
Added call to #remove_rule! as well.
2014-04-24 23:28:11 -04:00
soh_cah_toa
bca9eccdf0 Implemented GET ruleset, rule, and POST rule handlers.
Many filter checks were removed because the new DNS extension performs
validation before performing any database operation.

Modified message for InvalidParamError to be more modular.
2014-04-24 16:40:19 -04:00
soh_cah_toa
94fc2805d1 Added ID filter checks to #get_rule.
This is ensures that ID validation occurs when using either the Ruby API
or the RESTful API. Previously, validation was only done for the
RESTful API.
2014-04-24 16:36:44 -04:00
soh_cah_toa
7b229a2a20 Added new #validate_pattern method.
Uses BeEF::Filters to ensure that empty, null, and non-printable
patterns are tossed out. Added new InvalidDnsPatternError exception
class to handle these cases.

Renamed #validate_response to #format_callback since the name is more
appropriate.
2014-04-24 14:26:37 -04:00
soh_cah_toa
ad25c49b2d Refactored IP filters into parameterized #is_valid_ip?.
Using parameterized methods is better structured coding style rather
than defining multiple similarly-behaved methods.

annex_region('crimea') # good
vs.
annex_crimea # bad
2014-04-24 13:11:00 -04:00
soh_cah_toa
e791fca8a9 Updated #validate_response to use BeEF::Filters. 2014-04-23 18:07:27 -04:00
soh_cah_toa
6385ddf85b Changed data type of :callback property to Object.
Using String was sufficient but this way is more consistent.
2014-04-23 16:50:47 -04:00
soh_cah_toa
bd9891dc4d Implemented #validate_response method in Dns::Rule.
Perhaps the ugliest part of the DNS extension, it is also the most
crucial. This method ensures that a given resource and response are
appropriate for each other. It must also prevent RCE vulns since the
input is eval'd later on.

However, HINFO, MINFO, and especially TXT validation is not strict
enough. These three need to be reviewed scrupulously since a 100%
anti-RCE solution may prove to be difficult.
2014-04-23 16:39:26 -04:00
soh_cah_toa
53a54de5fe Added @database to Dns::Server as a model reference. 2014-04-23 16:36:16 -04:00
soh_cah_toa
3029d3cea8 Implemented #process method that handles requests.
The DNS server now searches for matching rules and sends its response
when handling incoming requests. However, all rules are still assigned
the same callback for the moment.
2014-04-23 13:28:34 -04:00
soh_cah_toa
0dd9c193ec Appended ! to #remove_rule and #remove_ruleset.
Adhering to the Ruby convention, this indicates that these methods
mutate the receiver and, therefore, should be considered dangerous.
2014-04-23 12:53:41 -04:00
soh_cah_toa
2303851498 Implemented #remove_ruleset method. 2014-04-23 12:50:42 -04:00
soh_cah_toa
56c686de64 Implemented #get_ruleset method.
Also refactored #get_rule to use new #to_hash helper method since
2014-04-23 12:42:39 -04:00