IT/Programming2023. 2. 27. 15:57

이 문서는 내부 자료유출방지시스템(DLP)가 설치된 환경에서 Java 개발을 위해 신뢰된 인증서(CaCert)를 설명하는 방법에 대해서 설명합니다.

: DLP는 Proxy 형태로 모든 SSL 인증서 암호화 등을 중간에서 볼수 있는 방식으로 원본 인증서를 변경하여 중계합니다. 따라서 SSL 인증서 검증시에 유효하지 않은 인증서로 실패하게 됩니다.   

// 인증서 설치 명령 
keytool.exe -import -alias 인증서 별칭 -keystore "자바 JRE 경로\lib\security\cacerts" -storepass changeit -file "DLP 인증서 파일 경로"

// MAC Java Keystore 디렉토리 위치
/Users/[유저명]/Library/Java/JavaVirtualMachines/[해당 Java 디렉토리]/Contents/Home/lib/security/cacerts

// 샘플
keytool -import -alias binanceLocal -keystore "/Users/[유저명]/Library/Java/JavaVirtualMachines/openjdk-19.0.1/Contents/Home/lib/security/cacerts" -storepass changeit -file

* 여기서는 BinanceAPI를 이용하여 연결하는 프로그램 개발시 DLP에서 발급된 인증서를 신뢰된 인증서로 설치가 필요하다.

* JDK 디렉토리: /Library/Java/JavaVirtualMachines

* System.getProperty("java.version")으로 실행 프로그램 버전 확인

 

[Error Message]

unable to find valid certification path to requested target

 

기타 문의 사항 등은 덧글 달아주시구요.

도움이 되셨으면 ♥ 눌러주세요.   

반응형
Posted by IT반장
IT/Blockchain2022. 10. 7. 12:31

안녕하세요. IT반장입니다.

오늘 UTC PM 10:12:49 이후로 바이낸스 BSC 체인이 블록생성이 멈추었습니다. 참고[1]

- 멈춘지 4시간이 지났네요. 우리나라 시간으로 10/7 오전 8시 12분 경이네요.  

바이낸스에서 운영하는 BSC Token Hub에 취약점이 발견되어 BSC 체인을 일시적으로 중지한 것입니다.

이 글에서는 해당 해킹 사건에 대해서 분석해 보고자 합니다. 

 


목차

1. 개요
2. 해킹 분석 
3. 패치 및 대응 
4. 고찰 

 


1. 개요

- BSC 공지 내용 원문 (참고[2])

Temporary Pause of BSC

We want to confirm that we coordinated with validators to temporarily suspend BSC after having determined an exploit on a cross-chain bridge, BSC Token Hub- which resulted in extra BNB.

We have asked all validators to temporarily suspend BSC. The issue is contained now. Your funds are safe. We apologize for the inconvenience and will provide further updates accordingly.
The Community has already played a pivotal role in assisting and helping freeze any transfers. All funds are safe.
We want to thank the node service providers for their quick and attentive response.
A huge thank you to the following:
Hash, Neptune, TW Staking, BSCScan, Legend, CertiK, Figment, NodeReal, Namelix, Defibit, Fuji, InfStones, MathWallet, Pexmons, Ankr, BNB48 Club, Avengers, Tranchess, Coinbase Cloud
For their quick and decisive actions - a true community.
Initial estimates for funds taken off BSC are between $100M - $110M. However, thanks to the community and our internal and external security partners, an estimated $7M has already been frozen.
We are humbled by the speed and collaboration from the community to freeze funds.
Thank you to everyone who helped and gave their support.
  • 해당 공지는 바이낸스가 BSC 노드 검증자(Validator)들에게 BSC 토큰 허브에 BNB 토큰이 추가로 발행되는 취약점을 확인하고자 노드를 중지하고자 한다는 내용입니다.
  •  해커가 빼낸 자금은 약 1 ~ 1.1 억 달러 이고, 그 중 7 백만 달러는 동결되었다고 합니다. 
  • 도움을 준 커뮤니티: Hash, Neptune, TW Staking, BSCScan, Legend, CertiK, Figment, NodeReal, Namelix, Defibit, Fuji, InfStones, MathWallet, Pexmons, Ankr, BNB48 Club, Avengers, Tranchess, Coinbase Cloud

- 해커 계좌에는 현재 약 711만 달러의 토큰 잔고가 있다. 

 

2. 해킹 분석

- 트위터 samczsun 이 분석한 자료 (참고[4])

  • vBNB 토큰 컨트랙트로 부터 해커 계좌로 약 60만 vBNB 토큰이 발행(Mint())되어 입금되는 것이 확인됩니다. 참고[5-1]

  • 이는 BSC-Chain의 Genesis에 배포된 "BSC Cross Chain" 컨트랙트의 handlePackage 메소드가 실행되어 100만개 BNB가 "BSC Token Hub" 컨트랙트로부터 전송됩니다. 참고[5-2]
    • 파라미터 중 height 값을 비정상적인 110217401 를 입력한 것이 특징입니다.

- 이는 GENESIS에 PreCompile 되어 배포된 컨트랙트에 포함된 MerkleProof 로직의 취약점을 이용한 것으로 보입니다. (참고[7])

  • 해커는 해당 검증 로직을 우회할 수 있는 데이터를 생성하여 토큰을 발행 받았습니다.

 

3. 패치 및 대응

- 패치 내용 (참고[6])

  • 해당 PreCompiled 컨트랙트를 중지하고 블랙리스트 계좌를 등록하여 수정하였습니다.
  • BSC 체인 노드 버전을 패치하고 노드들을 재실행하였습니다. 오후 2:30 경

 

4. 고찰

- 블록체인 기반 자산 관리는 은행의 장부를 도둑에게 모두 공개하고 서비스를 하는 것과 같다.

- 완벽한 보안은 없기 때문에 항상 대응 방안을 마련해야 한다.

- 중지 후 6시간 만에 빠르게 서비스를 복구했으나 근본적인 해결책은 아니므로 추가 문제가 발생하지 않도록 대응이 필요하다.

- 관련 내용으로 인한 Cosmos 취약점 공지가 추가되었다. 참고[8] 

  • IAVLDisableFastNode 기본 설정을 true로 변경하였다. 참고[9]

 


참고 목록

[1] BSC 체인 중지 블록: https://bscscan.com/block/21962147

[2] 바이낸스 공지: https://www.reddit.com/r/bnbchainofficial/comments/xxjkpy/temporary_pause_of_bsc/

[3] 해커 계좌: https://bscscan.com/tokenholdings?a=0x489a8756c18c0b8b24ec2a2b9ff3d4d447f79bec/ 

[4] 해킹 분석 트윗: https://twitter.com/samczsun/status/1578172227400310786

[5] TX 분석

  1. https://bscscan.com/tx/0xf9d911624b5294652ec7f0b9fa7817f2a5953860411325e7f6e73d87f14a70ab
  2. https://bscscan.com/tx/0xebf83628ba893d35b496121fb8201666b8e09f3cbadf0e269162baa72efe3b8b

[6] 패치 내용: https://github.com/bnb-chain/bsc/pull/1109

[7] CrossChain Contract: https://github.com/bnb-chain/bsc-genesis-contract/blob/master/contracts/CrossChain.sol

[8] Cosmos Security Notice:https://forum.cosmos.network/t/ibc-security-advisory-dragonberry/7702

[9] Cosmos Security Patch:https://github.com/cosmos/cosmos-sdk/commit/d8527c397792a2ca05f420040e8a5a718e9eaa0f

 


문서 이력

- v1.0 (20221017 12:30) :  최초 등록

- v1.1 (20221017 19:45) :  해킹 및 패치 내용 분석

- v1.2(20221014): 코스모스 취약점 공지 추가

 


도움이 되셨다면 

 눌러 주세요.^^


 

반응형
Posted by IT반장