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] => 29747
[posts] => 483882
[todayposts] => 110
[yesterdayposts] => 102
[rank] => 2
[oldrank] => 2
[lastpost] => 2808053 LightLink 推出 Stella:一款让 Web3“隐形化”的链抽象钱包(转) 1771850634 爱美的女人
[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万美元。成都链安技术团队对事件进行了分析,结果如下。
9 C. T M- g5 Z- a7 [/ J2 X6 l- z. q: D4 Z. n {
+ `% l0 I# G* p$ M0 a2 M; S( O% a. S
$ r( H2 N2 E& W
" Q' e( u3 l. K. }. ~9 d- l# U* t- C6 L& d7 K4 ?# T! s
#1 事件相关信息4 ]; q# ^6 g X, h
: A! U4 `7 [) x/ [* Y; S
% R2 {4 s2 Y8 x9 ?
' C0 | L$ X* f. `1 I% F8 E本次攻击事件包含多笔交易,部分交易信息如下所示:' J& e' k$ G: g: P e
5 B& j$ N( c. f: f! b0 J- h( O( |: M3 V* R
! X4 `$ w; d/ ~& p5 @9 C) c8 K* M
攻击交易 (部分)+ C: l) i! v. q% U
% |8 z$ q, [2 F6 j% } s0x77cf448ceaf8f66e06d1537ef83218725670d3a509583ea0d161533fda56c063 (BNB Chain)
6 C) r. F4 H7 A* E8 }% s/ S1 O6 g0 v( W. N
0x1e769a59a5a9dabec0cb7f21a3e346f55ae1972bb18ae5eeacdaa0bc3424abd2 (Ethereum)
`8 @1 x# ?" a( t+ L! l. ^5 @9 j9 \& D! Y, q/ M& J5 a
4 ~" j( _8 B3 E- U# p5 [! h/ w2 u% k* ~# z5 j& v
攻击者地址
! `" L5 y3 t, C, I' {' D7 n; D( A/ }: G
0x73b359d5da488eb2e97990619976f2f004e9ff7c
% ~- Z. t8 b, g& i6 m$ }
5 | Y6 o# v4 ^; K% G
: g; I: \1 F# k9 u- `7 K$ |9 T- S$ {/ c, b
攻击合约9 I' D2 E; X# @5 j
/ B( w3 W1 E4 @* }$ r }7 _0 [: ]0x9a843bb125a3c03f496cb44653741f2cef82f4455 m5 X6 C/ Y# U% s5 @1 X2 [. z
5 K7 ^1 I' {; K* Q- S
. n* u9 R2 U4 F N3 i- i3 P/ C3 l" N( q
被攻击合约(部分)
e" Y# x7 H: X% C; H) m; ?5 t
; [( t( c/ M n0x818e2013dd7d9bf4547aaabf6b617c1262578bc7 (BNB Chain)' t/ L, G4 F# }
5 m/ X% [/ J# k8 H3 ?% n0xf2bda964ec2d2fcb1610c886ed4831bf58f64948 (Ethereum)
7 x: [1 z- \: a& C% \9 t- I4 P, J
4 }5 g* N1 P, r! n) o8 l( {/ e9 ]) d+ u
5 `* \: d4 \9 v0 b! S7 c6 e#2 攻击流程2 g' ^9 C6 K- C+ V5 ?- p
' P$ k0 @! L: b
* C6 z# b( q! J4 LEthereum和BNB Chain上使用攻击手法相同,以下分析基于BNB Chain上攻击:7 ?. J! V* j2 Y# o
' f j9 `3 |( ^+ ]
% Y/ C5 [8 e. W1 J0 q% H% w; q1 f; {, _
1. 攻击者调用攻击合约(0x9a84...f445)利用闪电贷从DVM合约(0xd534...0dd7)中借贷915.84 WBNB,然后将116.81 WBNB兑换成115.65 fBNB为后续攻击做准备。
* M- ^: Y4 `. t& i# D& P+ t4 i. b" r7 W. g
% R' i) g/ L- w, S* s0 a+ B) s+ E
/ g1 \( E" u' X( m( i
2. 攻击者利用攻击合约创建了10个合约,为后续攻击做准备。
2 |; d; s3 |! F- _# M( W
! p1 }" t% x9 _6 w. @2 _; E7 W; u
$ y5 |) @8 o+ m$ b6 I& p+ n* }" h8 O. P' \9 o
) z* x4 b+ }) w6 Q7 w1 C3 g" C) Y; g
3. 攻击者接下来将兑换得到的fBNB代币抵押到FEGexPRO合约(0x818e...8bc7)中。4 y3 g! |4 c+ z d& s" ]
6 E7 [9 c8 y: b
4 |2 U' ^ O6 {6 o* t3 S r) G& a, @9 Y3 S8 y
4. 然后攻击者重复调用depositInternal和swapToSwap函数,让FEGexPRO合约授权fBNB给之前创建好的其他攻击合约。/ l1 @2 P0 y9 T2 Y( m
1 V% J- p5 ]9 w- l7 y
. l+ X! V/ A0 h0 L9 R* N1 ^+ w# e, [) ~6 I
& @& S. p! F9 x, S* m$ L9 z
3 J# q% b9 I8 ]+ K; {& h
5. 然后利用其他攻击合约调用transferFrom函数将FEGexPRO合约中fBNB全部转移到攻击合约(0x9a84...f445)中。" @1 ~% M' D) @& x( @5 y
$ Z9 @+ b" s6 i( {, ]* x
* @5 f, f& p& }4 I6 B, {; Y9 n, G& l+ e) y6 b
( h. b; }3 C# z6 D4 t# k2 k4 q1 I/ K' G% K- r' L( O7 J- `
6. 接下来又在LP交易对合约(0x2aa7...6c14)中借贷31,217,683,882,286.007211154 FEG代币和423 WBNB。
2 V* i4 q; l: |7 e8 h i- Z) p2 P, L K, {7 d
7 `% J' q1 n: U2 P7 Y7 G
) d' U: |* ^: G2 z7. 然后重复3、4、5步骤的攻击手法,将FEGexPRO合约中大量FEG代币盗取到攻击合约中。! z$ x# A& ^5 Y3 V) \, G
0 K( n, D9 a7 ^1 O2 K( D- e1 f, O* U2 C8 M4 }+ j0 k' g# i
- o" c9 s: O& F: U/ W8 K. x
( f. `' P) m7 D( q- @
n6 g& y$ B( a* Y0 l& o& `" g) y% L
, \0 a6 g/ l g. L- e. V8. 然后归还闪电贷,将获得的WBNB转入攻击合约中完成此笔攻击。
7 A4 d: N# h; P5 B3 ?* U- d8 j, y3 B1 v' A( y) i( q
2 F/ {; K- i; `3 X3 q* Q* o5 ~4 ^2 A" O1 f& f0 e9 o$ r$ K% z
$ H* l8 b! J2 q% d6 @/ p+ c
8 o5 q0 B6 S) C' K8 V! c9 g9. 此后,又利用相同的原理,执行了50余笔相同的攻击,最获利约144 ETH和3280 BNB。
( j- t( v- I7 K
$ q" u! `4 p5 F
. z# T6 [1 a% f2 g/ ?5 J, z
7 d8 A; O1 z3 O* C/ [, |( E) h
3 Q8 u; X" D% z$ ?: |
^: X% V) d2 b
: y7 s0 C. x% w( K- D* }2 b% a9 M' c
5 F6 j; {2 E# \" `- Q$ @7 N3 W* X$ Y
#3 漏洞分析
! ~; Z. N) M8 z
f' g1 [. S) H$ `. n! N- p/ L; E; n3 M( p7 w5 C* X
本次攻击主要利用了FEGexPRO合约中swapToSwap函数中path地址可控且合约中未对path地址进行有效性校验的漏洞。由于合约中depositInternal函数中更新用户余额时依赖于合约中当前代币余额,攻击者通过传入一个恶意的path地址,调用swapToSwap函数时合约中代币余额并未发生变化,导致攻击者可以反复重置攻击合约在FEGexPRO合约中记录的代币数量,从而让FEGexPRO合约将自身代币反复授权给攻击者所控制的多个恶意合约。
2 H& w1 C) M+ F0 e- l/ [4 \* i0 K0 K9 n1 N' K3 W. s \) s
" u2 I( \+ R7 q2 o% Y
9 F @6 R$ S) l8 q# Y; c2 J8 k/ x! k8 g3 o" Z' Q
7 v% |5 z( P8 r4 T3 j5 b
, M4 F+ }. H0 [, @: ]
2 o! C$ [8 p" I/ ~8 a#4 资金追踪' ^3 Y, N4 Z( o4 q( W2 L
/ ]) Q! x/ P7 A! x) |
. _4 s# C7 W3 @, E% Z8 Q截止发文时,被盗资金仍在攻击者地址(0x73b3...ff7c)中并未转移。
" c& q4 @( f; r/ {8 x- w; i, T! j; `! u% }6 V
/ p1 f) w9 e3 t5 ^7 P4 O
, |9 h% G; N* q6 H7 y& b/ U6 n
: t O; Y0 u& E, ?( j5 ?# ^) i! P8 G- k0 B
6 G5 @2 p% A6 L2 @2 z( o" ^$ I" f+ y
: F+ A5 @3 B% f# h
4 f+ }' Y# E! h; ?4 @( p, n& \) a8 `1 P
! U/ L( ~# B+ I) D: _
% S( Z4 D N1 |1 x* H7 l
#5 总结" P$ V% y& e: V# O4 Y$ X+ h5 A( m
3 H' l( x/ ?( \, X" U3 a) G2 k4 e! e& y' r& O; t
针对本次事件,成都链安技术团队建议:9 t$ [5 a% k3 n) b$ ?8 E
8 f- j0 ]1 K6 e1 H( T$ @: s. O" j5 \- x0 s0 l
8 P& K2 n- g6 _+ ` r
项目开发时,应该注意与其他合约交互时可能存在的安全风险,尽量避免将关键参数设置为用户可控。如果业务需求如此,则需要严格判断用户输入的参数是否存在风险。此外建议项目上线前选择专业的安全审计公司进行全面的安全审计,规避安全风险。
* v* U J0 R" F
2 y' F7 H' O l/ w9 ?6 C0 o |
|
|
|
|
|
|
|
|
当前离线
经验:
天策币:
活跃币:
策小分:
总在线: 13718 小时
本月在线: 44 小时
|
|
|
|
|
|
|
|
|
|
当前离线
经验:
天策币:
活跃币:
策小分:
总在线: 8669 小时
本月在线: 0 分钟
|
|
|
|
|
|
|
|
|
|
当前离线
经验:
天策币:
活跃币:
策小分:
总在线: 10536 小时
本月在线: 2 小时
|
|
|
|
|
|
|
|
|
|
当前离线
经验:
天策币:
活跃币:
策小分:
总在线: 19429 小时
本月在线: 0 分钟
|
|
|
|
|
|
|
|
|
|
当前离线
经验:
天策币:
活跃币:
策小分:
总在线: 21114 小时
本月在线: 0 分钟
|
|
|
|
|
|
|
|
|
|
当前离线
经验:
天策币:
活跃币:
策小分:
总在线: 8094 小时
本月在线: 0 分钟
|
|
|
|
|
|
|
|
|
|
当前离线
经验:
天策币:
活跃币:
策小分:
总在线: 290 小时
本月在线: 0 分钟
|
|
|
|
|
|
|
|
|
|
当前离线
经验:
天策币:
活跃币:
策小分:
总在线: 9610 小时
本月在线: 0 分钟
|
|
|
|
|
|
|
|
|
|
当前离线
经验:
天策币:
活跃币:
策小分:
总在线: 10425 小时
本月在线: 25 小时
|
|
|
|
|
|
|
|
|
|
当前离线
经验:
天策币:
活跃币:
策小分:
总在线: 2359 小时
本月在线: 0 分钟
|
|
|
|
|
|
|
|
|
|
当前离线
经验:
天策币:
活跃币:
策小分:
总在线: 4862 小时
本月在线: 9 小时
|
|
|
|
|
|
|
|
|
|
当前离线
经验:
天策币:
活跃币:
策小分:
总在线: 6160 小时
本月在线: 18 小时
|
|
|
|
|
|
|
|
|
|
当前离线
经验:
天策币:
活跃币:
策小分:
总在线: 6691 小时
本月在线: 0 分钟
|
|
|
|
|
|
|
|
|
|
当前离线
经验:
天策币:
活跃币:
策小分:
总在线: 11442 小时
本月在线: 6 小时
|
|
|
|
|
|
|
|
|
|
当前离线
经验:
天策币:
活跃币:
策小分:
总在线: 19697 小时
本月在线: 66 小时
|
|
|
|
|
|
|
|
|
|