python89 Server Side Template Injection (SSTI) Web Template Engine이란? Web Template Engine이란 웹 템플릿과 웹 컨텐츠 정보를 처리하기 위해 설계된 소프트웨어로 웹 문서가 출력되는 템플릿 엔진을 의미합니다. 또한, Web Template Engine은 View Code(HTML)와 Data Logic Code(DB Connection)를 분리해주는 기능을 합니다. Server Side Template Injection(SSTI) Server Side Template Injection(이하 SSTI)은 공격자가 서버에서 사용 중인 Template 구문으로 페이로드를 구성하여 입력함으로써 Template 구문이 서버에서 해석되어 실행되도록 하는 공격입니다. Template 구문은 Teplate Engine마다 다른 형태를 .. 2022. 4. 12. [Python3] Extract String from File in Directory Extract String from File in Directory Code import re import os directory = r"./" # directory path files = os.listdir(directory) for f1 in files: filename = os.path.join(directory, f1) with open(filename, encoding='Latin-1') as f2: str_list = re.findall("[A-Za-z0-9/\-:;.,_$%'!()[\] \#@]+", f2.read()) with open(os.path.join(directory,"strings.txt"),"a+") as save_file: for str in str_list: save_fil.. 2022. 3. 18. [Python3] Tcp Socket Proxy tool Windows에서 TCP Socket 통신을 하는 프로그램을 진단해야 했는데 NCIS의 safeij.dll이 DLL Injection 및 Debugging을 막아버려서 기존에 사용하던 Echo Mirage와 같은 도구를 사용할 수 없었습니다. 이를 진단하기 위해 서버의 IP를 내 IP로 변경한 뒤, MITM을 걸어 A Proxy B로 통신 구간을 확인했습니다. 통신 과정만 확인할 수 있도록 대충 개발하다보니 손을 봐야할 내용이 너무 많습니다. 참고용으로만 확인해주세요. import socket from threading import Thread HOST = "127.0.0.1" # Client IP HOST2 = "1.1.1.1" # Server IP PORT = 13010 def c_c(): clien.. 2022. 3. 10. [Python] resolve "failed to create process." issue Offline에서 Python Package를 다운로드 받으려고 시도했으나 어떤 이유인지 일부 Package(Frida)는 설치가 되지 않았습니다. 그래서 최후의 방법으로 Python 폴더를 통째로 옮기려고 했으나 "failed to create process."라는 에러를 볼 수 있었습니다. I tried to download Python Package from Offline, but for some reason, some packages (Frida) were not installed. So, as a last resort, I tried to move the entire Python folder, but I got an error saying "failed to create process." 이 에.. 2021. 11. 5. [백준 알고리즘] 10870번 Python 문제 정보 제출 코드 def fibonacci(n1, n2, count, n): if(count==n): return n1+n2 return fibonacci(n2, n1+n2, count+1, n) n = int(input()) if(n==0): print(0) elif(n==1 or n==2): print(1) else: print(fibonacci(0,1,2,n)) 2021. 10. 4. [백준 알고리즘] 10872번 Python 문제 정보 제출 코드 def fectorial(n): if(n==1): return 1 else: return n*fectorial(n-1) n = int(input()) if(n==0): print(1) else: print(fectorial(n)) 2021. 10. 4. [백준 알고리즘] 1002번 Python 문제 정보 제출 코드 # https://yoonsang-it.tistory.com/32 참고 n = int(input()) for i in range(n): x1, y1, r1, x2, y2, r2 = map(int,input().split()) # 피타고라스 정리 distance = ((x2 - x1) ** 2 + (y2 - y1) ** 2) ** 0.5 r_d = [r1,r2,distance] max_v = max(r_d) r_d.remove(max_v) # 접점이 무한히 많은 경우 if(r1==r2 and distance==0): print(-1) # 접점이 0개인 경우 elif(max_v>r_d[0]+r_d[1]): print(0) # 접점이 1개인 경우 elif(r1+r2==distance or.. 2021. 10. 4. [백준 알고리즘] 3053번 Python 문제 정보 제출 코드 # 유클리드 기하학에서 원의 반지름은 r*r*pi이며, 택시 기하학에서 원의 반지름은 r*r*2이다. import math r = int(input()) print(r*r*math.pi) print(r*r*2) 2021. 10. 4. [백준 알고리즘] 4153번 Python 문제 정보 제출 코드 # 직삼각형은 가장 큰 길이의 제곱과 나머지 길이의 제곱의 합이 같은 것으로 알 수 있음 while(True): data_list = list(map(int, input().split())) if(data_list[0]==0 and data_list[1]==0 and data_list[2]==0): break x = max(data_list) data_list.remove(x) if(x**2==(data_list[0]**2+data_list[1]**2)): print('right') else: print('wrong') 2021. 10. 4. 이전 1 2 3 4 5 ··· 10 다음