cron

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

cron based payloads.

The payload package contains cron and cronjob based payloads.

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