Linux business72.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
LiteSpeed
: 162.0.229.97 | : 3.149.251.199
Cant Read [ /etc/named.conf ]
8.1.30
temmmp
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
opt /
alt /
ruby31 /
share /
gems /
gems /
bundler-2.3.27 /
lib /
bundler /
vendor /
thor /
lib /
thor /
actions /
[ HOME SHELL ]
Name
Size
Permission
Action
create_file.rb
3.04
KB
-rw-r--r--
create_link.rb
1.86
KB
-rw-r--r--
directory.rb
3.76
KB
-rw-r--r--
empty_directory.rb
4.25
KB
-rw-r--r--
file_manipulation.rb
12.89
KB
-rw-r--r--
inject_into_file.rb
3.49
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : inject_into_file.rb
require_relative "empty_directory" class Bundler::Thor module Actions # Injects the given content into a file. Different from gsub_file, this # method is reversible. # # ==== Parameters # destination<String>:: Relative path to the destination root # data<String>:: Data to add to the file. Can be given as a block. # config<Hash>:: give :verbose => false to not log the status and the flag # for injection (:after or :before) or :force => true for # insert two or more times the same content. # # ==== Examples # # insert_into_file "config/environment.rb", "config.gem :thor", :after => "Rails::Initializer.run do |config|\n" # # insert_into_file "config/environment.rb", :after => "Rails::Initializer.run do |config|\n" do # gems = ask "Which gems would you like to add?" # gems.split(" ").map{ |gem| " config.gem :#{gem}" }.join("\n") # end # WARNINGS = { unchanged_no_flag: 'File unchanged! The supplied flag value not found!' } def insert_into_file(destination, *args, &block) data = block_given? ? block : args.shift config = args.shift || {} config[:after] = /\z/ unless config.key?(:before) || config.key?(:after) action InjectIntoFile.new(self, destination, data, config) end alias_method :inject_into_file, :insert_into_file class InjectIntoFile < EmptyDirectory #:nodoc: attr_reader :replacement, :flag, :behavior def initialize(base, destination, data, config) super(base, destination, {:verbose => true}.merge(config)) @behavior, @flag = if @config.key?(:after) [:after, @config.delete(:after)] else [:before, @config.delete(:before)] end @replacement = data.is_a?(Proc) ? data.call : data @flag = Regexp.escape(@flag) unless @flag.is_a?(Regexp) end def invoke! content = if @behavior == :after '\0' + replacement else replacement + '\0' end if exists? if replace!(/#{flag}/, content, config[:force]) say_status(:invoke) else say_status(:unchanged, warning: WARNINGS[:unchanged_no_flag], color: :red) end else unless pretend? raise Bundler::Thor::Error, "The file #{ destination } does not appear to exist" end end end def revoke! say_status :revoke regexp = if @behavior == :after content = '\1\2' /(#{flag})(.*)(#{Regexp.escape(replacement)})/m else content = '\2\3' /(#{Regexp.escape(replacement)})(.*)(#{flag})/m end replace!(regexp, content, true) end protected def say_status(behavior, warning: nil, color: nil) status = if behavior == :invoke if flag == /\A/ :prepend elsif flag == /\z/ :append else :insert end elsif warning warning else :subtract end super(status, (color || config[:verbose])) end # Adds the content to the file. # def replace!(regexp, string, force) content = File.read(destination) if force || !content.include?(replacement) success = content.gsub!(regexp, string) File.open(destination, "wb") { |file| file.write(content) } unless pretend? success end end end end end
Close