728x90
반응형

Listening

1. Choose the most appropriate response to complete each conversation.

M: I’ve been under a lot of stress at the office lately.
W: I know it’s hard, but I'm sure it's temporary.
M: You think so? I hope you're right.
W:
(a) I can’t stand the stress much longer.
(b) Definitely. I’d quit if I were you.
(c) Sure. Things are bound to turn around eventually.
(d) It’s hard to tell, but it looks like it’s getting worse.

해설:
여자가 그런 스트레스 받는 상황이 일시적(temporary)일 뿐일 것이라고 했는데, 이는 앞으로 시간이 지나면 스트레스를 덜 받게 될 것이라는 낙관적인 전망을 한다는 뜻이다. 따라서 상황이 결국 나아질 것이라는 (c)가 정답이다. 다른 세 선택지는 모두 비관적인 내용이므로 여자의 태도와 반대된다.

번역:
남: 저는 요 근래 직장에서 아주 스트레스를 많이 받아왔어요.
여: 힘든 건 저도 알지만, 그건 일시적일 거예요.
남: 그렇게 생각해요? 당신 말이 맞았으면 좋겠네요.
여: 그럼요. 상황이 결국 나아지게 될 거에요.

주석:
temporary: 일시적인, 한시적인, 덧없는
be bound to부정사: 반드시 ~하게 되어 있다, ~하기 마련이다
turn around: (시장, 견제 따위가) 회복되다, 호전되다, 방향을 바꾸다

정답: (c)
정답률 : 82.05%

 

2. Choose the most appropriate response to complete each conversation.

W: The cafe downstairs is under new management.
M: Yeah, I went yesterday.
W: I didn't notice any differences.
M:
(a) Give them time to make some changes.
(b) I'll make sure to check when I go there.
(c) It is a bit more drastic than I'd anticipated.
(d) Yeah. I just wish they hadn't changed the menu.
해설:
경영진이 바뀌었어도 별 변화를 못 느끼겠다는 여자의 말에 대한 남자의 적절한 응답을 찾으면 된다. 그들이 변화를 줄 때까지 시간을 두고 기다려보라는 (a)가 정답이다.
번역:
여: 아래층 카페에 새 경영진이 들어왔대요.
남: 그래요, 나 어제 갔었어요.
여: 난 다른 점을 눈치채지 못하겠던데요.
남: 그들이 변화를 주도록 시간을 줘 봐요.

주석:
(the) management: 경영진, 사측
drastic: (행동, 처리, 수단 등이) 철저한, 과감한
anticipate: 예상하다, 기대하다

정답: (a)
정답률 : 46.96%

Vocabulary

1. Choose the option that best completes each sentence.
Because the hikers were going so slowly, it was unlikely that they would _________ the summit before dark.

  •  (a) arrive
  •  (b) obtain
  •  (c) accomplish
  •  (d) reach
해설:
“arrive”와 “reach” 모두 어딘가에 도착하거나 도달한다는 뜻이지만 ‘arrive’는 자동사이고 ‘reach’는 타동사다. 따라서 전치사 없이 바로 목적어 “the summit”을 취할 수 있는 동사는 ‘reach’다.
번역:
그 등산객들은 너무 느리게 가고 있었기 때문에 해지기 전까지 정상에 닿을 것 같지 않았다.
주석:
unlikely: ~할 것 같지 않게, 있을 법하지 않은
summit: 정상, 꼭대기
accomplish: (일, 의무 등을) 성취하다, 이루어내다, 완수하다, (보람 있는 일을) 해내다

정답: (d)
정답률 : 78.26%

 

2. Choose the option that best completes each sentence.
The car was completely stuck in the snow bank that even with the force of five men it would not _______.

  •  (a) budge
  •  (b) switch
  •  (c) cruise
  •  (d) remove
해설:
보통 부정문에서 not과 함께 쓰여서 조금도 움직이지 않거나 양보의 기미를 전혀 보이지 않는다는 뜻으로 쓰이는 동사는 budge이므로 (a)가 정답이다.

번역:
그 차는 완전히 눈 더미에 갇혀서 다섯 남자의 힘으로도 꿈쩍도 하지 않았다.

주석:
be stuck: 갇히다, 꼼짝 못하게 되다, 끼다
snow bank: 눈 더미, 바람에 쌓인 눈 더미
budge: (보통 부정문) 조금 움직이다, 양보하다
switch: 방향을 바꾸다, 전환하다, 갈아타다
remove: 제거하다, 이사하다, 이동하다, 주거지를 옮기다

정답: (a)
정답률 : 55.47%

Grammar

1. Choose the option that best completes each sentence.
Had it not been for Harold’s help, Jean __________ last week's deadline.

  •  (a) missed
  •  (b) would miss
  •  (c) had missed
  •  (d) would have missed
해설:
과거에 이미 일어난 일에 대한 반대되는 가정은 가정법 과거완료로 표현한다. 따라서 주절의 동사 부분에 해당하는 빈칸에는 조동사의 과거형 다음에 have p.p.가 쓰인 (d)가 들어가야 알맞다.

번역:
해롤드의 도움이 없었다면, 진은 지난 주의 마감날을 놓쳤을 것이다.

주석:
had it not been for: ~이 없었다면
가정법 과거완료: if +주어+had p.p.~, 주어+조동사의 과거형(would, should, could, might)+have p.p.~
정답: (d)
정답률 : 82.96%

 

2. Choose the option that best completes each sentence.
At tonight's concert, Mr. Pearlman gave ________________________ as the night before and received another standing ovation.

  •  (a) great a performance
  •  (b) performance as great
  •  (c) as a great performance
  •  (d) as great a performance
해설:
빈칸 뒤의 as와 호응하여 원급 비교 as ~ as 구문을 이루어야 한다. 앞에 나오는 부사 as 다음의 어순이 중요한데, 보통 이 as 뒤에는 형용사나 부사가 온다. 여기서는 ‘great’이 이에 해당한다. 그런데 이 부분이 형용사나 부사로만 끝나지 않고 명사를 수반하는 경우는 (d)와 같이 먼저 ‘great’을 쓰고 그 다음에 a와 명사를 쓴다. 이것은 ‘such a great performance’(그런 멋진 연주)와 같은 such와 비교되는 대목이다.

번역:
오늘 밤의 연주회에서, 펄먼 씨는 전날만큼 훌륭한 연주를 했고, 또 다시 기립박수를 받았다.

주석:
as A as B: (수량, 정도의 비교) B와 같은 정도로 A, B와 마찬가지로 A
standing ovation: 기립 박수

정답: (d)
정답률 : 34.51%

Reading

1. Based on the given information, choose the option that best answers each question.
Impressionism was a major art movement which developed chiefly in France during the late nineteenth and early twentieth centuries. Impressionist art is a style in which the artist captures the image of an object as a viewer would see it from just a glimpse. These artists typically painted outdoor scenes, with a lot of color but a lack of detail. Perhaps the most unique characteristic of this art movement was the attempt of some painters to accurately and objectively record visual reality using transient effects of light and color. Q: What is the main purpose of the passage?

  •  (a) To instruct artists on recreating impressionist art
  •  (b) To detail the historical causes of impressionism
  •  (c) To describe the style of impressionist painting
  •  (d) To express the importance of impressionism
해설:
인상주의를 설명한 글인데, 사회역사적 배경이나 예술사적 중요성을 다룬다기 보다는 인상주의의 화풍 자체를 세세하게 설명하고 있으므로 (c)가 정답이다.
번역:
인상주의는 19세기 후반과 20세기 초반에 주로 프랑스에서 발전한 주요 예술 운동이었다. 인상주의 예술은 바라보는 사람이 사물을 한눈에 흘깃 보는 것과 같은 방식으로 예술가가 사물의 이미지를 포착하는 화풍이다. 이 예술가들은 보통 야외 풍경을 그렸는데 많은 색은 썼지만 세부는 자세히 다루지 않았다. 이 예술 운동의 가장 독특한 특징은 아마도 빛과 색의 순간적인 효과를 이용하여 시각적 리얼리티를 정확하고 객관적으로 기록하려는 일부 화가들의 시도였다.

주석:
impressionist art: 인상주의 미술[예술]
glimpse: 대충 얼핏 봄
transient: 순간적인, 일시적인
painting: 회화, 회화 작품, 그림

정답: (c)
정답률 : 91.67%

 

2. Based on the given information, choose the option that best answers each question.
Ultraviolet (UV) light lies just beyond the range of what humans can see, but thanks to UV-sensitive equipment, it can still be studied by humans. UV light, which causes sunburn, travels in shorter waves and has more energy than visible light. Typically, younger stars tend to emit this more energetic frequency of light, whereas older stars emit more light in the visible spectrum. Measuring UV light, then, is one of the ways scientists can determine the age of a group of stars. Q: Which of the following is correct according to the passage?

  •  (a) UV light is undetectable by the naked human eye.
  •  (b) UV light travels in longer waves with weak energy.
  •  (c) Old stars tend to emit less visible light than young stars.
  •  (d) Measuring light is the sole way scientists can date stars.
해설:
첫 번째 문장에서 자외선이 인간이 볼 수 있는 범위 너머에 존재한다고 했으므로, 육안으로는 감지할 수 없다는 (a)가 글의 내용과 일치한다.
번역:
자외선은 인간이 볼 수 있는 범위 너머에 존재하지만, 자외선 감지 장비 덕분에 인간은 자외선을 연구할 수 있다. 햇볕으로 인한 화상을 야기하는 자외선은 가시광선보다 더 짧은 단파로 움직이며 에너지가 더 크다. 보통 연수가 짧은 별들이 이 더 활동적인 주파수의 빛을 방출하는 반면, 늙은 별들은 가시 범위 내의 빛을 더 많이 발산한다. 따라서 자외선 측정은 과학자들이 일단의 별들의 나이를 측정할 수 있는 한 방법이다.

주석:
emit: (액체, 빛, 열, 냄새 등을) 방출하다, 내뿜다, 발산하다
frequency: 주파수, 진동[수], 빈도
determine: (양, 위치 등을) 측정하다
undetectable: 감지할 수 없는
the naked human eye: 인간의 육안

정답: (a)
정답률 : 79.85%

 

 

728x90
728x90

'Language > TEPS' 카테고리의 다른 글

[Weekly TEPS] 03_July 18, 2022  (0) 2022.08.05
[Weekly TEPS] 02_July 25, 2022  (0) 2022.08.04
728x90
반응형

디렉토리 내 실행 파일이 있음에도 파일을 찾지 못하는 경우

bash: ./[실행할 파일]: No such file or directory

64bit OS에서 32bit library 설치 없이, 32bit를 사용하는 실행 파일을 사용할 경우 발생

혹은 library 파일 연결이 불가한 경우

CPU: 64bit
File: 32bit

실행 파일과 CPU 포맷이 달라서 생기는 오류

sudo dpkg --add-architecture i386
sudo apt-get update

 

1) 패키지 설치(64bit에서도 32bit 파일을 실행할 수 있도록)

$ sudo apt-get install libc6-i386 lib32gcc1

dpkg: unrecoverable fatal error, aborting:
 files list file for package 'librpmio8' is missing final newline
E: Sub-process /usr/bin/dpkg returned an error code (2)

해결방안: librpmio8 목록 파일을 다시 만들어줌

sudo apt-get install --reinstall --download-only librpmio8

파일명 확인: librpmio8_4.14.2.1+dfsg1-1build2_amd64.deb

root@ubuntu:/var/cache/apt/archives# ls | grep librpmio8
librpmio8_4.14.2.1+dfsg1-1build2_amd64.deb
dpkg -c /var/cache/apt/archives/librpmio8_4.14.2.1+dfsg1-1build2_amd64.deb | \
awk '{if ($6 == "./"){ print "/."; } else if \
(substr($6, length($6), 1) == "/"){print \
substr($6, 2, length($6) - 2); } else { print \
substr($6, 2, length($6) - 1);}}' > \
/var/lib/dpkg/info/librpmio8.list

 

debugedit 패키지 파일 error에 대해, 동일하게 설정

debugedit_4.14.2.1+dfsg1-1build2_amd64.deb

dpkg -c /var/cache/apt/archives/debugedit_4.14.2.1+dfsg1-1build2_amd64.deb | \
awk '{if ($6 == "./"){ print "/."; } else if \
(substr($6, length($6), 1) == "/"){print \
substr($6, 2, length($6) - 2); } else { print \
substr($6, 2, length($6) - 1);}}' > \
/var/lib/dpkg/info/debugedit.list

libpython2.7:amd64 파일, ...

dpkg -c /var/cache/apt/archives/libpython2.7-stdlib_2.7.18-1~20.04.3_amd64.deb | \
awk '{if ($6 == "./"){ print "/."; } else if \
(substr($6, length($6), 1) == "/"){print \
substr($6, 2, length($6) - 2); } else { print \
substr($6, 2, length($6) - 1);}}' > \
/var/lib/dpkg/info/libpython2.7:arm64.list


libpython2.7_2.7.18-1~20.04.3_amd64.deb
libpython2.7-minimal_2.7.18-1~20.04.3_amd64.deb
libpython2.7-stdlib_2.7.18-1~20.04.3_amd64.deb
Try to fix it with

# rm /var/lib/dpkg/info/libopenjp2*
# dpkg --configure -a
# apt update
# apt upgrade

After that run Plesk update fix with:

# plesk installer --select-release-current --reinstall-patch --upgrade-installed-components

 

실행이 불가한 경우,

2) 64비트에서 32비트 컴파일이 동작 가능하도록 패키지 설치

$ sudo apt-get install ia32-libs g++-multilib

3) 추가 설치

$ sudo apt-get install lib32ncurses5, g++-multilib

정상 설치 및 실행

 

 

728x90
728x90

'Development > error' 카테고리의 다른 글

[Error] Ubuntu yum 설치 오류_Command 'yum' not found  (0) 2022.07.15
728x90
반응형
목차
1. 공개 소프트웨어 연구개발 실무 가이드라인 배포 (220727)
2. 과기정통부, 5세대 이동통신 28 대역 민ㆍ관 실무단 첫 회의 개최 (220728)
3. 랜섬웨어 최신 기술 동향 (220727)
  1) 랜섬웨어 유포 방식
    (1) 원격 데스크톱 프로토콜
    (2) 피싱메일
    (3) 소프트웨어 취약점 - Log4j 취약점
  2) 랜섬웨어 암호화 방식
    (1) 랜섬웨어 암호화 과정
4. SMP Admin Share를 활용한 내부망 이동 전략분석 (220725)
5. 비대면 서비스 개발‧운영 환경 주요 보안 취약 사례별 대응방안 (220801)
  1) 네트워크 보안
    (1) 독립 서버 운영
    (2) 네트워크 영역 분리 운영
    (3) 네트워크 접근통제

1. 공개 소프트웨어 연구개발 실무 가이드라인 배포 (220727)

(출처: 과학기술정보통신부, 보도자료, 소프트웨어정책관 소프트웨어산업과 조민영 과장(010-2725-9598), 강형석 사무관(044-202-6334))

  • 공개 소프트웨어는 제3자가 소스코드를 사용·복제·수정·배포할 수 있도록 공개한 소프트웨어
  • 최신 기술의 신속한 도입, 개발 기간 단축 등 효율적 개발 지원, 다양한 사용자 확보 등의 장점
  • 연구자가 활용할 수 있는 도구 및 연구자들을 위한 과제 점검표(체크리스트) 제시

공개SW R&D 실무 수행 가이드라인

(출처: 과학기술정보통신부, IITP 정보통신기획평가원)

 

GitHub - IITP2022/OpenSourceRnD: IITP_Guideline For Open Source Software RnD Projects

IITP_Guideline For Open Source Software RnD Projects - GitHub - IITP2022/OpenSourceRnD: IITP_Guideline For Open Source Software RnD Projects

github.com

단계별 가이드라인 주요 내용

사전 준비 단계 1.공개 소프트웨어 연구개발의 개요
2.공개 소프트웨어 연구개발 계획수립의 단계별 검토사항
  - 계획수립의 단계별 검토사항 개요
  - 추진전략 및 사업모델 수립단계
  - 라이선스 정책 수립단계
  - 공개 소프트웨어 사용정책 및 절차 수립단계
  - 기술이전시의 검토사항
3.자주 묻는 질문과 답변
연구수행 실무단계 1. 공개 소프트웨어 연구개발의 개요
2. 공개 소프트웨어 연구개발 수행 가이드
  - 과제 수행 준비
  - 과제 분석
  - 과제 설계
  - 과제 구현
  - 과제 검증
  - 커뮤니티 관리
3. 자주 묻는 질문과 답변

2. 과기정통부, 5세대 이동통신 28㎓ 대역 민ㆍ관 실무단 첫 회의 개최 (220728)

(출처: 과학기술정보통신부, 보도자료, 통신정책관 통신정책기획과 마재욱 과장(044-202-6620), 심주섭 서기관(044-202-6625))

  • 28㎓ 대역 5세대(5G) 추진방향 마련을 위한 논의 착수
  • 참여: 과기정통부, 통신3사, 단말기ㆍ장비 제조사(삼성전자), 한국전자통신연구원(ETRI), 한국정보통신기술협회(TTA), 한국방송통신전파 진흥원(KCA) 등
  • 논의 내용: 실무단 구성ㆍ운영 방안, 28㎓ 대역 5세대(5G) 국내ㆍ외 추진 현황

3. 랜섬웨어 최신 기술 동향 (220727)

(출처: 정보통신기획평가원, 주간기술동향 2056호, 국민대학교 김소람 연구원, 김종성 교수(02-910-5750))

  • 랜섬웨어(Ransomware)란 몸값 'Ransom'과 소프트웨어 'Software'의 합성어로, 파일 암호화를 통해 금전을 요구하는 악성코드

1) 랜섬웨어 유포 방식

원격 데스크톱 프로토콜

  • RDP: Microsoft에서 개발한 프로토콜, 다른 컴퓨터에 연결할 수 있는 기능 제공
  • 유효한 자격 증명은 brute force 공격을 통해 획득
  • 다크웹 사이트 등을 통해 대량의 자격 증명 구입

<자료> CISOMAG, What is an RDP attack?, 2021. 1.

피싱 메일

  • 랜섬웨어 유포 시 가장 많이 사용되는 방식
  • 공정거래위원회, 경찰청 및 은행 등을 사칭하거나 입사지원서로 위장하여 랜섬웨어가 첨부된 메일을 유포

피싱 메일로 인한 랜섬웨어 감염 경로

<자료> Caltptix security, Phishing Email Attack Flow, 2016. 7. 정보통신기획평가원 재구성

소프트웨어 취약점

Log4j 취약점

  • Apache 소프트웨어 재단에서 개발한 JAVA 기반 로깅 유틸리티
  • Log4Shell(CVE-2021-44228)은 임의코드 실행을 허용하는 Log4h 제로데이 취약점
  • 중국 알리바바 클라우드 보안팀이 2021년 11월 24일 최초 발견

<자료> LG CNS, Log4j 취약점 공격 피해 주의, 2021. 1. 정보통신기획평가원 재구성

2) 랜섬웨어 암호화 방식

  • 공개키 알고리즘과 대칭키 알고리즘을 동시에 사용해서 파일 암호화를 수행하는 하이브리드 시스템 사용이 대부분
  • 대량의 파일 암호화를 위해, 속도가 빠른 대칭키 알고리즘 이용

랜섬웨어 암호화 과정

가. 공격자가 공개키 알고리즘 쌍 생성 후, 공개키는 랜섬웨어 실행 파일에 탑재

공개키는 평문으로 저장하거나 base64 인코딩 또는 rc4 암호화/AES 암호화를 통해 가공한 값 저장

나. 파일 암호화를 위한 대칭키 생성

다. 파일 암호화 종료 후에는 파일 암호화에 사용한 대칭키(파일 암호키)를 공격자의 공개키로 암호화해서 보관

<자료> ESET, How encryption molded crypto-ransomware, 2016. 9.


4. SMP Admin Share를 활용한 내부망 이동 전략분석 (220725)

(출처: 한국인터넷진흥원 인터넷침해대응센터(KrCERT/CC), 자료실 > 보고서, 침해사고분석단 종합분석팀 김동욱 선임, 이슬기 선임, 이태우 선임, 이재광 팀장)

  • TTPs: Tactics, Techniques, Procedures
  • 주요 침해사고에서 공통으로 사용되는 핵심 기법: 'SMP/Admin Share'를 이용한 내부전파(Lateral Movement)

5. 비대면 서비스 개발‧운영 환경 주요 보안 취약 사례별 대응방안 (220801)

(출처: 한국인터넷진흥원 인터넷침해대응센터(KrCERT/CC), 자료실 > 가이드 및 매뉴얼, 사이버방역단 방역점검팀 김대완 선임, 고은혜 선임, 배승권 팀장)

  • 목적: 비대면 서비스의 안전한 개발‧운영 환경 구축, 비대면 서비스 개발‧운영 기업의 침해사고 예방 및 서비스 이용자의 피해 최소화

네트워크 보안

1) 독립 서버 운영

  • Web 서비스와 WAS, DB와 같은 중요 서비스를 하나의 서버에서 운영하는 경우
분류 대상
Web 서버 사용자 직접 접속이 필요한 Web 서비스 등
WAS 서버 동적인 데이터를 처리하는 서비스 등
DB 서버 데이터를 저장하는 DB 서비스 등
기타 서버 기타 주요 목적이 다른 서비스 등

2) 네트워크 영역 분리 운영

  • (e.g. 소스코드 버전관리 솔루션 외부 노출, 서버 내부 파일 유출)
분류 용도
업무망/사내망 시스템 접속망 서비스 개발·운영 환경에 접속할 수 있는 네트워크
내부망 사내 업무 네트워크
외부망 외부 인터넷에 접속할 수 있는 네트워크
서버망 DMZ/Public Zone 외부 접근이 필요한 서버를 운영하는 네트워크
내부망/Private Zone 외부 접근이 불필요한 서버를 운영하는 네트워크

3) 네트워크 접근통제

  • 접근통제 미흡으로 인해, 서버 내부 정보가 유출되거나 무작위 대입 공격(Brute Force Attack)으로 인해 서버 제어권이 탈취될 수 있음

<자료> KrCERT/CC, 비대면 서비스 개발‧운영 환경 주요 보안 취약 사례별 대응방안, 2022. 8.

 

 

728x90
728x90
728x90
반응형

1.  What is it like to live as a foreigner in South Korea?

 

Going by the OECD's definition, a "multi-cultural society" is a country where more than five percent of its population are foreigners, second-generation immigrants, and naturalized citizens.
That term does not describe South Korea yet, but it likely will soon.
Our Song Yoo-jin went out to find more about what life in Korea is like for people from other cultures, and how they're being integrated into society.

Two million.
Accounting for almost 5 percent of the population, that's the number of foreign residents living in South Korea.
The figure had been steadily rising, but dropped during the pandemic.
Now, it's rebounding again and is expected to grow.

"In five years, the number of foreign residents will reach three million and in the long run, will make up 10 percent of the population.
Every year, South Korea's economically active population declines by 3-hundred to 5-hundred-thousand.
Attracting more foreigners will help solve this labor shortage and population decline."

But starting a new life in a brand new country isn't easy.
The biggest obstacles are language and social perception.

"I live in Dobong-gu and there a lot of people don't speak English."

"If I'm in the subway, all the people look at me like how she is a foreigner."

It's even harder if you're planning to stay long term.

"I've never seen a person who moved here because the Korean society is welcoming.
It's been really exclusive to foreigners as it has a long history of cultural, ethnic homogeneity."


"Then what kind of efforts are being made in South Korea to help foreign residents adapt to the country?

One of them is the justice ministry's Korea Immigration and Integration Program.
Designated institutions offer free classes to help foreigners become self-reliant members of society.

"The program has seven levels.
Korean language is taught from level zero to four and those who complete level four have no problem communicating in Korean.
Levels five and six teach Korean culture and society.
Students can apply for permanent residency after level five and naturalization after level six."

But there's still room for improvement.

"When I first came to Korea in the early 2000s, there were very few foreigners living here, so there were barely any relevant laws or policies.
It's been less than two decades since they started developing them, so right now, they're too complicated and all over the place."

To solve this, the government is pushing to launch an immigration agency.

"There's no single, designated body that's in charge of immigration and foreign resident-related affairs.
Installing an agency that's solely in charge will not only increase the efficiency of the immigration and visa process, but also help the country attract more foreign talent into the country."

With South Korea looking to become a more multi-cultural society, relevant efforts should be made to embrace and support those who come here.
Song Yoo-jin, Arirang News.

Reporter : yjsong@arirang.com

2. Gov't and DP clash over latest plans to cut income and corporation taxes

 

On the second day of the National Assembly's three-day questioning session of Yoon administration officials Tuesday, lawmakers zeroed in on officials from ministries related to economic affairs.
Administration officials and the opposition bloc clashed over proposed income and corporate tax cuts.
Lee Kyung-eun has the details.

Among the most hotly debated topics during the parliamentary hearing on economy-related ministries on Tuesday was the government's latest tax cut plans.
Prime Minister Han Duck-soo called them "inevitable" in order to keep South Korea's growth momentum.
His remarks came in response to criticism from the Democratic Party who said that tax cuts will lead to fewer welfare benefits for the general public.


"If you cut corporation taxes what will happen to public spending for the people who need it?"

"The government has no other option but to take action and reduce business tax burdens especially at a time of high interest and currency rate."

The PM added that tax cuts on corporations had always brought a "trickle down effect" in the country where the prosperity of big companies leads to the growth of small firms and, therefore, more jobs.

Also put under fire was the governmenet's plan to cut income taxes which the DP lawmakers claimed would only benefit the wealthy.
President Yoon's People Power Party gave the finance minister a chance to refute such claims.

"The taxation scheme is designed to bring relatively bigger tax cuts for those in the low to middle income brackets."


Regarding the easing of real estate taxes in a major reversal of the previous administration's policy the PM said it is the most ideal way to normalize the market.


"The key to the housing policy is making sure that homeowners don't become the public enemy.
And the direction should be increasing supply not reducing the demand through excessive taxes."

Despite cuts in tax revenues which some lawmakers raise concerns about the PM said the budget is all precisely calculated in a way that would enable the government to carry out its plans.

"The PM added one of the key top priorities is maintaining financial soundness.
While the national debt to GDP ratio is projected to hit 68 percent at the current pace, but the government's plan is to keep in at 55 percent.
Lee Kyung-eun, Arirang News. "

Reporter : kelee@arirang.com

1. Do you think that tax cut really leads "reduced welfare benefits" ? If so, What do you think about the reduced welfare benefits due to the tax cut? 

 

2. Have you ever heard of a country with many welfare benefits? 

 

3.  There is a debate about the billionaire tax in the United States.  Do you think a billionaire or millionaire tax should be introduced in Korea too?

"The Billionaire Minimum Income Tax will require America’s wealthiest households to pay as they go, just like everyone else:

The Billionaire Minimum Income Tax will ensure that the very wealthiest Americans pay a tax rate of at least 20 percent on their full income, including unrealized appreciation." 

(Referred from White House homepage.)

 


본 저작물은 아리랑 TV에서 2022년 작성하여 공공누리 제1유형으로 개방한

Life/Culture, Nat'l/Politics News(작성자: yjsong@arirang.com, kelee@arirang.com)을 이용하였으며,
해당 저작물은 'Arirang TV, https://www.arirang.com/index.asp'에서 무료로 다운받으실 수 있습니다.

 

 

728x90
728x90
728x90
반응형
목차
1. 리스트 활용
  1) append(d)
  2) insert(i, d)
  3) remove(d)
  4) sort()
2. 시퀀스 자료형
  1) 인덱싱, 슬라이싱
  2) in: 멤버 조회
  3) len: 길이 확인
  4) 연결(+), 반복(*)

[Review] (2주차) 조건문

2022.07.22 - [Development/Python] - [Python] 02 조건문 - week.02

 

[Python] 02 조건문 - week.02

목차 1. 입력 1) 변수 2) 형 변환 2. 논리 자료형(Boolean Data) 1) 논리 자료형 2) 비교 연산자 3) 논리 연산자 3. 조건문 1) if문 2) elif문 3) else문 [Review] (1주차) 기초 자료형 2022.07.10 - [Dev/Python]..

sarahee.tistory.com


1. 리스트 활용

Point I
list.append(d) : 자료 d를 list의 마지막 원소 뒤에 추가

alphabet = ['A', 'B', 'C']
alphabet.append('D')
print(alphabet)

## 출력 결과 ##
['A', 'B', 'C', 'D']

Point II
list.insert(i, d) : 인덱스 i에 자료 d를 삽입

num_eng = ["one", "two", "four", "five"]
num_eng.insert(2, "three")
print(num_eng)

## 출력 결과 ##
["one", "two", "three", "four", "five"]

Point III
list.remove(d) : 인덱스 0부터 조회하여 처음 나오는 자료 d를 제거

ice_cream = ["Mother is Alien", "Mint Choco", "NY Cheese Cake", "Mint Choco"]
ice_cream.remove("Mint Choco")
print(ice_cream)

## 실행 결과 ##
["Mother is Alien", "NY Cheese Cake", "Mint Choco"]

Point IV
list.sort() : 리스트를 오름차순/사전순으로 정렬

digit = [0, 3, 6, 9, 1, 4, 7, 2, 5, 8]
digit.sort()
print(digit)

## 실행 결과 ##
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

2. 시퀀스 자료형

Point I
순서가 있는 자료형 → 리스트, 문자열 등이 이에 속함

Point II
인덱싱, 슬라이싱이 가능

prime_num = [2, 3, 5, 7, 9, 11]
prime_num[0] 
# 2

prime_num[1:4] 
# [3, 5, 7]
...

Point III
멤버 조회 in

prime_num = [2, 3, 5, 7, 9, 11]
2 in prime_num  
#True

4 in prime_num  
#False

Point IV
길이 확인 len

word = "Antidisestablishmentarianism"
len(word)  
#28

Point V
연결(+)반복(*)

mouse = ["Mickey"]
mice = mouse + ["Minnie"]  
#["Mickey", "Minnie"]

disney = ["Mickey"]*3 
#["Mickey", "Mickey", "Mickey"]

[Next] (4주차) 반복문

2022.08.08 - [Development/Python] - [Python] 04 반복문 - week.04

 

[Python] 04 반복문 - week.04

목차 1. 반복문 2. for-sequence문 3. for-range()문 1) range() 2) for-range(a, b) 3) for-range(a) 4. while 1) 변수 수정 2) break문 [Review] (3주차) 리스트 2022.07.28 - [Development/Python] - [Python]..

sarahee.tistory.com

 

728x90
728x90
728x90
반응형
목차
1. 한국 제안 5세대 이동통신, 양자암호통신기술 등 관련 국제전기통신연합 국제표준(안) 5건 채택 (220718)
2. 신규 가상자산사업자 시장진입 디딤돌 마련을 위해 정보보호 관리체계(ISMS) 예비인증 제도 도입 (220720)
3. 국내 IT 제조기업의 스마트 팩토리 활성화 방향 (220720)
4. 이스트시큐리티 보안동향보고서 (220725)

1. 한국 제안 5세대 이동통신, 양자암호통신기술 등 관련 국제전기통신연합 국제표준(안) 5건 채택 (220718)

(출처: 과학기술정보통신부, 보도자료, 국립전파연구원 국제기구협력팀 이경희 팀장(061-338-4460), 박문철 사무관(061-338-4480))

  • 국립전파연구원은 7월 4일부터 15일까지 스위스 제네바에서 개최된 "국제전기통신연합 전기통신표준화 부문(ITU-T) 미래네트워크 연구반(SG13)" 회의에서 5세대(5G), 클라우트컴퓨팅, 양자암호통신 분야의 관련한 국제표준(안) 5건이 사전 채택

5세대 이동통신(IMT-2020) 대규모 네트워크에서의 지터* 상한 보장 프레임워크

* 지터: 송·수신 하는 데이터의 지연 시간의 변화량

  • 중~대규모 네트워크에서의 jitter를 보장하기 위한 프레임워크 정의
  • 대규모 네트워크에서 데이터 지연 방지
  • 5G, 인터넷, 메타버스 등에서 초저지연 서비스와 관련된 산업의 활성화에 기여할 것으로 기대

멀티클라우드* 기능 요구사항

* 멀티클라우드: 두 개 이상의 클라우드 사업자가 제공하는 클라우드 서비스를 동시에 사용하는 환경

  • 멀티클라우드 개념 정의, 멀티클라우드 관리를 위한 기능 요구사항 정의
  • 한국 주도로 멀티클라우드 기술 표준을 세계 최초로 개발한 성과

분산 클라우드* 글로벌 관리 프레임워크

* 분산 클라우드: 중앙서버가 아닌, 서비스 사용자와 가까운 네트워크에 클라우드를 형성

  • 지리적으로 분산된 클라우드 환경을 통합하고 효율적으로 관리하기 위한 프레임워크 정의
  • 5세대(5G)의 핵심 응용기술인 분산 클라우드의 요구사항 정의

양자키분배네트워크(QKDN) 네트워크 품질 보장 기능 구조

  • 양자암호통신 네트워크 품질을 보장하기 위한 기능 구조 설계
  • 구조별 기능 요소 및 동작절차 정의

머신러닝 기반 QKDN 네트워크 품질 보장 요구사항

  • 미래 보안통신 기술로 주목받고 있는 양자암호통신 네트워크 품질 보장을 위한 기술
  • 기계학습 기반의 양자암호통신 네트워크 품질 보장 요구사항 정의, 기계학습을 양자암호통신에 적용한 최초의 표준

2. 신규 가상자산사업자 시장진입 디딤돌 마련을 위해 정보보호 관리체계(ISMS) 예비인증 제도 도입 (220720)

(출처: 과학기술정보통신부, 보도자료, 정보보호네트워크정책관 사이버침해대응과 설재진 과장(044-202-6460), 김순권 연구관(044-202-6463))

  • 예비인증 취득 후, 3개월 내 금융정보분석원(이하, FIU)에 신고 필요
  • FIU 신고 수리 후, 6개월 내 정보보호 관리체계(ISMS) 본인증 취득 필요
  • 일반 이용자는 본인증 취득 전까지 가상자산사업자 서비스 이용에 주의 필요


3. 국내 IT 제조기업의 스마트 팩토리 활성화 방향 (220720)

(출처: 한국전자통신연구원, 주간기술동향 2055호, 박종현 책임연구원, 김문구 책임연구원)

  • 국내외 스마트 팩토리 동향과 전망

국내외 정책 동향

국내외 기업 동향


4. 이스트시큐리티 보안동향보고서 (220725)

(출처: ESTsecurity 기업, 보안동향보고서 No.154)

ESRC*에서 선정한 2022년 2분기 주목할 랜섬웨어

* ESRC: Economic and Social Research Council, 경제·사회 연구위원회

 

 

728x90
728x90
728x90
반응형
Open to Debate 1(domestic topic)
&
Open to Debate 2(International topic)

additional Arirang TV(News)

 

Contents

Acknowledgements

Introduction

Suggestions to the teacher

 

Open to Debate 1 (Revised Edition) : 70 Korean Issues Open to Dabate 2 (Revised Edition) : 70 International Issues
UNIT 01 Korea’s Greatest Hero
UNIT 02 Smart Phone Addiction
UNIT 03 An Evening of Pork, Rice & Soju
UNIT 04 Most Stressful Day of the Week?
UNIT 05 The Value of a Woman’s Work?
UNIT 06 Rising Obesity in Korea
UNIT 07 Plastic Surgery
UNIT 08 Subway Suicides
UNIT 09 Healthy Supplements
UNIT 10 Korean Special Days for Couples
UNIT 11 Are boys Better?
UNIT 12 TV: Good or Bad Influence?
UNIT 13 Foreign Car Ownership
UNIT 14 Gambling & Suicide
UNIT 15 English for kindergartners
UNIT 16 Life Expectancy
UNIT 17 Teenagers Smoking
UNIT 18 Traffic Accidents in Korea
UNIT 19 Adoption in Korea
UNIT 20 Business & Social Responsibility
UNIT 21 Planning for Retirement
UNIT 22 Conscientious Objectors
UNIT 22 Low Birth Rate
UNIT 24 Sexual Harassment
UNIT 25 Cleaning Up Dog Poop
UNIT 26 Studying Overseas
UNIT 27 Internet Etiquette
UNIT 28 Soju = The National Drink?
UNIT 29 Charitable Giving in Korea
UNIT 30 Dog Owners & Dog Meat
UNIT 31 Discrimination Based in Looks
UNIT 32 What Is Happiness?
UNIT 33 Spam Spam & More Spam!
UNIT 34 The Gender Gap in Korea
UNIT 35 US Troops in Korea
UNIT 36 Korean Elderly Living Alone
UNIT 37 The Physically Disabled in Korea
UNIT 38 Not in My Backyard (NIMBY)
UNIT 39 Do the Japanese Trust Koreans?
UNIT 40 Foreign Visitors to Korea
UNIT 41 20-Something Korean Women
UNIT 42 A Bounty on Fake Goods
UNIT 43 Taxes!
UNIT 44 Trouble at Work
UNIT 45 Divorce in Korea
UNIT 46 Indebtedness
UNIT 47 Pre-marital Sex
UNIT 48 The High Cost of Dying
UNIT 49 Yellow Dust
UNIT 50 Miss Korea: A Sexist Contest?
UNIT 51 College Admission for Sale?
UNIT 52 Adultery Law Abolished
UNIT 53 Sex Offenders: Punished Enough?
UNIT 54 Wasted Welfare?
UNIT 55 Prostitution in Korea
UNIT 56 Career Students
UNIT 57 Reduce Military Service?
UNIT 58 Labor Unions
UNIT 59 Organ Trafficking
UNIT 60 Delayed Marriage Registration
UNIT 61 Low Construction Standards
UNIT 62 Korean PhDs
UNIT 63 Childless Couples
UNIT 64 Avoiding Foreigners
UNIT 65 Transsexuals & Gender Registration
UNIT 66 Abolish the Death Penalty?
UNIT 67 How Transparent Is Korea?
UNIT 68 Benefits of the FTA
UNIT 69 Plagiarism in Korea
UNIT 70 North-South Reunification
UNIT 01 The Five Biggest Regrets before Death
UNIT 02 Dangerous Sports
UNIT 03 Internet Addiction
UNIT 04 Road Rage
UNIT 05 Frivolous Lawsuits
UNIT 06 Domestic Violence
UNIT 07 Cage-Free Eggs and Animal Welfare
UNIT 08 Wasted Food
UNIT 09 Social Networking Services
UNIT 10 Human Trafficking
UNIT 11 Excessive Police Violence against Minorities
UNIT 12 Bullfighting
UNIT 13 Gun Violence in America
UNIT 14 Wrongfully Imprisoned
UNIT 15 Breastfeeding in Public
UNIT 16 Sugar Daddies and Sugar Babies
UNIT 17 Legalization of Marijuana?
UNIT 18 The Blame for Internet Spam
UNIT 19 Same-Sex Marriage
UNIT 20 Transgender Restrooms
UNIT 21 Asian Americans: Facing Discrimination?
UNIT 22 Eating Live Animals
UNIT 23 Cruelty to Animals
UNIT 24 An Apology for Hiroshima?
UNIT 25 Fur Coats
UNIT 26 Discrimination against Muslims
UNIT 27 Once a Cheater, Always a Cheater?
UNIT 28 Finding Mr./Ms. Right
UNIT 29 Bullying in Public Schools
UNIT 30 The Death of Marriage?
UNIT 31 Wealthy Pastors: Truly Serving God?
UNIT 32 Proliferation of Drones
UNIT 33 Future Foods
UNIT 34 Grade Inflation
UNIT 35 Underpaid Actresses
UNIT 36 American Universities and Chinese Students
UNIT 37 Cosmetics for Men?
UNIT 38 The 40-Year-Old Virgin
UNIT 39 Secret Lottery Winners?
UNIT 40 Male and Female: Attitudes toward Sex
UNIT 41 Date Rape
UNIT 42 Sexting
UNIT 43 Cheating Students
UNIT 44 Nonstop Hacking
UNIT 45 Preserving the Rain Forest
UNIT 46 Drug Cartels
UNIT 47 Euthanasia
UNIT 48 Israel versus Palestine
UNIT 49 Democrats and Republicans
UNIT 50 Racial Equality in the U.S.
UNIT 51 Artificial Intelligence
UNIT 52 An Apology for Slavery?
UNIT 53 Climate Change
UNIT 54 The British Monarchy
UNIT 55 Climbing Mount Everest
UNIT 56 World Religions
UNIT 57 Scientology
UNIT 58 China versus the U.S.
UNIT 59 Illegal Immigration to the U.S.
UNIT 60 The Death Penalty
UNIT 61 Religious Veils in Public Places
UNIT 62 Women’s Rights in Saudi Arabia
UNIT 63 Indian Housewives: Shocking Rate of Suicide
UNIT 64 Addiction to Prescription Drugs
UNIT 65 Claiming the Arctic and Antarctic
UNIT 66 India versus Pakistan
UNIT 67 The Sunni and the Shia
UNIT 68 Chemical Weapons
UNIT 69 A Colony on Mars?
UNIT 70 National Foods

 

 

728x90
728x90
728x90
반응형
목차
1. 입력
  1) 변수
  2) 형 변환
2. 논리 자료형(Boolean Data)
  1) 논리 자료형
  2) 비교 연산자
  3) 논리 연산자
3. 조건문
  1) if문
  2) elif문
  3) else문

[Review] (1주차) 기초 자료형

2022.07.10 - [Dev/Python] - [Python] 01 기초 자료형 - week.01

 

[Python] 01 기초 자료형 - week.01

목차 1. print() 2. 기본 자료형: 숫자형, 문자열, 리스트 3. 변수 4. 연산: 사칙연산, 특수연산, 문자열 연산 5. 인덱싱과 슬라이싱 1. print() Point I print() : 문자열을 출력하는 명령어 print("Hello Rabbit..

sarahee.tistory.com


1. 입력

Point I
변수 = input() : 변수에 입력받은 값을 집어넣겠다는 의미

var = input()

Point II
어떤 것을 입력하든 문자열로 입력되기 때문에 형 변환이 필요
int() : 정수형 변환, str() : 문자열 변환 등…

var1 = input() #4 입력
var1 = int(var1)
var2 = int(input()) #3 입력
print(3+var1+var2) #10 출력

2. 논리 자료형(Boolean Data)

Point I
논리 자료형 : 참(True) 혹은 거짓(False)을 나타내는 자료형

True, False

Point II
비교 연산자 : 숫자나 문자의 값을 비교하는 연산자
주어진 진술이 참이면 True, 거짓이면 False

A == B #A와 B가 같다
A != B #A와 B가 다르다
A >= B #A가 B보다 크거나 같다
A <= B #A가 B보다 작거나 같다
A > B #A가 B보다 크다
A < B #A가 B보다 작다

print(3 == 3) #True
print(3 != 3) #False

Point III
논리 연산자 : 논리 자료형 사이의 연산

AND : 각 논리가 모두 True이면 결과가 True  
OR : 각 논리 중 True가 존재하면 결과가 True  
NOT : 논리값을 뒤집는 연산

3. 조건문

조건에 따라 특정 명령을 수행하는 구문

Point I
if문 : 조건이 참이면 명령을 수행

if a >= 5:
    print("a는 5 이상입니다!")

Point II
elif문 : 이전 조건이 거짓인 상황에서 조건이 참이면 명령을 수행

if a >= 5:
    print("a는 5 이상입니다!")
elif a >= 3:
    print("a는 3 이상 5 미만입니다!")

Point III
else문 : 위의 조건에 해당하지 않는 모든 경우에 수행

if a >= 5:
    print("a는 5 이상입니다!")
elif a >= 3:
    print("a는 3 이상 5 미만입니다!")
else:
    print("a는 3 미만입니다!")

Point IV
조건문에 들어가는 명령들은 같은 들여쓰기로 구분(Tab 사용)


[Next] (3주차) 리스트

2022.07.28 - [Development/Python] - [Python] 03 리스트 - week.03

 

[Python] 03 리스트 - week.03

목차 1. 리스트 활용 1) append(d) 2) insert(i, d) 3) remove(d) 4) sort() 2. 시퀀스 자료형 1) 인덱싱, 슬라이싱 2) in: 멤버 조회 3) len: 길이 확인 4) 연결(+), 반복(*) [Review] (2주차) 조건문 2022.07.22..

sarahee.tistory.com

 

728x90
728x90
728x90
반응형

[Review] (5주차) 실습

2022.07.16 - [Dev/Swift] - [Xcode] iOS Swift 앱 개발 Byte Degree - week.05

 

[Xcode] iOS Swift 앱 개발 Byte Degree - week.05

[Review] (4주차) 실습 2022.07.10 - [Dev/Swift] - [Xcode] iOS Swift 앱 개발 Byte Degree - week.04 [Xcode] iOS Swift 앱 개발 Byte Degree - week.04 [Review] (3주차) 실습 2022.07.01 - [Swift] - [Xcode]..

sarahee.tistory.com


최종 구현

 

그리드 레이아웃 변경 작업

FocusViewController 및 QuickFocusListViewController의  레이아웃 작업 변경(UICollectionViewCompositionalLayout 응용)

 

FocusViewController code 기존 수정 해설
item의 .fractionalWidth(1) 1 0.9 크기 조절
let group = NSCollectionLayoutGroup.vertical(layoutSize: groupSize, subitems: [item]) vertical horizontal 스크롤 방향: 세로 → 가로
section.orthogonalScrollingBehavior = .groupPagingCentered   신규 추가 스크롤 시 item 중앙 정렬
section.contentInsets = NSDirectionalEdgeInsets(top: 10, leading: 20, bottom: 10, trailing: 20) leading: 20, trailing: 20 leading: 5, trailing: 5 좌우 padding 줄이기
group의 .fractionalWidth(1) 1 0.9 item과 동일하게 설정(group padding이 별도로 설정되지 않도록)
section.interGroupSpacing = 10 10 -25 좌우 여백값 조절

 

QuickFocusListViewController code 기존 수정 해설
let group = NSCollectionLayoutGroup.horizontal(layoutSize: groupSize, subitem: item, count: 2) subitem: item, count: 2 subitems: [item] 동적으로 할당하도록 개수  설정 해제
section.orthogonalScrollingBehavior = .continuous   신규 추가 스크롤 시 item 정렬되지 않도록(이동한 만큼 위치)
let group = NSCollectionLayoutGroup.horizontal(layoutSize: groupSize, subitems: [item])
subitems: [item] subitem: item, count: 1 변경사항 복구
section.interGroupSpacing = 20 20 10 좌우 padding 줄이기

QuickFocusListViewController의 UIViewController에서

        let groupSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1), heightDimension: .estimated(50))
        // 기존
//        let group = NSCollectionLayoutGroup.horizontal(layoutSize: groupSize, subitem: item, count: 2)
        // 변경: 유연하게 할당될 수 있도록
		let group = NSCollectionLayoutGroup.horizontal(layoutSize: groupSize, subitems: [item])
        group.interItemSpacing = .fixed(10)
        
        let section = NSCollectionLayoutSection(group: group)
        section.contentInsets = NSDirectionalEdgeInsets(top: 30, leading: 20, bottom: 30, trailing: 20)
        section.interGroupSpacing = 20
        // 추가: .continuous, .groupPagingCentered
        section.orthogonalScrollingBehavior = .continuous

Collection View Cell

수평적으로 화면 조회되지만, 각 화면에 하나의 group만 존재하도록 설정됨

(참고) corner의 값 조절 - 코드에 반영하지 않음

collectionView.collectionViewLayout = layout()
collectionView.delegate = self
// 추가: width의 값이 동적으로 조절
collectionView.clipsToBounds = true

→ group의 fractionalWidth도 item과 동일하게 설정해 주어야 함 + spacing 값 또한 조절


UICollectionViewCompositionalLayout

출처:  https://developer.apple.com/documentation/uikit/uicollectionviewcompositionallayout

func createBasicListLayout() -> UICollectionViewLayout { 
    let itemSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1.0),                                  
                                         heightDimension: .fractionalHeight(1.0))    
    let item = NSCollectionLayoutItem(layoutSize: itemSize)  
  
    let groupSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1.0),                                          
                                          heightDimension: .absolute(44))    
    let group = NSCollectionLayoutGroup.horizontal(layoutSize: groupSize,                                                   
                                                     subitems: [item])  
  
    let section = NSCollectionLayoutSection(group: group)    

    let layout = UICollectionViewCompositionalLayout(section: section)    
    return layout
}

group.interItemSpacing에 int 값을 넣으면 다음과 같은 오류 발생

Cannot assign value of type 'int' to type 'NSCollectionLayoutSpacing?'

 

group size의 fractionWidth를 item size와 동일하게 0.5로 설정할 경우 다음과 같은 화면 조회

두 item처럼 보이는 부분이 하나의 item으로 설정됨

QuickFocusCell의 count를 subitems: [item] → subitem: item, count: 1 설정

좌측부터 차례대로 FocusViewController, QuickFocusListViewController

최종 코드

//
//  FocusViewController.swift
//  HeadSpaceFocus
//
//  Created by sehee on 2022/07/10.
//

import UIKit

class FocusViewController: UIViewController {
    
    @IBOutlet weak var collectionView: UICollectionView!
    @IBOutlet weak var refreshButton: UIButton!
    
    var curated: Bool = false
    var items: [Focus] = Focus.list
    
    typealias Item = Focus
    enum Section {
        case main
    }
    var datasource: UICollectionViewDiffableDataSource<Section, Item>!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        refreshButton.layer.cornerRadius = 10
        
        // Presentation: Diffable Datasource + Cell Provider
        datasource = UICollectionViewDiffableDataSource<Section, Item>(collectionView: collectionView, cellProvider: { collectionView, indexPath, item in
            guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "FocusCell", for: indexPath) as? FocusCell else {
                return nil
            }
            cell.configure(item)
            return cell
        })
        
        // Data: Snapshot
        var snapshot = NSDiffableDataSourceSnapshot<Section, Item>()
        snapshot.appendSections([.main])
        snapshot.appendItems(items, toSection: .main)
        datasource.apply(snapshot)
        
        // Layout
        collectionView.collectionViewLayout = layout()
        collectionView.delegate = self
        
        updateButtonTitle()
    }
    
    private func layout() -> UICollectionViewCompositionalLayout {
        
        let itemSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(0.9), heightDimension: .estimated(50))
        let item = NSCollectionLayoutItem(layoutSize: itemSize)
        
        let groupSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(0.9), heightDimension: .estimated(50))
        let group = NSCollectionLayoutGroup.horizontal(layoutSize: groupSize, subitems: [item])
        
        let section = NSCollectionLayoutSection(group: group)
        section.contentInsets = NSDirectionalEdgeInsets(top: 10, leading: 5, bottom: 10, trailing: 5)
        section.interGroupSpacing = -25
        section.orthogonalScrollingBehavior = .groupPagingCentered
        
        let layout = UICollectionViewCompositionalLayout(section: section)
        return layout
    }
    
    func updateButtonTitle() {
        let title = curated ? "See All" : "See Recommendation"
        refreshButton.setTitle(title, for: .normal)
    }
    
    @IBAction func refreshButtonTapped(_ sender: Any) {
        curated.toggle()
        
        self.items = curated ? Focus.recommendations : Focus.list
        
        var snapshot = NSDiffableDataSourceSnapshot<Section, Item>()
        snapshot.appendSections([.main])
        snapshot.appendItems(items, toSection: .main)
        datasource.apply(snapshot)
        
        updateButtonTitle()
    }
}

extension FocusViewController: UICollectionViewDelegate {
    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
        let item = items[indexPath.item]
//        print(">>> \(item.title)")
        
        let storyboard = UIStoryboard(name: "QuickFocus", bundle: nil)
        let vc = storyboard.instantiateViewController(withIdentifier: "QuickFocusListViewController") as! QuickFocusListViewController
        vc.title = item.title
//        present(vc, animated: true)
        navigationController?.pushViewController(vc, animated: true)
    }
}
//
//  QuickFocusListViewController.swift
//  HeadSpaceFocus
//
//  Created by sehee on 2022/07/21.
//

import UIKit

class QuickFocusListViewController: UIViewController {
    
    @IBOutlet weak var collectionView: UICollectionView!
    
    let breathingList = QuickFocus.breathing
    let walkingList = QuickFocus.walking
    
    enum Section: CaseIterable {
        case breathe
        case walking
        
        var title: String {
            switch self {
            case .breathe: return "Breathing exercises"
            case .walking: return "Mindful walks"
            }
        }
    }
    
    typealias Item = QuickFocus
    var datasource: UICollectionViewDiffableDataSource<Section, Item>!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        // enum Section CaseIterable 생성한 코드가 다음 내용과 동일
//        Section.allCases
//        let allItems: [Section] = [.breathe, .walking]
        // 생성 코드가 다음과 같이 쓰일 수 있음
//        let section: Section = .breathe
//        section.title
        
        // Presentation
        datasource = UICollectionViewDiffableDataSource<Section, Item>(collectionView: collectionView, cellProvider: { collectionView, indexPath, item in
            guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "QuickFocusCell", for: indexPath) as? QuickFocusCell else {
                return nil
            }
            cell.configure(item)
            return cell
        })
        
        datasource.supplementaryViewProvider = { (collectionView, kind, indexPath) in
            guard let header = collectionView.dequeueReusableSupplementaryView(ofKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: "QuickFocusHeaderView", for: indexPath) as? QuickFocusHeaderView else {
                return nil
            }
            let allSections = Section.allCases
            let section = allSections[indexPath.section]
            header.configure(section.title)
            return header
        }
        
        // Data
        var snapshot = NSDiffableDataSourceSnapshot<Section, Item>()
        snapshot.appendSections([.breathe, .walking])
        // 위의 코드와 동일
//        snapshot.appendSections(Section.allCases)
        snapshot.appendItems(breathingList, toSection: .breathe)
        snapshot.appendItems(walkingList, toSection: .walking)
        datasource.apply(snapshot)
        
        // Layout
        collectionView.collectionViewLayout = layout()
        self.navigationItem.largeTitleDisplayMode = .never
    }
    private func layout() -> UICollectionViewCompositionalLayout {
        let itemSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(0.5), heightDimension: .estimated(50))
        let item = NSCollectionLayoutItem(layoutSize: itemSize)
        
        let groupSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(0.5), heightDimension: .estimated(50))
        let group = NSCollectionLayoutGroup.horizontal(layoutSize: groupSize, subitem: item, count: 1)
        group.interItemSpacing = .fixed(10)
        
        let section = NSCollectionLayoutSection(group: group)
        section.contentInsets = NSDirectionalEdgeInsets(top: 30, leading: 20, bottom: 30, trailing: 20)
        section.interGroupSpacing = 10
        section.orthogonalScrollingBehavior = .continuous
        
        let headerSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1), heightDimension: .absolute(50))
        let header = NSCollectionLayoutBoundarySupplementaryItem(layoutSize: headerSize, elementKind: UICollectionView.elementKindSectionHeader, alignment: .top)
        section.boundarySupplementaryItems = [header]
        
        let layout = UICollectionViewCompositionalLayout(section: section)
        return layout
    }
}

 

 

728x90
728x90
728x90
반응형

NTP

개념 Network Time Protocol, 가장 오래된 인터넷 프로토콜, 네트워크를 통해 컴퓨터 간 시간 동기화를 위한 네트워크 프로토콜
사용 포트 123/UDP port, CVE-2013-5211
원리 NTP 프로토콜에 '몬리스트(monlist)'라는 명령어를 보냄
'monlist'라는 명령으로 요청받으면, 최근에 해당 서버에 접속한 최대 600개의 호스트들에 대한 최신 정보를 응답으로 보내줌
기본 monlist 요청은 8byte로 가능, 수백~수천 배의 응답
찾는 방법 nmap 등의 스캐닝 툴
예시 프랑스에서 초당 400Gbps 규모의 DDoS 공격 탐지(2014년 2월 13일)
NTP 프로토콜을 이용한 증폭 공격 사례
대량의 정보를 요청하는 명령 전송하여 대량의 응답 받음
해결 방안 NTP 서버가 취약한 버전일 경우 NTP-4.2.7p26 이상 버전으로 업그레이드

Intro

NTP에 대해 이해하고 서버 구축하기

 

서버의 설정

1. NTP 서버 설치

2. 파일 설정(/etc/ntp.conf 변경)

3. 방화벽 허용 및 서비스 시작

 

클라이언트 설정

1. NTP 서버 상태 확인(ntpq -p)

2. NTP 서버 시간 동기화(ntpdate 서버 IP주소 명령)

 

NTP 서버 설정

NTP server: 192.168.17.134

NTP client: 192.168.17.145

 

NTP DRDoS Attack 기본 원리

공격자가 자신의 IP를 희생자 IP(client IP)로 바꿔서 NTP에게 시간을 질의

NTP는 클라이언트에게 시간을 알려줌

해커가 클라이언트 IP로 NTP에게 monlist를 요청

클라이언트에게 600개의 정보가 날라감

 

yum: Yellowdog Updater Modified, rpm 기반의 시스템을 위한 자동 업데이트 및 패키지 설치/삭제 도구

sudo apt-get install yum

 

1. 서버 및 클라이언트에 NTP 설치

# yum -y install ntp 혹은

apt install -y ntp

2. NTP 서버 설정

root@ubuntu:/etc# vi ntp.conf

# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help

driftfile /var/lib/ntp/ntp.drift

# Leap seconds definition provided by tzdata
leapfile /usr/share/zoneinfo/leap-seconds.list

# Enable this if you want statistics to be logged.
#statsdir /var/log/ntpstats/

statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable

# Specify one or more NTP servers.

# Use servers from the NTP Pool Project. Approved by Ubuntu Technical Board
# on 2011-02-08 (LP: #104525). See 
http://www.pool.ntp.org/join.html
 for
# more information.
pool 0.ubuntu.pool.ntp.org iburst
pool 1.ubuntu.pool.ntp.org iburst
pool 2.ubuntu.pool.ntp.org iburst
pool 3.ubuntu.pool.ntp.org iburst

# Use Ubuntu's ntp server as a fallback.
pool ntp.ubuntu.com

# Access control configuration; see /usr/share/doc/ntp-doc/html/accopt.html for
# details.  The web page <
http://support.ntp.org/bin/view/Support/AccessRestrictions>

# might also be helpful.
#
# Note that "restrict" applies to both servers and clients, so a configuration
# that might be intended to block requests from certain clients could also end
# up blocking replies from your own upstream servers.

# By default, exchange time with everybody, but don't allow configuration.
restrict -4 default kod notrap nomodify nopeer noquery limited
restrict -6 default kod notrap nomodify nopeer noquery limited

# Local users may interrogate the ntp server more closely.
restrict 127.0.0.1
restrict ::1

# Needed for adding pool entries
restrict source notrap nomodify noquery

# Clients from this (example!) subnet have unlimited access, but only if
# cryptographically authenticated.
#restrict 192.168.123.0 mask 255.255.255.0 notrust


# If you want to provide time to your local subnet, change the next line.
# (Again, the address is an example only.)
#broadcast 192.168.123.255

# If you want to listen to time broadcasts on your local subnet, de-comment the
# next lines.  Please do this only if you trust everybody on the network!
#disable auth
#broadcastclient

 

해당 부분 주석 처리하여 설정 변경

# restrict -4 default kod notrap nomodify nopeer noquery limited
# restrict -6 default kod notrap nomodify nopeer noquery limited

 

192.168.17.0/16 네트워크에서의 NTP 요청 허용

restrict 192.168.17.0 mask 255.255.255.0 nomodify notrap

service ntp restart

 

Kali에서 ntp-monlist scan 시 다음과 같이 filtered

서버 iptables 기본 설정(NTP port: 123/UDP)

iptables -I INPUT 1 -p udp --dport 123 -j ACCEPT

script output


참고 자료

NTP 서버 구축 및 관리

NTP DrDoS Attack

NTP 증폭 공격

 

728x90
728x90
728x90
반응형
개요
* Easy_KeygenMe.exe 파일 실습
1. 레지스터 활용 분석
- 메모리 주소 및 스택 프레임의 이해
- ESP(스택 포인터), EBP(프레임 포인터), EIP 등 개념 정리
2. 어셈블리 명령어 이해 및 알고리즘 분석
- Pseudo code 기반 소스코드 작성

목차
0. 파일 버전 확인(32bit, 64bit)
1. 정의된 데이터(db)
2. 어셈블리어: CMP, LEA, TEST, XOR, MOV, MOVZX, MOVSX
3. 메모리의 구조
   1) 코드 영역
   2) 데이터 영역
   3) 힙 영역
   4) 스택 영역 - 레지스터: ESP, EBP, EIP, ECX, EAX

4. IDA 메모리 주소 표시 차이

[Review] (3주차) 실습

2022.07.04 - [Security & Analysis/IDA Pro] - IDA Pro 악성코드 정적분석 툴 사용법&실습 - week.03(Easy_KeygenMe) (1)

 

IDA Pro 악성코드 정적분석 툴 사용법&실습 - week.03(Easy_KeygenMe) (1)

개요 * Easy_CrackMe.exe 실습 리뷰 및 Easy_KeygenMe.exe 파일 실습 1. 디스어셈블리 상세 기능 - 스택 프레임 및 함수 호출 규약의 이해 - 동적 디버깅 사용 및 코드 실행 - 데이터 타입과 데이터 구조 - 기

sarahee.tistory.com


0. 파일 버전 확인(32bit,  64bit)

실행파일 32bit, 64bit 버전 확인(e.g. exe, dll, ocx)

ExeProperties 프로그램: 윈도우 탐색기에 플러그인, 실행파일이나 프로그램 내부적으로 사용하는 라이브러리(dll, ocx 등)가 사용하는 비트 확인

Download ExeProperties

 

Download ExeProperties

<!--   ExtraBit Software Ltd. Products | Contact --> ExtraBit Software Home ExeProperties Download Download ExeProperties Download the ExeProperties installer for Windows 11/10/8/7 Download ExeProperties v1.4 To install ExeProperties on your system, run t

www.extrabit.com

설치 이후, 해당 파일 우클릭 > 속성(R) > Exe/Dll Info 탭 추가되어, Additional Exe/Dll Properties 확인 가능

Type: x86 (32-bit) or x64 (64-bit)

기본 속성(Alt+Enter)
Download ExeProperties v1.4
32-bit 확인


1. 정의된 데이터(db)

# define 식별자 문자열

  • 식별자: 매개변수, 전달인자, ...
  • 문자열: 치환텍스트

2. 어셈블리어: CMP, LEA, TEST, XOR, MOV, MOVZX, MOVSX

CMP

cmp [esp+68h+var_63], 61h: esp+68h+var_63의 값이 61h 위치에 있는 값과 같은지 비교(값을 빼서 비교)

LEA

lea edi, [esp+68h+var_63]: esp+68h+var_63에 저장된 주소를 esp에 저장

TEST

: 인수1과 인수2 내용을 AND 연산하여 결과가 0이면 ZF = 1로 설정(보통 NULL check할 때 사용)

(두 operand가 0이 아닌 경우를 제외하고는 값을 판별하기 어려움 → eax, eax와 같은 형태로 사용하여 0인지 아닌지 확인)

Byte 단위로 각각 스택에 넣어줌, 사용자가 입력한 문자열을 첫번째 글자부터 순서대로 Byte 단위로 레지스터에 넣음

XOR

두 입력 신호가 서로 같으면 0, 다르면 1, 동일한 두 값 → 초기화

MOV

데이터 복사 명령어

MOVZX

소스의 내용을 목적지로 복사, 목적지의 나머지 부분을 0 padding

(목적지에 32bit register → 소스에 16bit register)

MOVSX

소스의 내용을 목적지로 복사, 목적지의 나머지 부분을 소스의 맨 처음 bit로 채움

(목적지에 32bit register → 소스에 16bit register)


3.  메모리의 구조

1) 코드(code) 영역

const int constval = 30;  // 상수

int function() {  // 함수
    return 20;
}

실행할 프로그램의 코드가 저장되는 영역 (= 텍스트 영역)

2) 데이터(data) 영역

int uniintial;  // 초기화되지 않은 전역변수
int initial = 30;  // 초기화된 전역변수
static int staticval = 70;  // 정적변수

프로그램의 전역 변수와 정적(static) 변수가 저장되는 영역

프로그램 시작 시 할당, 프로그램 종료 시 소멸

3) 힙(heap) 영역

int main(int argc, const char * argv[]) {
    char *arr = malloc(sizeof(char) * 10);  // 동적 할당 변수
    return 0;
}

사용자가 직접 관리하는 메모리 영역

사용자에 의해 메모리 공간이 동적으로 할당되고 해제됨

메모리의 낮은 주소에서 높은 주소로의 방향으로 할당

4) 스택(stack) 영역

int main(int argc, const char * argv[]) {
    int localval1 = 30;  // 지역변수 1
    int localval2;  // 지역변수 2
    return 0;
}

지역 변수와 매개변수가 저장되는 영역(함수의 호출과 관련)

함수의 호출과 함께 할당, 함수의 호출이 완료되면 소멸

스택 영역에 저장되는 함수의 호출 정보: 스택 프레임(stack frame)

 

스택에 할당된 메모리 블록, 호출된 함수에 지정

함수가 호출되면,

1) 함수 호출자가 파라미터 형태로 정보를 넘겨줄 때 어딘가에 저장되고, 호출된 함수가 정보를 찾게 해야 한다.

2) 함수의 작업을 위한 임시 저장소가 필요하다.

* 스택: 제한적으로 접근할 수 있는 자료 구조(LIFO, Last In First Out)

* 임시 저장소: 주로 지역 변수가 사용, 함수가 종료되면 더 이상 접근 불가

전역변수가 저장되는 곳이 스택이라는  메모리 공간

먼저 선언된 변수일수록  높은 주소값을 할당 받음

→ ESP, EBP는 이러한 스택 공간의 주소값을 저장하기 위해 설계된 레지스터


레지스터: ESP, EBP, EIP, ECX, EAX

* E: Extended(16bit → 32bit system), 64bit에서는 R로 표현

ESP(Stack Pointer)

: 현재의 스택 지점(stack의 가장 아래 부분), 스택의 크기를 조정할 때 사용

  • 현재 스택의 최상단 주소값(가장 작은값) 저장(∵ 스택의 주소는 높은 주소에서 낮은 주소로 할당)
  • 스택에 값을 넣을 때마다 ESP가 4만큼 줄어듦

EBP(Base Pointer)  (= Frame Pointer)

: 프레임 포인터를 사용하는 함수를 가리킴(함수가 프레임 포인터를 쓰는지 여부의 분석이 필요할 때, 이 속성을 이용해 수작업으로 지정 가능 - 레지스터의 크기 보정 필요)

  • 현재 스택 프레임의 베이스 주소(스택의 가장 윗 부분)
  • 스택 프레임(함수나 지역변수의 경계를 구분짓기 위한 하나의 블록으로 묶임)의 base 주소
  • 스택 프레임 형태로 저장된 함수의 지역 변수나 전달인자를 참조/변경시 사용하는 레지스터
  • 고정적, 코드 유지에 용이(스택프레임 생성시)

EIP(instruction pointer)

: 다음에 실행할 명령어 위치를 담는 레지스터

ECX(Extended Counter Register)

: 주로 반복 명령어 사용시 반복 카운터로 사용

EAX(Extended Accum ulator Register)

: 산술(덧셈, 곱셈, 나눗셈 등) 논리 연산을 수행할 때 사용, 함수의 반환값이 이 레지스터에 저장


4. IDA 메모리 주소 표시 차이

var_(숫자): 함수의 지역변수, EBP보다 더 낮은 메모리 주소에 위치하므로 음수 값을 가짐

스택 메모리 구조 상 지정된 주소는 초기 스택 포인터보다 낮은 주소에 있어야 하므로, 스택 포인터가 양수 값을 가지면 에러

디버거 메모리 주소 형태 비고
Ollydbg ESP + n 일반적인 형태
IDA Pro ESP + 현재 스택 포인터 + var_? 자동으로 스택의 사용을 조사해서 지역 변수를 찾아내는데 용이하도록 설정

IDA 디스어셈블러 화면 시작 부분의 var_? 형태로 특정 값이 설정되어 있음

함수 시작 시 EBP 주소를 기준으로 스택 상에 변수가 위치하는 오프셋 값

단축키

1) (지역 변수 선택 후) + x

해당 지역 변수가 또 다른 어디에서 참조되었는지 확인 가능

2) (지역 변수 선택 후) + Enter

"Stack of ..." 창 조회, 해당 함수에서 추측된 스택 프레임 보여줌


[Next] (5주차) 실습

2022.08.06 - [Security & Analysis/IDA Pro] - [IDA Pro] 악성코드 정적분석 툴 사용법&이론 - week.05(Easy ELF)

 

[IDA Pro] 악성코드 정적분석 툴 사용법&이론 - week.05(Easy ELF)

목차 1. Easy ELF 실습 - 실습을 위한 사전 단계(Linux 파일 실행) 2. 분기문 분석 3. byte 및 배열 정리 4. 소스코드 작성(어셈블리어 기반) [Review] (4주차) 이론 - 총정리 2022.07.19 - [Security & Analysis/..

sarahee.tistory.com

 

728x90
728x90
728x90
반응형

DRDoS 개념

Distributed Reflection Denial of Service (분산 반사 서비스 거부 공격)

 

특징

출발지 IP를 위조(Source IP Spoofing)

공격자는 IP를 공격 대상으로 Spoofing, 대량의 공격 요청을 반사 대상(서버 등)에 보냄

→ IP를 기반으로 공격을 방어하거나 공격자 역추적이 어려움

다수의 정상 동작 서버에 공격 트래픽 발생시켜, 정상 트래픽과의 구분이 어려움

공격 트래픽이 수백 Gbps 이상의 대규모로 발생하여, 탐지 하더라도 방어하기 어려움


UDP 기반 증폭 공격

DNS

개념 Domain Name System, 호스트와 도메인 이름과 아이피 주소와의 변환을 수행할 수 있도록 만들어진 주소 변환 프로토콜
사용 포트 53/UDP port, CVE-2006-0987
원리 DNS 레코드 값을 서버에 재귀적인 방식으로 질의를 하여 찾을 수 있음
DNS 서버에 dig 명령을 이용해 ANY 타입의 쿼리로 질의를 보냄(취약한 서버 찾기)
DNS 서버는 질의를 받은 도메인과 관련된 모든 타입의 레코드 정보를 보내줌(대량의 응답)
* dig 명령: DNS 질의응답이 정상적으로 이루어지는지를 확인 점검하는 경우에 주로 사용

기존 DNS 프로토콜: 512byte로 사이즈 제한
확장 버전인 EDNS: 4096byte까지 전송이 가능하여 더 큰 증폭 효과를 만들 수 있음
찾는 방법 DNS 서버에 dig 명령을 이용해 ANY 타입의 쿼리를 보내 취약한 서버 찾음

 

NTP

개념 Network Time Protocol, 가장 오래된 인터넷 프로토콜, 네트워크를 통해 컴퓨터 간 시간 동기화를 위한 네트워크 프로토콜
사용 포트 123/UDP port, CVE-2013-5211
원리 NTP 프로토콜에 '몬리스트(monlist)'라는 명령어를 보냄
'monlist'라는 명령으로 요청받으면, 최근에 해당 서버에 접속한 최대 600개의 호스트들에 대한 최신 정보를 응답으로 보내줌
기본 monlist 요청은 8byte로 가능, 수백~수천 배의 응답
찾는 방법 nmap 등의 스캐닝 툴
예시 프랑스에서 초당 400Gbps 규모의 DDoS 공격 탐지(2014년 2월 13일)
NTP 프로토콜을 이용한 증폭 공격 사례
대량의 정보를 요청하는 명령 전송하여 대량의 응답 받음
해결 방안 NTP 서버가 취약한 버전일 경우 NTP-4.2.7p26 이상 버전으로 업그레이드

 

SSDP

개념 Simple Service Discovery Protocol, UPnP(Universal Plug and Play) 프로토콜에서 근거리 혹은 인터넷에 연결된 디바이스를 찾는데 사용되는 프로토콜
사용 포트 1900/UDP port
원리 SSDP를 이용해 네트워크 서버나 정적인 호스트 설정 없이 디바이스 탐지가 가능(like DHCP, DNS)
M-Search 메서드를 이용하여 멀티캐스트 방식으로 로컬 네트워크에 연결된 디바이스 조회 가능
응답 패킷에는 다양한 정보 포함(e.g. 헤더, 배너정보 OS, UUID 정보)
40byte 정도의 M-Search 요청에 대해 서버는 평균적으로 30배 이상의 크기를 갖는 응답을 보내줌
찾는 방법 UDP 1900번 포트로 SSDP M-Search 패킷으로 인터넷 스캐닝하여 서버 찾음

 

SNMP

개념 Simple Network Management Protocol, 네트워크 디바이스를 관리하는 목적으로 만들어진 프로토콜, 네트워크 구성/성능/장비/보안관리가 가능
기존: 네트워크 디바이스의 모니터링은 ICMP와 같은 프로토콜을 사용
신규: 네트워크가 복잡해짐에 따라 더 효율적으로 네트워크 디바이스를 관리하기 위함
대량의 트래픽을 유발하는 명령 전송하여 대량의 응답 받음
사용 포트 161/UDP port
원리 장비 관리에 접근제어는 SNMP 패킷의 community 필드의 값으로, 보통 public과 같은 값으로 세팅
GetBulkRequest 명령을 이용
테이블에 있는 객체데이터를 요청하는 GetBulkRequest 명령을 반복적으로 수행
70byte의 GetBulkRequest 요청으로 최대 수만 byte의 응답을 받음
찾는 방법 community 값을 public으로 SNMP 패킷을 생성하여 스캐닝하여 증폭 공격에 이용 가능한 서버 찾음

 

Chargen

개념 Character Generator Protocol, 클라이언트의 요청에 대해 랜덤한 개수(0-512)의 문자열을 응답으로 보내주는 프로토콜
사용 포트 19/UDP port (네트워크 연결에 대한 디버깅, 대역폭 테스팅 등에 사용)
원리 60byte의 요청 패킷에 대해 랜덤한(74~1472bytes) 크기의 응답을 보내줌
(수백 배 정도의 증폭 효과)
찾는 방법 nmap 등의 스캐닝 툴

 

Others

NetBios

PC의 이름 등록(name registration)과 resolution을 수행하는 프로토콜의 디버깅을 위한 nbtstat 명령 이용

약 3배 정도의 증폭 효과

 

QOTD

Quote Of The Day, CharGen 프로토콜과 거의 유사한 형태

17/UDP port

 

TCP SYN Flooding

공격자가 IP를 목표물로 설정

반사 서버로 Syn 요청

반사 서버는 목표물에게 SYN+ACK 보냄

일정 시간 이후 목표물이 SYN+ANK 재전송(TCP 연결 특성상)

 

P2P


프로토콜별 증폭 공격이 가능한 이유, 공격 기법

공격자는 보통 네트워크 스캐너를 이용하여 증폭 공격에 이용할 취약 서버 리스트를 확보

(e.g. 디바이스 검색엔진 Shodan 이용)

 

과정

증폭 공격에 대한 공격 대상이 네트워크에 존재하는 경우

공격에 사용되는 서버가 네트워크에 존재하는 경우

공격자가 네트워크에 존재하는 경우

 

보안 대책

ISP에서 IP Spoofing 패킷 진입 불가(Ingress Filtering) 설정

네트워크 보안 장비(e.g. 방화벽)에서 동일 IP에 대해 일정 요청 이상은 차단하도록 설정

NTP의 경우 monlist 기능 비활성화(ntpdc -c monlist (NTP server add))

 

Proactive Attack Prevention

사전에 DRDoS 증폭 공격을 방어하는 방법

1) IP spoofing을 원천적으로 막는 안티스푸핑(Anti spoofing) 기법 적용

2) 프로토콜 취약점을 패치

 

1. 안티 스푸핑(Anti-Spoofing)

: 인증을 이용한 안티 스푸핑 기법

1) 세션 토큰을 이용한 인증

2) 암호화 기법을 이용한 인증

3) 제삼자(third-party)를 이용한 인증

성능 상의 오버헤드나 추가적으로 트래픽 발생

 

2. 네트워크 토폴로지를 이용한 방법

 


[참조]

 

최현상,박현도,이희조, "DRDoS 증폭 공격 기법과 방어 기술 연구(A Study on Amplification DRDoS Attacks and Defenses)", 한국정보전자통신기술학회논문지, 15-08-05-429 Vol.8 No.5 (2015), 9page.

 

김효종, 한군희, 신승수, "DRDoS 증폭 공격 대응 시스템(Response System for DRDoS Amplification Attacks)", 융합정보논문지(Journal of Convergence for Information Technology), Vol.10 No12 (2020), 22~30page

 

 

728x90
728x90
728x90
반응형
목차
1. 더 빠르고 쾌적한 공공와이파이가 온다! (220708)
2. 2022년 국가연구개발 우수성과 100선 선정 추진 (220711)
3. 가상융합경제 안전한 성장을 위해 보안업계 맞손 (220714)
4. 무인기 기반의 안전한 데이터 수집을 위한 클러스터 헤드 선출 보안 기술 동향 (220713)
4. 2022년 상반기 KISA 사이버 위협 동향 보고서 (220715)

1. 더 빠르고 쾌적한 공공와이파이가 온다! (220708)

(출처: 과학기술정보통신부, 보도자료, 정보보호네트워크정책관 네트워크안전기획과 구본준 과장(044-202-6430), 송창종 사무관(044-202-6431))

  • 22년 7월 시내버스 4,200대부터 5세대(5G) 백홀 와이파이로 단계적 전환
  • 올해는 신기술인 와이파이 6E*를 활용하여 공공와이파이를 구축할 예정

21년 하반기 제품 출시된 와이파이 규격으로, 2.4, 5㎓만 활용하는 기존의 와이파이 6 비해 6㎓ 대역을 추가 사용하여 체감속도 및 동시접속 안정성 향상


2. 2022년 국가연구개발 우수성과 100선 선정 추진 (220711)

(출처: 과학기술정보통신부, 보도자료, 성과평가정책국 성과평가정책과 이은영 과장(044-202-6920), 성인제 사무관(044-202-6922))

  • 국가연구개발사업을 통해 창출된 전년도 연구성과 중 기술 분야별 가장 우수한 성과를 선정하는 대한민국 유일의 범부처급 국가연구개발 우수성과 선정제도

[사례1] 다양한 나노물질에서의 광반응 현상 연구

  • 핵심 연구성과: 초극단시간 분해 분광 실험장비의 개발 및 최적화

[사례2] 간암치료를 목적으로 비수술적 치료법인 동맥화학색전술에 사용되는 미세구체의 개발

  • 핵심 연구성과: 부작용은 줄이고 사용은 편리한 국산제품 상용화

[사례3] 세노바메이트, 미국 FDA 시판허가 및 유럽지역 기술 수출 계약

  • 핵심 연구성과: 우리나라 최초로 신약 후보물질 발굴부터 글로벌 임상 개발, 판매 허가까지 전 과정을 독자적으로 진행하여 미국 FDA 승인 및 진출에 성공한 뇌전증 치료제 개발

[사례4] 고 에너지밀도 전지 제조를 위한 핵심 원천 기술 개발 및 지식 재산권 확보

  • 핵심 연구성과: 순수 우리 기술로 만든 전기자동차용 양극재 개발

3. 가상융합경제 안전한 성장을 위해 보안업계 맞손 (220714)

(출처: 과학기술정보통신부, 보도자료, 정보보호네트워크정책관 정보보호기획과 신대식 과장(044-202-6440), 김장호 서기관(044-202-6441))

  • 과학기술정보통신부와 한국인터넷진흥원은 가상융합경제의 확산에 따라 「확장가상세계(메타버스)‧대체불가토큰(NFT) 보안협의체」 발대식 개최
  • 사이버보안 패러다임 변화에 대응하여, 제로트러스트, 공급망 보안 등 보안체계를 기반시설에 적용하기 위한 '사이버보안 패러다임 대응 연구반' 운영

4. 무인기 기반의 안전한 데이터 수집을 위한 클러스터 헤드 선출 보안 기술 동향 (220713)

(출처: 정보통신기획평가원, 주간기술동향 2054호, 한국전자통신연구원 왕기철 책임연구원(062-970-6531), 김재인 선임연구원, 김성창 책임연구원)

  • 무인기 기반의 IoT 네트워크에서 효율적인 데이터 수집 및 분배를 위해서는 클러스터 구조의 활용이 필요
  • 데이터 수집을 안전하게 하기 위해서는 클러스터 헤드(Cluster Head: CH)들의 선출을 안전하게 수행하는 것이 필수적

5. 2022년 상반기 KISA 사이버 위협 동향 보고서 (220715)

(출처: 한국인터넷진흥원 인터넷침해대응센터(KISA 인터넷보호나라&KrCERT), 보고서, 침해사고분석단 종합분석팀)

(출처2: (220725) 한국인터넷진흥원, 지식플랫폼 > 동향분석 > 사이버 위협 동향, 침해사고분석단 종합분석팀, https://www.kisa.or.kr/20205/form?postSeq=1022&page=1#fndoDocumentPreview)

  • 요약: 랜섬웨어 갱단의 활발한 활동과 가상자산의 공격 피해
  • 랩서스(Lapsus$): 가장 활발하게 활동한 랜섬웨어 갱단, 2021년 12월 브라질 보건부 해킹을 시작으로 올해 마이크로소프트, 엔비디아, 옥타(Okta) 등 글로벌 보안 전문기업 해킹
  • 블랙캣(BlackCat): 2022년 상반기 새로 모습을 드러낸 랜섬웨어 갱단
  • + 콘티(Conti), 락빗(Lockbit), ...

국내외 사이버 위협 동향

1. 세계 주요 기업 Lapsus$ 공격으로 인해 피해 발생

세계 주요 기업 Lapsus$ 공격으로 인해 피해 발생
Lapsus$의 주요 공격 방식

2. 러시아-우크라이나 하이브리드 전쟁, 또 하나의 전쟁터가 된 사이버 공간

3. 사이버 공격 하는 북한, 사이버 공격 받는 북한

  • 북한 연계 피싱 공격 지속: 2월, 국내 군사 연구 및 동북아 평화 협회인 것처럼 위장해 외교·안보·국방분야 전문가를 겨냥해 프로필을 보내달라면서 프로필 양식 문서로 위장한 MS 워드 악성 파일을 첨부한 피싱 메일 발송

4. 여전히 기업 비즈니스의 큰 위협인 랜섬웨어

5. 블록체인 브리지, 해킹으로 대규모 가상자산 피해 잇따라 발생

  • 블록체인 브리지에서 사고가 나는 이유: 복잡한 요구사항을 처리하고, 많은 가상자산을 보유해 주요 공격 대상이 됨
  • 다양한 가상자산을 처리하는 크로스체인 DeFi에서 브리지를 많이 사용

6. 비밀번호 해킹과 피싱으로 피해가 계속되는 NFT

7. 클레이튼 기반 DeFi KLAYswap, 해킹으로 약 22억 원 피해

  • 국내 대형 DeFi 중 하나인 클레이스왑(KLAYswap)에 대한 공격은 BGP 하이재킹 이용

8. 공격 대상을 정부로 넓혀가는 러시아 사이버범죄 집단 - Conti, Lockbit2.0, Killnet

취약점 동향

1. 오픈소스 보안 라이브러리 잠재적 위협 - OpenSSL 취약점

  • 2014년 4월 OpenSSL 라이브러리에 HeartBleed 취약점 발견
  • 2022년 3월 OpenSSL 내 BN_mod_sqrt() 함수에서 연산시 무한루프가 발생하는 서비스 거부 취약점(CVE-2022-0778) 발견
  • 2022년 5월 OpenSSL 내 명령 주입 취약점(CVE-2022-1292), 인증 오류 취약점(CVE-2022-1343), 비밀번호 오류 취약점(CVE-2022-1434), 서비스 거부 취약점(CVE-2022-1473) 발표

2. 방심이 불러온 취약점의 부활 - 사파리 취약점

  • 특정 버전 이하의 소프트웨어를 사용하는 이용자 단말에서 악의적으로 제작된 웹 컨텐츠를 처리하면 임의의 코드를 실행할 수 있으며, 권한을 탈취하고 정보를 유출할 수 있음
  • 대응방법: Zero-day 공격에 노출되어 있어, 보안패치 및 업데이트 발표시 최신 버전으로 적용

* macOS Monterey 12.2.1, iOS 15.3.1 and iPadOS 15.3.1, Safari 15.3(v. 16612.4.9.1.8 and 15612.4.9.1.8)

3. 협업의 도구의 숨은 위협 - 아틀라시안 컨플루언스 취약점

  • End-Point에 사용자가 계정을 만들어 가입하도록 허용되어 있는 경우 관리자가 아닌 사용자 또는 인증되지 않은 사용자가 컨플루언스 또는 데이터센터 인스턴스에서 html 필드를 대상으로 임의의 코드 실행을 통해 원격 명령어의 실행을 통한 이용자에 대한 2차 공격 및 등록된 자료의 유출이 가능함
  • 공격자가 제공한 URI가 네임스페이스로 변환되어 OGNL 표현식 평가로 이어져 공격자가 임의의 명령어를
    수행할 수 있음

* Atlassian: 소프트웨어 개발 및 협업 도구

 

[참고] Log4j 위협 대응 보고서 v1.0

21년 12월, 全 세계를 공포로 몰아넣을 만한 심각한 취약점 공격 기법이 Github에 공개되었다. 당시 공개된 공격
기법은 Log4j라는 오픈소스 프로그램이 가지고 있는 취약점을 악용하는 것이었다.

 

 

728x90
728x90
728x90
반응형

[Review] (4주차) 실습

2022.07.10 - [Dev/Swift] - [Xcode] iOS Swift 앱 개발 Byte Degree - week.04

 

[Xcode] iOS Swift 앱 개발 Byte Degree - week.04

[Review] (3주차) 실습 2022.07.01 - [Swift] - [Xcode] iOS Swift 앱 개발 Byte Degree - week.03 [Xcode] iOS Swift 앱 개발 Byte Degree - week.03 [Review] (2주차) 실습 2022.06.26 - [Swift] - [Xcode] iOS..

sarahee.tistory.com


애플 프레임워크 모달 - 상세뷰로 진입하거나, 새로운 뷰 띄워보기

// 위임 self
override func viewOldLoad() {
	collectionView.delegate = self
}

extension FrameworkListViewController: UICollectionViewDelegate {
	func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
    	let framework = list[indexPath.item]
        print(">>> selected: \(framework.name)")
        
        // FrameworkDetailViewController 띄우고자 함
        let storyboard = UIStoryboard(name: "Detail", bundle: nil)
        let vc = storyboard.instantiateViewController(withIdentifier: "FrameworkDetailViewController")
        	as! FrameworkDetailViewController
        vc.framework = framework
        present(vc, animated: true)
    }
}

멀티라인으로 설정하기 위해서는..

Label의 Lines: 1 → 0

 

Combine Overview

주요 컴포넌트 3가지

Publisher: 생산자, 크리에이터

Subscriber: 소비자, 구독자

Operator: 변경시키는 사람, 가공하는 사람

-

실습

Class: QuickFocusListViewController, Subclass of: UIViewController 추가

Class: QuickFocusCell, Subclass of: UICollectionViewCell 추가

//
//  QuickFocusListViewController.swift
//  HeadSpaceFocus
//
//  Created by sehee on 2022/07/21.
//

import UIKit

class QuickFocusListViewController: UIViewController {
    
    @IBOutlet weak var collectionView: UICollectionView!
    
    let breathingList = QuickFocus.breathing
    let walkingList = QuickFocus.walking
    
    enum Section: CaseIterable {
        case breathe
        case walking
        
        var title: String {
            switch self {
            case .breathe: return "Breathing exercises"
            case .walking: return "Mindful walks"
            }
        }
    }
    
    typealias Item = QuickFocus
    var datasource: UICollectionViewDiffableDataSource<Section, Item>!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        // enum Section CaseIterable 생성한 코드가 다음 내용과 동일
//        Section.allCases
//        let allItems: [Section] = [.breathe, .walking]
        // 생성 코드가 다음과 같이 쓰일 수 있음
//        let section: Section = .breathe
//        section.title
        
        // Presentation
        datasource = UICollectionViewDiffableDataSource<Section, Item>(collectionView: collectionView, cellProvider: { collectionView, indexPath, item in
            guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "QuickFocusCell", for: indexPath) as? QuickFocusCell else {
                return nil
            }
            cell.configure(item)
            return cell
        })
        
        // Data
        var snapshot = NSDiffableDataSourceSnapshot<Section, Item>()
        snapshot.appendSections([.breathe, .walking])
        // 위의 코드와 동일
//        snapshot.appendSections(Section.allCases)
        snapshot.appendItems(breathingList, toSection: .breathe)
        snapshot.appendItems(walkingList, toSection: .walking)
        datasource.apply(snapshot)
        
        // Layout
        collectionView.collectionViewLayout = layout()
    }
    private func layout() -> UICollectionViewCompositionalLayout {
        let itemSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(0.5), heightDimension: .estimated(50))
        let item = NSCollectionLayoutItem(layoutSize: itemSize)
        
        let groupSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1), heightDimension: .estimated(50))
        let group = NSCollectionLayoutGroup.horizontal(layoutSize: groupSize, subitem: item, count: 2)
        
        let section = NSCollectionLayoutSection(group: group)
        
        let layout = UICollectionViewCompositionalLayout(section: section)
        return layout
    }
}

코드를 연결하기 위해, FocusViewController의 Layout에 다음 코드 추가

collectionView.delegate = self

하단 코드 연결

extension FocusViewController: UICollectionViewDelegate {
    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
        let item = items[indexPath.item]
        print(">>> \(item.title)")
        
        let storyboard = UIStoryboard(name: "QuickFocus", bundle: nil)
        let vc = storyboard.instantiateViewController(withIdentifier: "QuickFocusListViewController") as! QuickFocusListViewController
        present(vc, animated: true)
    }
}

좌우 padding

1) section.contentInsets

2) section.interGroupSpacing, group.interItemSpacing

private func layout() -> UICollectionViewCompositionalLayout {
        let itemSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(0.5), heightDimension: .estimated(50))
        let item = NSCollectionLayoutItem(layoutSize: itemSize)
        
        let groupSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1), heightDimension: .estimated(50))
        let group = NSCollectionLayoutGroup.horizontal(layoutSize: groupSize, subitem: item, count: 2)
        group.interItemSpacing = .fixed(10)
        
        let section = NSCollectionLayoutSection(group: group)
        section.contentInsets = NSDirectionalEdgeInsets(top: 30, leading: 20, bottom: 30, trailing: 20)
        section.interGroupSpacing = 20
        
        let layout = UICollectionViewCompositionalLayout(section: section)
        return layout
    }

헤더 추가

+ > Collection Reusable View

해당 View의 custom class 생성 - Class: QuickFocusListHeaderView, Subclass of: UICollectionReusableView 추가

//
//  QuickFocusHeaderView.swift
//  HeadSpaceFocus
//
//  Created by sehee on 2022/07/22.
//

import UIKit

class QuickFocusHeaderView: UICollectionReusableView {
    @IBOutlet weak var titleLabel: UILabel!
    
    func configure(_ title: String) {
        titleLabel.text = title
    }
}

QuickFocusListViewController 코드 삽입

datasource.supplementaryViewProvider = { (collectionView, kind, indexPath) in
            guard let header = collectionView.dequeueReusableSupplementaryView(ofKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: "QuickFocusHeaderView", for: indexPath) as? QuickFocusHeaderView else {
                return nil
            }
            let allSections = Section.allCases
            let section = allSections[indexPath.section]
            header.configure(section.title)
            return header
        }

QuickFocusListViewController 하단 UICollectionViewCompositionalLayout

let headerSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1), heightDimension: .absolute(50))
        let header = NSCollectionLayoutBoundarySupplementaryItem(layoutSize: headerSize, elementKind: UICollectionView.elementKindSectionHeader, alignment: .top)
        section.boundarySupplementaryItems = [header]

Focus View Controller UI 클릭 후, Editor > Embed in > Navigation Controller

FocusViewController의 UICollectionViewDelegate

// 기존
		present(vc, animated: true)
// 변경: Navigation - Back
		navigationController?.pushViewController(vc, animated: true)

Navigation Bar의 ☑ Prefers Large Titles, Title 이름은 Focus로 설정

FocusViewController의 UICollectionViewDelegate 코드 추가

vc.title = item.title

QuickFocusListViewController의 Layout 코드 추가

self.navigationItem.largeTitleDisplayMode = .never

Navigation Bar의 Tint color: Default에서 White Color로 변경

최종 코드

//
//  QuickFocusListViewController.swift
//  HeadSpaceFocus
//
//  Created by sehee on 2022/07/21.
//

import UIKit

class QuickFocusListViewController: UIViewController {
    
    @IBOutlet weak var collectionView: UICollectionView!
    
    let breathingList = QuickFocus.breathing
    let walkingList = QuickFocus.walking
    
    enum Section: CaseIterable {
        case breathe
        case walking
        
        var title: String {
            switch self {
            case .breathe: return "Breathing exercises"
            case .walking: return "Mindful walks"
            }
        }
    }
    
    typealias Item = QuickFocus
    var datasource: UICollectionViewDiffableDataSource<Section, Item>!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        // enum Section CaseIterable 생성한 코드가 다음 내용과 동일
//        Section.allCases
//        let allItems: [Section] = [.breathe, .walking]
        // 생성 코드가 다음과 같이 쓰일 수 있음
//        let section: Section = .breathe
//        section.title
        
        // Presentation
        datasource = UICollectionViewDiffableDataSource<Section, Item>(collectionView: collectionView, cellProvider: { collectionView, indexPath, item in
            guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "QuickFocusCell", for: indexPath) as? QuickFocusCell else {
                return nil
            }
            cell.configure(item)
            return cell
        })
        
        datasource.supplementaryViewProvider = { (collectionView, kind, indexPath) in
            guard let header = collectionView.dequeueReusableSupplementaryView(ofKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: "QuickFocusHeaderView", for: indexPath) as? QuickFocusHeaderView else {
                return nil
            }
            let allSections = Section.allCases
            let section = allSections[indexPath.section]
            header.configure(section.title)
            return header
        }
        
        // Data
        var snapshot = NSDiffableDataSourceSnapshot<Section, Item>()
        snapshot.appendSections([.breathe, .walking])
        // 위의 코드와 동일
//        snapshot.appendSections(Section.allCases)
        snapshot.appendItems(breathingList, toSection: .breathe)
        snapshot.appendItems(walkingList, toSection: .walking)
        datasource.apply(snapshot)
        
        // Layout
        collectionView.collectionViewLayout = layout()
        self.navigationItem.largeTitleDisplayMode = .never
    }
    private func layout() -> UICollectionViewCompositionalLayout {
        let itemSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(0.5), heightDimension: .estimated(50))
        let item = NSCollectionLayoutItem(layoutSize: itemSize)
        
        let groupSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1), heightDimension: .estimated(50))
        let group = NSCollectionLayoutGroup.horizontal(layoutSize: groupSize, subitem: item, count: 2)
        group.interItemSpacing = .fixed(10)
        
        let section = NSCollectionLayoutSection(group: group)
        section.contentInsets = NSDirectionalEdgeInsets(top: 30, leading: 20, bottom: 30, trailing: 20)
        section.interGroupSpacing = 20
        
        let headerSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1), heightDimension: .absolute(50))
        let header = NSCollectionLayoutBoundarySupplementaryItem(layoutSize: headerSize, elementKind: UICollectionView.elementKindSectionHeader, alignment: .top)
        section.boundarySupplementaryItems = [header]
        
        let layout = UICollectionViewCompositionalLayout(section: section)
        return layout
    }
}
//
//  QuickFocusCell.swift
//  HeadSpaceFocus
//
//  Created by sehee on 2022/07/21.
//

import UIKit

class QuickFocusCell: UICollectionViewCell {
    @IBOutlet weak var thumbnailImageView: UIImageView!
    @IBOutlet weak var titleLabel: UILabel!
    @IBOutlet weak var descriptionLabel: UILabel!
    
    func configure(_ quickFocus: QuickFocus) {
        thumbnailImageView.image = UIImage(named: quickFocus.imageName)
        titleLabel.text = quickFocus.title
        descriptionLabel.text = quickFocus.description
    }
}
//
//  FocusViewController.swift
//  HeadSpaceFocus
//
//  Created by sehee on 2022/07/10.
//

import UIKit

class FocusViewController: UIViewController {
    
    @IBOutlet weak var collectionView: UICollectionView!
    @IBOutlet weak var refreshButton: UIButton!
    
    var curated: Bool = false
    var items: [Focus] = Focus.list
    
    typealias Item = Focus
    enum Section {
        case main
    }
    var datasource: UICollectionViewDiffableDataSource<Section, Item>!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        refreshButton.layer.cornerRadius = 10
        
        // Presentation: Diffable Datasource + Cell Provider
        datasource = UICollectionViewDiffableDataSource<Section, Item>(collectionView: collectionView, cellProvider: { collectionView, indexPath, item in
            guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "FocusCell", for: indexPath) as? FocusCell else {
                return nil
            }
            cell.configure(item)
            return cell
        })
        
        // Data: Snapshot
        var snapshot = NSDiffableDataSourceSnapshot<Section, Item>()
        snapshot.appendSections([.main])
        snapshot.appendItems(items, toSection: .main)
        datasource.apply(snapshot)
        
        // Layout
        collectionView.collectionViewLayout = layout()
        collectionView.delegate = self
        
        updateButtonTitle()
    }
    
    private func layout() -> UICollectionViewCompositionalLayout {
        
        let itemSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1), heightDimension: .estimated(50))
        let item = NSCollectionLayoutItem(layoutSize: itemSize)
        
        let groupSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1), heightDimension: .estimated(50))
        let group = NSCollectionLayoutGroup.vertical(layoutSize: groupSize, subitems: [item])
        
        let section = NSCollectionLayoutSection(group: group)
        section.contentInsets = NSDirectionalEdgeInsets(top: 10, leading: 20, bottom: 10, trailing: 20)
        section.interGroupSpacing = 10
        
        let layout = UICollectionViewCompositionalLayout(section: section)
        return layout
    }
    
    func updateButtonTitle() {
        let title = curated ? "See All" : "See Recommendation"
        refreshButton.setTitle(title, for: .normal)
    }
    
    @IBAction func refreshButtonTapped(_ sender: Any) {
        curated.toggle()
        
        self.items = curated ? Focus.recommendations : Focus.list
        
        var snapshot = NSDiffableDataSourceSnapshot<Section, Item>()
        snapshot.appendSections([.main])
        snapshot.appendItems(items, toSection: .main)
        datasource.apply(snapshot)
        
        updateButtonTitle()
    }
}

extension FocusViewController: UICollectionViewDelegate {
    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
        let item = items[indexPath.item]
        print(">>> \(item.title)")
        
        let storyboard = UIStoryboard(name: "QuickFocus", bundle: nil)
        let vc = storyboard.instantiateViewController(withIdentifier: "QuickFocusListViewController") as! QuickFocusListViewController
        vc.title = item.title
//        present(vc, animated: true)
        navigationController?.pushViewController(vc, animated: true)
    }
}

[Next] (6주차) 실습

2022.07.22 - [Development/Swift] - [Swift] iOS 앱 개발(Xcode) Byte Degree - week.06

 

[Swift] iOS 앱 개발(Xcode) Byte Degree - week.06

[Review] (5주차) 실습 2022.07.16 - [Dev/Swift] - [Xcode] iOS Swift 앱 개발 Byte Degree - week.05 [Xcode] iOS Swift 앱 개발 Byte Degree - week.05 [Review] (4주차) 실습 2022.07.10 - [Dev/Swift] - [Xco..

sarahee.tistory.com

 

728x90
728x90
728x90
반응형

yum: Yellowdog Updater Modified, rpm 기반의 시스템을 위한 자동 업데이트 및 패키지 설치/삭제 도구

Command 'yum' not found, did you mean: /&nbsp;See 'snap info <snapname>' for additional versions.

root@ubuntu:/home/sehee# yum help

Command 'yum' not found, did you mean:

  command 'gum' from snap gum (0.12.0)
  command 'sum' from deb coreutils (8.30-3ubuntu2)
  command 'zum' from deb perforate (1.2-5.1)
  command 'uum' from deb freewnn-jserver (1.1.1~a021+cvs20130302-7build1)
  command 'num' from deb quickcal (2.4-1)

See 'snap info <snapname>' for additional versions.

ubuntu nginx에 yum 설치가 되어 있지 않기 때문에 생긴 오류

E: Unable to locate package yum

root@ubuntu:/etc/apt# sudo apt-get install yum

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package yum

ubuntu에서 package를 다운로드하는 홈페이지 주소가 추가되지 않음

(/etc/apt 폴더 내)

sudo cp source.list source.list.backup

sudo 명령어를 통하여 /etc/apt/source.list 수정

sudo vi sources.list

default sources.list code

sources.list 파일 내 us 삭제

http://us.archive.ubuntu.com/ubuntu http://archive.ubuntu.com/ubuntu

 

하단에 다음 url 입력(package를 설치하는)

deb http://archive.ubuntu.com/ubuntu bionic main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu bionic-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu bionic-updates main restricted universe multiverse

업데이트 후 확인

sudo apt-get update

root@ubuntu:/etc/apt# sudo apt-get install yum

E: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 5628 (unattended-upgr)
N: Be aware that removing the lock file is not a solution and may break your system.
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
sudo killall apt apt-get

# 진행 중인 파일이 없다면
sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock*

sudo dpkg --configure -a

command 순서대로 설치하여 해결

apt-get install python-lzma python-sqlitecachec python-pycurl python-urlgrabber

 

728x90
728x90

'Development > error' 카테고리의 다른 글

[Error] bash 오류_No such file or directory  (0) 2022.08.03
728x90
반응형
목차
1. 허준이 교수, 필즈상(Fields Medal) 수상 (220705)

2. 2022년 공개소프트웨어 개발자대회 참가자 모집 (220704)
3. 과기정통부, 7월 한 달간 제11회 정보보호의 달 운영 (220704)
4. 1차관, 주요 공공기관 사이버보안 대응태세 점검 (220701)
5. [2022년 6월] 인터넷·정보보호 법제동향 제177호 (220707)
6. 과학기술&ICT 정책·기술 동향 217호 (220701)

1. 허준이 교수, 필즈상(Fields Medal) 수상 (220705)

(출처: 과학기술정보통신부, 보도자료, 미래인재정책국 미래인재양성과 강호원 과장(044-202-4830), 이현우 사무관(044-202-4832))

  • '22년 세계수학자대회(International Congress of Mathematicians, ICM)에서 수학계에 중요한 공헌을 한 40세 미만의 수학자에게 수여하는 ‘필즈상 (Fields Medal)을 허준이 교수(美 프린스턴대 및 韓 고등과학원)가 수상
  • 허교수는 조합 대수기하학을 통해 조합론의 난제를 해결하고 대수기하학의 토대가 더욱 확장되도록 새 지평을 연 공로를 인정받아, 한국계 최초로 필즈상 수상의 쾌거를 이룩

허교수의 연구분야

조합 대수기하학(combinatorial algebraic geometry)

  • 대수기하학(algebraic geometry)*을 통해 조합론(combinatorics)**의 문제를 해결하는 비교적 새로운 분야

* 대수기하학: 1·2차 다항식으로 직선·평면·타원·쌍곡선을 표현·분석하는 것처럼 대수학으로 기하를 연구하는 학문

** 조합론: 유한·가산적 대상들에 대하여, 주어진 성질을 만족시키거나 극대화하는 것을 연구하는 학문

 

해결한 다수의 난제(conjecture)

리드 추측

  • 여러 개의 꼭짓점들을 선분으로 연결하고, 연결된 점들까지는 다른 색으로 칠하는 경우의 수를 사용된 색의 개수에 관한 함수로 표현할 때, 함수는 다항식이 되는데 그 다항식의 계수들의 커지고 작아지는 경향을 추측

국제수학연맹(IMU)에서 한국의 수학 국가등급을 최고등급으로 상향

  • ‘22. 2월 한국의 수학 국가등급을 최고등급(4그룹 → 5그룹)으로 상향
  • '81년 1그룹 국가로 IMU 가입 이후, 회원국 중 최단기간 內 최고등급(5그룹)으로 상향

- (現 5그룹) 한국, 독일, 러시아, 미국, 브라질, 영국, 이스라엘, 이탈리아, 일본, 중국, 캐나다, 프랑스


2. 2022년 공개소프트웨어 개발자대회 참가자 모집 (220704)

(출처: 과학기술정보통신부, 보도자료, 소프트웨어정책관 소프트웨어산업과 조민영 과장(010-3188-9598), 손진철 사무관(044-202-6331))

  • 총 상금 6,600만원, 과기정통부장관상 등 총 23점 시상
  • 공개소프트웨어 개발 역량 향상 및 온라인 교육, 멘토링 기회 제공
  • 참가 접수: 2022년 7월 4일(월) - 8월 3일(수), 출품작 접수: 2022년 9월 15일(목)

* 대회 문의

1) '2022년 공개소프트웨어 개발자대회' 운영 사무국(02-599-7917/contest@oss.kr)

2) 카카오톡 '공개소프트웨어 개발자대회' 채널


3. 과기정통부, 7월 한 달간 제11회 정보보호의 달 운영 (220704)

(출처: 과학기술정보통신부, 보도자료, 과학기술정보통신부 정보보호기획과)

  • '튼튼한 사이버안보, 안전한 디지털강국'을 주제로 7월 한 달 동안 제11회 정보보호의 달 운영
  • 정보보호의 날 기념행사: 기념식, 정보보호 국제 컨퍼런스, 정보보호 제품 전시회
  • 정보보호의 달 연계행사: 정보보호 인력양성 간담회, 지역 정보보호 생태계 조성 간담회, 융합산업XSecurity 밋업데이, 메타버스·대체불가토큰(NFT) 보안 협의체 발대식 등(정보보호의 달 기념 누리집(www.secuday.kr)에서 확인 가능)
  • 국민과 함께하는 7월: 국민 참여 이벤트, 정보보호 실천 교육

4. 1차관, 주요 공공기관 사이버보안 대응태세 점검 (220701)

(출처: 산업통상자원부, 보도자료, 정보보호담당관 박지운 과장(044-203-5590))

  • 최근 세계적으로 러시아-우크라이나 전쟁의 여파가 사이버영역까지 확대되고, 특정 대상을 목표로 한 랜섬웨어(Ransomware) 공격*과 소프트웨어 취약점**을 이용하여 불특정 다수를 공격하는 사례가 빈번해지는 등 사이버위협이 증대되고 있음

* 랜섬웨어 공격: 컴퓨터 내 파일을 암호화한 후 금전을 요구하는 형태로 ‘21. 5월 美 송유관 기업(콜로니얼 파이프라인)을 대상으로 송유관 제어설비를 마비시켜 6일간 美 동남부 휘발유 공급이 중단된 사례가 있음

** 제로데이 공격: 소프트웨어 취약점이 발견된 후 보안업데이트가 배포되기 전까지 해당 소프트웨어가 적용된 서버, PC 등을 집중적으로 공격하는 형태로 ‘21. 12월 로그 관리용 소프트웨어인 Log4j의 취약점 공격이 대표 사례

  • 올해 3월 21일 공공기관 사이버위기경보 단계가 관심에서 주의로 격상, 산업부는 사이버안전 위기대응 매뉴얼에 따라 보안관제를 강화하고 긴급대응반을 운영해 오고 있음

* 사이버위기경보 발령단계: 정상 → 관심 → 주의 → 경계 → 심각


5. [2022년 6월] 인터넷·정보보호 법제동향 제177호 (220707)

(출처: 한국인터넷진흥원, 인터넷·정보보호 법제동향, 법제연구팀 김홍빈(061-820-1704))

 국내 입법 동향 <공포된 법령> 

  • 「정보통신망 이용촉진 및 정보보호 등에 관한 법률」 일부개정법률 공포 (2022. 6. 10.)
  • 「정보통신기반 보호법」 일부개정법률 공포 (2022. 6. 10.)
  • 「전기통신사업법」 일부개정법률 공포 (2022. 6. 10.)
  • 「산업재해보상보험법」 일부개정법률 공포 (2022. 6. 10.)
  • 「이러닝(전자학습)산업 발전 및 이러닝 활용 촉진에 관한 법률」 일부개정법률 공포 (2022. 6. 10.)

6. 과학기술&ICT 정책·기술 동향 217호 (220701)

(출처: 과학기술정보통신부 · 한국과학기술기획평가원(KISTEP), S&T GPS)

  • EU와 유럽 주요국 연구개발시스템 동향
  • 주요 동향: 과학기술

미국, 핵융합 에너지 기술개발과 상업화 병행 방안

  • 백악관 과학기술정책실(OSTP)은 핵융합 에너지 기술의 개발과 상업화를 병행하여 추진하는 방안 발표*('22.6)

* Parallel Processing the Path to Commercialization of Fusion Energy

미국, 스테이블코인의 법적 이슈와 규제적 대응 방안

  • 미국 의회조사국(CRS)은 스테이블코인 기술과 관련한 미국 내 법적 이슈와 정부와 의회의 규제적 대응 방안 발표*('22.6)
  • 스테이블코인(Stablecoins) 기술은 가격 변동성이 너무 크다는 암호화폐의 한계를 극복하고자 개발
  • 암호화폐는 일반적인 화폐로의 기능에는 한계(∵ 가격 변동성) 법정화폐나 자산을 담보로 발행되거나 알고리즘을 바탕으로 가치를 일정하게 유지하도록 설계

* Stablecoins: Legal Issues and Regulatory Options

미국, 국가별 첨단 산업의 경쟁력 평가 발표

  • 정보기술혁신재단(ITIF)은 국가・지역별 첨단 산업의 경쟁력 분석 결과를 바탕으로 미국의 산업 경쟁력 강화 방안 보고서* 발표(’22.6)

* The Hamilton Index: Assessing National Performance in the Competition for Advanced Industries

 

 

728x90
728x90
728x90
반응형
목차
1. print()
2. 기본 자료형: 숫자형, 문자열, 리스트
3. 변수
4. 연산: 사칙연산, 특수연산, 문자열 연산
5. 인덱싱과 슬라이싱

1. print()

Point I
print() : 문자열을 출력하는 명령어

print("Hello Rabbit!")  

## 출력결과 ##
Hello Rabbit!

Point II
콤마(,)를 통해 여러 자료를 출력

print(3, "Hello")   

## 출력결과 ##
3 Hello

Point III
print()를 여러 번 사용하여 여러 줄에 걸쳐 출력

print(3)  
print(6)  
print(9)  

## 출력결과 ##
3
6
9

2. 기본 자료형

Point I
숫자형 : 숫자로 이루어진 자료형

3 : 정수  
3.14 : 실수  

Point II
문자열 : 문자, 혹은 문자들의 집합 - 큰따옴표(“)/작은따옴표(‘)로 구분

'Hello'  
'3.14'  
"3.14"  

Point III
리스트 : 여러 자료를 함께 보관하는 자료형 - 대괄호([])로 구분

[]  
['a', 'b']  
['a', 2]  

3. 변수

Point I
변수 : 자료를 담는 그릇
변수 이름 = 자료 형태로 사용

num = 10   
name = "Michael"   
grade = ['A+', 'B+', 'A0']  

Point II
변수 이름 짓기
숫자, 알파벳, 언더바(_) 등을 사용

Point III
금지 규칙

  • 숫자로 시작하는 변수이름 금지
1st = 1000 #Error
  • 숫자로만 구성된 변수 이름은 사용 불가
123 = "Hello!" #Error
  • 파이썬 문법에서 이미 사용되는 단어(keyword, 예약어)는 사용 불가
for = 10 #Error
  • 공백 문자( )와 연산자는 사용 불가
I am = "groot" #Error  
3+4 = 12 #Error

4. 연산

Point I
숫자의 사칙연산 : +(더하기), -(빼기), *(곱하기), /(나누기)

print(6+3) #9
print(6-3) #3
print(6*3) #18
print(6/3) #2.0

Point II
숫자의 특수연산 : **(제곱), //(몫 연산), %(나머지 연산)

print(6**3) #216
print(6//3) #2
print(6%3) #0

Point III
문자열의 연산: +(연결하기), *(반복하기)

print("Hello" + "World") #HelloWorld
print("Hello"*3) #HelloHelloHello

5. 인덱싱과 슬라이싱

Point I
인덱스 : 문자열과 리스트의 특정 원소의 위치, 0부터 시작

"Hello"에서 H = Index 0, e = index 1, ...

Point II
인덱싱 : 문자열과 리스트의 특정 위치(인덱스)의 원소를 가져오는 것

greet = "Hello!"  
print(greet[1])  

## 출력결과 ##
e

Point III
슬라이싱 : 문자열과 리스트의 특정 부분을 가져오는 것

greet = "Hello!"  
print(greet[0:5])  
Hello

[Next] (2주차) 조건문

2022.05.25 - [Dev/Python] - [Python] 02 조건문 - week.02

 

[Python] 02 조건문 - week.02

목차 1. 입력 1) 변수 2) 형 변환 2. 논리 자료형(Boolean Data) 1) 논리 자료형 2) 비교 연산자 3) 논리 연산자 3. 조건문 1) if문 2) elif문 3) else문 [Review] (1주차) 기초 자료형 2022.07.10 - [Dev/Python]..

sarahee.tistory.com

 

728x90
728x90

'Development > Python' 카테고리의 다른 글

[Python] 02 함수와 메서드 - week.06  (0) 2022.11.08
[Python] 01 기초 자료형 II - week.05  (0) 2022.09.05
[Python] 04 반복문 - week.04  (0) 2022.08.08
[Python] 03 리스트 - week.03  (0) 2022.07.28
[Python] 02 조건문 - week.02  (0) 2022.07.22
728x90
반응형

[Review] (3주차) 실습

2022.07.01 - [Swift] - [Xcode] iOS Swift 앱 개발 Byte Degree - week.03

 

[Xcode] iOS Swift 앱 개발 Byte Degree - week.03

[Review] (2주차) 실습 2022.06.26 - [Swift] - [Xcode] iOS Swift 앱 개발 Byte Degree - week.02 [Xcode] iOS Swift 앱 개발 Byte Degree - week.02 iOS 아키텍처 패턴 중 애플에서는 기본적으로 MVC 패턴을 가..

sarahee.tistory.com


다크모드 변경

command + shift + a (toggle)



주석 달기

command + /

 

내비게이션 컨트롤러 설정

Editor > Embed in > Navigation Controller

Prefers Large Titles 체크

 

Safe Area 설정

Vertical에서

Align Bottom to: Safe Area / Align Top to: Safe Area 더블클릭

Fitst Item: Safe Area Bottom -> Superview, 다시 이전 Edit -> Constant: 0 설정

 

좌우측 여백(padding)

override func viewDidLead() { 내에

collectionView.contentInset = UIEdgeInsets(top: 20, left: 30, bottom: 0, right: 30)


탭바 컨트롤러의 주요 뷰

[Documentation] UITabBarController

https://developer.apple.com/documentation/uikit/uitabbarcontroller

 

File > New > File (or command + N) > Cocoa Touch Class > Class: FocusViewController, Subclass of: UIViewController

Main > Focus View Controller의 Class와 Storyboard ID에 FocusViewController 입력

 

UI의 Collection View 설정, 셀 디자인 및 오토레이아웃 설정

//
//  FocusViewController.swift
//  HeadSpaceFocus
//
//  Created by sehee on 2022/07/10.
//

import UIKit

class FocusViewController: UIViewController {
    @IBOutlet weak var collectionView: UICollectionView!
    var items: [Focus] = Focus.list
    typealias Item = Focus
    enum Section {
        case main
    }
    var datasource: UICollectionViewDiffableDataSource<Section, Item>!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        // Presentation, Data, Layout
        datasource = UICollectionViewDiffableDataSource<Section, Item>(collectionView: collectionView, cellProvider: { collectionView, indexPath, item in
            
            guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "FocusCell", for: indexPath) as? FocusCell else {
                return nil
            }
            cell.configure(item)
            return cell
        })
        // data: Snapshot
        var snapshot = NSDiffableDataSourceSnapshot<Section, Item>()
        snapshot.appendSections([.main])
        snapshot.appendItems(items, toSection: .main)
        datasource.apply(snapshot)
        collectionView.collectionViewLayout = layout()
    }
    private func layout() -> UICollectionViewCompositionalLayout {
        let itemSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1), heightDimension: .estimated(50))
        let item = NSCollectionLayoutItem(layoutSize: itemSize)
        let groupSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1), heightDimension: .estimated(50))
        let group = NSCollectionLayoutGroup.vertical(layoutSize: groupSize, subitems: [item])
        let section = NSCollectionLayoutSection(group: group)
        let layout = UICollectionViewCompositionalLayout(section: section)
        return layout
    }
}
//
//  FocusCell.swift
//  HeadSpaceFocus
//
//  Created by sehee on 2022/07/10.
//

import UIKit

class FocusCell: UICollectionViewCell {
    
    @IBOutlet weak var titleLabel: UILabel!
    @IBOutlet weak var descriptionLabel: UILabel!
    @IBOutlet weak var thumbnailImageView: UIImageView!
    
    func configure(_ item: Focus) {
        titleLabel.text = item.title
        descriptionLabel.text = item.description
        thumbnailImageView.image = UIImage(systemName: item.imageName)?.withRenderingMode(.alwaysOriginal)
    }
}

FocusCell 코드 추가

override func awakeFromNib() {
        super.awakeFromNib()
        contentView.backgroundColor = UIColor.systemIndigo
        contentView.layer.cornerRadius = 10
    }

FocusViewController 코드 추가

let section = NSCollectionLayoutSection(group: group)
        section.contentInsets = NSDirectionalEdgeInsets(top: 10, leading: 20, bottom: 10, trailing: 20)
        section.interGroupSpacing = 10

FocusViewController 코드 추가

// 1
@IBOutlet weak var refreshButton: UIButton!
    var curated: Bool = false

// 2
let title = curated ? "See All" : "See Recommendation"
        refreshButton.setTitle(title, for: .normal)
    
// 3
@IBAction func refreshButtonTapped(_ sender: Any) {
        curated.toggle()
        self.items = curated ? Focus.recommendations : Focus.list
        
        var snapshot = NSDiffableDataSourceSnapshot<Section, Item>()
        snapshot.appendSections([.main])
        snapshot.appendItems(items, toSection: .main)
        datasource.apply(snapshot)
        
        let title = curated ? "See All" : "See Recommendation"
        refreshButton.setTitle(title, for: .normal)
    }

DRY 원칙(Do not Repeat Yourself)

updateButtonTitle() 함수 생성하여 중복 코드 제거

func updateButtonTitle() {
        let title = curated ? "See All" : "See Recommendation"
        refreshButton.setTitle(title, for: .normal)
    }

버튼 둥글게 설정

refreshButton.layer.cornerRadius = 10

전체 코드

//
//  FocusViewController.swift
//  HeadSpaceFocus
//
//  Created by sehee on 2022/07/10.
//

import UIKit

class FocusViewController: UIViewController {
    @IBOutlet weak var collectionView: UICollectionView!
    
    @IBOutlet weak var refreshButton: UIButton!
    
    var curated: Bool = false
    var items: [Focus] = Focus.list
    
    typealias Item = Focus
    enum Section {
        case main
    }
    
    var datasource: UICollectionViewDiffableDataSource<Section, Item>!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        refreshButton.layer.cornerRadius = 10
        
        // Presentation, Data, Layout
        datasource = UICollectionViewDiffableDataSource<Section, Item>(collectionView: collectionView, cellProvider: { collectionView, indexPath, item in
            
            guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "FocusCell", for: indexPath) as? FocusCell else {
                return nil
            }
//            let data = self.items[indexPath.item]
//            cell.configure(data)
            cell.configure(item)
            return cell
        })
        // data: Snapshot
        var snapshot = NSDiffableDataSourceSnapshot<Section, Item>()
        snapshot.appendSections([.main])
        snapshot.appendItems(items, toSection: .main)
        datasource.apply(snapshot)
        collectionView.collectionViewLayout = layout()
        
        updateButtonTitle()
    }
    private func layout() -> UICollectionViewCompositionalLayout {
        let itemSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1), heightDimension: .estimated(50))
        let item = NSCollectionLayoutItem(layoutSize: itemSize)
        
        let groupSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1), heightDimension: .estimated(50))
        let group = NSCollectionLayoutGroup.vertical(layoutSize: groupSize, subitems: [item])
        
        let section = NSCollectionLayoutSection(group: group)
        section.contentInsets = NSDirectionalEdgeInsets(top: 10, leading: 20, bottom: 10, trailing: 20)
        section.interGroupSpacing = 10
        
        let layout = UICollectionViewCompositionalLayout(section: section)
        return layout
    }
    
    func updateButtonTitle() {
        let title = curated ? "See All" : "See Recommendation"
        refreshButton.setTitle(title, for: .normal)
    }
    
    @IBAction func refreshButtonTapped(_ sender: Any) {
        curated.toggle()
        self.items = curated ? Focus.recommendations : Focus.list
        
        var snapshot = NSDiffableDataSourceSnapshot<Section, Item>()
        snapshot.appendSections([.main])
        snapshot.appendItems(items, toSection: .main)
        datasource.apply(snapshot)
        
        updateButtonTitle()
    }
}
//
//  FocusCell.swift
//  HeadSpaceFocus
//
//  Created by sehee on 2022/07/10.
//

import UIKit

class FocusCell: UICollectionViewCell {
    
    @IBOutlet weak var titleLabel: UILabel!
    @IBOutlet weak var descriptionLabel: UILabel!
    @IBOutlet weak var thumbnailImageView: UIImageView!
    
    override func awakeFromNib() {
        super.awakeFromNib()
        contentView.backgroundColor = UIColor.systemIndigo
        contentView.layer.cornerRadius = 10
    }
    
    func configure(_ item: Focus) {
        titleLabel.text = item.title
        descriptionLabel.text = item.description
        thumbnailImageView.image = UIImage(systemName: item.imageName)?.withRenderingMode(.alwaysOriginal)
    }
}

[Next] (5주차) 실습

2022.07.16 - [Dev/Swift] - [Xcode] iOS Swift 앱 개발 Byte Degree - week.05

 

[Xcode] iOS Swift 앱 개발 Byte Degree - week.05

[Review] (4주차) 실습 2022.07.10 - [Dev/Swift] - [Xcode] iOS Swift 앱 개발 Byte Degree - week.04 [Xcode] iOS Swift 앱 개발 Byte Degree - week.04 [Review] (3주차) 실습 2022.07.01 - [Swift] - [Xcode]..

sarahee.tistory.com

 

728x90
728x90
728x90
반응형
개요
* Easy_CrackMe.exe 실습 리뷰 및 Easy_KeygenMe.exe 파일 실습
1. 디스어셈블리 상세 기능
- 스택 프레임 및 함수 호출 규약의 이해
- 동적 디버깅 사용 및 코드 실행
- 데이터 타입과 데이터 구조
- 기본 데이터/코드 변환
2. 스택/힙 할당 배열 및 구조체 접근

목차
0. Easy KeygenMe 실습
1. 어셈블리어: MOV, CMP, XOR, MOVZX, MOVSX
2. 알고리즘 분석
3. XOR(⊕) 연산의 결합법칙
4. 소스코드 작성(pseudo code 기반)

[Review] (3주차) 실습

2022.07.04 - [IDA Pro] - IDA Pro 악성코드 정적분석 툴 사용법&실습 - week.03(Easy_CrackMe) (2)

 

IDA Pro 악성코드 정적분석 툴 사용법&실습 - week.03(Easy_CrackMe) (2)

개요 * Easy_CrackMe.exe 실습 리뷰 및 Easy_KeygenMe.exe 파일 실습 1. 디스어셈블리 상세 기능 - 스택 프레임 및 함수 호출 규약의 이해 - 동적 디버깅 사용 및 코드 실행 - 데이터 타입과 데이터 구조 - 기

sarahee.tistory.com


0. Easy KeygenMe 실습

Intro

Find the Name when the Serial is 5B134977135E7D13

Name을 사용해서 시리얼 값 생성, 역으로 시리얼 값을 통해 해당 Name을 찾아내는 문제

초기 디스어셈블리 창
debug Running page
Input Name, Input Serial

시리얼 생성 알고리즘과 관련된 문제 풀이

1) 어셈블리어로 전체적인 구조 파악

2) Hex-rays로 세부 알고리즘 파악

rep stosd: 저장소 문자열 명령

stosb: AL로부터 byte를 읽어 들임, stosw: AX로부터 word를 읽어 들임 - 정수값을 메모리에 복사


1. 어셈블리어: MOV, CMP, XOR, MOVZX, MOVSX

MOV

데이터 복사 명령어

0x10: [esp+140h+var_130]

0x20: [esp+140h+var_12F]

0x30: [esp+140h+var_12E]

Byte 단위로 각각 스택에 넣어줌, 사용자가 입력한 문자열을 첫번째 글자부터 순서대로 Byte 단위로 레지스터에 넣음

CMP

esi가 3 이상이면 0으로 초기화

XOR

두 입력 신호가 서로 같으면 0, 다르면 1, 동일한 두 값초기화

MOVZX

소스의 내용을 목적지로 복사, 목적지의 나머지 부분을 0 padding

(목적지에 32bit register 소스에 16bit register) 

MOVSX

소스의 내용을 목적지로 복사, 목적지의 나머지 부분을 소스의 맨 처음 bit로 채움

(목적지에 32bit register → 소스에 16bit register)

loc_40107E: pseudocode


2. 알고리즘 분석

1) v3이 v8의 strlen이 클 때 까지 반복하고, i가 3 이상이면 0으로 초기화

2) sprintf를 통해 Buffer에 생성된 serial 저장

3) "%s%02X"를 통해 기존 Buffer 내용과 v8 포인터 입력값을 한글자씩 가져옴

4) xor 연산을 한 값을 sprintf 함수를 통해 serial이 저장되는 Buffer에 저장

5) serial을 계산하여 scanf로 입력받은 후, strcmp 함수로 동일한지 비교

- if 0일 때 거짓, 0이 아닐 때 참으로 동작하므로, strcmp 내 0일 경우(문자열이 같을 경우) Correct 출력

 

v6에는 16 16 = 0x10

v7[i - 1]가 될 수 있는 값은, v7[0], v7[1], v7[2]의 반복

qmemcpy: sizeof(v7)만큼 " 0" 영역의 값을 v7로 복사

첫번째 인자(v7): 복사받을 메모리를 가리킴

두번째 인자(" 0"): 복사할 메모리를 가리킴

세번째 인자(sizeof(v7)): 복사할 데이터(값)의 길이(바이트 단위)

 

16진수이므로 두자리씩 끊어서 총 8자리


3. XOR(⊕) 연산의 결합법칙

^: XOR 연산자

p q p ⊕ q (p ⊕ q) ⊕ q
T T F T
T F T T
F T T F
F F F F

(p ⊕ q) ⊕ q ≡ p ⊕ (q ⊕ q) ≡ p ⊕ F ≡ p

 

0x5b^0x10

0x13^0x20

0x49^0x30

0x77^0x10

0x13^0x20

0x5E^0x30

0x7D^0x10

0x13^0x20


4. 소스코드 작성(pseudo code 기반)

# sol1

serial = [0x5B, 0x13, 0x49, 0x77, 0x13, 0x5E, 0x7D, 0x13]
xor = [0x10, 0x20, 0x30]
ans = []

i_xor = 0
for i_ser in range(len(serial)):
    if i_xor >= 3:
        i_xor = 0
    ans.append(serial[i_ser]^xor[i_xor])
    i_xor += 1
    print(chr(ans[i_ser]), end='')

# sol2

serial = [0x5B, 0x13, 0x49, 0x77, 0x13, 0x5E, 0x7D, 0x13]
xor = [0x10, 0x20, 0x30]
ans = []

for i in range(len(serial)):
    ans.append(serial[i]^xor[i%3])
    print(chr(ans[i]), end='')

출력: K3yg3nm3

75 51 121 103 51 110 109 51

Name: K3yg3nm3 / Serial: 5B134977135E7D13

결과값 출력도 전에 창이 닫혀서, cmd로 다시..

Correct!


[Next] (4주차) 이론

2022.07.19 - [Security & Analysis/IDA Pro] - IDA Pro 악성코드 정적분석 툴 사용법&이론 - week.04(전 과정 Review)

 

IDA Pro 악성코드 정적분석 툴 사용법&이론 - week.04(전 과정 Review)

개요 * Easy_KeygenMe.exe 파일 실습 1. 레지스터 활용 분석 - 메모리 주소 및 스택 프레임의 이해 - ESP(스택 포인터), EBP(프레임 포인터), EIP 등 개념 정리 2. 어셈블리 명령어 이해 및 알고리즘 분석 - Pse

sarahee.tistory.com

 

728x90
728x90
728x90
반응형
개요
* Easy_CrackMe.exe 실습 리뷰 및 Easy_KeygenMe.exe 파일 실습
1. 디스어셈블리 상세 기능
- 스택 프레임 및 함수 호출 규약의 이해
- 동적 디버깅 사용 및 코드 실행
- 데이터 타입과 데이터 구조
- 기본 데이터/코드 변환
2. 스택/힙 할당 배열 및 구조체 접근

목차
0. Easy CrackMe 실습 이어서
1. 스택 프레임(stack frame)이란?
2. 레지스터: ESP, EBP, EIP, ECX, EAX
3. 어셈블리어: CMP, LEA, TEST
4. Debugger

[Review] (2주차) 실습 - Easy CrackMe (1)

2022.06.12 - [IDA Pro] - IDA Pro 악성코드 정적분석 툴 사용법&실습 - week.02(Easy_CrackMe) (1)

 

IDA Pro 악성코드 정적분석 툴 사용법&실습 - week.02(Easy_CrackMe) (1)

목차 - 샘플 파일을 이용하여 IDA Pro 실행 - 사용자 인터페이스 및 기본 사용법 이해 * 샘플 자료: reversing.kr > 상단 Challenge 버튼 > Easy Crack (login 필요) 0. IDA Pro란? 1. 실행 파일 로드 2. 디스어셈..

sarahee.tistory.com


0. Easy CrackMe 실습 이어서

Easy_CrackMe.exe 실행시 팝업창
임의의 값을 넣어 확인 버튼 눌렀을 때 Incorrect Password
Alt + T: Enter the search substring(문자열 및 어셈블리어 검색) > Tab: Ctrl + T
MessageBoxA 함수 영역

  • 성공 시의 메시지 출력(Congratulation !!)
  • 실패 시의 메시지 출력(Incorrect Password)

input이 틀렸을 경우 MessageBox로 JMP하게 만드는 분기문 확인

.text:004010B0                 cmp     [esp+68h+var_63], 61h ; 'a'

.text:004010BD                 push    offset Str2     ; "5y"

.text:004010D1                 mov     esi, offset aR3versing ; "R3versing"

.text:0040110D                 cmp     [esp+68h+String], 45h ; 'E'

strcmp: 문자열 비교 함수

strncmp: strcmp + n(검사할 문자의 개수 지정)

형태: char * strncmp( const char *s1, const char *s2, size_t n);

ASCII Table(10진 - 16진 - 문자 변환): 97 - 0x61 - a, 69 - 0x45 - E
ASCII Table
Str2 = 5y, aR3versing = R3versing


1. 스택 프레임(stack frame)이란?

스택에 할당된 메모리 블록, 호출된 함수에 지정

함수가 호출되면,

1) 함수 호출자가 파라미터 형태로 정보를 넘겨줄 때 어딘가에 저장되고, 호출된 함수가 정보를 찾게 해야 한다.

2) 함수의 작업을 위한 임시 저장소가 필요하다.

* 스택: 제한적으로 접근할 수 있는 자료 구조(LIFO, Last In First Out)

* 임시 저장소: 주로 지역 변수가 사용, 함수가 종료되면 더 이상 접근 불가


2. 레지스터: ESP, EBP, EIP, ECX, EAX

예제

32비트 x86 기반 컴퓨터의 컴파일된 함수 코드

void bar(int j, int k); // 호출할 함수
void demo_stackframe(int a, int b, int c) {
	int x;
    char buffer[64];
    int y;
    int z;
    // 스택 프레임 테스트 용도 외에는 다른 목적이 없는 함수
    bar(z, y);
}

지역 변수에 최소 76바이트(3개의 4바이트 정수, 64바이트 버퍼)가 필요

변수 오프셋 ESP 기반 스택 프레임
z [esp] 지역 변수
y [esp+4]
buffer [esp+8]
x [esp+72]
저장된 eip [esp+76]  
a [esp+80] 파라미터
b [esp+84]
c [esp+88]

모든 오프셋은 ESP가 바뀜에 따라 다시 조절

변수 오프셋 EBP 기반 스택 프레임
z [ebp-76] 지역 변수
y [ebp-72]
buffer [ebp-68]
x [ebp-4]
저장된 ebp [ebp] 저장된 레지스터
저장된 eip [ebp+4]  
a [ebp+8] 파라미터
b [ebp+12]
c [ebp+16]

개념 정리

* E: Extended(16bit  32bit system), 64bit에서는 R로 표현

ESP(stack pointer register)

: 현재의 스택 지점(stack의 가장 아래 부분), 스택의 크기를 조정할 때 사용

- 스택에 값을 넣을 때마다 ESP가 4만큼 줄어듦

EBP(base pointer)

: 프레임 포인터를 사용하는 함수를 가리킴(함수가 프레임 포인터를 쓰는지 여부의 분석이 필요할 때, 이 속성을 이용해 수작업으로 지정 가능 - 레지스터의 크기 보정 필요)

- 스택의 가장 윗 부분, 스택 프레임 형태로 저장된 함수의 지역 변수나 전달인자를 참조/변경시 사용하는 레지스터

- 고정적, 코드 유지에 용이(스택프레임 생성시)

EIP(instruction pointer)

: 실행할 명령의 주소


3. 어셈블리어: CMP, LEA, TEST

1) .text:004010B0

.text:004010B0 cmp [esp+68h+var_63], 61h ; 'a'

디스어셈블리 코드 설명
.text:00401080  var_63 스택 프레임에서 바로 참조할 수 있는 모든 변수의 목록을
변수 크기와 프레임 포인터에서 떨어진 거리와 함께 요약해 보여줌
.text:00401080  sub esp, 64h 스택 프레임에 지역 변수를 위한 98바이트(64h 대략 환산) 할당
.text:004010B0  cmp [esp+68h+var_63], 61h dest == source 이면 ZF(Zero Flag) = 1, CF(Carry Flag) = 0

CMP

cmp [esp+68h+var_63], 61h: esp+68h+var_63의 값이 61h 위치에 있는 값과 같은지 비교(값을 빼서 비교)

LEA

lea edi, [esp+68h+var_63]: esp+68h+var_63에 저장된 주소를 esp에 저장

[esp+68h+var_63] 우클릭시 &rarr; [esp+5]

2) .text:004010BD

.text:004010BD push offset Str2 ; "5y"

ECX(Extended Counter Register)

: 주로 반복 명령어 사용시 반복 카운터로 사용

EAX(Extended Accum ulator Register)

: 산술(덧셈, 곱셈, 나눗셈 등) 논리 연산을 수행할 때 사용, 함수의 반환값이 이 레지스터에 저장

TEST

: 인수1과 인수2 내용을 AND 연산하여 결과가 0이면 ZF = 1로 설정(보통 NULL check할 때 사용)

(두 operand가 0이 아닌 경우를 제외하고는 값을 판별하기 어려움 eax, eax와 같은 형태로 사용하여 0인지 아닌지 확인)

[esp+6Ch+Str1] 우클릭시 &rarr; [esp+10]

3) .text:004010D1

.text:004010D1 mov esi, offset aR3versing ; "R3versing"
[esp+70h+var_60] 우클릭시 &rarr; [esp+16]

4) .text:0040110D

.text:0040110D cmp [esp+68h+String], 45h ; 'E'
[esp+68h+String] 우클릭시 &rarr; [esp+4]

주소 해당 문자열 ESP 스택 포인터 10진수 변환 순번
.text:004010B0 a [esp+68h+var_63] [esp+5] 2
.text:004010BD 5y [esp+6Ch+Str1] [esp+10] 3
.text:004010D1 R3versing [esp+70h+var_60] [esp+16] 4
.text:0040110D E [esp+68h+String] [esp+4] 1

참조 순서: E - a - 5y - R3versing


4. Debugger

options: No debugger / Local Bochs debugger / Local Windows debugger / PIN tracer

Remote GDB debugger / Remote Windows debugger / Trace replayer / Windbg debugger

어셈블리 코드 파악을 위한 Local Windows debugger

Start a new process in the debugger or continue a debugged process 클릭시 > Yes
answer: Ea5yR3versing

 


[Next] (4주차) 실습 - Easy KeygenMe

2022.07.04 - [Security & Analysis/IDA Pro] - IDA Pro 악성코드 정적분석 툴 사용법&실습 - week.03(Easy_KeygenMe)

 

IDA Pro 악성코드 정적분석 툴 사용법&실습 - week.03(Easy_KeygenMe)

개요 * Easy_CrackMe.exe 실습 리뷰 및 Easy_KeygenMe.exe 파일 실습 1. 디스어셈블리 상세 기능 - 스택 프레임 및 함수 호출 규약의 이해 - 동적 디버깅 사용 및 코드 실행 - 데이터 타입과 데이터 구조 - 기

sarahee.tistory.com

 

728x90
728x90

+ Recent posts