[14572] 2019-09-11_Exploit自动生成引擎:Rex

文档创建者:s7ckTeam
浏览次数:6
最后更新:2025-01-18
2019-09-11_Exploit自动生成引擎:Rex E x p l o i t R e x x i a o h a n 0 x 0 0   F r e e B u f   2 0 1 9 - 0 9 - 1 1   U C S B     S h e l l p h i s h   D A R P A     C G C     C R S C y b e r   R e a s o n i n g   S y s t e m M e c h a p h i s h   D r i l l e r E x p l o i t   R e x   P a t c h e r e x     r o p c h a i n     a n g r o p   E x p l o i t     R e x     R e x     C r a s h     O r z E x p l o i t     R e x     Q E M U     a n g r     C o n c o l i c   E x e c u t i o n     E x p l o i t     C r a s h   R e x     C r a s h     E x p l o i t :   R e x   1   M e c h a p h i s h 2   R e x   M e c h a p h i s h     D r i l l e r   R e x   P a t c h e r e x     r o p c h a i n     a n g r o p   R e x   U b u n t u   1 6 . 0 4 . 5   D e s k t o p ( 6 4   b i t ) R e x   : a n g r A   p o w e r f u l   a n d   u s e r - f r i e n d l y   b i n a r y   a n a l y s i s   p l a t f o r m ! t r a c e r U t i l i t i e s   f o r   g e n e r a t i n g   d y n a m i c   t r a c e s . a n g r o p a n g r o p   i s   a   r o p   g a d g e t   f i n d e r   a n d   c h a i n   b u i l d e r . c o m p i l e r e x P O V   t e m p l a t e s   a n d   c o m p i l a t i o n   s u p p o r t   f o r   C G C   b i n a r i e s .   c o m p i l e r e x   i s   a   h a c k y   c g c   b i n a r y   c o m p i l e r s h e l l p h i s h - q e m u S h e l l p h i s h s   p i p - i n s t a l l a b l e   p a c k a g e   o f   Q E M U p o v s i m P O V   s i m u l a t i o n   f o r   C G C . 使   R e x   #   t r i a g e   a   c r a s h > > >   c r a s h   =   r e x . C r a s h ( " . / l e g i t _ 0 0 0 0 3 " ,   b " x 0 0 x 0 b 1 x c 1 x 0 0 x 0 c x e b x e 4 x f 1 x f 1 x 1 4 r r M r x f 3 x 1 b r r r ~ x 7 f x 1 b x e 3 x 0 c ` _ 2 2 2 r r M r x f 3 x 1 b r x 7 f x 0 0 2 x 7 f ~ x 7 f x e 2 x f f x 7 f x f f x f f x 8 b x c 7 x c 9 x 8 3 x 8 b x 0 c x e b x 8 0 x 0 0 2 x a c x e 2 x f f x f f x 0 0 t x 8 b t x 8 b t o x 0 0 t x 8 b x c 7 x d d x 8 3 x c 2 t ~ n x a c x e 2 x f f x f f k x 0 0 t x 8 b x c 7 x d d x 8 3 x c 2 t ~ n x a c x e 2 x f f x f f x 0 0 t x 8 b t x 8 b x a c x f 1 x 8 3 x c 2 t ~ c x 0 0 x 0 0 x 0 0 ~ ~ x 7 f x e 2 x f f x f f x 0 0 t x 9 e x a c x e 2 x f 1 x f 2 @ x 8 3 x c 3 t " > > >   c r a s h . c r a s h _ t y p e s [ ' w r i t e _ w h a t _ w h e r e ' ] > > >   c r a s h . e x p l o r a b l e ( ) T r u e e x p l o r e   t h e   c r a s h   b y   s e t t i n g   s e g f a u l t i n g   p o i n t e r s   t o   s a n e   v a l u e s   a n d   r e - t r a c i n g > > >   c r a s h . e x p l o r e ( ) n o w   w e   c a n   s e e   t h a t   w e   c o n t r o l   i n s t r u c t i o n   p o i n t e r > > >   c r a s h . c r a s h _ t y p e s ' i p _ o v e r w r i t e ' g e n e r a t e   e x p l o i t s   b a s e d   o f f   o f   t h i s   c r a s h i t   m a y   t a k e   s e v e r a l   m i n u t e s
  R e x   1 E x p l o i t _ f a c t o r y   E x p l o i t 2 C r a s h   C r a s h   3 T e c h n i q u e   C r a s h   E x p l o i t 4 S h e l l c o d e _ f a c t o r y s h e l l c o d e     S h e l l c o d e i t   m a y   t a k e   s e v e r a l   m i n u t e s > > >   a r s e n a l   =   c r a s h . e x p l o i t ( ) w e   g e n e r a t e d   a   t y p e   1   P O V   f o r   e v e r y   r e g i s t e r > > >   l e n ( a r s e n a l . r e g i s t e r _ s e t t e r s )   #   w e   g e n e r a t e   o n e   c i r c u m s t a n t i a l   r e g i s t e r   s e t t e r ,   o n e   s h e l l c o d e   r e g i s t e r   s e t t e r 2 a n d   o n e   T y p e   2   w h i c h   c a n   l e a k   a r b i t r a r y   m e m o r y > > >   l e n ( a r s e n a l . l e a k e r s ) 1 e x p l o i t s   a r e   g r a d e d   b a s e d   o n   r e l i a b i l i t y ,   a n d   w h a t   k i n d   o f   d e f e n s e s   t h e y   c a n b y p a s s ,   t h e   t w o   b e s t   e x p l o i t s   a r e   p u t   i n t o   t h e   ' b e s t _ t y p e 1 '   a n d   ' b e s t _ t y p e 2 '   a t t r i b u t e s > > >   a r s e n a l . b e s t _ t y p e 1 . r e g i s t e r ' e b p ' e x p l o i t s   c a n   b e   d u m p e d   i n   C ,   P y t h o n ,   o r   a s   a   c o m p i l e d   P O V > > >   a r s e n a l . b e s t _ t y p e 2 . d u m p _ c ( ' l e g i t 3 _ x . c ' ) > > >   a r s e n a l . b e s t _ t y p e 2 . d u m p _ p y t h o n ( ' l e g i t 3 _ x . p y ' ) > > >   a r s e n a l . b e s t _ t y p e 2 . d u m p _ b i n a r y ( ' l e g i t 3 _ x . p o v ' ) a l s o   P O V s   c a n   b e   t e s t e d   a g a i n s t   a   s i m u l a t i o n   o f   t h e   C G C   a r c h i t e c t u r e > > >   a r s e n a l . b e s t _ t y p e 1 . t e s t _ b i n a r y ( ) T r u e
  C r a s h   C r a s h   R e x     C o n c o l i c   E x e c u t i o n     c r a s h     c r a s h     C r a s h . p y   S o K :   ( S t a t e   o f )   T h e   A r t   o f   W a r :   O f f e n s i v e   T e c h n i q u e s   i n   B i n a r y   A n a l y s i s V u l n e r a b l e   S t a t e s .   U n l i k e   A E G / M a y h e m ,   b u t   s i m i l a r   t o   A X G E N ,   w e   g e n e r a t e   e x p l o i t s   b y   p e r f o r m i n g   c o n c o l i c   e x e c u t i o n   o n   c r a s h i n g   p r o g r a m   i n p u t s   u s i n g   a n g r .   W e   d r i v e   c o n c o l i c   e x e c u t i o n f o r w a r d ,   f o r c i n g   i t   t o   f o l l o w   t h e   s a m e   p a t h   a s   a   d y n a m i c   t r a c e   g a t h e r e d   b y   c o n c r e t e l y   e x e c u t i n g   t h e   c r a s h i n g   i n p u t   a p p l i e d   t o   t h e   p r o g r a m .   C o n c o l i c   e x e c u t i o n   i s   s t o p p e d   a t   t h e   p o i n t   w h e r e t h e   p r o g r a m   c r a s h e d ,   a n d   w e   i n s p e c t   t h e   s y m b o l i c   s t a t e   t o   d e t e r m i n e   t h e   c a u s e   o f   t h e   c r a s h   a n d   m e a s u r e   e x p l o i t a b i l i t y .   B y   c o u n t i n g   t h e   n u m b e r   o f   s y m b o l i c   b i t s   i n   c e r t a i n   r e g i s t e r s ,   w e   c a n t r i a g e   a   c r a s h   i n t o   a   n u m b e r   o f   c a t e g o r i e s   s u c h   a s   f r a m e   p o i n t e r   o v e r w r i t e ,   i n s t r u c t i o n   p o i n t e r   o v e r w r i t e ,   o r   a r b i t r a r y   w r i t e ,   a m o n g   o t h e r s . 1 C o n c r e t e   E x e c u t i o n C o n c o l i c   E x e c u t i o n   a n g r     c o n c o l i c   e x e c u t i o n     c r a s h _ a d d r   Q E M U     P o C   c r a s h _ a d d r   T r a c e r   C r a s h . p y     T r a c e r   2 C o n c o l i c   E x e c u t i o n   c r a s h _ a d d r     a n g r     C o n c o l i c   E x e c u t i o n S t a t e   P l u g i n   1   s i m u l a t i o n _ m a n a g e r     s a v e _ u n c o n s t r a i n e d     r     t r a c e r . Q E M U R u n n e r ( )     P o C     r . c r a s h _ m o d e     T r u e   F a l s e   f u l l _ i n i t _ s t a t e ( ) t r a c e r _ a r g s = { ' l d _ l i n u x ' :   o s . p a t h . j o i n ( b i n _ l o c a t i o n ,   ' t e s t s / i 3 8 6 / l d - l i n u x . s o . 2 ' ) , ' l i b r a r y _ p a t h ' :   o s . p a t h . j o i n ( b i n _ l o c a t i o n ,   ' t e s t s / i 3 8 6 ' ) } r   =   t r a c e r . Q E M U R u n n e r ( b i n a r y = b i n a r y ,   i n p u t = i n p u t _ d a t a ,   a r g v = a r g v ,   t r a c e _ t i m e o u t = t r a c e _ t i m e o u t ,   * * t r a c e r _ a r g s )
  t r a c i n g   m o d e   =   t r a c i n g a d d _ o p t i o n s : O p t i o n   n a m e D e s c r i p t i o n s o . M E M O R Y _ S Y M B O L I C _ B Y T E S _ M A P M a i n t a i n   a   m a p p i n g   o f   s y m b o l i c   v a r i a b l e   t o   w h i c h   m e m o r y   a d d r e s s   i t   r e a l l y   c o r r e s p o n d s   t o ,   a t   t h e   p a g e d   m e m o r y   l e v e l ? s o . T R A C K _ A C T I O N _ H I S T O R Y t r a c k   t h e   h i s t o r y   o f   a c t i o n s   t h r o u g h   a   p a t h   ( m u l t i p l e   s t a t e s ) .   T h i s   a c t i o n   a f f e c t s   t h i n g s   o n   t h e   a n g r   l e v e l s o . C O N C R E T I Z E _ S Y M B O L I C _ W R I T E _ S I Z E S C o n c r e t i z e   t h e   s i z e s   o f   s y m b o l i c   w r i t e s   t o   m e m o r y s o . C O N C R E T I Z E _ S Y M B O L I C _ F I L E _ R E A D _ S I Z E S C o n c r e t e i z e   t h e   s i z e s   o f   f i l e   r e a d s s o . T R A C K _ M E M O R Y _ A C T I O N S K e e p   a   S i m A c t i o n   f o r   e a c h   m e m o r y   r e a d   a n d   w r i t e r e m o v e _ o p t i o n s :       t r a c i n g   a d d _ o p t i o n s   r e m o v e _ o p t i o n s . / a n g r / s i m _ o p t i o n s . p y O p t i o n   n a m e D e s c r i p t i o n s o . T R A C K _ C O N S T R A I N T _ A C T I O N S K e e p   a   S i m A c t i o n   f o r   e a c h   c o n s t r a i n t   a d d e d s o . L A Z Y _ S O L V E S D o n t   c h e c k   s a t i s f i a b i l i t y   u n t i l   a b s o l u t e l y   n e c e s s a r y s o . A L L _ F I L E S _ E X I S T A t t e m p t i n g   t o   o p e n   a n   u n k o w n   f i l e   w i l l   r e s u l t   i n   c r e a t i n g   i t   w i t h   a   s y m b o l i c   l e n g t h s o . T R A C K _ R E G I S T E R _ A C T I O N S K e e p   a   S i m A c t i o n   f o r   e a c h   r e g i s t e r   r e a d   a n d   w r i t e s o . T R A C K _ T M P _ A C T I O N S K e e p   a   S i m A c t i o n   f o r   e a c h   t e m p o r a r y   v a r i a b l e   r e a d   a n d   w r i t e s o . T R A C K _ J M P _ A C T I O N S K e e p   a   S i m A c t i o n   f o r   e a c h   j u m p   o r   b r a n c h s o . A C T I O N _ D E P S T r a c k   d e p e n d e n c i e s   i n   S i m A c t i o n s s o . S I M P L I F Y _ M E M O R Y _ W R I T E S R u n   v a l u e s   s t o r e d   t o   m e m o r y   t h r o u g h   z 3 s   s i m p l i f i c a t i o n 2   S t a t e   P l u g i n s S i m S t a t e     a n g r   R e x     p o s i x     p r e c o n s t r a i n e r . / a n g r / s t a t e _ p l u g i n s / S i m S y s t e m P o s i x (   ) D a t a   s t o r a g e   a n d   i n t e r a c t i o n   m e c h a n i s m s   f o r   s t a t e s   w i t h   a n   e n v i r o n m e n t   c o n f o r m i n g   t o   p o s i x . A v a i l a b l e   a s   s t a t e . p o s i x .
S i m S t a t e P r e c o n s t r a i n e r (   ) T h i s   s t a t e   p l u g i n   m a n a g e s   t h e   c o n c e p t   o f   p r e c o n s t r a i n i n g   -   a d d i n g   c o n s t r a i n t s   w h i c h   y o u   w o u l d   l i k e   t o   r e m o v e   l a t e r . : p a r a m   c o n s t r a i n e d _ a d d r s   :   S i m A c t i o n s   f o r   m e m o r y   o p e r a t i o n s   w h o s e   a d d r e s s e s s h o u l d   b e   c o n s t r a i n e d   d u r i n g   c r a s h   a n a l y s i s 3     R e x     C o n c o l i c   E x e c u t i o n   T r a c e r O p p o l o g i s t   a n g r     . / a n g r / e x p l o r a t i o n _ t e c h n i q u e s /   C r a s h . p y   3 C r a s h   T r i a g e _ t r i a g e _ c r a s h ( )     e i p e b p     C r a s h   d e f   _ t r i a g e _ c r a s h ( s e l f ) :         i p   =   s e l f . s t a t e . r e g s . i p         b p   =   s e l f . s t a t e . r e g s . b p         #   a n y   a r b i t r a r y   r e c e i v e s   o r   t r a n s m i t s         #   T O D O :   r e c e i v e s         z p   =   s e l f . s t a t e . g e t _ p l u g i n ( ' z e n _ p l u g i n ' )   i f   s e l f . o s   = =   ' c g c '   e l s e   N o n e         i f   z p   i s   n o t   N o n e   a n d   l e n ( z p . c o n t r o l l e d _ t r a n s m i t s ) :                 l . d e b u g ( " d e t e c t e d   a r b i t r a r y   t r a n s m i t   v u l n e r a b i l i t y " )                 s e l f . c r a s h _ t y p e s . a p p e n d ( V u l n e r a b i l i t y . A R B I T R A R Y _ T R A N S M I T )         #   w e   a s s u m e   a   s y m b o l i c   e i p   i s   a l w a y s   e x p l o i t a b l e         i f   s e l f . s t a t e . s o l v e r . s y m b o l i c ( i p ) :                 #   h o w   m u c h   c o n t r o l   o f   i p   d o   w e   h a v e ?                 i f   s e l f . _ s y m b o l i c _ c o n t r o l ( i p )   > =   s e l f . s t a t e . a r c h . b i t s :                         l . i n f o ( " d e t e c t e d   i p   o v e r w r i t e   v u l n e r a b i l i t y " )                         s e l f . c r a s h _ t y p e s . a p p e n d ( V u l n e r a b i l i t y . I P _ O V E R W R I T E )                 e l s e :                         l . i n f o ( " d e t e c t e d   p a r t i a l   i p   o v e r w r i t e   v u l n e r a b i l i t y " )                         s e l f . c r a s h _ t y p e s . a p p e n d ( V u l n e r a b i l i t y . P A R T I A L _ I P _ O V E R W R I T E )                 r e t u r n         i f   s e l f . s t a t e . s o l v e r . s y m b o l i c ( b p ) :                 #   h o w   m u c h   c o n t r o l   o f   b p   d o   w e   h a v e                 i f   s e l f . _ s y m b o l i c _ c o n t r o l ( b p )   > =   s e l f . s t a t e . a r c h . b i t s :                         l . i n f o ( " d e t e c t e d   b p   o v e r w r i t e   v u l n e r a b i l i t y " )                         s e l f . c r a s h _ t y p e s . a p p e n d ( V u l n e r a b i l i t y . B P _ O V E R W R I T E )                 e l s e :                         l . i n f o ( " d e t e c t e d   p a r t i a l   b p   o v e r w r i t e   v u l n e r a b i l i t y " )                         s e l f . c r a s h _ t y p e s . a p p e n d ( V u l n e r a b i l i t y . P A R T I A L _ B P _ O V E R W R I T E )                 r e t u r n         #   i f   n o t h i n g   o b v i o u s   i s   s y m b o l i c   l e t ' s   l o o k   a t   a c t i o n s         #   g r a b   t h e   a l l   a c t i o n s   i n   t h e   l a s t   b a s i c   b l o c k         s y m b o l i c _ a c t i o n s   =   [   ]         i f   s e l f . _ t   i s   n o t   N o n e   a n d   s e l f . _ t . l a s t _ s t a t e   i s   n o t   N o n e :                 r e c e n t _ a c t i o n s   =   r e v e r s e d ( s e l f . _ t . l a s t _ s t a t e . h i s t o r y . r e c e n t _ a c t i o n s )                 s t a t e   =   s e l f . _ t . l a s t _ s t a t e                 #   T O D O :   t h i s   i s   a   d e a d   a s s i g n m e n t !   w h a t   w a s   t h i s   s u p p o s e d   t o   b e ?         e l s e :                 r e c e n t _ a c t i o n s   =   r e v e r s e d ( s e l f . s t a t e . h i s t o r y . a c t i o n s )                 s t a t e   =   s e l f . s t a t e         f o r   a   i n   r e c e n t _ a c t i o n s :                 i f   a . t y p e   = =   ' m e m ' :                         i f   s e l f . s t a t e . s o l v e r . s y m b o l i c ( a . a d d r ) :                                 s y m b o l i c _ a c t i o n s . a p p e n d ( a )         #   T O D O :   p i c k   t h e   c r a s h i n g   a c t i o n   b a s e d   o f f   t h e   c r a s h i n g   i n s t r u c t i o n   a d d r e s s ,         #   c r a s h   f i x u p   a t t e m p t s   w i l l   b r e a k   o n   t h i s         # i m p o r t   i p d b ;   i p d b . s e t _ t r a c e ( )         f o r   s y m _ a c t i o n   i n   s y m b o l i c _ a c t i o n s :                 i f   s y m _ a c t i o n . a c t i o n   = =   " w r i t e " :                         i f   s e l f . s t a t e . s o l v e r . s y m b o l i c ( s y m _ a c t i o n . d a t a ) :                                 l . i n f o ( " d e t e c t e d   w r i t e - w h a t - w h e r e   v u l n e r a b i l i t y " )                                 s e l f . c r a s h _ t y p e s . a p p e n d ( V u l n e r a b i l i t y . W R I T E _ W H A T _ W H E R E )                         e l s e :                                 l . i n f o ( " d e t e c t e d   w r i t e - x - w h e r e   v u l n e r a b i l i t y " )                                 s e l f . c r a s h _ t y p e s . a p p e n d ( V u l n e r a b i l i t y . W R I T E _ X _ W H E R E )                           s e l f . v i o l a t i n g _ a c t i o n   =   s y m _ a c t i o n                         b r e a k                 i f   s y m _ a c t i o n . a c t i o n   = =   " r e a d " :                         #   s p e c i a l   v u l n e r a b i l i t y   t y p e ,   i f   t h i s   i s   d e t e c t e d   w e   c a n   e x p l o r e   t h e   c r a s h   f u r t h e r                         l . i n f o ( " d e t e c t e d   a r b i t r a r y - r e a d   v u l n e r a b i l i t y " )
  E x p l o i t     R e x     R e x     C r a s h     O r z r e x     h t t p s : / / g i t h u b . c o m / s h e l l p h i s h / r e x M e c h a p h i s h     h t t p s : / / g i t h u b . c o m / m e c h a p h i s h S h e l l p h i s h   h t t p : / / s h e l l p h i s h . n e t / c g c / a n g r   d o c s     h t t p s : / / d o c s . a n g r . i o a n g r   h t t p s : / / g i t h u b . c o m / a n g r S o K :   ( S t a t e   o f )   T h e   A r t   o f   W a r :   O f f e n s i v e   T e c h n i q u e s   i n   B i n a r y   A n a l y s i s   h t t p s : / / g i t h u b . c o m / M a 3 k 4 H 3 d / P a p e r s / b l o b / m a s t e r / 2 0 1 6 _ S P _ a n g r S o K . p d f * x i a o h a n 0 x 0 0 F r e e B u f . C O M                         l . i n f o ( " d e t e c t e d   a r b i t r a r y - r e a d   v u l n e r a b i l i t y " )                         s e l f . c r a s h _ t y p e s . a p p e n d ( V u l n e r a b i l i t y . A R B I T R A R Y _ R E A D )                         s e l f . v i o l a t i n g _ a c t i o n   =   s y m _ a c t i o n                         b r e a k         r e t u r n

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则