-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
279 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>login page bypass by hakimi</title> | ||
</head> | ||
<body> | ||
<form id="credentials-form" action="https://mrsmkualaklawang.edu.my/epelajar/MenuUtama.asp"> | ||
<label for="txtNoMak">No. Maktab:</label> | ||
<input type="text" id="txtNoMak" name="txtNoMak"><br><br> | ||
|
||
<label for="txtPwd">No. KP:</label> | ||
<input type="password" id="txtPwd" name="txtPwd" required><br><br> | ||
|
||
<input type="submit" name="Submit"> | ||
</form> | ||
</body> | ||
<script src="index.js"></script> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
const form = document.getElementById("credentials-form"); | ||
|
||
function redirect(txtNoMak, txtPwd) { | ||
const menuUrl = 'https://mrsmkualaklawang.edu.my/epelajar/MenuUtama.asp'; | ||
const formData = new FormData(); | ||
formData.append('txtNoMak', txtNoMak); | ||
formData.append('txtPwd', txtPwd); | ||
|
||
fetch(menuUrl, { | ||
method: 'POST', | ||
body: formData, | ||
mode: "no-cors" | ||
}).then(response => { | ||
if (response.status !== 200) { | ||
window.alert("error") | ||
console.log(response); | ||
} else { | ||
window.location.href = menuUrl; | ||
} | ||
}) | ||
} | ||
|
||
function unlockCORSAnywhere() { | ||
// Create a URL for the CORS Anywhere unlock endpoint | ||
const unlockURL = 'https://cors-anywhere.herokuapp.com/corsdemo'; | ||
|
||
// Send an OPTIONS request to the unlock endpoint | ||
fetch(unlockURL, { | ||
method: 'OPTIONS', | ||
headers: { | ||
'Origin': 'https://Hakimi0804.github.io', // Replace with your website's origin | ||
'Access-Control-Request-Method': 'POST', // Replace with the HTTP method you intend to use | ||
}, | ||
}) | ||
.then(response => { | ||
if (response.ok) { | ||
console.log('CORS Anywhere unlocked'); | ||
// You can now proceed to make POST requests | ||
} else { | ||
console.error('Failed to unlock CORS Anywhere'); | ||
} | ||
}) | ||
.catch(error => { | ||
console.error('Error:', error); | ||
}); | ||
} | ||
|
||
|
||
form.addEventListener('submit', function(event) { | ||
event.preventDefault(); | ||
|
||
const txtNoMak = document.getElementById('txtNoMak').value; | ||
const txtPwd = document.getElementById('txtPwd').value; | ||
|
||
console.log(`No. Maktab: ${txtNoMak}`); | ||
console.log(`No. KP: ${txtPwd}`); | ||
|
||
const menuUrl = 'https://mrsmkualaklawang.edu.my/epelajar/MenuUtama.asp'; | ||
const formData = new FormData(document.getElementById("credentials-form")); | ||
|
||
// fetch(menuUrl, { | ||
// method: 'POST', | ||
// body: formData, | ||
// mode: "no-cors", | ||
// }).then(response => { | ||
// if (!response.ok) { | ||
// window.alert("error"); | ||
// console.debug(response); | ||
// } else { | ||
// window.location.href = menuUrl; | ||
// } | ||
// }) | ||
|
||
unlockCORSAnywhere(); | ||
fetch('https://cors-anywhere.herokuapp.com/https://mrsmkualaklawang.edu.my/epelajar/MenuUtama.asp', { | ||
method: 'POST', | ||
body: formData, | ||
headers: { | ||
'X-Requested-With': 'XMLHttpRequest' // Required header for CORS Anywhere | ||
} | ||
}) | ||
.then(response => { | ||
if (response.ok) { | ||
console.log('Form data sent successfully'); | ||
window.location.href = menuUrl; | ||
} else { | ||
window.alert("error"); | ||
console.error('Failed to send form data'); | ||
} | ||
}) | ||
.catch(error => { | ||
console.error('Error:', error); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,165 @@ | ||
<!DOCTYPE html> | ||
|
||
<html> | ||
<head> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<style> | ||
body {font-family: Arial, Helvetica, sans-serif;} | ||
form { | ||
border: 3px solid #f1f1f1; | ||
width: 25%; | ||
} | ||
|
||
input[type=text], input[type=password] { | ||
width: 100%; | ||
padding: 12px 20px; | ||
margin: 8px 0; | ||
display: inline-block; | ||
border: 1px solid #ccc; | ||
box-sizing: border-box; | ||
text-align:center; | ||
} | ||
|
||
button { | ||
background-color: #4CAF50; | ||
color: white; | ||
padding: 14px 20px; | ||
margin: 8px 0; | ||
border: none; | ||
cursor: pointer; | ||
width: 100%; | ||
} | ||
|
||
button:hover { | ||
opacity: 0.8; | ||
} | ||
|
||
.button11 { | ||
background-color: #4CAF50; /* Green */ | ||
border: none; | ||
color: white; | ||
padding: 16px 32px; | ||
border-radius: 8px; | ||
text-align: center; | ||
text-decoration: none; | ||
display: inline-block; | ||
font-size: 16px; | ||
margin: 4px 2px; | ||
-webkit-transition-duration: 0.4s; /* Safari */ | ||
transition-duration: 0.4s; | ||
cursor: pointer; | ||
} | ||
|
||
.button111 { | ||
background-color: #4CAF50; | ||
color: white; | ||
border: 2px solid black; | ||
} | ||
|
||
.button111:hover { | ||
background-color: #e7e7e7; | ||
color: black; | ||
} | ||
|
||
|
||
.cancelbtn { | ||
width: auto; | ||
padding: 10px 18px; | ||
background-color: #f44336; | ||
} | ||
|
||
.imgcontainer { | ||
background-image: url("images/bg-02.png"); | ||
background-color: #cccccc; | ||
height: 330px; | ||
background-position: center; | ||
background-repeat: no-repeat; | ||
background-size: cover; | ||
position: relative; | ||
|
||
} | ||
} | ||
|
||
img.avatar { | ||
width: 40%; | ||
border-radius: 50%; | ||
} | ||
|
||
.container { | ||
padding: 16px; | ||
/*width: 25%;*/ | ||
} | ||
|
||
span.psw { | ||
float: right; | ||
padding-top: 16px; | ||
} | ||
|
||
p.a { | ||
font-family:Tahoma, Geneva, sans-serif; | ||
font-size:22px; | ||
font-weight:bold; | ||
} | ||
|
||
div.b { | ||
font-family:Tahoma, Geneva, sans-serif; | ||
font-size:12px; | ||
font-weight:bold; | ||
} | ||
/* Change styles for span and cancel button on extra small screens */ | ||
@media screen and (max-width: 768px) { | ||
span.psw { | ||
display: block; | ||
float: none; | ||
} | ||
.cancelbtn { | ||
width: 100%; | ||
} | ||
|
||
form { | ||
border: 3px solid #f1f1f1; | ||
width: 90%; | ||
} | ||
|
||
.container { | ||
padding: 16px; | ||
width: 90%; | ||
} | ||
} | ||
</style> | ||
<title>..:: e-Pelajar MRSMKuala Klawang::..</title> | ||
</head> | ||
<body> | ||
|
||
<h3 align="center">Selamat Datang ke Sistem<BR> | ||
<img src="images/epelajar.png" width="126" height="47" alt="e-Pelajar"></h3> | ||
|
||
<div align="center"> | ||
<form action="https://mrsmkualaklawang.edu.my/epelajar/MenuUtama.asp" class="imgcontainer" method="POST"> | ||
<p class="a">Maktab Rendah Sains MARA<br>Kuala Klawang</p> | ||
|
||
<div class="container"> | ||
<label for="uname"><b>ID Pengguna</b></label> | ||
<input name="txtNoMak" type="text" required id="txtNoMak" placeholder="Masukkan ID Pengguna"> | ||
|
||
<label for="psw"><b>Katalaluan</b></label> | ||
<input type="password" placeholder="Masukkan Katalaluan" name="txtPwd" required> | ||
|
||
<button class="button11 button111" type="submit">LOG MASUK</button> | ||
<label> | ||
|
||
</label> | ||
</div> | ||
|
||
<div class="container" style="background-color:#f1f1f1"> | ||
|
||
<div class="b"> | ||
Jika terdapat sebarang masalah, sila emel ke [email protected]<br><br> | ||
@Hakcipta terpelihara. MKH-SS 2019. | ||
</div> | ||
</div> | ||
</form> | ||
</div> | ||
|
||
</body> | ||
</html> |