현재 파일구조

webApp

|
| ㅡ index.php

| ㅡ db_connection.php

| ㅡ login.php

| ㅡ register.php


register.php

1 register.php로 POST 요청과 함께 id, pw, name, submit을 전달받으면

2. id 중복체크

3. 회원가입 처리

4. insert의 결과가 1이라면 login.php로 이동

예외처리

POST로 Submit이 왔는데 id가 공란이라면? => 아이디를 입력하세요 출력

POST로 Submit이 왔는데 name이 공란이라면? => name 입력하세요 출력

POST로 Submit이 왔는데 pw가 공란이라면? => 비밀번호를 입력하세요 출력


<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors">
    <meta name="generator" content="Hugo 0.104.2">
    <title>Checkout example · Bootstrap v5.2</title>

    <link rel="canonical" href="https://getbootstrap.com/docs/5.2/examples/checkout/">

    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">    
    <?php
      require_once 'db_connection.php';
    ?>

    <?php
        $is_id = isset($_POST['id']) && $_POST['id'];
        $is_name = isset($_POST['name']) && $_POST['name'];
        $is_pw = isset($_POST['pw']) && $_POST['pw'];
        $is_submit = isset($_POST['submit']);
        // echo 'name' . $is_name;
        /* 
        echo 'name' . ($is_submit && $is_name != 1);
        echo 'id' . $is_id;
        echo 'pw' . $is_pw;
        echo 'sub' . $is_submit;
        */
        if ($is_name && $is_id && $is_pw && $is_submit) {
          $idCount = idCount($_POST['id']);
          // echo 'idcount : ' . $idCount;

          if($idCount < 1) {
            $result = regist($_POST['id'], $_POST['name'], $_POST['pw']);
            if ($result) {
              echo "<script>alert('회원가입 완료.');
              </script>";
              // location.href='주소'
              exit;
            }
          } 
        }
    ?>

<link href="../assets/dist/css/bootstrap.min.css" rel="stylesheet">

    <style>
      .bd-placeholder-img {
        font-size: 1.125rem;
        text-anchor: middle;
        -webkit-user-select: none;
        -moz-user-select: none;
        user-select: none;
      }

      @media (min-width: 768px) {
        .bd-placeholder-img-lg {
          font-size: 3.5rem;
        }
      }

      .b-example-divider {
        height: 3rem;
        background-color: rgba(0, 0, 0, .1);
        border: solid rgba(0, 0, 0, .15);
        border-width: 1px 0;
        box-shadow: inset 0 .5em 1.5em rgba(0, 0, 0, .1), inset 0 .125em .5em rgba(0, 0, 0, .15);
      }

      .b-example-vr {
        flex-shrink: 0;
        width: 1.5rem;
        height: 100vh;
      }

      .bi {
        vertical-align: -.125em;
        fill: currentColor;
      }

      .nav-scroller {
        position: relative;
        z-index: 2;
        height: 2.75rem;
        overflow-y: hidden;
      }

      .nav-scroller .nav {
        display: flex;
        flex-wrap: nowrap;
        padding-bottom: 1rem;
        margin-top: -1px;
        overflow-x: auto;
        text-align: center;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
      }
    </style>


    <!-- Custom styles for this template -->
    <link href="form-validation.css" rel="stylesheet">
  </head>
  <body class="bg-light">

<div class="container">
  <main>
    <div class="py-5 text-center">
      <img class="d-block mx-auto mb-4" src="./assets/images/normaltic_logo.png" alt="" width="72" height="57">
      <h2>회원가입</h2>
      <!-- <p class="lead">하기의 항목을 기입해주세요.</p> -->
    </div>

    <div class="row g-5">

      <div class="">
        <!-- <h4 class="mb-3">Billing address</h4> -->
        <form class="needs-validation" novalidate method="POST">
          <div class="row g-3">

            <div class="">
              <label for="아이디" class="form-label">아이디</label>
              <input type="text" value=
                <?php
                  if (isset($_POST['id'])){
                    echo '"' . $_POST['id'] . '"';
                  } else {
                    echo '""';
                  }
                ?>
              class="form-control" name="id" placeholder="아이디" required>
              <div class="">
                <?php
                    if ($is_submit && $is_id != 1) {
                        echo '아이디를 입력해주세요';
                    } elseif ($is_submit && $idCount > 0 ){
                      echo '이미 존재하는 id 입니다';
                    }
                ?>
              </div>
            </div>

            <div class="">
              <label for="이름" class="form-label">이름</label>
              <input type="text" value=
              <?php
                if(isset($_POST['name'])) {
                  echo '"' . $_POST['name'] . '"';
                } else {
                  echo '""';
                }
                ?>
              name="name" class="form-control" id="username" placeholder="이름" required>
              <div class="">
                <?php
                    if ($is_submit && $is_name != 1) {
                        echo '이름을 입력해주세요';
                    }
                ?>
              </div>
            </div>

            <div class="">
              <label for="비밀번호" class="form-label">비밀번호</label>
              <input type="password" name="pw" class="form-control" id="username" placeholder="비밀번호" required>
              <div class="">
                <?php
                        if ($is_submit && $is_pw != 1) {
                            echo '비밀번호를 입력해주세요';
                        }
                    ?>
              </div>
            </div>

            <input type=text vlaue="submit" style="display:none;" name="submit"/>

          <button class="w-100 btn btn-primary btn-lg" type="submit">회원가입</button>
        </form>
      </div>
    </div>
  </main>

  <footer class="my-5 pt-5 text-muted text-center text-small">
    <p class="mb-1">&copy; 2017–2022 Company Name</p>
    <ul class="list-inline">
      <li class="list-inline-item"><a href="#">Privacy</a></li>
      <li class="list-inline-item"><a href="#">Terms</a></li>
      <li class="list-inline-item"><a href="#">Support</a></li>
    </ul>
  </footer>
</div>


    <script src="../assets/dist/js/bootstrap.bundle.min.js"></script>

      <script src="form-validation.js"></script>
  </body>
</html>

db_connection.php

<?php
    ini_set('display_errors', 1);
    define('DB_SERVER', 'localhost');
    define('DB_USERNAME', 'admin');
    define('DB_PASSWORD', 'student1234');
    define('DB_NAME', 'test');

    $db_conn = mysqli_connect(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME);

    function idCount($id) {
        global $db_conn;

        $sql = "select count(id) as count from user where id ='" . $id . "'";
        $result = mysqli_query($db_conn, $sql);
        $row = mysqli_fetch_array($result);
        return $row['count'];
    }


    function regist($id, $name, $pw) {
        global $db_conn;
        $sql = "insert into user (idx, id, name, pw) value ( null, '"
        . $id . "', '" . $name . "', '" . $pw . "')";

        return mysqli_query($db_conn, $sql);
        // return $sql;
    }

    function login($id, $pw) {
        global $db_conn;
        $sql = "select count(id) as count from user where id = '" . $id . "' and pw='" . $pw . "'";

        $result = mysqli_query($db_conn, $sql);
        $row = mysqli_fetch_array($result);
        return $row['count'];
    }
?>

결과


로그인 로직 구조

1. index.php($_session['id'] 없음) ===== redirection=====> login.php(GET)

2. login = POST => login

3. login.php로 POST 요청과 함께 id, pw, submit을 전달받으면

4. 로그인 처리 후 $_session['id'] 저장 =====redicrct===> index.php

예외처리

POST로 Submit이 왔는데 id가 공란이라면? => 아이디를 입력하세요 출력

POST로 Submit이 왔는데 pw가 공란이라면? => 비밀번호를 입력하세요 출력

POST로 Submit이 존재하고 pw가 존재하고 id가 존재하지만 DB 조회결과 count가 0 이라면 => '아이디 비밀번호를 확인하세요'

`

login.php


<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors">
    <meta name="generator" content="Hugo 0.104.2">
    <title>Checkout example · Bootstrap v5.2</title>

    <link rel="canonical" href="https://getbootstrap.com/docs/5.2/examples/checkout/">

    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">    
    <?php
      require_once 'db_connection.php';
    ?>

    <?php
        $is_id = isset($_POST['id']) && $_POST['id'];
        $is_name = isset($_POST['name']) && $_POST['name'];
        $is_pw = isset($_POST['pw']) && $_POST['pw'];
        $is_submit = isset($_POST['submit']);
        // echo 'name' . $is_name;
        /* 
        echo 'name' . ($is_submit && $is_name != 1);
        echo 'id' . $is_id;
        echo 'pw' . $is_pw;
        echo 'sub' . $is_submit;
        */
        if ($is_name && $is_id && $is_pw && $is_submit) {
          $idCount = idCount($_POST['id']);
          // echo 'idcount : ' . $idCount;

          if($idCount < 1) {
            $result = regist($_POST['id'], $_POST['name'], $_POST['pw']);
            if ($result) {
              echo "<script>alert('회원가입 완료.');
               location.href='login.php'
              </script>";
              exit;
            }
          } 
        }
    ?>

<link href="../assets/dist/css/bootstrap.min.css" rel="stylesheet">

    <style>
      .bd-placeholder-img {
        font-size: 1.125rem;
        text-anchor: middle;
        -webkit-user-select: none;
        -moz-user-select: none;
        user-select: none;
      }

      @media (min-width: 768px) {
        .bd-placeholder-img-lg {
          font-size: 3.5rem;
        }
      }

      .b-example-divider {
        height: 3rem;
        background-color: rgba(0, 0, 0, .1);
        border: solid rgba(0, 0, 0, .15);
        border-width: 1px 0;
        box-shadow: inset 0 .5em 1.5em rgba(0, 0, 0, .1), inset 0 .125em .5em rgba(0, 0, 0, .15);
      }

      .b-example-vr {
        flex-shrink: 0;
        width: 1.5rem;
        height: 100vh;
      }

      .bi {
        vertical-align: -.125em;
        fill: currentColor;
      }

      .nav-scroller {
        position: relative;
        z-index: 2;
        height: 2.75rem;
        overflow-y: hidden;
      }

      .nav-scroller .nav {
        display: flex;
        flex-wrap: nowrap;
        padding-bottom: 1rem;
        margin-top: -1px;
        overflow-x: auto;
        text-align: center;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
      }
    </style>


    <!-- Custom styles for this template -->
    <link href="form-validation.css" rel="stylesheet">
  </head>
  <body class="bg-light">

<div class="container">
  <main>
    <div class="py-5 text-center">
      <img class="d-block mx-auto mb-4" src="./assets/images/normaltic_logo.png" alt="" width="72" height="57">
      <h2>회원가입</h2>
      <!-- <p class="lead">하기의 항목을 기입해주세요.</p> -->
    </div>

    <div class="row g-5">

      <div class="">
        <!-- <h4 class="mb-3">Billing address</h4> -->
        <form class="needs-validation" novalidate method="POST">
          <div class="row g-3">

            <div class="">
              <label for="아이디" class="form-label">아이디</label>
              <input type="text" value=
                <?php
                  if (isset($_POST['id'])){
                    echo '"' . $_POST['id'] . '"';
                  } else {
                    echo '""';
                  }
                ?>
              class="form-control" name="id" placeholder="아이디" required>
              <div class="">
                <?php
                    if ($is_submit && $is_id != 1) {
                        echo '아이디를 입력해주세요';
                    } elseif ($is_submit && isset($idCount) && $idCount > 0 ){
                      echo '이미 존재하는 id 입니다';
                    }
                ?>
              </div>
            </div>

            <div class="">
              <label for="이름" class="form-label">이름</label>
              <input type="text" value=
              <?php
                if(isset($_POST['name'])) {
                  echo '"' . $_POST['name'] . '"';
                } else {
                  echo '""';
                }
                ?>
              name="name" class="form-control" id="username" placeholder="이름" required>
              <div class="">
                <?php
                    if ($is_submit && $is_name != 1) {
                        echo '이름을 입력해주세요';
                    }
                ?>
              </div>
            </div>

            <div class="">
              <label for="비밀번호" class="form-label">비밀번호</label>
              <input type="password" name="pw" class="form-control" id="username" placeholder="비밀번호" required>
              <div class="">
                <?php
                        if ($is_submit && $is_pw != 1) {
                            echo '비밀번호를 입력해주세요';
                        }
                    ?>
              </div>
            </div>

            <input type=text vlaue="submit" style="display:none;" name="submit"/>

          <button class="w-100 btn btn-primary btn-lg" type="submit">회원가입</button>
        </form>
      </div>
    </div>
  </main>

  <footer class="my-5 pt-5 text-muted text-center text-small">
    <p class="mb-1">&copy; 2017–2022 Company Name</p>
    <ul class="list-inline">
      <li class="list-inline-item"><a href="#">Privacy</a></li>
      <li class="list-inline-item"><a href="#">Terms</a></li>
      <li class="list-inline-item"><a href="#">Support</a></li>
    </ul>
  </footer>
</div>


    <script src="../assets/dist/js/bootstrap.bundle.min.js"></script>

      <script src="form-validation.js"></script>
  </body>
</html>

index.php

<?php
  ini_set('display_errors', 1);
  session_start();

  echo 'aaa: ' . session_id();
  if(!$_SESSION['id']) {
      header('location:login.php');
      eixt;
  }
  echo '<br>';
  echo $_SESSION['id'] . 'is login';

?>

 


 

결과

'웹 해킹 코스 > 과제' 카테고리의 다른 글

3-2 JWT 토큰이란?  (3) 2023.11.12
3-1(로그인 케이스)  (0) 2023.11.09
2-1 php와 DB연결  (0) 2023.11.02
1-3 CSS를 사용하여 로그인 페이지 꾸미기  (0) 2023.10.29
1-2 WAS POST방식 데이터 전달  (0) 2023.10.27

## 이번주차 과제

1. 복습

2. DataBase에서 이름, 점수 조회하기(name = doldol)

3. 회원가입 페이지 만들기

4. 로그인 페이지 만들기(DB)연동


기존에 Flask로 WAS를 구성하였는데 과정에서 진행하는 php로 진행하는게 과정 이해에 대해 더 도움이 될 것 같아 php로 다시 수정하고자 한다. (php 잘 모르는데... 큰일이다.)

phpmyadmin 사용한 Database 추가와 Table 추가

test라는 DataBase의 생성과 user라는 테이블을 구성

insert와 select로 데이터를 확인


php로 학생 점수를 조회하기

~/webDev/webApp/mini_test.php

<html>
    <form>
        <input name='name' type='text'>
        <button type='submit' placeholder="이름"> 전송 </button>
    </form>
</html>


<?php
    if (isset($_GET['name'])){

        $name = $_GET['name'];

        ini_set('display_errors', 1);
        define('DB_SERVER', 'localhost');
        define('DB_USERNAME', 'admin');
        define('DB_PASSWORD', 'student1234');
        define('DB_NAME', 'test');

        $db_conn = mysqli_connect(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME);
        $sql = 'select * from user where name = "' . $name . '"';

        $result = mysqli_query($db_conn, $sql);
        //var_dump($result);    
        $row = mysqli_fetch_array($result);
        //var_dump($row);    
        if ($row){
            echo 'userName is :' . $row['name'] . ', socre is : ' . $row['score'];

        } else {
            echo $name . ' is not exists';
        }

    } 
?>

결과

DataBase

일반적인 웹의 구조는 아래와 같다
WEB <=> WAS <=> DB

WAS의 동적화면이나 API를 개발할 때 사용되는 데이터의 저장을 담당하는것이 DB이다.

데이터베이스(영어: database, DB)는 여러 사람이 공유하여 사용할 목적으로 체계화해 통합, 관리하는 데이터의 집합이다.
-위키백과-

Table은 컬럼(column)과 로우(row)로 구성되며 컬럼의 데이터의 속성, row는 속성들의 집합이다.

위키백과

비유

DataBase: 엑셀파일

Table: 엑셀 시트

컬럼: 엑셀의 열

로우: 엑셀의 행


SQL

관계형 데이터베이스 관리 시스템(RDBMS)의 데이터를 관리하기 위해 설계한 특수 목적의 프로그래밍 언어이다. 관계형 데이터베이스 관리 시스템에서 자료의 검색과 관리, 데이터베이스 스키마 생성과 수정, 데이터베이스 객체 접근 조정 관리를 위해 고안하였다.
-위키백과-

즉 DB의 데이터를 관리하기 언어이다.

SQL은 크게 3가지로 나뉘게된다.

  • 데이터 정의 언어 (DDL : Data Definition Language) : DB의 구조 혹은 Table의 구조의 정의, 변경 (create, drop, alter)
  • 데이터 조작 언어 (DML : Data Manipulation Language): 데이터의 생성, 조회, 수정, 삭제 (insert, select, update, delete)
  • 데이터 제어 언어 (DCL : Data Control Language): 사용자 권한 부여 및 제거 등.(grant, revoke)

SELECT 간략한 구조

select [컬럼 명] from [테이블명] where [조건]

insert 구문의 간략한 구조

insert into [테이블] (컬럼명1, 컬럼명2) value ('값1', '값2')

'웹 해킹 코스 > 내용 정리' 카테고리의 다른 글

5주차 SQL Ijection  (2) 2023.11.26
4주차 (burp suitte)  (0) 2023.11.15
3주차 (쿠키, 세션)  (0) 2023.11.08
0주차 (리눅스 기초 명령어)  (2) 2023.10.26
1주차(WEB, WAS, IP, NAT)  (0) 2023.10.26

CSS자체가 어렵기도 하고 디자인적인 감각이 부족하기 때문에 다른 사이트의 로그인 페이지를 카피하고자 한다.

일단 버튼들을 비슷하게 구성하고 form태그를 삽입하자

~/flask01/templates/new_login.html을 생성한다.

네이버 페이지의 html 소스를 분석해보자

F12를 들어가서 개발자도구를 들어가 Elements탭을 클릭한 뒤 가장 왼쪽의 화살표를 클릭한 후 로그인 화면에 가저가보자

아래와 같이 화면이 어떻게 구역이 나뉘어져있는지, Elements 탭에는 어떤 Class와 Tag들이 사용되었는지 알 수 있다.

그리고 하단에는 Style이라고하여 어떤 CSS가 사용되었는지 볼 수 있다.

이것들을 참고하여 인스타그램의 로그인 화면을 만들어보자


결과

더 이상은 못하겟다...

이정도 만드는데도 한참 걸렸다 역시 CSS는 너무 어려운것 같다...
이번 작업중 icon 작업이 가장 힘들었는데 아이콘의 위치가 absolute가 걸려있는데 동적으로 어떻게 처리하는지 전혀 모르겠더라...

화면을 줄여버리자 날아가버리는 아이콘

이제 파이썬과 연동만 하면 과제 끝


 

수정된 app.py

# 이상 생략
@app.route('/login', methods=['GET'])
def login_get():
    msg = request.args.get('msg')
    print("msg: ",msg )
    return render_template('new_login.html', msg=msg)
#이하 생략

html 소스코드

<html>
    <body >
        <header class="heaer">
            <div class="heaer_inner">
                <img src="" alt="">
            </div>
        </header>
        <div class="content" style="margin-top: 20%;">
            <div class="login_wrap">
                <!-- <ul class="menu_wrap" role="tablist">
                    <li class="menu_item" role="presentation">
                        <span class="menu_text menu_qr"><span class="text">ID 로그인</span></span>
                    </li>
                    <li class="menu_item" role="presentation">
                        <span class="menu_text"><span class="text">일회용 번호</span></span>
                    </li>
                    <li class="menu_item" role="presentation">
                        <span class="menu_text"><span class="text">QR코드</span></span>
                    </li>
                </ul> -->
                <ul class="panel_wrap">
                    <li class="panel_item">
                        <form method="POST" action="/login">
                            <div class="panel_inner">
                                <div class="id_pw_wrap">

                                    <div class="input_row" id="id_line">
                                        <div class="icon_cell" id="id_cell">
                                            <span class="icon_id">
                                                <span class="blind">아이디</span>
                                            </span>
                                        </div>
                                        <input type="text" id="id" name="id" placeholder="아이디" title="아이디" class="input_text" maxlength="41" value="">
                                        <span role="button" class="btn_delete" id="id_clear" style="display: none;">
                                            <span class="icon_delete">
                                                <span class="blind">삭제</span>
                                            </span>
                                        </span>
                                    </div>


                                    <div class="input_row" id="pw_line">
                                        <div class="icon_cell" id="pw_cell">
                                            <span class="icon_pw">
                                                <span class="blind">비밀번호</span>
                                            </span>
                                        </div>
                                        <input type="password" id="pw" name="pw" placeholder="비밀번호" title="비밀번호" class="input_text" maxlength="16">
                                        <span role="button" class="btn_delete" id="pw_clear" style="display: none;">
                                            <span class="icon_delete">
                                                <span class="blind">삭제</span>
                                            </span>
                                        </span>
                                    </div>





                                </div>


                                <div class="btn_login_wrap">

                                    <button type="submit" class="btn_login" id="log.login">
                                        <span class="btn_text">로그인</span>
                                    </button>
                                        {% if msg != '' and msg != None %}
                                                {{msg}}
                                        {% endif %}
                                </div>

                            </div>
                        </form>

                    </li>
                </ul>
            </div>
        </div>
    </body>
</html>

<style>
.btn_login .btn_text {
    font-size: 20px;
    font-weight: 700;
    line-height: 24px;
    color: #fff;
}
 body {
    font-family: -apple-system,BlinkMacSystemFont,helvetica,"Apple SD Gothic Neo",sans-serif;
 }

    button, input, select, textarea {
    border-radius: 0;
    border: none;
    background: 0 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    outline: 0;
    text-decoration: none;
    cursor: pointer;
    -webkit-text-size-adjust: none;
}
.input_row {
    /* position: relative; */
    display: block;
    /* height: 100%; */
    border: 1px solid #dadada;
    padding: 16px 18px 15px;
    border-radius: 6px;
    box-sizing: border-box;
    text-align: left;
    box-shadow: 0 2px 6px 0 rgba(68,68,68,.08);
}


.id_pw_wrap .input_row:last-child {
    border-radius: 0 0 6px 6px;
}

.btn_login {
    margin-top: 20px;
    display: block;
    width: 100%;
    padding: 13px 0 13px;
    border-radius: 6px;
    border: solid 1px rgba(0,0,0,.15);
    background-color: #03c75a;
    box-sizing: border-box;
}

.id_pw_wrap .input_row .icon_cell .icon_pw {
    background-position: -129px -203px;
    background-repeat: no-repeat;
    width: 16px;
    height: 16px;
}
    .blind {
    position: absolute;
    clip: rect(0 0 0 0);
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
}
/* 아이디 아이콘 */
.id_pw_wrap .input_row .icon_cell .icon_id {
    position: absolute;
    top: 24.4rem;
    left: 43.8rem;
    margin-top: -8px;
    background-position: -93px -203px;
    background-repeat: no-repeat;
    width: 16px;
    height: 16px;
}
/* pw 아이콘 */
.id_pw_wrap .input_row .icon_cell .icon_pw {
    position: absolute;
    top: 27.4rem;
    left: 43.8rem;
    margin-top: -8px;
    background-position: -129px -203px;
    background-repeat: no-repeat;
    width: 16px;
    height: 16px;
}
.bullet_help, .captcha_form .image::after, .captcha_form .reload::after, .captcha_form .voice::after, .captcha_wrap .voice_box .icon_voice, .chatbot .icon_chatbot, .icon_delete, .id_pw_wrap .input_row .icon_cell .icon_id, .id_pw_wrap .input_row .icon_cell .icon_pw, .id_pw_wrap .input_row.on .icon_cell .icon_id, .id_pw_wrap .input_row.on .icon_cell .icon_pw, .img_lock, .img_wowpoint, .ip_relogin_box .relogin_close::after, .ip_relogin_box .relogin_tip::before, .keep_check .keep_text::before, .keep_check input:checked+.keep_text::before, .lang::after, .menu_id .menu_text::before, .menu_id.on .menu_text::before, .menu_id.on::after, .menu_ones .menu_text::before, .menu_ones.on .menu_text::before, .menu_ones.on::after, .menu_ones.on::before, .menu_qr .menu_text::before, .menu_qr.on .menu_text::before, .menu_qr.on::before, .nudge_banner .nudge_close .icon_nudge_close, .ones_text .bullet_set, .pop_img_lock, .qrcode_help_stepbox .popup_close::after, .qrcode_help_stepbox .step_title::before, .reconfirm_sub .captcha_form .image::after, .reconfirm_sub .captcha_form .reload::after, .reconfirm_sub .captcha_form .voice::after, .reconfirm_sub .captcha_wrap .voice_box .icon_voice, .sns_wrap li:nth-child(1) .sns_text::before, .sns_wrap li:nth-child(2) .sns_text::before, .sns_wrap li:nth-child(3) .sns_text::before, .step_ask .ask_text::before, .sub_desc .bullet_greendot, .sub_desc .bullet_lens, .time_wrap .btn_renewal::before {
    background-image: url(https://ssl.pstatic.net/static/nid/login/m_sp_01_login_008d5216.png);
    background-size: 266px 225px;
    /* background-repeat: no-repeat; */
}

    .input_text {
    padding-left: 10px;
    position: relative;
    display: block;
    width: 100%;
    font-size: 16px;
    font-weight: 400;
    line-height: 19px;
    letter-spacing: -.5px;
    color: #222;
    box-sizing: border-box;
    z-index: 4;
}
.id_pw_wrap .input_row {
    display: table;
    table-layout: fixed;
    width: 100%;
    padding: 14px 17px 13px;
    box-sizing: border-box;
}
.id_pw_wrap .input_row:first-child {
    border-radius: 6px 6px 0 0;
    box-shadow: none;
}
.panel_inner {
    padding: 20px 28px;
}
.panel_item {
    border: 1px solid #c6c6c6;
    border-radius: 6px;
    background-color: #fff;
    box-shadow: 0 5px 8px 0 rgba(68,68,68,.04);
}

ol, ul {
    list-style: none;
}
.login_wrap {
    box-sizing: border-box;
    width: 460px;
    margin: 0 auto;
    }

/* 
    .menu_item {
    position: relative;
    display: table-cell;
    vertical-align: top;
}
    .menu_wrap {
    display: table;
    table-layout: fixed;
    width: 100%;
    border-collapse: collapse;
    }

    .header .logo {
    background-image: url(https://ssl.pstatic.net/static/nid/login/m_sp_00_common_978240a6.png);
    background-size: 244px 107px;
    background-repeat: no-repeat;
    display: inline-block;
    margin-top: 108px;
    vertical-align: top;
    background-position: 0 -51px;
    background-repeat: no-repeat;
    width: 155px;
    height: 30px;

}

    .header .header_inner {
    position: relative;
    width: 743px;
    margin: 0 auto;
    text-align: center;
    box-sizing: border-box;
}
  .header {
    padding-bottom: 48px;
    box-sizing: border-box;
} 

*/

</style>

비고

사실 로그인 페이지의 html과 CSS를 받아온다면 더욱 간단히 피싱 사이트를 만들 수 있을것 이다.

 

login 페이지를 카피한 html과 다운로드 받은 w_20220216.css

브라우저에서 확인해 본다면?

하지만 공부니까....

header, content, footer 모두 동일한 디자인을 확인 할 수 있다.

 

과제 끝

'웹 해킹 코스 > 과제' 카테고리의 다른 글

3-1(로그인 케이스)  (0) 2023.11.09
2-2 DB를 사용한 회원가입, 로그인  (0) 2023.11.02
2-1 php와 DB연결  (0) 2023.11.02
1-2 WAS POST방식 데이터 전달  (0) 2023.10.27
1-1 WAS 서버 만들기  (0) 2023.10.26

+ Recent posts