I just started on secure coding.Does anyone know what type of exploit is an attacker performing by executing the code snippet?
They're trying to execute shell commands through SQL injection. The SQL Server
xp_cmdshell system stored procedure lets the executor execute a shell script, and return the script's output as row data.
So if this attack would succeed, the output of that web page would (granted the column would be printed somewhere directly) display something among the lines of:
Pinging 10.10.1.2 with 32 bytes of data:
And the attacker would know this particular attack works, and work their way through more resourceful scripts to execute.