这篇文章距离上次修改已过半年,其中的信息可能已经有所发展或是发生改变。

转换为语音并朗读全文 00:00 / 00:00

20130904172702

博主在一个网站看到了一堆被黑的网站,在一堆被黑的网站里看到了一个自动打字机的页面,于是,博主兴致来了,码了这套代码。

我把代码贴出来,你只需要复制粘贴就行了,使用方法自己摸索吧,或者找谷哥和度娘吧~

403演示页:http://demo.yuxiaoxi.com/403/

404演示页:http://demo.yuxiaoxi.com/404/

至于500、501和502的演示嘛,这个服务器挂了的时候就会出现!

好了话不多说,下面开始贴代码,文章比较长,你可以直接下载压缩包,我也只能帮你到这了。

代码直达: 403404500501502

403错误提示页代码

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>403 Forbidden :( </title>
<style type="text/css">
::-moz-selection {
background: #fff;
text-shadow: none;
}
::selection {
background: #fff;
text-shadow: none;
}
body {
font-family: NSimSun;
background: #000;
color: #C0C0C0;
font-size: 12pt;
}
#blink {
display: inline;
color: #0F0;
}
.errorpop {
font-family: "Microsoft YaHei", Helvetica, Arial, sans-serif;
color: #737373;
max-width: 380px;
_width: 380px;
margin: 0 auto;
margin-top: 50px;
text-align: center;
padding: 30px 20px 50px;
border-radius: 4px;
box-shadow: 0 1px 10px #a7a7a7, inset 0 1px 0 #fff;
background: #fcfcfc;
display: none;
}
h1 {
margin: 0 10px;
font-size: 42px;
}
p {
margin-top: 50px;
margin-bottom: -20px;
font-size: 16px;
}
a:link, a:visited, a:active {
color: #888;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
</style>
<script type="text/javascript">
var charIndex = -1;
var stringLength = 0;
var inputText;
function writeContent(init){
if(init){
inputText = document.getElementById('errormsg').innerHTML;
}
if(charIndex==-1){
charIndex = 0;
stringLength = inputText.length;
}
var initString = document.getElementById('echoerror').innerHTML;
initString = initString.replace(/<span.*$/gi,"");

var theChar = inputText.charAt(charIndex);
var nextFourChars = inputText.substr(charIndex,4);
if(nextFourChars=='<br>'){
theChar = '<br>';
charIndex+=3;
}
initString = initString + theChar + "<span id='blink'>▌</span>";
document.getElementById('echoerror').innerHTML = initString;
charIndex = charIndex/1 +1;
if(charIndex<=stringLength){
setTimeout('writeContent(false)',40);
}else{
document.getElementById('errorpop').style.display = "block";
}
}
</script>
</head>
<body>
<div id="echoerror"></div>
<div id="errormsg" style="display:none"> login as: visitor <br>
visitor@<?php echo $_SERVER['HTTP_HOST'];?>'s password: <br>
Access denied<br>
visitor@<?php echo $_SERVER['HTTP_HOST'];?>'s password: </div>
<div class="errorpop" id="errorpop">
<h1>403 Forbidden</h1>
<p><a href="http://www.yuxiaoxi.com">麦田一根葱</a>&nbsp;&nbsp;<a href="mailto:i@yuxiaoxi.com">i@yuxiaoxi.com</a></p>
</div>
<script type="text/javascript">
writeContent(true)
</script>
</body>
</html>

404错误提示页代码

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>404 Not Found :( </title>
<style type="text/css">
::-moz-selection {
background: #fff;
text-shadow: none;
}
::selection {
background: #fff;
text-shadow: none;
}
body {
font-family: NSimSun;
background: #000;
color: #C0C0C0;
font-size: 12pt;
}
#blink {
display: inline;
color: #0F0;
}
.errorpop {
font-family: "Microsoft YaHei", Helvetica, Arial, sans-serif;
color: #737373;
max-width: 380px;
_width: 380px;
margin: 0 auto;
margin-top: 50px;
text-align: center;
padding: 30px 20px 50px;
border-radius: 4px;
box-shadow: 0 1px 10px #a7a7a7, inset 0 1px 0 #fff;
background: #fcfcfc;
display: none;
}
h1 {
margin: 0 10px;
font-size: 42px;
}
p {
margin-top: 50px;
margin-bottom: -20px;
font-size: 16px;
}
a:link, a:visited, a:active {
color: #888;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
</style>
<script type="text/javascript">
var charIndex = -1;
var stringLength = 0;
var inputText;
function writeContent(init){
if(init){
inputText = document.getElementById('errormsg').innerHTML;
}
if(charIndex==-1){
charIndex = 0;
stringLength = inputText.length;
}
var initString = document.getElementById('echoerror').innerHTML;
initString = initString.replace(/<span.*$/gi,"");

var theChar = inputText.charAt(charIndex);
var nextFourChars = inputText.substr(charIndex,4);
if(nextFourChars=='<br>'){
theChar = '<br>';
charIndex+=3;
}
initString = initString + theChar + "<span id='blink'>▌</span>";
document.getElementById('echoerror').innerHTML = initString;
charIndex = charIndex/1 +1;
if(charIndex<=stringLength){
setTimeout('writeContent(false)',40);
}else{
document.getElementById('errorpop').style.display = "block";
}
}
</script>
</head>
<body>
<div id="echoerror"></div>
<div id="errormsg" style="display:none"> login as: visitor <br>
visitor@<?php echo $_SERVER['HTTP_HOST'];?>'s password: <br>
[visitor@<?php echo $_SERVER['HTTP_HOST'];?> ~]# cat <?php echo $_SERVER['REQUEST_URI'];?><br>
cat: <?php echo $_SERVER['REQUEST_URI'];?>: 没有那个文件或目录<br>
[visitor@<?php echo $_SERVER['HTTP_HOST'];?> ~]# </div>
<div class="errorpop" id="errorpop">
<h1>404 Not found</h1>
<p><a href="http://www.yuxiaoxi.com">麦田一根葱</a>&nbsp;&nbsp;<a href="mailto:i@yuxiaoxi.com">i@yuxiaoxi.com</a></p>
</div>
<script type="text/javascript">
writeContent(true)
</script>
</body>
</html>

500错误提示页代码

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>500 Internal Server Error :( </title>
<style type="text/css">
::-moz-selection {
background: #fff;
text-shadow: none;
}
::selection {
background: #fff;
text-shadow: none;
}
body {
font-family: NSimSun;
background: #000;
color: #C0C0C0;
font-size: 12pt;
}
#blink {
display: inline;
color: #0F0;
}
.errorpop {
font-family: "Microsoft YaHei", Helvetica, Arial, sans-serif;
color: #737373;
max-width: 600px;
_width: 600px;
margin: 0 auto;
margin-top: 50px;
text-align: center;
padding: 30px 20px 50px;
border-radius: 4px;
box-shadow: 0 1px 10px #a7a7a7, inset 0 1px 0 #fff;
background: #fcfcfc;
display: none;
}
h1 {
margin: 0 10px;
font-size: 42px;
}
p {
margin-top: 50px;
margin-bottom: -20px;
font-size: 16px;
}
a:link, a:visited, a:active {
color: #888;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
</style>
<script type="text/javascript">
var charIndex = -1;
var stringLength = 0;
var inputText;
function writeContent(init){
if(init){
inputText = document.getElementById('errormsg').innerHTML;
}
if(charIndex==-1){
charIndex = 0;
stringLength = inputText.length;
}
var initString = document.getElementById('echoerror').innerHTML;
initString = initString.replace(/<span.*$/gi,"");

var theChar = inputText.charAt(charIndex);
var nextFourChars = inputText.substr(charIndex,4);
if(nextFourChars=='<br>'){
theChar = '<br>';
charIndex+=3;
}
initString = initString + theChar + "<span id='blink'>▌</span>";
document.getElementById('echoerror').innerHTML = initString;
charIndex = charIndex/1 +1;
if(charIndex<=stringLength){
setTimeout('writeContent(false)',40);
}else{
document.getElementById('errorpop').style.display = "block";
}
}
</script>
</head>
<body>
<div id="echoerror"></div>
<div id="errormsg" style="display:none"> login as: visitor <br>
visitor@<?php echo $_SERVER['HTTP_HOST'];?>'s password: <br>
[visitor@<?php echo $_SERVER['HTTP_HOST'];?> ~]# <br>
......<br>
[visitor@<?php echo $_SERVER['HTTP_HOST'];?> ~]# make<br>
......<br>
gcc: 内部错误:已杀死 (程序 cc1)<br>
请提交一份完整的错误报告。<br>
具体步骤请参见 http://www.yuxiaoxi.com/guestbook。<br>
make: *** [***] 错误<br>
[visitor@<?php echo $_SERVER['HTTP_HOST'];?> ~]# </div>
<div class="errorpop" id="errorpop">
<h1>500 Internal Server Error</h1>
<p><a href="http://www.yuxiaoxi.com">麦田一根葱</a>&nbsp;&nbsp;<a href="mailto:i@yuxiaoxi.com">i@yuxiaoxi.com</a></p>
</div>
<script type="text/javascript">
writeContent(true)
</script>
</body>
</html>

501错误提示页代码

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>501 Not Implemented :( </title>
<style type="text/css">
::-moz-selection {
background: #fff;
text-shadow: none;
}
::selection {
background: #fff;
text-shadow: none;
}
body {
font-family: NSimSun;
background: #000;
color: #C0C0C0;
font-size: 12pt;
}
#blink {
display: inline;
color: #0F0;
}
.errorpop {
font-family: "Microsoft YaHei", Helvetica, Arial, sans-serif;
color: #737373;
max-width: 500px;
_width: 500px;
margin: 0 auto;
margin-top: 50px;
text-align: center;
padding: 30px 20px 50px;
border-radius: 4px;
box-shadow: 0 1px 10px #a7a7a7, inset 0 1px 0 #fff;
background: #fcfcfc;
display: none;
}
h1 {
margin: 0 10px;
font-size: 42px;
}
p {
margin-top: 50px;
margin-bottom: -20px;
font-size: 16px;
}
a:link, a:visited, a:active {
color: #888;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
</style>
<script type="text/javascript">
var charIndex = -1;
var stringLength = 0;
var inputText;
function writeContent(init){
if(init){
inputText = document.getElementById('errormsg').innerHTML;
}
if(charIndex==-1){
charIndex = 0;
stringLength = inputText.length;
}
var initString = document.getElementById('echoerror').innerHTML;
initString = initString.replace(/<span.*$/gi,"");

var theChar = inputText.charAt(charIndex);
var nextFourChars = inputText.substr(charIndex,4);
if(nextFourChars=='<br>'){
theChar = '<br>';
charIndex+=3;
}
initString = initString + theChar + "<span id='blink'>▌</span>";
document.getElementById('echoerror').innerHTML = initString;
charIndex = charIndex/1 +1;
if(charIndex<=stringLength){
setTimeout('writeContent(false)',40);
}else{
document.getElementById('errorpop').style.display = "block";
}
}
</script>
</head>
<body>
<div id="echoerror"></div>
<div id="errormsg" style="display:none"> login as: visitor <br>
visitor@<?php echo $_SERVER['HTTP_HOST'];?>'s password: <br>
[visitor@<?php echo $_SERVER['HTTP_HOST'];?> ~]# ******<br>
-bash: ******: command not found<br>
[visitor@<?php echo $_SERVER['HTTP_HOST'];?> ~]# </div>
<div class="errorpop" id="errorpop">
<h1>501 Not Implemented</h1>
<p><a href="http://www.yuxiaoxi.com">麦田一根葱</a>&nbsp;&nbsp;<a href="mailto:i@yuxiaoxi.com">i@yuxiaoxi.com</a></p>
</div>
<script type="text/javascript">
writeContent(true)
</script>
</body>
</html>

502错误提示页代码

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>502 bad gateway :( </title>
<style type="text/css">
::-moz-selection {
background: #fff;
text-shadow: none;
}
::selection {
background: #fff;
text-shadow: none;
}
body {
font-family: NSimSun;
background: #000;
color: #C0C0C0;
font-size: 12pt;
}
#blink {
display: inline;
color: #0F0;
}
.errorpop {
font-family: "Microsoft YaHei", Helvetica, Arial, sans-serif;
color: #737373;
max-width: 400px;
_width: 400px;
margin: 0 auto;
margin-top: 50px;
text-align: center;
padding: 30px 20px 50px;
border-radius: 4px;
box-shadow: 0 1px 10px #a7a7a7, inset 0 1px 0 #fff;
background: #fcfcfc;
display: none;
}
h1 {
margin: 0 10px;
font-size: 42px;
}
p {
margin-top: 50px;
margin-bottom: -20px;
font-size: 16px;
}
a:link, a:visited, a:active {
color: #888;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
</style>
<script type="text/javascript">
var charIndex = -1;
var stringLength = 0;
var inputText;
function writeContent(init){
if(init){
inputText = document.getElementById('errormsg').innerHTML;
}
if(charIndex==-1){
charIndex = 0;
stringLength = inputText.length;
}
var initString = document.getElementById('echoerror').innerHTML;
initString = initString.replace(/<span.*$/gi,"");

var theChar = inputText.charAt(charIndex);
var nextFourChars = inputText.substr(charIndex,4);
if(nextFourChars=='<br>'){
theChar = '<br>';
charIndex+=3;
}
initString = initString + theChar + "<span id='blink'>▌</span>";
document.getElementById('echoerror').innerHTML = initString;
charIndex = charIndex/1 +1;
if(charIndex<=stringLength){
setTimeout('writeContent(false)',40);
}else{
document.getElementById('errorpop').style.display = "block";
}
}
</script>
</head>
<body>
<div id="echoerror"></div>
<div id="errormsg" style="display:none"></div>
<div class="errorpop" id="errorpop">
<h1>502 bad gateway</h1>
<p><a href="http://www.yuxiaoxi.com">麦田一根葱</a>&nbsp;&nbsp;<a href="mailto:i@yuxiaoxi.com">i@yuxiaoxi.com</a></p>
</div>
<script type="text/javascript">
writeContent(true)
</script>
</body>
</html>

演示和下载


403演示页 404演示页 源码打包下载

带符号 * 的表示必填项
  1. todayzhou
    todayzhou

    表示演示页出错了~
    自己码的代码,超赞~~~~ :twisted:

    回复
  2. anopos
    anopos
    demo看不了啊。

    502 Bad Gateway

    nginx/1.5.0

    回复
  3. 小媒体
    小媒体

    呵呵,我之前是用java做了一个,还是挺有用的。

    回复
  4. tiandi
    tiandi

    没有演示没有真相。。。

    回复
  5. 南寻
    南寻

    虽然看不明白,但是感觉好厉害啊~ :roll:

    回复
  6. 席梦思
    席梦思

    折腾折腾。

    回复
  7. 胡桃小泽梅
    胡桃小泽梅

    帅呀,大神 给跪了 :x

    回复
  8. 优搜
    优搜

    演示站挂了~~

    回复
    1. 麦田一根葱
      麦田一根葱博主

      @优搜 :roll: vps面板重装中

      回复