网络编程与渗透技术笔记

CTF网络安全大赛一道简单的web题目:my-first-sqli

红帝
1年前发布

题目来源于:bugku
一道非常简单的sql注入题目
只需要简单的语法注入就行了
web题目:
因PHP代码看不到,只能看到html的代码
页面html源代码:

<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css" rel="stylesheet" />

    <title> My First SQLi </title>
  </head>

  <body>
    <div class="card mt-3 p-3 w-50">
      <div class="card-body">
        <h2></i> Login</h2>

        <form method="POST" action="/">
          <div class="form-group">
            <label for="username">SELECT * FROM USERS WHERE username = </label>
            <input class="form-control" name="username" id="username" required>
            <label for="password">AND password = </label>
            <input class="form-control" name="password" id="password" required>
          </div>
          <br>
          <button type="submit" class="btn btn-primary">Login</button>
        </form>
      </div>
    </div>
  </body>
</html>

ctf.jpg
解题过程:
我们先开始在页面输入

admin'or 1=1 --
  

成功获取到flag
屏幕截图 2024-05-15 215458.png

© 版权声明
THE END
喜欢就支持一下吧
点赞 0 分享 收藏
评论 抢沙发
取消
易航博客
SSL