本文目录一览:
网站问题 HTML格式 怎么防止查看源文件以及被攻击
如果是html的页面,那么就很安全,从页面途径不可能破解和攻击.但是,攻击你的站点并不是只有从页面这个途径的.所以,这个时候攻击你的服务器才是主要途径.那个和html没关系了.
你想隐藏源文件的话,倒是可以,首先使用以js输出html的方式去写成脚本嵌入页面,然后使用packer或是min方式将js代码压缩混淆.但是这种方式只能防止别人看你源码的时候没那么轻松.如果真想看你的源码,一样会有 *** 的.一种方式就是解密你的js脚本,另一种方式就是从浏览器端获取html代码,因为浏览器只能解释明文的html代码,虽然,这个时候获取到的html和你的源码稍微有点出入.
如果怕攻击,写成html倒是不错的途径,这个时候只要关注服务器端的安全就行了,因为一般的黑客只停留在连接注入的阶段,能有气候攻击服务器的黑客少之又少.
是不是需要写成jsp看需要了,如果有需要动态更新的,你就需要编程了.就像刚才所提的,写成动态语言的就增加了被攻击的几率,你要保证代码的安全才行
怎么把黑客帝国的这段代码放在html主页的背后
!--使用position:absolute;z-index:100;--
canvas id="q"/canvas
div id="main" style=" position:absolute;z-index:100;top:10px;width:960px;height:400px;background:red;"123/div
script type="text/javascript"
var s = window.screen;
var width = q.width = s.width;
var height = q.height = s.height;
var letters = Array(256).join(1).split('');
var _div=document.getElementById("main");
_div.style.left=(width-960)/2+"px";//给主页面left定位;
var draw = function () {
q.getContext('2d').fillStyle='rgba(0,0,0,.05)';
q.getContext('2d').fillRect(0,0,width,height);
q.getContext('2d').fillStyle='#0F0';
letters.map(function(y_pos, index){
text = String.fromCharCode(3e4+Math.random()*33);
x_pos = index * 10;
q.getContext('2d').fillText(text, x_pos, y_pos);
letters[index] = (y_pos 758 + Math.random() * 1e4) ? 0 : y_pos + 10;
});
};
setInterval(draw, 33);
/script
关于黑页代码
右键查看源文件,如果禁止右键,就用浏览器的查看--查看源文件就能看到了,如果加密,可以到在线解密站点解密,现在黑页自己写的少了,基本都改别人的
我要黑客帝国里的数字流星雨代码,用html或asp写的
htmlstyle type="text/css"
!--
body {
background-color: #000000;
}
--
/style
Body
script language="JavaScript"
!--
if (document.all){
Cols=60;
Cl=20;//Space's are included so real length is 48!
Cs=20;
Ts=20;
Tc='#008800';
Tc1='#00ff00';
MnS=20;
MxS=30;
I=Cs;
Sp=new Array();S=new Array();Y=new Array();
C=new Array();M=new Array();B=new Array();
RC=new Array();E=new Array();Tcc=new Array(0,1);
document.write(" div id='Container' style='position:absolute;top:0;left:-"+Cs+"'");
document.write(" div style='position:relative'");
for(i=0; i Cols; i++){
S[i]=I+=Cs;
document.write(" div id='A' style='position:absolute;top:0;font-family:Arial;font-size:"
+Ts+"px;left:"+S[i]+";width:"+Ts+"px;height:0px;color:"+Tc+";visibility:hidden' /div");
}
document.write(" /div /div");
for(j=0; j Cols; j++){
RC[j]=1+Math.round(Math.random()*Cl);
Y[j]=0;
Sp[j]=Math.round(MnS+Math.random()*MxS);
for(i=0; i RC[j]; i++){
B[i]='';
C[i]=Math.round(Math.random()*1)+' ';
M[j]=B[0]+=C[i];
}
}
function Cycle(){
Container.style.top=window.document.body.scrollTop;
for (i=0; i Cols; i++){
var r = Math.floor(Math.random()*Tcc.length);
E[i] = ' font color='+Tc1+''+Tcc[r]+' /font';
Y[i]+=Sp[i];
if (Y[i] window.document.body.clientHeight){
for(i2=0; i2 Cols; i2++){
RC[i2]=1+Math.round(Math.random()*Cl);
for(i3=0; i3 RC[i2]; i3++){
B[i3]='';
C[i3]=Math.round(Math.random()*1)+' ';
C[Math.floor(Math.random()*i2)]=' '+' ';
M[i]=B[0]+=C[i3];
Y[i]=-Ts*M[i].length/1.5;
A[i].style.visibility='visible';
}
Sp[i]=Math.round(MnS+Math.random()*MxS);
}
}
A[i].style.top=Y[i];
A[i].innerHTML=M[i]+' '+E[i]+' ';
}
setTimeout('Cycle()',20)
}
Cycle();
}
// --
/script
/body
/html
演示地址:
网上找的代码,我给你改了下