64bit 우분투 18.04 LTS에서 실습환경 구축

우분투18.04 LTS환경에서 문제파일 중 elf 파일이 실행되지 않습니다.

실행을 위해 다른 프로그램을 깔아야 하는지 ,실습 환경을 뭘로 바꿔야 하는지 알고싶습니다.

User@DESKTOP-A0EPTKG:~$ gdb ./string -q
Reading symbols from ./string...(no debugging symbols found)...done.
gdb-peda$ r
Starting program: /home/User/string
/bin/bash: /home/User/string: cannot execute binary file: Exec format error
/bin/bash: /home/User/string: Success
During startup program exited with code 126.
gdb-peda$

이렇게 exec format error를 내뱉습니다.
해결 방법으로 32비트 라이브러리를 설치하려 했으나,

User@DESKTOP-A0EPTKG:~/CTF$ sudo apt-get install libc6:i386 libstdc++6:i386 
Reading        package lists... Done 
Building dependency tree Reading state information... Done 
Package libc6:i386 is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source However the following packages replace it: libdb1-compat tzdata 
E: Package 'libc6:i386' has no installation candidate 
E: Unable to locate package libstdc++6:i386 
E: Couldn't find any package by regex 'libstdc++6' 
E: Could not read response to hello message from hook [ ! -f   /usr/bin/snap ] || /usr/bin/snap advise-snap --from-apt 2>/dev/null || true: Success 

와 같이 32bit 라이브러리를 받을 수 없다고 합니다. 이 경우 32bit elf파일을 어떻게 실행시키면 될까요

#wargame
작성자 정보
답변 1
avatar
마리마리
강의 수강: 10

해결했습니다.
wsl 1환경이라서 문제가 생긴 것 같습니다.

싹 밀고 wsl 2로 버전업하니 해결됩니다.

2020.07.23. 18:36
질문에 대한 답을 알고 계신가요?
지식을 나누고 포인트를 획득해보세요.
답변하고 포인트 받기