MSSQL
sqlcmd -S SRVMSSQL -U julio -P 'MyPassword!' -y 30 -Y 30
Login it to mssql remotely
Interactive with MSSQL
Enable File Write (Ole Automation Procedures)

MSSQL, we need to enable Ole Automation Procedures, which requires admin privileges, and then execute some stored procedures to create the fileWrite File

Read File

MSSQL allows file read on any file in the operating system to which the account has read accessImpersonate Existing Users

IMPERSONATE, that allows the executing user to take on the permissions of another user or login until the context is reset or the session ends. Sysadmins can impersonate anyone by default, But for non-administrator users, privileges must be explicitly assigned.
0 indicates, we do not have the sysadmin role, but we can impersonate the sa user
EXECUTE AS LOGIN within the master DB, because all users, by default, have access to that database. If a user you are trying to impersonate doesn't have access to the DB you are connecting to it will present an error. Try to move to the master DB using USE masterWe can now execute any command as a sysadmin as the returned value 1 indicates.Communicate with Other Databases with MSSQL

isremote, where 1 means is a remote server, and 0 is a linked server
Last updated