当前位置:网站首页>Wargames study notes -- Leviathan
Wargames study notes -- Leviathan
2022-07-03 20:05:00 【Zhaohg720】
Range link :https://overthewire.org/wargames/leviathan/
Level 0
Username: leviathan0
Password: leviathan0
Level 0 --> Level 1
Sign in leviathan0
Home catalog
ls -a
Found a hidden directory .backup
, There is one in the catalog html file Copy the file locally and open it with a browser , Search for password Found the password
Not Found
The requested URL /passwordus.html | This will be fixed later, the password for leviathan1 is rioGegei8m was not found on this server.
Apache/2.4.10 (Debian) Server at leviathan.labs.overthewire.org Port 80
Level 1 --> Level 2
Sign in leviathan1
There is an executable file in the home directory
check
, Password is required for running prompt direct scp Drag to local ida Look at

The key part is to combine the input string with
sex
compare , If it is successful, it will execute shell stay password Enter password /bin/sh This shell, Find that you already have leviathan2 Authority , direct cat The password will do
[email protected]:~$ ./check
password: sex
$ id
uid=12002(leviathan2) gid=12001(leviathan1) groups=12001(leviathan1)
$ cat /etc/leviathan_pass/leviathan2
ougahZi8Ta
$
Level 2 --> Level 3
Sign in leviathan2
The home directory has an executable
printfile
, You should be able to read the password directly according to the prompt [email protected]:~$ ./printfile
*** File Printer ***
Usage: ./printfile filename
[email protected]:~$ ls -l
total 8
-r-sr-x--- 1 leviathan3 leviathan2 7436 Aug 26 2019 printfile
Directly print password file prompt file without this file , Look at the source code
The key here is to use access() This function checks the file name and type of the file , So we should bypass this check , Print the input directly , You can create a soft link to a password file , Create a file with spaces at the beginning of the soft link name , And then execute the command ,access() Check is a file ,cat The execution of will be divided into two files cat To password
mkdir /tmp/leviathan2
cd /tmp/leviathan2
ln -s /etc/leviathan_pass/leviathan3 getpass
touch "getpass 1.txt"
~/printfile getpass\ 1.txt
Level 3 --> Level 4
Sign in leviathan4
It is very similar to the previous question

What is in the main function , The content is do_stuff() In this function

Obviously , The comparison string is snlprintf, The same thing get shell
./level3
Enter the password> snlprintf
[You've got shell]!
$ id
uid=12004(leviathan4) gid=12003(leviathan3) groups=12003(leviathan3)
$ cat /etc/leviathan_pass/leviathan4
Level 4 --> Level 5
Sign in leviathan5
A hidden Directory
.trash
, There's a bin
Executable file [email protected]:~$ ls -la
total 24
drwxr-xr-x 3 root root 4096 Aug 26 2019 .
drwxr-xr-x 10 root root 4096 Aug 26 2019 ..
-rw-r--r-- 1 root root 220 May 15 2017 .bash_logout
-rw-r--r-- 1 root root 3526 May 15 2017 .bashrc
-rw-r--r-- 1 root root 675 May 15 2017 .profile
dr-xr-x--- 2 root leviathan4 4096 Aug 26 2019 .trash
[email protected]:~/.trash$ ltrace ./bin
__libc_start_main(0x80484bb, 1, 0xffffd774, 0x80485b0 <unfinished ...>
fopen("/etc/leviathan_pass/leviathan5", "r") = 0
+++ exited (status 255) +++
[email protected]:~/.trash$ ./bin
01010100 01101001 01110100 01101000 00110100 01100011 01101111 01101011 01100101 01101001 00001010
The output of direct execution is the binary of password , as long as 2 Turn into the system ascii Can
b_password = '01010100 01101001 01110100 01101000 00110100 01100011 01101111 01101011 01100101 01101001 00001010'
list_pasword = b_password.split(' ')
password = []
for i in range(0, len(list_pasword)):
password += chr(int(list_pasword[i], 2))
# print(int(list_pasword[i], 2))
print(password)
Level 5 --> Level 6
Sign in leviathan6
There is an executable program , direct ida to glance at

It's reading /tmp/file.log The content of the document , This file does not exist . So you can still use the soft link method
ln -s /etc/leviathan_pass/leviathan6 /tmp/file.log
Direct execution ./leviathan5
Then the password will be displayed
Level 6 --> Level 7
Sign in leviathan6
[email protected]:~$ ./leviathan6
usage: ./leviathan6 <4 digit code>
Prompt to add four digits , Obviously want us to explode . Because the file on the target is deleted in a short time, which is inconvenient to operate , So copy the file locally , use shell Script explosion
#!/bin/bash
for i in {
1000..9999}
do
/root/Desktop/leviathan6 $i
echo $i
done
Wrong
7122
# ^C
# id
uid=0(root) gid=0(root) groups=0(root)
# ^C
#
You can see the execution to 7123 Enter shell, So input directly on the target 7123 then cat The password will do
[email protected]:~$ ./leviathan6 7123
$ cat /etc/leviathan_pass/leviathan7
边栏推荐
- Global and Chinese market of two in one notebook computers 2022-2028: Research Report on technology, participants, trends, market size and share
- Realize user registration and login
- 2022-06-28 advanced network engineering (XIII) IS-IS route filtering, route summary, authentication, factors affecting the establishment of Isis neighbor relations, other commands and characteristics
- BOC protected alanine zinc porphyrin Zn · TAPP ala BOC / alanine zinc porphyrin Zn · TAPP ala BOC / alanine zinc porphyrin Zn · TAPP ala BOC / alanine zinc porphyrin Zn · TAPP ala BOC supplied by Qiyu
- 2022-06-30 網工進階(十四)路由策略-匹配工具【ACL、IP-Prefix List】、策略工具【Filter-Policy】
- Chapter 2: find the number of daffodils based on decomposition, find the number of daffodils based on combination, find the conformal number in [x, y], explore the n-bit conformal number, recursively
- How to check the permission to write to a directory or file- How do you check for permissions to write to a directory or file?
- Today's work summary and plan: February 14, 2022
- Global and Chinese market of liquid antifreeze 2022-2028: Research Report on technology, participants, trends, market size and share
- Print linked list from end to end
猜你喜欢
Sparse matrix (triple) creation, transpose, traversal, addition, subtraction, multiplication. C implementation
2022-06-30 网工进阶(十四)路由策略-匹配工具【ACL、IP-Prefix List】、策略工具【Filter-Policy】
10 smart contract developer tools that miss and lose
2.3 other data types
Chapter 2: find the box array, complete number in the specified interval, and improve the complete number in the specified interval
[effective Objective-C] - block and grand central distribution
Chapter 1: find the algebraic sum of odd factors, find the same decimal sum s (D, n), simplify the same code decimal sum s (D, n), expand the same code decimal sum s (D, n)
PR 2021 quick start tutorial, material import and management
Phpstudy set LAN access
BOC protected tryptophan porphyrin compound (TAPP Trp BOC) Pink Solid 162.8mg supply - Qiyue supply
随机推荐
2022-06-25 advanced network engineering (XI) IS-IS synchronization process of three tables (neighbor table, routing table, link state database table), LSP, cSNP, psnp, LSP
Ruby replaces gem Alibaba image
6006. Take out the minimum number of magic beans
2022-06-25 网工进阶(十一)IS-IS-三大表(邻居表、路由表、链路状态数据库表)、LSP、CSNP、PSNP、LSP的同步过程
44. Concurrent programming theory
Initialization and instantiation
Leetcode daily question solution: 540 A single element in an ordered array
Don't be afraid of no foundation. Zero foundation doesn't need any technology to reinstall the computer system
Acquisition and transmission of parameters in automatic testing of JMeter interface
Cross compile opencv with contrib
Micro service knowledge sorting - cache technology
2.4 conversion of different data types
4. Data splitting of Flink real-time project
PR 2021 quick start tutorial, material import and management
Chapter 1: extend the same code decimal sum s (D, n)
Chapter 2: find the number of daffodils based on decomposition, find the number of daffodils based on combination, find the conformal number in [x, y], explore the n-bit conformal number, recursively
Derivation of decision tree theory
PR notes:
IP address is such an important knowledge that it's useless to listen to a younger student?
2022-06-30 advanced network engineering (XIV) routing strategy - matching tools [ACL, IP prefix list], policy tools [filter policy]