1. Go語言二進制程式分析
???在分析一些使用GOlang語言進行編譯的惡意程式時,由于程式在被打包成二進制程式時會打包諸多參考的庫,并且作者對二進制程式進行了去符號化,導致在動態或是靜態分析時函式過多而不便于跟蹤,
???而如果GO編譯成的二進制程式并未進行去符號化,那么在IDA中進行分析時,幾乎可以相當于看原始碼了,所以只要將去符號的程式進行符號恢復,那么之后除錯時就十分方便了,
???可以使用Github上的ida py腳本IDAGolangHelper,關于Go程式恢復符號的資料:[https://2016.zeronights.\ru/wp-content/uploads/2016/12/GO_Zaytsev.pdf](https://2016.zeronights. ru/wp-content/uploads/2016/12/GO_Zaytsev.pdf),主要就是為了確認Go語言程式特有的.gopclntab段位置,中文可以參考以下https://www.freebuf.com/articles/others-articles/176803.html,
???另外還可以使用Redress對程式包結構進行分析,
2. 加密函式
EnryptOAEP/DecryptOAEP
// EncryptOAEP encrypts the given message with RSA-OAEP.
//
// OAEP is parameterised by a hash function that is used as a random oracle.
// Encryption and decryption of a given message must use the same hash function
// and sha256.New() is a reasonable choice.
//
// The random parameter is used as a source of entropy to ensure that
// encrypting the same message twice doesn't result in the same ciphertext.
//
// The label parameter may contain arbitrary data that will not be encrypted,
// but which gives important context to the message. For example, if a given
// public key is used to decrypt two types of messages then distinct label
// values could be used to ensure that a ciphertext for one purpose cannot be
// used for another by an attacker. If not required it can be empty.
//
// The message must be no longer than the length of the public modulus minus
// twice the hash length, minus a further 2.
EncryptOAEP(hash hash.Hash, random io.Reader, pub *PublicKey, msg []byte, label []byte)
??查看相關原始碼后,可以知道散列函式hash被用于計算label的hash值;random引數產生hash.size()個強亂數作為seed;計算seed的hash值與包括明文和label的hash值在內的資料進行異或,從而防止旁路攻擊,最終使用公鑰加密包括seed、hash(label)、明文在內的資料,作為密文,
??加密的訊息必須不大于(公鑰長度 - 2*hash.size() - 2),
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/24406.html
標籤:Go
