php 파일 업로드 우회 원리

php 파일 업로드 우회 원리

# 입력된 데이터에 따른 파일 유형 확인 $ echo "MZPE" > test.txt $ file test.txt test.txt: ASCII $ xxd test.txt 0000000000: 4d5a 5045 0a MZPE. $ echo ".ELFasasfdhasfk" > test2.txt >> ELF 파일은 대문자로 작성해야함 $ file test2.txt test2.txt : ELF $ python -c 'print "\x7F\x45\x4C\x46"' > test3.txt $ file test3.txt test3.txt: ELF $ xxd test.txt 0000000000: 7f45 4c46 0a .ELF. $ python -c 'print "\x00\x420\x31\xc0asdflkjasdfl"' > test4.txt $ file test4.txt test4.txt: data $ python -c 'print "0asdfkljhffff"' > test5.txt $ file test5.txt test5.txt: ASCII text $ echo "GIF8;takudaddy" > test6.txt $ file test6.txt test6.txt: GIF image data 12595 X 12959

from http://takudaddy.tistory.com/477 by ccl(A) rewrite - 2021-11-24 16:26:50