ecchiexploit

example css injection

Oct 17th, 2021
1,146
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html lang="en">
  3.  
  4. <head>
  5.     <meta charset="UTF-8">
  6.     <meta http-equiv="X-UA-Compatible" content="IE=edge">
  7.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  8.     <title>Test</title>
  9.     <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css" integrity="sha384-B0vP5xmATw1+K9KRQjQERJvTumQW0nPEzvF6L/Z6nronJ3oUOFUFpCjEUQouq2+l" crossorigin="anonymous">
  10. </head>
  11.  
  12. <body>
  13.     <div class="container">
  14.         <div class="row">
  15.             <div class="card card-body col-md-4 offset-md-4 mt-3">
  16.                 <h3 class="text-center">Masukan Code HEX Color</h3>
  17.                 <div class="form-group mt-2">
  18.                     <input type="text" id="code" class="form-control">
  19.                 </div>
  20.                 <button class="btn btn-primary" id="sub">Submit</button>
  21.             </div>
  22.         </div>
  23.     </div>
  24.  
  25.     <script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
  26.     <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/js/bootstrap.min.js" integrity="sha384-+YQ4JLhjyBLPDQt//I+STsc9iw4uQqACwlvpslubQzn4u2UU2UFM80nGisd026JF" crossorigin="anonymous"></script>
  27.     <script>
  28.         $(document).ready(function() {
  29.             let code = $('#code');
  30.             code.click(function() {
  31.                 $(this).keyup(function() {
  32.                     $(this).attr("value", $(this).val());
  33.                 });
  34.             });
  35.  
  36.             $('#sub').click(function() {
  37.                 $('head').append("<style>.card {background-color: " + code.val() + "}</style>");
  38.             });
  39.         });
  40.     </script>
  41. </body>
  42.  
  43. </html>
RAW Paste Data