Linux/모의해킹

get.html

GGkeeper 2022. 1. 26. 21:18

실습> get.html 

http://192.168.108.101/get.php?userid=boankorea&userpw=111111


-- get.html --
<!doctype html>
<html>
  <head>
    <meta charset=utf-8>
    <title> ::: get.html ::: </title>
  </head>

<body>

<form method=get action=get.php> 
<table align=center bgcolor=#000000 border=0 
       cellpadding=4 cellspacing=1 width=300 >
<tr bgcolor=#ffffff>
  <td align=center width=100> 이름 </td>
  <td width=240> <input type=text name=userid > </td>
</tr>
<tr bgcolor=#ffffff>
  <td align=center width=60> 비밀번호 </td>
  <td width=240> <input type=password name=userpw > </td>
</tr>
<tr bgcolor=#ffffff>
  <td align=center colspan=2> 
  <input type=submit value='저장'> </td>
</tr>
</table>
</form>

</body>
</html>
-- get.html --

-- get.php --
<?
print_r($_GET);
?>
-- get.php --

-- requests02.py --
"""
파일명 : requests02.py
프로그램 설명 : GET 방식으로 파라미터에 값을 전송하는 예제
"""

import requests

# geturl = 'http://192.168.108.101/get.php?userid=boankorea&userpw=111111'
# res = requests.get(geturl)

# parameter를 dict로 자료형으로 전달한 경우
geturl = 'http://192.168.108.101/get.php'
paramData = { 'userid':'boankorea', 'userpw':'111111' }
res = requests.get(geturl, params=paramData)
print(res.text)
-- requests02.py --