Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
hakimifr committed Nov 24, 2023
1 parent 73f62e7 commit a4ddd76
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 98 deletions.
28 changes: 28 additions & 0 deletions esppng-system-bypass/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
html {
font-family: 'Quicksand', sans-serif;
background-color: rgb(245, 178, 178);
}

.hello {
position: relative;
text-align: center;
}

input {
border-radius: 7px;
border-color: green;
}

button {
border: none;
border-radius: 13px;
background-color: rgb(193, 2, 138);
color: white;
padding: 5px;
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
transition-duration: 200ms;
}

button:hover {
transform: scale(1.3);
}
14 changes: 10 additions & 4 deletions esppng-system-bypass/index.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="index.css">
<head> <!-- Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Quicksand&display=swap" rel="stylesheet">
<meta charset="UTF-8">
<meta http-equiv="refresh" content="1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>login page bypass by hakimi</title>
</head>
<body>
<form action="https://mrsmkualaklawang.edu.my/epelajar/MenuUtama.asp" class="imgcontainer" method="POST">
<form class="hello" action="https://mrsmkualaklawang.edu.my/epelajar/MenuUtama.asp" class="imgcontainer" method="POST">
<label for="uname"><b>ID Pengguna</b></label>
<input name="txtNoMak" type="text" required id="txtNoMak" placeholder="Masukkan ID Pengguna">

<h1></h1>
<label for="psw"><b>Katalaluan</b></label>
<input type="password" placeholder="Masukkan Katalaluan" name="txtPwd" required>
<h1></h1>

<button class="button11 button111" type="submit">LOG MASUK</button>
<button id="btn" class="button11 button111" type="submit">LOG MASUK</button>
<label>

</label>
Expand Down
98 changes: 4 additions & 94 deletions esppng-system-bypass/index.js
Original file line number Diff line number Diff line change
@@ -1,94 +1,4 @@
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);
});
});
const button = document.getElementById("btn");
button.addEventListener("click", () => {
document.getElementById("btn").innerText = "Loading...";
})

0 comments on commit a4ddd76

Please sign in to comment.