-
Notifications
You must be signed in to change notification settings - Fork 0
/
hashcat-setup-notes-for-Debian-with-Windows-remoting.txt
171 lines (110 loc) · 5.07 KB
/
hashcat-setup-notes-for-Debian-with-Windows-remoting.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# Hashcat setup adapted from:
https://arminreiter.com/2020/11/using-azure-vm-to-crack-passwords/
https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html
# PSremoting steps use
https://github.com/darkoperator/Posh-SSH
# GCP GPU instructions here:
https://cloud.google.com/compute/docs/gpus/install-drivers-gpu
TLDR;
curl https://raw.githubusercontent.com/GoogleCloudPlatform/compute-gpu-installation/main/linux/install_gpu_driver.py --output install_gpu_driver.py
# this installation takes 20-ish minutes or more for apt install -y cuda . What is normal ?
sudo python3 install_gpu_driver.py
sudo reboot
# Hashcat setup
sudo apt-get install p7zip-full -y
nvidia-smi
# Output from nvidia-smi:
Tue Sep 14 14:32:38 2021
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 465.19.01 Driver Version: 465.19.01 CUDA Version: 11.3 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 NVIDIA Tesla K80 Off | 00000001:00:00.0 Off | 0 |
| N/A 72C P0 65W / 149W | 0MiB / 11441MiB | 1% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| No running processes found |
+-----------------------------------------------------------------------------+
# Install latest version of Hashcat (check https://hashcat.net/hashcat/ to get latest version number)
cd /opt
HASHCAT_VER=hashcat-6.2.4
sudo wget https://hashcat.net/files/${HASHCAT_VER}.7z
sudo 7z x ${HASHCAT_VER}.7z
sudo rm ${HASHCAT_VER}.7z
cd ${HASHCAT_VER}
# make a link using short name
sudo ln -s hashcat.bin hashcat
# grant write perms so that the .pid, .induct and other temp files can be written without sudo
## make more elegant!!!
sudo chmod -R 757 /opt/hashcat-6.2.4/
sudo chmod a+rw /opt/hashcat-6.2.4/hashcat.potfile
sudo chmod a+rw /opt/hashcat-6.2.4/show.log
# Chec for GPU recognition
sudo ./hashcat.bin -I
hashcat (v6.2.4) starting in backend information mode
CUDA Info:
==========
CUDA.Version.: 11.3
Backend Device ID #1
Name...........: NVIDIA Tesla K80
Processor(s)...: 13
Clock..........: 823
Memory.Total...: 11441 MB
Memory.Free....: 11382 MB
PCI.Addr.BDFe..: 0001:00:00.0
OpenCL Info:
============
OpenCL Platform ID #1
Vendor..: NVIDIA Corporation
Name....: NVIDIA CUDA
Version.: OpenCL 3.0 CUDA 11.3.55
Backend Device ID #2
Type...........: GPU
Vendor.ID......: 32
Vendor.........: NVIDIA Corporation
Name...........: NVIDIA Tesla K80
Version........: OpenCL 3.0 CUDA
Processor(s)...: 13
Clock..........: 823
Memory.Total...: 11441 MB (limited to 2860 MB allocatable in one block)
Memory.Free....: 11328 MB
OpenCL.Version.: OpenCL C 1.2
Driver.Version.: 465.19.01
PCI.Addr.BDF...: 00:00.0
mkdir wordlists
cd wordlists
sudo wget http://thehackerplaybook.com/get.php?type=THP-password
sudo 7z x
rm get
cd ../rules
sudo wget https://raw.githubusercontent.com/NotSoSecure/password_cracking_rules/master/OneRuleToRuleThemAll.rule
# Finicky syntax
sudo ./hashcat.bin -m 1000 -O --outfile x.txt --potfile-disable -r rules/OneRuleToRuleThemAll.rule hash-to-crack.txt wordlists/40GB_CleanUpFile.txt
# Remoting setup
# On Windows client
# Install OpenSSH
Get-WindowsCapability -Online | Where-Object {$_.Name -like 'OpenSSH.Client*'} | Add-WindowsCapability -Online
- OR -
See DISM batch file in this folder
Make sure ssh.exe is in your path.
c:\Windows\System32\OpenSSH\ssh.exe
# on Ubuntu server (using direct download method)
https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-7.1#installation-via-direct-download---ubuntu-1604
sudo wget https://github.com/PowerShell/PowerShell/releases/download/v7.1.4/powershell_7.1.4-1.ubuntu.16.04_amd64.deb
sudo dpkg -i powershell_7.1.4-1.ubuntu.16.04_amd64.deb
# Ignore dependency errors from above ^^. Next command resolves
sudo apt-get install -f
# Add the following (commented) line to the sshd config (near SFTP line)
# Subsystem powershell /usr/bin/pwsh -sshs -NoLogo
sudo vi /etc/ssh/sshd_config
sudo systemctl restart sshd.
# Test from client
$SessionParams = @{SSHTransport = $true; UserName = "$env:USERNAME@$env:USERDNSDOMAIN"; HostName = "SRV1"; }