[15337] 2020-05-05_配合格式化字符串漏洞绕过canary保护机制

文档创建者:s7ckTeam
浏览次数:10
最后更新:2025-01-18
2020-05-05_配合格式化字符串漏洞绕过canary保护机制 c a n a r y w w w h x y   F r e e B u f   2 0 2 0 - 0 5 - 0 5 0 x 0 1   C a n a r y P I E N X c a n a r y c a n a r y   c a n a r y   c a n a r y _ _ _ s t a c k _ c h k _ f a i l (   c a n a r y 使 x 0 0 c a n a r y 0 0 ) 使 c a n a r y c a n a r y 1 . c a n a r y 2 . c a n a r y c a n a r y 0 x 0 2   C C p r i n t f ( ) p r i n t f C p r i n t f ( % d , a ) ;   / / a
a % d   -     -   % s   -     -   % x   -     -   % c   -     -   % p   -     -   % n   -   % k $ x 访 k % k $ d 访 k p r i n t f h e l l o _ w o r l d f o r m a t % s % d % k $ x p r i n t f
m a i n + 1 5
n p r i n t f       0 x 8 0 4 9 1 8 9   < m a i n + 3 9 >         p u s h       2       0 x 8 0 4 9 1 8 b   < m a i n + 4 1 >         p u s h       1       0 x 8 0 4 9 1 8 d   < m a i n + 4 3 >         l e a         e d x ,   [ e a x   -   0 x 1 f f 3 ]       0 x 8 0 4 9 1 9 3   < m a i n + 4 9 >         p u s h       e d x       0 x 8 0 4 9 1 9 4   < m a i n + 5 0 >         m o v         e b x ,   e a x     0 x 8 0 4 9 1 9 6   < m a i n + 5 2 >         c a l l       p r i n t f @ p l t   < 0 x 8 0 4 9 0 3 0 > 0 0 : 0 0 0 0   e s p       0 x f f f f d 2 6 0     0 x 8 0 4 a 0 0 d     a n d         e a x ,   0 x 6 4 2 5 2 0 6 4   / *   ' % d   % d   % d   % d   % s '   * / 0 1 : 0 0 0 4             0 x f f f f d 2 6 4     0 x 1 0 2 : 0 0 0 8             0 x f f f f d 2 6 8     0 x 2 0 3 : 0 0 0 c             0 x f f f f d 2 6 c     0 x 3 0 4 : 0 0 1 0             0 x f f f f d 2 7 0     0 x 1 0 0 5 : 0 0 1 4             0 x f f f f d 2 7 4     0 x 8 0 4 a 0 0 8     j e           0 x 8 0 4 a 0 6 f   / *   ' t e s t '   * / 0 6 : 0 0 1 8             0 x f f f f d 2 7 8     0 x f f f f d 3 3 c     0 x f f f f d 4 e 9     ' S H E L L = / b i n / b a s h ' 0 7 : 0 0 1 c             0 x f f f f d 2 7 c     0 x 8 0 4 9 1 7 6   ( m a i n + 2 0 )     a d d         e a x ,   0 x 2 e 8 a
g c c   - m 3 2   - z   e x e c s t a c k   - f n o - s t a c k - p r o t e c t o r   - n o - p i e   - o   t e s t   t e s t . c r C 1 , 2 , 3 , 1 6 , t e s t , 7 p r i n t f , - 1 1 4 6 0 1 3 4 5 1 7 1 1 0 , , v c 6 . 0 + + l i n u x 7 t h 7 0 , 4 t h 0 0 4 0 0 x 0 3  
# i n c l u d e < s t d i o . h > v o i d   e x p l o i t ( ) {         s y s t e m ( " / b i n / s h " ) ; } v o i d   f u n c ( ) {         c h a r   s t r [ 1 6 ] ;         r e a d ( 0 ,   s t r ,   6 4 ) ;         p r i n t f ( s t r ) ;         r e a d ( 0 ,   s t r ,   6 4 ) ; } i n t   m a i n ( ) {         f u n c ( ) ;         r e t u r n   0 ; } g c c   - n o - p i e   - f s t a c k - p r o t e c t o r     - m 3 2   - o   5 . e x e   5 . c c h e c k s e c   5 . e x e g d b   5 . e x e   i   b b   f u n c i   b s t a r t
n f u n c n g s g s 4 ( e a x ) c a n a r y c a n a r y x 0 0 c a n a r y c a n a r y c a n a r y c a n a r y c a n a r y n r e a d
s t a c k   2 0 c a n a r y e s p 0 x 2 c 4 1 1 1 1 p r i n t f c a n a r y n
% 1 1 $ 8 x n c a n a r y c a n a r y n 2 r e a d
r e a d r e a d p a y l o a d p a y l o a d g e t s h e l l c a n a r y c a n a r y p a y l o a d 使 p y t h o n c a n a r y p a y l o a d c a n a r y e x p l o i t p a y l o a d g e t s h e l l p y t h o n
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则