System() command injection
# include "stdlib.h" # include "stdio.h" void main () {char s; while (1) {printf ("input cmd:"); scanf ("% s", s); system (s);}}
Enter cmd1 | pwd:cmd2 refers to the line
Enter cmd1&&cmd2:cmd1 to refer to the line, cmd2 to execute
Enter cmd1&cmd2:cmd2 to execute, and cmd1 refers to line and hang
Enter cmd1 & cmd2:cmd1 to execute, error report, cmd2 execute
Enter cmd1;cmd2:cmd1 to refer to the line, cmd2 to execute
Reference:
Http://blog.csdn.net/hitwangpeng/article/details/45716821