在用户名或者密码框中输入“11‘ or ’1‘ = '1”时,生成的sql语句将为“selec * from userInfo where name = '11' or '1' = '1' and pwd = '11' or '1' = '1'”:该语句永远为真.为了防止sql语句的注入,提高程序的安全性.需要替换危险字符. Java代码段: public class Checkstr {public String dostring(String str){ str=str.replac
使用命令sed.cp.tail.cat 1.拷贝一个任意文件(生产环境切勿操作) cp /etc/profile /tmp 查看文件部分格式 cat /tmp/profile # /etc/profile # System wide environment and startup programs, for login setup # Functions and aliases go in /etc/bashrc # It's NOT a good idea to change this fil