-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcaptcha.html
More file actions
121 lines (111 loc) · 3.47 KB
/
Copy pathcaptcha.html
File metadata and controls
121 lines (111 loc) · 3.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<!--Captcha Verification System-->
<!DOCTYPE html>
<html>
<head>
<title>Captcha</title>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta content="utf-8" http-equiv="encoding">
</head>
<body>
<center>
<h3>Captcha validation</h3>
<div id="captcha_wrapper">
<div id="captcha"></div>
<input type="text" id="input" placeholder="Insert Captcha" />
<div id="output">securitycode</div>
<div id="captcha_container">
<input type="button" id="checked" onclick="validate();" value="I'm not a robot"/>
</div>
</div><br>
<!-- Scripts -->
<style>
@import url('https://fonts.googleapis.com/css?family=Ubuntu');
body {
margin:0; font-family: 'Ubuntu', sans-serif;
font-size:13px;
}
h3 {
position:absolute; padding:20px;
top:0px; left:100px; color:#379;
}
#input {
position:relative; width:80%; left:5%;
background-color:rgba(40,90,120,0.15);
border:solid 2px #379;
border-radius:4px;
color:#379; margin:10px; padding:5px;
}
#captcha_wrapper {
position:absolute; padding:20px;
top:50px; left:50px;
border-bottom:solid 3px #379;
border-top:solid 3px #379;
background-color:rgba(40,90,120,0.11);
}
#captcha {
position:relative; width:100% height:200px;
background-color:rgba(40,90,120,0.15);
border-radius:4px;
padding:10px; margin:20px;
}
#output {
width:70%; left:10%;
position:relative;
border:solid 1px #379; border-radius:4px;
background-color:rgba(40,90,120,0.15);
padding:1px; margin-bottom:10px;
text-align:center;
display:none;
}
#captcha_container {
position:relative; background-color:rgba(40,90,120,0.3);
border-radius:4px;
padding:30px;
}
</style>
<script>
function rand(captcha_str,fin){
captcha_str="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#$%^&*()_+{}:,./;][=-";
fin=Math.floor(Math.random()*captcha_str.length);
for(let i=0; i<24; i++){
fin+=captcha_str[Math.floor(Math.random()* 85)];
}
console.log(captcha_str.length)
console.log("Security Debug Code: "+fin);
return fin;
}
var doc=document.getElementById("captcha");
doc.innerHTML=(rand());
/*
------------------------------------------------------
:: Code: Captcha
:: Author: Vincent Berger
--------------------------------------------------
Remixed By Mr Discord Animation
*/
function validate(){
var input=document.getElementById("input"),
//check=document.getElementById("checked"),
valid=document.getElementById("output");
if(input.value===doc.textContent){
doc.innerHTML=(rand());
valid.style.display="block";
valid.style.color="#090";
valid.style.border="solid 1px #090";
valid.style.backgroundColor="rgba(0,170,0,0.15)";
valid.innerHTML=("Valid Captcha! Redirecting....");
window.location="./youtube-test.html";
}else{
doc.innerHTML=(rand());
valid.style.display="block";
valid.style.color="#900";
valid.style.border="solid 1px #900";
valid.style.backgroundColor="rgba(170,0,0,0.15)";
valid.innerHTML=("Invalid Captcha! Try again!");
console.log("Incorrect Debug Code: " + input.value)
}
}
</script>
</center>
</body>
</html>