Merge pull request #2127 from wheatley/defect/2010_could_not_find_table_webcloners
Rename the WebCloner model class to align with ActiveRecord syntax
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
|
||||
|
||||
|
||||
@@ -206,7 +206,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
|
||||
)
|
||||
|
||||
22
spec/beef/extensions/social_engineering_spec.rb
Normal file
22
spec/beef/extensions/social_engineering_spec.rb
Normal file
@@ -0,0 +1,22 @@
|
||||
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
|
||||
|
||||
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
|
||||
FileUtils.rm(Dir['./extensions/social_engineering/web_cloner/cloned_pages/www.google.com'])
|
||||
FileUtils.rm(Dir['./extensions/social_engineering/web_cloner/cloned_pages/www.google.com_mod'])
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user