일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
- 웹 해킹 입문
- 불법유통근절
- 도구모음
- webhacking
- 연구모임
- 화학물질
- 경기팀
- UKPT
- PHP
- Service
- 화학물질불법유통온라인감시단
- 불법유통
- 국가기록원
- 정보보안
- 기타정보
- 국가정보원
- 여행
- 화학물질안전원
- 국정원
- 12기
- 프로젝트
- nurisec
- codeup
- Los
- UKPT level
- HTML
- 대외활동
- suninatas
- 파이썬
- MITRE ATT&CK
- Today
- Total
목록분류 전체보기 (303)
agencies

1. 우선 ngrok 사이트에서 회원가입을 진행해야 합니다. (토큰)https://ngrok.com/ ngrok | API Gateway, IoT Device Gateway, Secure Tunnels for Containers, Apps & APIsngrok is a secure ingress platform that enables developers to add global server load balancing, reverse proxy, firewall, API gateway and Kubernetes Ingress to applications and APIs.ngrok.com> 여기서 회원가입을 진행합니다.그럼 dashboard에서 (Your Authtoken 을 눌러서 확인합니다) ※ 코랩에서..

이번시간에는backward slicing 으로 실제 취약한 함수의 흐름을 파악할 수 있도록 joern을 이용한 흐름 추적을 통해나온 결과물을 추상화 하고 전체 소스코드를 추상화 한 것과 비교를 해보고자 합니다.import subprocessimport jsonimport hashlibimport csvfrom pycparser import c_parser, c_astimport reimport os# Joern 파일 경로 및 함수 이름file_name = "/content/connect.c"func_name = "stl_remove_degenerate"csv_file_name = "/content/backward-db.csv"class Abstractor(c_ast.NodeVisitor): def ..

변수 : var파라미터 : param 으로 추상화 진행 소스코드from pycparser import c_parser, c_astimport redef remove_preprocessor_directives(code): """ C 코드에서 주석 및 전처리 지시문 제거 """ # 주석 제거 code = re.sub(r'//.*?\n|/\*.*?\*/', '', code, flags=re.S) # 전처리 지시문 제거 code = "\n".join([line for line in code.splitlines() if not line.strip().startswith("#")]) return codeclass Abstractor(c_ast.NodeVisitor): ..

tesseract 를 이용하여 이미지 안의 텍스트를 읽을 수 있다고 합니다.(소스코드)#pip install pytesseractimport pytesseractfrom PIL import Image# Tesseract 실행 파일 경로 설정 (Windows 설치 경로)pytesseract.pytesseract.tesseract_cmd = r"C:\Program Files\Tesseract-OCR\tesseract.exe"# 이미지 로드image_path = "./image.png"image = Image.open(image_path)# 이미지에서 텍스트 추출text = pytesseract.image_to_string(image)print(text) (테스트 이미지) (실행결과) 사전 준비물환경 : 윈도..

colab joern 설치 과정!sudo apt install openjdk-21-jdk -y!wget https://github.com/joernio/joern/releases/latest/download/joern-install.sh!chmod +x joern-install.sh!./joern-install.sh!unzip joern-cli.zip backward slicing 여기서는 대상 파일이 test.c취약한 함수가 func_3 으로 가정 import subprocess# 파일명과 취약한 함수명을 변수로 정의file_name = "/content/test.c"func_name = "func_3"# Joern 스크립트 생성joern_script_content = f"""importCode("{..

# Load and read the provided files to analyze the contentpatch_file_path = "test.patch"old_vul_file_path = "test_OLD.vul"with open(patch_file_path, 'r') as patch_file: patch_content = patch_file.readlines()with open(old_vul_file_path, 'r') as old_vul_file: old_vul_content = old_vul_file.readlines()# Extract removed lines (starting with '-') from the patch fileremoved_lines = [line[1:].stri..

import pandas as pdimport osimport reimport requestsfrom bs4 import BeautifulSoup# 초기 설정csv_file_path = "output.csv"columns = [ "index", "all_file_name", "CVE-ID", "Description", "Affected_Product", "Affected_Version", "Vulnerability_Type", "Severity", "CVSS_Score", "Attack_Vector", "Impact-C", "Impact-I", "Impact-A", "Exploitability", "Published_Date", "Last_Modified_Date", "Privile..

msg = "in the flag.txt"key = "?????"flag = []for i in range(len(msg)): t = ord(msg[i]) ^ ord(key[i%len(key)]) flag.append(chr(t))with open("flag.txt","w") as f: f.write("".join(flag)) 이것은 문제 파일입니다.msg 에는 flag.txt파일 안에 있는 문자를 읽어옵니다.key에는 xor할 문자 5개가 들어갑니다. 플래그는 mobsy{ 로 시작하기 때문에xor을 진행할 때 범위를 30 ~ 130 으로 진행합니다 : 키 값이 하나일 경우만... 진행key를 mobsy로 설정하고 xor을 시도해봅시다. with open("flag.txt","r") a..
import torchimport torch.nn as nnfrom torch.nn import CrossEntropyLossfrom transformers import RobertaModel, RobertaConfig, RobertaTokenizerimport dglimport pandas as pd# FlowGNNGGNNModule class with debugging# FlowGNNGGNNModule class with debuggingclass FlowGNNGGNNModule(nn.Module): def __init__(self, feat, input_dim, hidden_dim, n_steps, num_output_layers, label_style, concat_all_absdf, enc..

colab 마운트from google.colab import drivedrive.mount('/content/drive') 모델 평가모드로 진행(strict=false 를 사용해서 걱정된다)import torchimport torch.nn as nnfrom torch.nn import CrossEntropyLossfrom transformers import RobertaModel, RobertaConfig, RobertaTokenizer, RobertaForSequenceClassificationfrom DeepDFA.DDFA.code_gnn.models.flow_gnn.ggnn import FlowGNNGGNNModule# FlowGNNGGNNModule 초기화flowgnn_encoder = FlowG..