# KeePass database

### Crack the password

{% code overflow="wrap" %}

```bash
sudo apt-get install -y kpcli #Install keepass tools like keepass2john

# For John
keepass2john Database.kdbx > Keepasshash.txt
# In case if you need a password file to access 
keepass2john -k <file-password> Database.kdbx > Keepasshash.txt

john --wordlist=/usr/share/wordlists/rockyou.txt Keepasshash.txt

# For hashcat
keepass2john CEH.kdbx | cut -d ':' -f 2 > jeeves.keepass # Remove the name of DB at the beggining

hashcat  -a 0 -m 13400 -O jeeves.keepass /usr/share/wordlists/rockyou.txt  
```

{% endcode %}

### Access to Database

```bash
# Install
sudo apt-get install kpcli libterm-readline-gnu-perl libdata-password-perl

# Access (Assume that you crack the passwrod and save it in keypass file. 
kpcli --pwfile=./keypass --kdb=CEH.kdbx    
kpcli:/> help  
kpcli:/> ls 
kpcli:/> cd CEH 
kpcli:/> ls 

# Show entry - change the number
kpcli:/CEH> show 0
kpcli:/CEH> show -f 0
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://iptracej.gitbook.io/windows-linux-and-active-directory-ctf-notes/credential-access/password-cracking/keepass-database.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
