beefproject / beef

The Browser Exploitation Framework Project
https://beefproject.com
9.8k stars 2.17k forks source link

ARE crashing on uninitialized variable against ActiveModel #1855

Closed aboro closed 4 years ago

aboro commented 4 years ago

Environment

What version/revision of BeEF are you using? Master

On what version of Ruby? ruby 2.5.7p206

On what browser? All

On what operating system? Debian

Configuration

Are you using a non-default configuration? Default

Have you enabled or disabled any BeEF extensions? No

Summary

Please provide a summary of the issue. During use of Auto Rules Engine uninitialized variables cause crash prior to execution of module.

Expected Behaviour

What was the expected result? Execution of alert box

Actual Behaviour

What was the actual result? Crash and no execution

Steps to Reproduce

Please provide steps to reproduce this issue. Prepare any ARE in enabled/ e.g. cp beef/arerules/alert.json beef/arerules/enabled/

Additional Information

<Thread:0x000055a8733637f8@/root/git/beef/core/main/network_stack/handlers/dynamicreconstruction.rb:47 run> terminated with exception (report_on_exception is true): Traceback (most recent call last): 20: from /root/git/beef/core/main/network_stack/handlers/dynamicreconstruction.rb:48:in block (2 levels) in <class:DynamicReconstruction>' 19: from /root/git/beef/core/main/network_stack/handlers/dynamicreconstruction.rb:55:incheck_packets' 18: from /root/git/beef/core/main/network_stack/handlers/dynamicreconstruction.rb:55:in each' 17: from /root/git/beef/core/main/network_stack/handlers/dynamicreconstruction.rb:80:inblock in check_packets' 16: from /root/git/beef/core/main/network_stack/handlers/dynamicreconstruction.rb:107:in execute' 15: from /root/git/beef/core/main/network_stack/handlers/dynamicreconstruction.rb:107:innew' 14: from /root/git/beef/core/main/handlers/browserdetails.rb:19:in initialize' 13: from /root/git/beef/core/main/handlers/browserdetails.rb:513:insetup' 12: from /root/git/beef/core/main/autorun_engine/engine.rb:33:in run' 11: from /root/git/beef/core/main/autorun_engine/engine.rb:43:intrigger' 10: from /root/git/beef/core/main/autorun_engine/engine.rb:43:in each' 9: from /root/git/beef/core/main/autorun_engine/engine.rb:88:inblock in trigger' 8: from /var/lib/gems/2.5.0/gems/activerecord-6.0.2.1/lib/active_record/inheritance.rb:70:in new' 7: from /var/lib/gems/2.5.0/gems/activerecord-6.0.2.1/lib/active_record/inheritance.rb:70:innew' 6: from /var/lib/gems/2.5.0/gems/activerecord-6.0.2.1/lib/active_record/core.rb:326:in initialize' 5: from /var/lib/gems/2.5.0/gems/activemodel-6.0.2.1/lib/active_model/attribute_assignment.rb:35:inassign_attributes' 4: from /var/lib/gems/2.5.0/gems/activerecord-6.0.2.1/lib/active_record/attribute_assignment.rb:22:in _assign_attributes' 3: from /var/lib/gems/2.5.0/gems/activemodel-6.0.2.1/lib/active_model/attribute_assignment.rb:43:in_assign_attributes' 2: from /var/lib/gems/2.5.0/gems/activemodel-6.0.2.1/lib/active_model/attribute_assignment.rb:43:in each' 1: from /var/lib/gems/2.5.0/gems/activemodel-6.0.2.1/lib/active_model/attribute_assignment.rb:44:inblock in _assign_attributes' /var/lib/gems/2.5.0/gems/activemodel-6.0.2.1/lib/active_model/attribute_assignment.rb:53:in `_assign_attribute': unknown attribute 'session' for BeEF::Core::Models::Execution. (ActiveModel::UnknownAttributeError)

h4sh5 commented 4 years ago

That's an active record issue. If you know how to fix it please send in a pull request. The dev team is now working on fixing the issue as well.

h4sh5 commented 4 years ago

fixed