×
Array
(
[fid] => 6974
[description] => 专注于币圈最新最快资讯,数字货币应用及知识普及
[password] =>
[icon] => b1/common_6974_icon.png
[redirect] =>
[attachextensions] =>
[creditspolicy] => Array
(
[post] => Array
(
[usecustom] => 1
[cycletype] => 1
[cycletime] => 0
[rewardnum] => 5
[extcredits1] => 1
[extcredits2] => 1
[extcredits3] => 0
[extcredits4] => 0
[extcredits5] => 0
[extcredits6] => 0
[extcredits7] => 0
[extcredits8] => 0
[rid] => 1
[fid] => 6974
[rulename] => 发表主题
[action] => post
[fids] => 32,52,67,447,1120,1151,1156,6750,6762,6763,6766,6769,6772,6773,6787,6796,6808,6809,6810,6813,6814,6820,6829,6830,6846,6856,6864,6865,6827,6930,6931,6776,6858,6880,6764,6932,6871,6758,6905,1116,6788,6812,6798,6736,6759,6842,6966,6767,6828,6924,6935,6936,6938,6940,6941,6826,6909,6803,6919,6911,6908,6881,6920,6912,6913,6921,6925,6922,6789,6818,6819,6872,6928,6969,6889,6888,6917,6939,6947,6961,6937,6943,6970,6869,6900,6902,6783,6817,1111,6870,6821,6876,6952,6954,6960,6942,6910,6949,6962,6963,6964,6927,6926,6973,6728,6929,6874,6894,6896,6885,6857,6868,1113,6778,56,6844,6878,6802,6933,6811,6923,6877,6875,6918,6892,6757,6832,6833,6795,6793,6848,6837,6849,6850,6851,6852,6853,6854,6863,6882,6836,6790,6838,6794,6791,6873,555,6934,6958,6944,6945,6907,6779,6886,6950,6904,6956,6862,6957,6855,6955,6959,6914,6965,6971,6972,6953,6976,6824,6815,6891,6866,6979,6977,6765,6903,6948,6980,6981,6983,6799,6982,6951,6984,6975,6895,6845,6879,1121,6974
)
[reply] => Array
(
[usecustom] => 1
[cycletype] => 1
[cycletime] => 0
[rewardnum] => 0
[extcredits1] => 0
[extcredits2] => 1
[extcredits3] => 10
[extcredits4] => 0
[extcredits5] => 0
[extcredits6] => 0
[extcredits7] => 0
[extcredits8] => 0
[rid] => 2
[fid] => 6974
[rulename] => 发表回复
[action] => reply
[fids] => 32,52,67,447,1120,1151,1156,6750,6763,6766,6769,6772,6773,6787,6796,6808,6809,6810,6813,6814,6820,6829,6830,6846,6856,6864,6865,6827,6930,6931,6776,6858,6880,6764,6932,6871,6758,1116,6788,6812,6798,6736,6759,6842,6966,6767,6828,6924,6935,6936,6938,6940,6941,6826,6909,6803,6919,6911,6908,6881,6920,6912,6913,6921,6925,6922,6789,6818,6819,6872,6928,6969,6889,6888,6917,6939,6947,6961,6937,6943,6970,6869,6900,6902,6783,6817,1111,6870,6821,6876,6952,6954,6960,6942,6910,6949,6962,6963,6964,6927,6926,6973,6728,6929,6874,6894,6896,6885,6857,6868,1113,6778,56,6844,6878,6802,6933,6811,6923,6877,6875,6918,6892,6757,6832,6833,6795,6793,6848,6837,6849,6850,6851,6852,6853,6854,6863,6836,6790,6838,6794,6791,6873,555,6934,6958,6944,6945,6907,6779,6886,6950,6904,6956,6862,6957,6855,6955,6959,6914,6965,6971,6972,6953,6976,6824,6815,6891,6866,6979,6977,6765,6903,6948,6980,6981,6983,6799,6982,6951,6984,6975,6895,6845,6879,1121,6974
)
)
[formulaperm] => a:5:{i:0;s:0:"";i:1;s:0:"";s:7:"message";s:0:"";s:5:"medal";N;s:5:"users";s:0:"";}
[moderators] => 实习版主1
[rules] =>
[threadtypes] => Array
(
[required] => 1
[listable] => 1
[prefix] => 1
[types] => Array
(
[1590] => 论坛公告
[1752] => 公司优惠
[1603] => 虚拟币交流
[1753] => 数字钱包
[1754] => 虚拟币存提
[1755] => 交易所
[1655] => 虚拟币资讯
[1756] => 银行卡
[1757] => 第三方支付
[1760] => 币圈大佬
[1758] => 科技前沿
[1759] => 天策嗨聊
[1661] => 入驻合作
)
[icons] => Array
(
[1590] =>
[1752] =>
[1603] =>
[1753] =>
[1754] =>
[1755] =>
[1655] =>
[1756] =>
[1757] =>
[1760] =>
[1758] =>
[1759] =>
[1661] =>
)
[moderators] => Array
(
[1590] => 1
[1752] =>
[1603] =>
[1753] =>
[1754] =>
[1755] =>
[1655] =>
[1756] =>
[1757] =>
[1760] =>
[1758] =>
[1759] => 1
[1661] =>
)
)
[threadsorts] => Array
(
)
[viewperm] => 9 26 22 11 12 13 14 15 27 43 44 60 61 62 63 64 19 31 67 68 69 73 75 76 83 84 87 90 91 92 33 38 57 58 65 66 74 77 79 80 85 86 1 2 3 7 8
[postperm] => 22 11 12 13 14 15 27 43 44 60 61 62 63 64 19 67 68 69 73 75 76 83 84 87 90 91 92 33 38 57 58 65 66 74 77 79 80 85 86 1 2 3
[replyperm] => 26 22 11 12 13 14 15 27 43 44 60 61 62 63 64 19 67 68 69 73 75 76 83 84 87 90 91 92 33 38 57 58 65 66 74 77 79 80 85 86 1 2 3
[getattachperm] => 26 22 11 12 13 14 15 27 43 44 60 61 62 63 64 19 67 68 69 73 75 76 83 84 87 90 91 92 33 38 57 58 65 66 74 77 79 80 85 86 1 2 3
[postattachperm] => 26 22 11 12 13 14 15 27 43 44 60 61 62 63 64 19 67 68 69 73 75 76 83 84 87 90 91 92 33 38 57 58 65 66 74 77 79 80 85 86 1 2 3
[postimageperm] => 26 22 11 12 13 14 15 27 43 44 60 61 62 63 64 19 67 68 69 73 75 76 83 84 87 90 91 92 33 38 57 58 65 66 74 77 79 80 85 86 1 2 3
[spviewperm] =>
[seotitle] =>
[keywords] =>
[seodescription] =>
[supe_pushsetting] =>
[modrecommend] => Array
(
[open] => 0
[num] => 10
[imagenum] => 0
[imagewidth] => 300
[imageheight] => 250
[maxlength] => 0
[cachelife] => 0
[dateline] => 0
)
[threadplugin] => Array
(
)
[replybg] =>
[extra] => a:2:{s:9:"namecolor";s:0:"";s:9:"iconwidth";s:2:"60";}
[jointype] => 0
[gviewperm] => 0
[membernum] => 0
[dateline] => 0
[lastupdate] => 0
[activity] => 0
[founderuid] => 0
[foundername] =>
[banner] =>
[groupnum] => 0
[commentitem] =>
[relatedgroup] =>
[picstyle] => 0
[widthauto] => 0
[noantitheft] => 0
[noforumhidewater] => 0
[noforumrecommend] => 0
[livetid] => 0
[price] => 0
[fup] => 6729
[type] => forum
[name] => 虚拟币讨论大厅
[status] => 1
[displayorder] => 3
[styleid] => 0
[threads] => 27699
[posts] => 444960
[todayposts] => 740
[yesterdayposts] => 557
[rank] => 2
[oldrank] => 2
[lastpost] => 2758058 以太坊的涨势看起来比 2020 年更健康,但仍有一个担忧(转) 1757581511 rainwang
[domain] =>
[allowsmilies] => 1
[allowhtml] => 1
[allowbbcode] => 1
[allowimgcode] => 1
[allowmediacode] => 0
[allowanonymous] => 0
[allowpostspecial] => 21
[allowspecialonly] => 0
[allowappend] => 0
[alloweditrules] => 1
[allowfeed] => 0
[allowside] => 0
[recyclebin] => 1
[modnewposts] => 2
[jammer] => 1
[disablewatermark] => 0
[inheritedmod] => 0
[autoclose] => 0
[forumcolumns] => 3
[catforumcolumns] => 0
[threadcaches] => 0
[alloweditpost] => 1
[simple] => 16
[modworks] => 1
[allowglobalstick] => 1
[level] => 0
[commoncredits] => 0
[archive] => 0
[recommend] => 0
[favtimes] => 0
[sharetimes] => 0
[disablethumb] => 0
[disablecollect] => 0
[ismoderator] => 0
[threadtableid] => 0
[allowreply] =>
[allowpost] =>
[allowpostattach] =>
)
卷土重来?黑客获利约130万美元,FEGexPRO合约被攻击事件分析
[复制链接]
|
当前离线
经验:
天策币:
活跃币:
策小分:
总在线: 183 小时
本月在线: 0 分钟
|
|
2022年5月16日,成都链安链必应-区块链安全态势感知平台舆情监测显示,Ethereum和BNB Chain上FEGtoken项目的FEGexPRO合约遭受黑客攻击,黑客获利约3280 BNB 以及144 ETH,价值约130万美元。成都链安技术团队对事件进行了分析,结果如下。( M" O9 m. t/ Y2 [
$ L" x1 E. ]' Y
0 A, R, Z. b( l+ K
. Y7 F1 a, k; P: k* j* W0 o$ n& L; r/ M! G
; A' ~2 U- A; `4 r p8 e9 V#1 事件相关信息: J& v- U2 l; Z' S* ^2 k4 p# _
/ ~6 {( i1 l6 H$ f4 u
4 |9 c, }: E7 |4 x3 V; s( d3 H
本次攻击事件包含多笔交易,部分交易信息如下所示:
* G2 W0 H8 q6 m% F8 F' h
( e# |% f9 _7 ]/ D% z2 A% a
* _) F+ }, X# X# F1 Q" h V! j/ m Y& V
攻击交易 (部分)) U3 g! Y* P) n z$ Y
, ]2 S4 w- x7 x4 ^0x77cf448ceaf8f66e06d1537ef83218725670d3a509583ea0d161533fda56c063 (BNB Chain)
# g8 z" ?9 Y+ n1 l9 S$ `6 f4 [
; S8 N$ L1 ]/ ?9 Z0x1e769a59a5a9dabec0cb7f21a3e346f55ae1972bb18ae5eeacdaa0bc3424abd2 (Ethereum)# {& {( ]0 A$ A: X5 K* J% D
9 F2 b! {; e8 Y9 n2 I7 i3 w5 x8 I( v: P) P$ v1 g$ G
3 K' L3 p7 l- L3 U9 j6 ]. h E攻击者地址
5 L6 N6 M/ G! g# e9 m; F% W: S S- h# D! A Y
0x73b359d5da488eb2e97990619976f2f004e9ff7c* s) H v7 v) n- v1 D& n) V7 b
# @8 T' K6 T! v6 i/ i+ W; f" U/ n
% |$ w0 Z0 Z* z& L& y- n攻击合约+ O/ b- L: V6 C6 f
/ f6 O T+ b9 ?7 E0x9a843bb125a3c03f496cb44653741f2cef82f445% o; ^; K3 j" G$ P
( p; P6 P; L. e) d7 B f
3 d8 q* M F8 u8 f9 T
+ p7 K& p4 ?: i; K" n) s! Q被攻击合约(部分)
; F) Y; [. U+ O% \/ T/ L& x: `; O' j9 n* d* V2 q
0x818e2013dd7d9bf4547aaabf6b617c1262578bc7 (BNB Chain)
+ s; L9 C5 n E. R F2 \/ n5 q7 m' ^+ R R
0xf2bda964ec2d2fcb1610c886ed4831bf58f64948 (Ethereum)% } k+ \! [+ I! S
9 w2 K6 l6 J9 g- F* q( \1 {6 }
$ U J, q; L3 M# x1 B4 h6 y5 ]7 `7 W5 |$ U- H; C x/ a; i( ?
#2 攻击流程
1 {' F8 f8 U0 E
( P; I0 s1 ^- K9 Y
( X! Y5 P9 O) `" G: T. IEthereum和BNB Chain上使用攻击手法相同,以下分析基于BNB Chain上攻击:( g Z' `9 ?, F5 M$ M. N
0 b1 _) |* o8 `: A" V
# t* l- A5 z: C; P+ k. p: i% g+ ?1 s# c, J6 u& b. X9 m
1. 攻击者调用攻击合约(0x9a84...f445)利用闪电贷从DVM合约(0xd534...0dd7)中借贷915.84 WBNB,然后将116.81 WBNB兑换成115.65 fBNB为后续攻击做准备。& ]$ L8 m# n5 l) q
; e" L5 h. @( z: [' p1 d( b
, q9 F) t2 ]( ^* L2 f8 N
& I h j* j9 A2. 攻击者利用攻击合约创建了10个合约,为后续攻击做准备。
9 m, ~7 Q& x+ J
. w4 E$ E% |% o5 O# J3 M1 m. e& M
0 R9 W; V. [$ q, f7 i: V% A4 z/ H" O4 D C5 v/ W
. C& {7 ?0 ]& O, a2 f4 P
1 ?+ d/ J2 Y$ a& o/ I, n9 }7 x3. 攻击者接下来将兑换得到的fBNB代币抵押到FEGexPRO合约(0x818e...8bc7)中。
' m/ L8 s m/ W( n! C3 r& k7 a! @; i( ?5 n" J; M+ x3 W" g" P
+ t3 y t; c. M$ I% B+ q2 P6 ^/ Z' g4 ]
4. 然后攻击者重复调用depositInternal和swapToSwap函数,让FEGexPRO合约授权fBNB给之前创建好的其他攻击合约。" I1 H( J4 a5 t3 m6 z1 a
7 j; h* V& Y$ E8 h/ ^2 P& ^
* U+ x ^3 n7 f' r; E5 s7 ~
4 V/ I6 ?2 X4 X9 ?8 H8 @# a, D5 n
5 ]/ S$ Q2 c2 r: F6 N
( P# s% z! X0 B4 e) ~5. 然后利用其他攻击合约调用transferFrom函数将FEGexPRO合约中fBNB全部转移到攻击合约(0x9a84...f445)中。1 e0 R0 P: s. e: ` k
! g6 ?% u0 D; _ _6 S1 ?6 R4 r" n* B* ~
5 l# g9 w& [0 X$ v
& V( o4 V- p8 ^# f$ E! C" F- s
# Y/ @& d! W7 [" b! N4 w- U8 h6. 接下来又在LP交易对合约(0x2aa7...6c14)中借贷31,217,683,882,286.007211154 FEG代币和423 WBNB。$ U8 \( X z: \0 [0 E& w- ~
. W4 j' D" R" m/ |- {: v6 ~$ {
9 [8 Z) E" f# e5 L, w# y ^! z' q
7. 然后重复3、4、5步骤的攻击手法,将FEGexPRO合约中大量FEG代币盗取到攻击合约中。1 k& g @# `1 f* |$ Y- y0 b2 @
! c* |" b! x6 ], }8 j0 I" Z8 y7 I5 K4 H g
5 G/ u0 }& n# F5 `+ f6 Z2 B9 M+ |5 w# J* _0 P
+ u. }# j8 L1 O9 u' v
0 f/ R* ?- n* n7 e4 j
! Z1 t+ G9 L- t3 t/ F: r: l. {# O8. 然后归还闪电贷,将获得的WBNB转入攻击合约中完成此笔攻击。8 S9 j+ \. z' O6 o; _# E
" X5 a" r" X6 L
. F5 p! p0 I2 x
7 x! b1 f+ d" z1 W3 r U/ f+ ?) H9 g4 o
+ n. d( `, B/ S% r# u8 K
9. 此后,又利用相同的原理,执行了50余笔相同的攻击,最获利约144 ETH和3280 BNB。& C" p5 _' m3 k
) w$ T" u& e" i2 M; S
* T0 d# V& W) V* V" r* |/ Q5 ?# x$ n8 h: T
0 l$ b! a( t' P# j
& x5 e, K/ V" C8 D. ?, U+ Q
( r% i2 q& {0 S+ g' b0 Z& B, b: F" r; U2 D) t/ L! Q
- _5 z/ J5 v j. n6 M) h
' p B6 A0 p0 X v' `! i. a8 t+ ?#3 漏洞分析
! N7 ?1 @: `7 T( a4 Q
4 c; [2 R- U; D; o( x0 V
$ R, m: @9 L. p1 c0 m1 {4 v) {本次攻击主要利用了FEGexPRO合约中swapToSwap函数中path地址可控且合约中未对path地址进行有效性校验的漏洞。由于合约中depositInternal函数中更新用户余额时依赖于合约中当前代币余额,攻击者通过传入一个恶意的path地址,调用swapToSwap函数时合约中代币余额并未发生变化,导致攻击者可以反复重置攻击合约在FEGexPRO合约中记录的代币数量,从而让FEGexPRO合约将自身代币反复授权给攻击者所控制的多个恶意合约。# a1 Y" Z8 ?* ~7 F" ~9 d8 N
& W9 X; B* R7 r2 c1 K6 _5 v' T8 N# n# h! L) F, n8 H
0 M1 n' _* F$ V9 z# ]; _: s# j" i! ^3 c
+ }' L- W8 D4 X7 L! N& N7 F* N% r9 m* j8 ?
1 G/ S, f- B5 \7 R1 C#4 资金追踪
2 `) u+ T+ f5 M; L% b ~0 P8 l2 d, X- F& e4 }$ e
$ {- G( @. ?3 x9 b- s截止发文时,被盗资金仍在攻击者地址(0x73b3...ff7c)中并未转移。
* s; [% v5 c7 L9 U. M0 U0 s% Z2 u. P! ~& l
' P4 z: U6 d; p, V: W" F6 L7 [+ ^% D) M6 s/ Z; l& D# G
5 K( L8 j: B1 j. H0 O4 F
. Q! P/ m1 Z. y p, B, @
' Y2 \; j0 L+ f {2 }2 H# W3 U
+ \ a9 u% T; H- O+ m( t# c2 e4 {
( M( N# L6 o9 K
( K+ ~: m( v h6 i
. e; C; D6 V6 f2 k: M, C, c$ W3 R1 m: Q& N
#5 总结
, I: \" i& E. Y+ W& w1 G
$ W" Z. ]5 w6 j6 E( p) x8 a
1 K4 J* d4 i4 p. e; i! c) L针对本次事件,成都链安技术团队建议:% ^; k( @5 Z6 l) ? e3 [! s
' c* q& ?( O8 D
' I# ]9 O! f7 L' z& m$ L* N8 k9 Z6 C& } }9 Z1 f t7 ^* Q3 E+ [
项目开发时,应该注意与其他合约交互时可能存在的安全风险,尽量避免将关键参数设置为用户可控。如果业务需求如此,则需要严格判断用户输入的参数是否存在风险。此外建议项目上线前选择专业的安全审计公司进行全面的安全审计,规避安全风险。4 G) v; k3 L1 A+ n+ ~6 B0 ^1 s
& V: j- U+ p' G |
|
|
|
|
|
|
当前离线
经验:
天策币:
活跃币:
策小分:
总在线: 13343 小时
本月在线: 41 小时
|
|
|
|
|
|
|
|
当前离线
经验:
天策币:
活跃币:
策小分:
总在线: 8669 小时
本月在线: 0 分钟
|
|
|
|
|
|
|
|
当前离线
经验:
天策币:
活跃币:
策小分:
总在线: 10526 小时
本月在线: 1 小时
|
|
|
|
|
|
|
|
当前离线
经验:
天策币:
活跃币:
策小分:
总在线: 19429 小时
本月在线: 0 分钟
|
|
|
|
|
|
|
|
当前离线
经验:
天策币:
活跃币:
策小分:
总在线: 21114 小时
本月在线: 0 分钟
|
|
|
|
|
|
|
|
当前离线
经验:
天策币:
活跃币:
策小分:
总在线: 8094 小时
本月在线: 0 分钟
|
|
|
|
|
|
|
|
当前离线
经验:
天策币:
活跃币:
策小分:
总在线: 290 小时
本月在线: 0 分钟
|
|
|
|
|
|
|
|
当前离线
经验:
天策币:
活跃币:
策小分:
总在线: 9609 小时
本月在线: 15 分钟
|
|
|
|
|
|
|
|
当前离线
经验:
天策币:
活跃币:
策小分:
总在线: 10235 小时
本月在线: 15 小时
|
|
|
|
|
|
|
|
当前离线
经验:
天策币:
活跃币:
策小分:
总在线: 2359 小时
本月在线: 0 分钟
|
|
|
|
|
|
|
|
当前离线
经验:
天策币:
活跃币:
策小分:
总在线: 4794 小时
本月在线: 10 小时
|
|
|
|
|
|
|
|
当前离线
经验:
天策币:
活跃币:
策小分:
总在线: 6063 小时
本月在线: 6 小时
|
|
|
|
|
|
|
|
当前离线
经验:
天策币:
活跃币:
策小分:
总在线: 6690 小时
本月在线: 0 分钟
|
|
|
|
|
|
|
|
当前离线
经验:
天策币:
活跃币:
策小分:
总在线: 11416 小时
本月在线: 0 分钟
|
|
|
|
|
|
|
|
当前离线
经验:
天策币:
活跃币:
策小分:
总在线: 19239 小时
本月在线: 43 小时
|
|
|
|
|
|
|
|