Server Message Block (SMB)
Last updated
Last updated
dir \\192.168.220.129\Finance\net use n: \\192.168.220.129\Finance
net use n: \\192.168.220.129\Finance /user:plaintext Password123# instead of dir
Get-ChildItem \\192.168.220.129\Finance\
# instead of net use
New-PSDrive -Name "N" -Root "\\192.168.220.129\Finance" -PSProvider "FileSystem"
N:
# with username and password
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
N:sudo mkdir /mnt/Finance
sudo mount -t cifs -o username=plaintext,password=Password123,domain=. //192.168.220.129/Finance /mnt/Finance
# or using a credential file
mount -t cifs //192.168.220.129/Finance /mnt/Finance -o credentials=/path/credentialfileusername=plaintext
password=Password123
domain=.