fileplant

package
v1.42.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

file planting based payloads.

The fileplant package contains payloads to aid the exploit developer in achieving execution via binary planting, dll planting, and just general file hijinks.

Index

Constants

This section is empty.

Variables

View Source
var Cron = &CronPayload{}

Functions

This section is empty.

Types

type CronPayload

type CronPayload struct{}

func (*CronPayload) SelfRemovingCron

func (c *CronPayload) SelfRemovingCron(user string, cronPath string, xploitPath string, payload string) (string, string)

Creates two strings that can be used for gaining execution via "/etc/cron.d". The first return ("cron") should be uploaded to "cronPath" (presumably /etc/cron.d but I don't know your life), and the second return should be uploaded to "xploitPath" (e.g. /tmp/helloworld). The cron file will trigger execution of the bash script which will delete both the cron and itself. Example usage:

cronPath := fmt.Sprintf("/etc/cron.d/%s", random.RandLetters(8))
xploitPath := fmt.Sprintf("/tmp/%s", random.RandLetters(8))
xploit, ok := generatePayload(conf)
if !ok {
    return false
}
cron, xploit := payload.SelfRemovingCron("root", cronPath, xploitPath, xploit)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL