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:
whealtey
2021-07-11 08:18:14 +00:00
parent b58978870d
commit 5d0a499a12
3 changed files with 27 additions and 2 deletions

View File

@@ -6,7 +6,7 @@
module BeEF
module Core
module Models
class Webcloner < BeEF::Core::Model
class WebCloner < BeEF::Core::Model
has_many :interceptors

View File

@@ -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
)

View 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