Updated the code to be compatible with Rack3

This commit is contained in:
zinduolis
2025-09-09 21:21:24 +10:00
parent d05ff08dbc
commit 5cf691120f
3 changed files with 12 additions and 3 deletions

View File

@@ -70,7 +70,11 @@ module BeEF
res = JSON.parse(b64).first
res['beefhook'] = packet[:beefhook]
res['request'] = request
res['beefsession'] = request[BeEF::Core::Configuration.instance.get('beef.http.hook_session_name')]
session_key = BeEF::Core::Configuration.instance.get('beef.http.hook_session_name')
res['beefsession'] = request.cookies[session_key] ||
request.params[session_key] ||
request.env[session_key]
execute(res)
rescue JSON::ParserError => e
print_debug 'Network stack could not decode packet stream.'