在Js逆向的過(guò)程中經(jīng)常遇到 window.btoa() /window.atob() :
這是 瀏覽器內(nèi)置的Base64 編碼和解碼 ,第十六題案例,第十九題案例 等等
解決方式 :
1. 簡(jiǎn)單字符串使用 Buffer 方法
// atob base64 編碼
var s = new Buffer.from("待解碼的字符串", "base64").toString("binary")
// btoa base64 解碼
var s = new Buffer.from("待編碼的字符串", "binary").toString("base64")
2. python爬蟲直接改寫
import base64
# atob base64編碼
s = base64.b64encode("待解碼的字符".encode("utf8")).decode()
# btoa base64解碼
s = base64.b64decode("待編碼的字符".encode("utf8")).decode()
3. 直接用JS實(shí)現(xiàn)Base64功能
以下是 完整JS的base64代碼
// 這是 完整可用的JS實(shí)現(xiàn)base64編碼的模塊
var Base64 = {
// private property
_keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
// public method for encoding
, encode: function (input)
https://www.buymeacoffee.com/dtrzfjtvxr?new=1
https://www.buymeacoffee.com/dtrzfjtvxr
https://www.buymeacoffee.com/dtrzfjtvxr?kycsg
https://www.buymeacoffee.com/bznnjtdvvh?new=1
https://www.buymeacoffee.com/bznnjtdvvh
https://www.buymeacoffee.com/bznnjtdvvh?guioc
https://www.buymeacoffee.com/flrzlrhzvhp?new=1
https://www.buymeacoffee.com/flrzlrhzvhp
https://www.buymeacoffee.com/flrzlrhzvhp?phfrl
https://www.buymeacoffee.com/ayesiieoi?new=1
https://www.buymeacoffee.com/ayesiieoi
https://www.buymeacoffee.com/lbvtzntztl?new=1
https://www.buymeacoffee.com/tznhhdvfph
https://www.buymeacoffee.com/tznhhdvfph?tdjrv
https://www.buymeacoffee.com/tblpbvtzvz
https://www.buymeacoffee.com/tblpbvtzvz?vrdtr
https://www.buymeacoffee.com/oamsmeaoycu?new=1
https://www.buymeacoffee.com/oamsmeaoycu
https://www.buymeacoffee.com/oamsmeaoycu?kieku
https://www.buymeacoffee.com/zvzjtpzhf?new=1
https://www.buymeacoffee.com/zvzjtpzhf
https://www.buymeacoffee.com/zvzjtpzhf?zfrfz
https://www.buymeacoffee.com/gqskyoskw?new=1
https://www.buymeacoffee.com/gqskyoskw
https://www.buymeacoffee.com/gqskyoskw?uuqsm
https://www.buymeacoffee.com/emyqcywys?new=1
https://www.buymeacoffee.com/emyqcywys
https://www.buymeacoffee.com/emyqcywys?mmiwk
https://www.buymeacoffee.com/njrfbfnbh?new=1
https://www.buymeacoffee.com/njrfbfnbh
https://www.buymeacoffee.com/njrfbfnbh?ltbpz