su - root
cd /opt/webssh
wget http://web-shell.googlecode.com/files/WebShell-0.9.6.zip
unzip WebShell-0.9.6.zip
mv WebShell-0.9.6 WebShell
cd WebShell
./make_certificate.sh
./webshell.py --ssl-disable &
cd /etc/httpd/conf.d/
vi webssh.conf
# web-shell
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /webshell/ http://localhost:8022/
ProxyPassReverse /webshell/ http://localhost:8022/
# 設定只允許 127.0.0.1 與 140.92.xxx.xxx 可以連上
<Location /webshell>
Order deny,allow
Deny from all
Allow from 127.0.0.1
Allow from 140.92.
</Location>
如果想要開機或 webshell 無法服務時自動啟動, 可透過
trysrvtool 的 mon_service 來達成
cd /opt/webssh
vi webshell.sh
#!/bin/bash
/opt/webssh/WebShell/webshell.py --ssl-disable &
service httpd restart
chmod a+x webshell.sh
cd /opt/trysrvtool
cp mon_service.conf.default mon_service.conf
vi mon_service.conf
:
webshell localhost 8022 HEAD / HTTP/1.0 Server: BaseHTTP /opt/webssh/webshell.sh
vi /etc/crontab
:
# monitor service
* * * * * root /opt/trysrvtool/mon_service.pl
service crond restart