SMB Command Codes

Below is a table giving some of the Core SMB commands:

Table 8. Core SMB Commands

Field Name smb_com Description
SMBmkdir 0x00 Create directory
SMBrmdir 0x01 Delete directory
SMBopen 0x02 Open file
SMBcreate 0x03 Create file
SMBclose 0x04 Close file
SMBflush 0x05 Commit all files
SMBunlink 0x06 Delete file
SMBmv 0x07 Rename file
SMBgetatr 0x08 Get file attribute
SMBsetatr 0x09 Set file attribute
SMBread 0x0a Read byte block
SMBwrite 0x0b Write byte block
SMBlock 0x0c Lock byte block
SMBunlock 0x0d Unlock byte block
SMBmknew 0x0f Create new file
SMBchkpth 0x10 Check directory
SMBexit 0x11 End of process
SMBlseek 0x12 LSEEK
SMBtcon 0x70 Start connection
SMBtdis 0x71 End connection
SMBnegprot 0x72 Verify dialect
SMBbskattr 0x80 Get disk attributes
SMBsearch 0x81 Search multiple files
SMBsplopen 0xc0 Create spool file
SMBsplwr 0xc1 Spool byte block
SMBsplclose 0xc2 Close spool file
SMBsplretq 0xc3 Return print queue
SMBsends 0xd0 Send message
SMBsendb 0xd1 Send broadcast
SMBfwdname 0xd2 Forward user name
SMBcancelf 0xd3 Cancel forward
SMBgetmac 0xd4 Get machine name
SMBsendstrt 0xd5 Start multi-block message
SMBsendend 0xd6 End multi-block message
SMBsendtxt 0xd7 Multi-block message text
Never valid 0xfe Invalid
Implementation-dependent 0xff Implementation-dependent

Below is a table giving some of the Core plus commands:

Table 9. Core plus Commands

Field Name smb_com Description
SMBlockreadr 0x13 Lock then read data
SMBwriteunlock 0x14 Write then unlock data
SMBreadBraw 0x1a Read block raw
SMBwriteBraw 0x1d Write block raw

Below is a table giving some of the LANMAN 1.0 SMB commands:

Table 10. LANMAN 1.0 SMB Commands

Field Name smb_com Description
SMBreadBmpx 0x1b Read block multiplexed
SMBreadBs 0x1c Read block (secondary response)
SMBwriteBmpx 0x1e Write block multiplexed
SMBwriteBs 0x1f Write block (secondary response)
SMBwriteC 0x20 Write complete response
SMBsetattrE 0x22 Set file attributes expanded
SMBgetattrE 0x23 Get file attributes expanded
SMBlockingX 0x24 Lock/unlock byte ranges and X
SMBtrans 0x25 Transaction (name, bytes in/out)
SMBtranss 0x26 Transaction (secondary request/response)
SMBioctl 0x27 Passes the IOCTL to the server
SMBioctls 0x28 IOCTL (secondary request/response)
SMBcopy 0x29 Copy
SMBmove 0x2a Move
SMBecho 0x2b Echo
SMBwriteclose 0x2c Write and Close
SMBopenX 0x2d Open and X
SMBreadX 0x2e Read and X
SMBwriteX 0x2f Write and X
SMBsesssetup 0x73 Session Set Up and X (including User Logon)
SMBtconX 0x75 Tree connect and X
SMBffirst 0x82 Find first
SMBfunique 0x83 Find unique
SMBfclose 0x84 Find close
SMBinvalid 0xfe Invalid command