Skip to content

Commit

Permalink
GITBOOK-21: No subject
Browse files Browse the repository at this point in the history
  • Loading branch information
T-Crypt authored and gitbook-bot committed Dec 18, 2023
1 parent 3e1b3ad commit 5851d3e
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 2 deletions.
1 change: 1 addition & 0 deletions SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@
* [Network Services](network-services.md)
* [Metasploit](metasploit.md)
* [Cheat Sheets](cheat-sheets.md)
* [Windows Commands](windows-commands.md)
8 changes: 6 additions & 2 deletions ftp.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# FTP


```shell-session
sudo nmap -sC -sV -p 21 192.168.2.142
```

```
ftp> get Important\ Notes.txt
Expand Down Expand Up @@ -28,7 +30,9 @@ sudo nmap -sV -p21 -sC -A 10.129.14.136 --script-trace
```
{% endcode %}


```shell-session
medusa -u fiona -P /usr/share/wordlists/rockyou.txt -h 10.129.203.7 -M ftp
```

{% code title="Service Interaction" %}
```
Expand Down
8 changes: 8 additions & 0 deletions mssql.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,11 @@ msf6 auxiliary(scanner/mssql/mssql_ping)
```shell-session
python3 mssqlclient.py Administrator@10.129.201.248 -windows-auth
```

```shell-session
sqsh -S 10.129.20.13 -U username -P Password123
```

```cmd-session
C:\htb> sqlcmd -S 10.129.20.13 -U username -P Password123
```
10 changes: 10 additions & 0 deletions mysql.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# MySQL

{% code title="Windows" %}
```cmd-session
mysql.exe -u username -pPassword123 -h 10.129.20.13
```
{% endcode %}

```shell-session
mysql -u username -pPassword123 -h 10.129.20.13
```

```shell-session
sudo nmap 10.129.14.128 -sV -sC -p3306 --script mysql*
```
Expand Down
4 changes: 4 additions & 0 deletions nfs.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ mkdir target-NFS
sudo mount -t nfs 10.129.14.128:/ /target-NFS/ -o nolock
cd target-NFS
tree .
sudo mkdir /mnt/Finance
sudo mount -t cifs -o username=plaintext,password=Password123,domain=. //192.168.220.129/Finance /mnt/Finance
```
{% endcode %}

Expand Down
51 changes: 51 additions & 0 deletions windows-commands.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Windows Commands

{% code title="File Count in C:\" %}
```cmd-session
dir n: /a-d /s /b | find /c ":\"
```
{% endcode %}

{% code title="Search for file with a word" %}
```cmd-session
dir n:\*cred* /s /b
dir n:\*secret* /s /b
```
{% endcode %}

{% code title=" specific word within a text file" %}
```cmd-session
findstr /s /i cred n:\*.*
```
{% endcode %}

### Powershell

{% code title="Powershell Credential Function" %}
```powershell-session
PS C:\htb> $username = 'plaintext'
PS C:\htb> $password = 'Password123'
PS C:\htb> $secpassword = ConvertTo-SecureString $password -AsPlainText -Force
PS C:\htb> $cred = New-Object System.Management.Automation.PSCredential $username, $secpassword
PS C:\htb> New-PSDrive -Name "N" -Root "\\192.168.220.129\Finance" -PSProvider "FileSystem" -Credential $cred
```
{% endcode %}

```powershell-session
Get-ChildItem \\192.168.220.129\Finance\
```

{% code title="File Count" %}
```powershell-session
PS C:\htb> N:
PS N:\> (Get-ChildItem -File -Recurse | Measure-Object).Count
```
{% endcode %}

{% code title="File with string find " %}
```powershell-session
Get-ChildItem -Recurse -Path N:\ | Select-String "cred" -List
```
{% endcode %}

0 comments on commit 5851d3e

Please sign in to comment.