renamed the WebCloner model class to align with ActiveRecord syntax
changed WebCloner name changes in web_cloner.rb created two tests to support changeswq
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
module BeEF
|
||||
module Core
|
||||
module Models
|
||||
class Webcloner < BeEF::Core::Model
|
||||
class WebCloner < BeEF::Core::Model
|
||||
|
||||
has_many :interceptors
|
||||
|
||||
|
||||
@@ -144,6 +144,7 @@ module BeEF
|
||||
end
|
||||
|
||||
print_info "Mounting cloned page on URL [#{mount}]"
|
||||
byebug
|
||||
@http_server.mount("#{mount}", interceptor.new)
|
||||
@http_server.remap
|
||||
|
||||
@@ -206,7 +207,7 @@ module BeEF
|
||||
end
|
||||
|
||||
def persist_page(uri, mount)
|
||||
webcloner_db = BeEF::Core::Models::Webcloner.new(
|
||||
webcloner_db = BeEF::Core::Models::WebCloner.new(
|
||||
:uri => uri,
|
||||
:mount => mount
|
||||
)
|
||||
|
||||
24
spec/beef/extensions/social_engineering_spec.rb
Normal file
24
spec/beef/extensions/social_engineering_spec.rb
Normal file
@@ -0,0 +1,24 @@
|
||||
require 'extensions/social_engineering/models/web_cloner'
|
||||
require 'extensions/social_engineering/web_cloner/web_cloner'
|
||||
require 'extensions/social_engineering/web_cloner/interceptor'
|
||||
require 'extensions/social_engineering/models/interceptor'
|
||||
require 'fileutils'
|
||||
|
||||
RSpec.describe 'BeEF Extension Social Engineering' do
|
||||
|
||||
after(:all) do
|
||||
FileUtils.rm_rf(Dir['./extensions/social_engineering/web_cloner/cloned_pages/*'])
|
||||
end
|
||||
|
||||
it 'persistence web cloner' do
|
||||
expect {
|
||||
BeEF::Core::Models::WebCloner.create(uri: "example.com", mount: "/")
|
||||
}.to_not raise_error
|
||||
end
|
||||
|
||||
it 'clone web page' do
|
||||
expect {
|
||||
BeEF::Extension::SocialEngineering::WebCloner.instance.clone_page("https://www.google.com", "/", nil, nil)
|
||||
}.to_not raise_error
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user