现在的位置: 首页 > 综合 > 正文

禁止右键

2013年12月12日 ⁄ 综合 ⁄ 共 5807字 ⁄ 字号 评论关闭
禁止右键
<script language="javascript">document.oncontextmenu = function() { return false;}</script>
禁止选取<body oncontextmenu="return false" ondragstart="return false" onselectstart ="return false" onselect="document.selection.empty()" oncopy="document.selection.empty()" onbeforecopy="return false"onmouseup="document.selection.empty()">
禁止粘贴
<input type=text onpaste="return false">

禁止屏蔽类:
1.禁止右键
<body oncontextmenu=return(false)>
2.禁止选择
<body onselectstart="return false">

3.禁止粘贴
<body onpaste="return false">

4.禁止直接访问 [必须框架内才行]
<script>
if (top == self)top.location.href = "page.htm";
</script>

5.禁止frame引用
<script>
if (top != self)top.location.href = "page.htm";
</script>

6.禁止功能键Shift,Alt,Ctrl
<script>function key(){
if(event.shiftKey) alert("Shift不允许使用!");} document.onkeydown=key; </script>

数据取得类
1.取得分辨率
<script>document.write("宽为"+screen.Width+"高为"+screen.Height)</script>

2.取得地址栏
<script>document.write(self.location)</script>

3.取得地址栏?后参数
<SCRIPT>var add = top.location;
add = add.toString();
document.write (add.substring(add.indexOf("?")+1,add.length));
</SCRIPT>

常用特效类
1.主页遥控器
文件一.(t1.html)
<SCRIPT language="javascript">
window.open("t2.html","_blank","width=200","height=200","scroll=no");
</SCRIPT>
文件二.(t2.html)
<SCRIPT language="javascript">
function op(add){if (window.opener){window.opener.document.location = add;}}
</SCRIPT>
<a href=# onClick="op(’link1.html’)">地址1 </a><br><a href=# onClick="op(’link2.html’)">地址2 </a><br><a href=# onClick="op(’http://music.jx165.com’)">地址3 </a>

2.只弹一次的窗口
<script>
function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (documents.cookie.length > 0) {offset = documents.cookie.indexOf(search)
if (offset != -1) {offset += search.length;end = documents.cookie.indexOf(";", offset);
if (end == -1)end = documents.cookie.length;returnvalue=unescape(documents.cookie.substring(offset, end))}
}
return returnvalue;
}
function jx165ad(){
if (get_cookie(’jx165ad’)==’’){
documents.cookie="jx165ad=yes"
window.open("ad.html","_blank","width=200","height=200","scroll=no");
}
else {}
}
</script>
<body>
<script>
jx165ad();
</script>

3.鼠标放在连接上强行点击
<script>
function mClk2() {var source=event.srcElement;if (source.tagName=="A")}
document.write("<div onmouseover=mClk2();>");
</script>

网站源代码加密解密保护 [ 2005-5-19 | 单纯小麦 ]
文本代码保护是件很头痛的事,随着了解的加深保护的方法越多,也就意味着漏洞越多.
[-调取原代码的方法-]
1:右键 - 查看原文件
2:查看 - 原文件
3:文件 - 另存为
4:IE缓存
5:还可以通过代码提取

教程代码:
<SCRIPT>
function add()
{
var ress=document.forms[0].it315zhangxx.value
window.location="view-source:"+ress;
}
</SCRIPT>
<p>在网页源代码查看器中输入要查看网页源代码的URL地址:
<p> 
<FORM><INPUT name=it315zhangxx size=56 value=http://></FORM>
<FORM><BR><INPUT onclick=add() type=button value=查看网页源代码></FORM>
[-关于保护-]
先通过代码来禁止IE的一些操作
:禁止另存为
<NOSCRIPT><IFRAME SRC=*.html></IFRAME></NOSCRIPT>
:取消选取、防止复制 不准粘贴 防止复制>
<BODY onselectstart="return false" oncut="return false;" onpaste="return false" onmouseover="window.status=’ ’;return true" oncopy="return false;" bgColor=#ffffff leftMargin=0 topMargin=0>
:禁止右键>
<SCRIPT language=javascript>
<!--

if (window.Event)
document.captureEvents(Event.MOUSEUP);

function nocontextmenu()
{
event.cancelBubble = true
event.returnValue = false;

return false;
}

function norightclick(e)
{
if (window.Event)
{
if (e.which == 2 || e.which == 3)
return false;
}
else
if (event.button == 2 || event.button == 3)
{
event.cancelBubble = true
event.returnValue = false;
return false;
}

}

document.oncontextmenu = nocontextmenu; // for IE5+
document.onmousedown = norightclick; // for all others
//-->
</SCRIPT>

:状态栏固定
<body bgcolor="#fef4d9" onmouseover="self.status=’自定义资料’;return true">
:禁止缓存 在页面中使用HTML标记,如下面:
<HEAD>
<META http-equiv=Pragma content=no-cache>
<META http-equiv=Cache-Control content=no-cache>
<META http-equiv=Expires content=0>
-利用上面的代码可以禁止下面几种手段-
1:右键 - 查看原文件
3:文件 - 另存为
4:IE缓存
-用代码本身很难禁止下面的手段我门就迷惑的方法阻止调出原代码-
2:查看 - 原文件
5:还可以通过代码提取
URL欺骗(可以隐藏真实地址)
教程代码:
<meta http-equiv="refresh" content="0;url=’http://东邪.明天毕竟又是新的一天@www.hack.net/index.htm’">
注意代码中url=’http://东邪.明天毕竟又是新的一天@www.hack.net/index.htm’"
@ 符号前面的[http://东邪.明天毕竟又是新的一天]就是欺骗后在IE中出现的效果 也可以是 http://www.163.com/
后面的不用说就是连接的真实地址 www.hack.net/index.htm
URL迷惑
<meta http-equiv="refresh" content="0;url=’http://东邪.明天毕竟又是新的一天@.htm’">
注意这一段和上面的有什么不同对就是.htm 那.htm是什么呢呵呵其实就是真实地址
怎么访问呢 有.htm吗?呵呵我门要做的就就做一个没有名字的HTM
方法很简单先创建个XXX.htm 上传到 QQ网络硬盘 双激文件名将XXX删除 怎么样.htm出来了吧
这样就算得到原代码很难看出真实地址
列1:http://东邪.明天毕竟又是新的一天@.htm
列2:http://www.163.com/@.htm
呵呵很难看出真实地址是什么吧

[JS禁止 用IE - 查看 - 原文件]
也是迷惑的方法 但是可以绝对禁止以上面的方式调用原文件
要用到JS
教程JS代码
var oPopup = window.createPopup();
var popTop=50;
function popmsg(msgstr){
var winstr="<table style=/"border: 1 solid #000000/" width=/"241/" height=/"172/" border=/"0/" cellpadding=/"0/" cellspacing=/"0/">";
winstr+="<tr><td height=/"150/"></td><td align=/"center/"><table width=/"90%/" height=/"110/" border=/"0/" cellpadding=/"0/" cellspacing=/"0/">";
winstr+="<tr><td valign=/"top/" style=/"font-size:12px; color: #F00000; face: Tahoma/">"+msgstr+"</td></tr></table></td></tr></table>";
oPopup.document.body.innerHTML = winstr;
popshow();
}
function popshow(){
window.status=popTop;
if(popTop>1720){
clearTimeout(mytime);
oPopup.hide();
return;
}else if(popTop>1520&&popTop<1720){
oPopup.show(screen.width-250,screen.height,241,1720-popTop);
}else if(popTop>1500&&popTop<1520){
oPopup.show(screen.width-250,screen.height+(popTop-1720),241,172);
}else if(popTop<180){
oPopup.show(screen.width-250,screen.height,241,popTop);
}else if(popTop<220){
oPopup.show(screen.width-250,screen.height-popTop,241,172);
}
popTop+=10000;
var mytime=setTimeout("popshow();",1);
}
popmsg(" ");
另存为 17789897.js
HTM调用JS代码
<SCRIPT language=javascript
src="17789897.js"></SCRIPT>
呵呵有写朋友可能熟悉但是我要告诉你他现在的作用是禁止同过 [IE - 查看 - 原文件]
区别在这段代码
popTop+=10000;
var mytime=setTimeout("popshow();",1);
看到了吗?速度是10000
不用我说也知道是什么意思了吧
把上面JS和HTM调用JS代码
加到网页里就可以禁止 [IE - 查看 - 原文件]
关于保护我知道的就这些.

[-关于加密-]
我建议重要的代码采用复合加密
方式基本上有以下几种
JS编码
escape加密
8进制转义字符串
16进制转义字符串
10进制HTML编码如下
16进制HTML编码如下
都可以用<script>
<!--
document.write(unescape("加密后的代码"));
//-->
</script>
由于他门的代码很大还有JS文件我就不给了
大家可以去baidu.com搜索
[-关于破解-]
正所谓魔高一尺,道高一丈,再复杂的加密,在多的迷惑,还是要用IE来解码
给大家个超级技巧
在地址栏或按Ctrl+O,输入:
javascript:s=document.documentElement.outerHTML;document.write(’<body></body>’);document.body.innerText=s;
源代码就出来了。不论加密如何复杂,最终都要还原成浏览器可以解析的html代码,而documentElement.outerHTML正是最终的结果.

抱歉!评论已关闭.