• Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
AnonyViet - English Version
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
No Result
View All Result
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
No Result
View All Result
AnonyViet - English Version
No Result
View All Result

TryHackMe: OWASP Top 10 Challenge Part 1

AnonyViet by AnonyViet
January 26, 2023
in Security
0

In this article, we will explore the challenge OWASP Top 10 above TryHackMe. Through this challenge, you can also learn and exploit each of the top 10 OWASP vulnerabilities. Those are the 10 most important web security risks, read this paragraph to understand more.

Join the channel Telegram of the AnonyViet 👉 Link 👈

TryHackMe: OWASP Top 10 Challenge Part 1

Because this challenge is a bit too much, I will divide it into 3 parts for you to follow and also read to be less boring.

I will go straight to the practical part and skip the technical knowledge. If you want to learn the knowledge or how the vulnerability works, you can go to the room to read it. And note, the websites I visit in this article are Tryhackme’s virtual servers.

TryHackMe: OWASP Top 10 Challenge Part 1

Mission 5: [Mức độ nghiêm trọng 1] Command Injection

What is Active Command Injection?

Blind command injection (Blind command injection) occurs when a system command executed to the server does not return a response to the user in the HTML document. And ACI (Active command injection) will return the response to the user. It can be displayed through a number of HTML elements.

See the following script: EvilCorp started developing on the web platform but was accidentally exposed to the Internet. It’s incomplete but still contains a command injection vulnerability. But this time, the response from the system call can be seen on the web page.

Read the sample code from evilhell.php and see what it’s doing and why it’s getting ACI. I will leave the sample code below.

EvilShell (evilshell.php)

TryHackMe: OWASP Top 10 Challenge Part 1 23

Program analysis:

  1. Check if the parameter “commandString” has been declared.
  2. If so, then the variable $command_string get what was passed into the input field.
  3. The program then enters a try block to execute the function passthru($command_string). You can read the documentation for the passthru() function on the PHP website, but in general it will execute what is entered in the input field, then pass the output directly back to the browser.
  4. If it fails, it will give an error. In general, it won’t output anything because you can’t output it stderr.

Ways to detect Active Command Injection

ACI occurs when you can see a response from a system call. In the above code, the function passthru() direct feedback to the document so you can see it. This command will help you easily view and analyze system errors.

Commands to try

Linux

  • whoami
  • id
  • ifconfig/ip addr
  • uname -a
  • ps -ef

Windows

  • whoami
  • ver
  • ipconfig
  • tasklist
  • nestat -an

To answer the questions below you need to navigate to http://10.10.147.50/evilshell.php.

#1 What strange text file is in the website root directory?

We can go to evilhell.php and try the whoami command.

TryHackMe: OWASP Top 10 Challenge Part 1 24

Try next command uname -a.

TryHackMe: OWASP Top 10 Challenge Part 1 25

Continue to try the command ls.

TryHackMe: OWASP Top 10 Challenge Part 1 26

What do you see? I found the file drpepper.txt.

#2 How many non-root/non-service/non-daemon users are there?

You can try the command cat /etc/passwd

TryHackMe: OWASP Top 10 Challenge Part 1 27

Couldn’t find anything.

#3 What user is this application running as?

We found it upstairs, but let’s rewrite the whoami command.

TryHackMe: OWASP Top 10 Challenge Part 1 24

Answer: www-data

#4 User Shell?

We can find it with the command cat /etc/passwd.

TryHackMe: OWASP Top 10 Challenge Part 1 29

Answer: usr/sbin/nologin

#5 What version of Ubuntu is running?

TryHackMe: OWASP Top 10 Challenge Part 1 30

As the picture above, you just need to enter the command lsb_release -a to know the Ubuntu version the application is running.

Answer: 18.04.4

#6 Watch MOTD

Just do a little search on the internet and you will know the command to show MOTD. MOTD (Message Of The Day) is the message when you start an application in the terminal.

TryHackMe: OWASP Top 10 Challenge Part 1 31

The path of the MOTD file is /etc/update-motd.d. I tried, but nothing. I’m so confused, I decided to come back to see the suggestion :v.

TryHackMe: OWASP Top 10 Challenge Part 1 32

cat /etc/update-motd.d/00-header

TryHackMe: OWASP Top 10 Challenge Part 1 33

Successful!

Answer: DR PEPPER

Mission 7: [Mức độ nghiêm trọng 2] Broken Authentication

For this vulnerability, we will study a logical flaw in the authentication mechanism.

Developers often forget to filter user-provided input (username and password) in their application, which can leave the application vulnerable to SQL injection attacks. And we’re going to focus on a security flaw that’s caused by developer error but is very easy to exploit – re-registering an existing user.

For example, let’s say there is an existing user with the name admin and now we want to have access to that account, so what we can do is try to register that username again but there slightly modified. We will enter “admin” (note the space at the beginning). Now when you enter that information in username field and enter other required information like email or password and send that data. It will register a new user but that user will have the same permissions as normal admin. That new user will also be able to view all of the content presented under the user admin privileges.

To see the demo go to the website http://10.10.147.50:8888 and try to register the username, you will see that user already exists, so try to register a user “darren” and you will see that we are now signed in and will be able to view content that is only available in Darren’s account, and this is where we exploit this vulnerability.

TryHackMe: OWASP Top 10 Challenge Part 1 35

I put a space in front of the word darren.

I am logged in as a member. It’s successful!

We have found the flag.

TryHackMe: OWASP Top 10 Challenge Part 1 38

Answer: fe86079416a21a3c99937fea8874b667

#2 Now try to do the same trick and see if you can login with arthur account.

TryHackMe: OWASP Top 10 Challenge Part 1 39

TryHackMe: OWASP Top 10 Challenge Part 1 36

TryHackMe: OWASP Top 10 Challenge Part 1 41

TryHackMe: OWASP Top 10 Challenge Part 1 34

#3 What’s the flag you found in Arthur’s account?

TryHackMe: OWASP Top 10 Challenge Part 1 43

Answer: d9ac0f7db4fda460ac3edeb75d75e16e

Complete 2 common errors in OWASP 10, Broken Authentication and Command Injection.

The next part will still be exploiting other bugs in OWASP 10.

The article achieved: 5/5 – (100 votes)

Tags: challengeOWASPPartTopTryhackme
Previous Post

Lesson 95: How to import Access data files into Excel

Next Post

Should I choose Parrot OS or Kali Linux to learn Hack?

AnonyViet

AnonyViet

Related Posts

How to implement Shellcode Injection attack technique with Autoit
Security

How to implement Shellcode Injection attack technique with Autoit

March 14, 2025
How to exploit the holy hole of Hijacking on Windows
Security

How to exploit the holy hole of Hijacking on Windows

March 8, 2025
Hamamal: Shellcode execution technique from afar to overcome Antivirus's discovery
Security

Hamamal: Shellcode execution technique from afar to overcome Antivirus's discovery

February 10, 2025
Snov.io Email Finder: Search emails with only company name/domain name/LinkedIn profile
Security

Snov.io Email Finder: Search emails with only company name/domain name/LinkedIn profile

December 14, 2024
Capsolver: Automatic solution solution for business
Security

Capsolver: Automatic solution solution for business

December 12, 2024
Seekr: Collect & manage OSINT data
Security

Seekr: Collect & manage OSINT data

November 22, 2024
Next Post
Should I choose Parrot OS or Kali Linux to learn Hack?

Should I choose Parrot OS or Kali Linux to learn Hack?

0 0 votes
Article Rating
Subscribe
Login
Notify of
guest

guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments

Recent News

Discover the glowing effect next to the iPhone ios 18 screen

Discover the glowing effect next to the iPhone ios 18 screen

June 8, 2025
[Godot Shooter] #2: Creating characters & shooting bullets

[Godot Shooter] #2: Creating characters & shooting bullets

June 7, 2025

Tải App 89Bet Để Trải Nghiệm Không Giới Hạn

June 6, 2025
What do you need to learn game programming? Is it difficult? How long does it take?

What do you need to learn game programming? Is it difficult? How long does it take?

June 6, 2025
Discover the glowing effect next to the iPhone ios 18 screen

Discover the glowing effect next to the iPhone ios 18 screen

June 8, 2025
[Godot Shooter] #2: Creating characters & shooting bullets

[Godot Shooter] #2: Creating characters & shooting bullets

June 7, 2025

Tải App 89Bet Để Trải Nghiệm Không Giới Hạn

June 6, 2025
AnonyViet - English Version

AnonyViet

AnonyViet is a website share knowledge that you have never learned in school!

We are ready to welcome your comments, as well as your articles sent to AnonyViet.

Follow Us

Contact:

Email: anonyviet.com[@]gmail.com

Main Website: https://anonyviet.com

Recent News

Discover the glowing effect next to the iPhone ios 18 screen

Discover the glowing effect next to the iPhone ios 18 screen

June 8, 2025
[Godot Shooter] #2: Creating characters & shooting bullets

[Godot Shooter] #2: Creating characters & shooting bullets

June 7, 2025
  • Home
  • Home 2
  • Home 3
  • Home 4
  • Home 5
  • Home 6
  • Next Dest Page
  • Sample Page

©2024 AnonyVietFor Knowledge kqxs hôm nay xem phim miễn phí SHBET https://kubet88.yoga/ bj88

No Result
View All Result
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office

©2024 AnonyVietFor Knowledge kqxs hôm nay xem phim miễn phí SHBET https://kubet88.yoga/ bj88

wpDiscuz
0
0
Would love your thoughts, please comment.x
()
x
| Reply