Skip to content

Commit 5a5755c

Browse files
carlospolopgitbook-bot
authored andcommitted
GitBook: [#3248] No subject
1 parent af790f3 commit 5a5755c

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

Diff for: generic-methodologies-and-resources/brute-force.md

+17
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,23 @@ hashcat.exe -m 13600 -a 0 .\hashzip.txt .\wordlists\rockyou.txt
455455
.\hashcat.exe -m 13600 -i -a 0 .\hashzip.txt #Incremental attack
456456
```
457457
458+
#### Known plaintext zip attack
459+
460+
You need to know the **plaintext** (or part of the plaintext) **of a file contained inside** the encrypted zip. You can check **filenames and size of files contained inside** an encrypted zip running: **`7z l encrypted.zip`**\
461+
Download [**bkcrack** ](https://github.com/kimci86/bkcrack/releases/tag/v1.4.0)from the releases page.
462+
463+
```bash
464+
# You need to create a zip file containing only the file that is inside the encrypted zip
465+
zip plaintext.zip plaintext.file
466+
467+
./bkcrack -C <encrypted.zip> -c <plaintext.file> -P <plaintext.zip> -p <plaintext.file>
468+
# Now wait, this should print akey such as 7b549874 ebc25ec5 7e465e18
469+
# With that key you can create a new zip file with the content of encrypted.zip
470+
# but with a different pass that you set (so you can decrypt it)
471+
./bkcrack -C <encrypted.zip> -U unlocked.zip -k 7b549874 ebc25ec5 7e465e18 new_pwd
472+
unzip unlocked.zip #User new_pwd as password
473+
```
474+
458475
### 7z
459476
460477
```bash

Diff for: linux-hardening/useful-linux-commands/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@ echo "CIKUmMesGw==" | base64 -d | protoc --decode_raw
132132
#Set not removable bit
133133
sudo chattr +i file.txt
134134
sudo chattr -i file.txt #Remove the bit so you can delete it
135+
136+
# List files inside zip
137+
7z l file.zip
135138
```
136139

137140
## Bash for Windows

Diff for: pentesting-web/login-bypass/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ If you find a login page, here you can find some techniques to try to bypass it:
2424
* Check if you can **directly access the restricted pages**
2525
* Check to **not send the parameters** (do not send any or only 1)
2626
* Check the **PHP comparisons error:** `user[]=a&pwd=b` , `user=a&pwd[]=b` , `user[]=a&pwd[]=b`
27+
* **Change content type to json** and send json values (bool true included)
28+
* If you get a response saying that POST is not supported you can try to send the **JSON in the body but with a GET request**
2729
* Check nodejs potential parsing error (read [**this**](https://flattsecurity.medium.com/finding-an-unseen-sql-injection-by-bypassing-escape-functions-in-mysqljs-mysql-90b27f6542b4)): `password[password]=1`
2830
* Nodejs will transform that payload to a query similar to the following one: ` SELECT id, username, left(password, 8) AS snipped_password, email FROM accounts WHERE username='admin' AND`` `` `**`password=password=1`**`;` which makes the password bit to be always true.
2931
* If you can send a JSON object you can send `"password":{"password": 1}` to bypass the login.

0 commit comments

Comments
 (0)