[16956] 2021-06-27_CVE-2021-23017:nginxDNS解析漏洞PoC公开

文档创建者:s7ckTeam
浏览次数:11
最后更新:2025-01-18
2021-06-27_CVE-2021-23017:nginxDNS解析漏洞PoC公开 C V E - 2 0 2 1 - 2 3 0 1 7 n g i n x   D N S P o C A l p h a _ h 4 c k   F r e e B u f   2 0 2 1 - 0 6 - 2 7 0 . 6 . 1 8   -   1 . 2 0 . 0 1 . 2 1 . 0 1 . 2 0 . 1 F 5 ,   I n c h t t p s : / / n g i n x . o r g / h t t p s : / / m a i l m a n . n g i n x . o r g / p i p e r m a i l / n g i n x - a n n o u n c e / 2 0 2 1 / 0 0 0 3 0 0 . h t m l C V E C V E - 2 0 2 1 - 2 3 0 1 7
C W E 1 9 3 C V S S 8 . 1 D N S n g x _ r e s o l v e r _ c o p y ( ) o f f - b y - o n e . ,   0 x 2 E n g i n x D N S D N S 使 0 x 2 E n g i n x D N S n g i n x D N S D N S I D D N S n g i n x D N S c o r e / n g x _ r e s o l v e r . c D N S n g x _ r e s o l v e r _ c o p y ( ) D N S D N S l e n 1 2 8 1 2 l e n o f f - b y - o n e n a m e - > d a t a N U L L N U L L N U L L / /   1 )   c o p y   t h e   l a b e l   t o   t h e   o u t p u t   b u f f e r ,   n g x _ s t r l o w ( d s t ,   s r c ,   n ) ;                         d s t   + =   n ;                         s r c   + =   n ; / /   2 )   r e a d   n e x t   c h a r a c t e r ,                         n   =   * s r c + + ; / /   3 )   a s   i t s   a   p o i n t e r ,   i t s   n o t   N U L ,                         i f   ( n   ! =   0 )   {
3 P R E V _ I N U S E I S _ M M A P P E D / /   4 )   s o   a   d o t   c h a r a c t e r   t h a t   w a s   n o t   a c c o u n t e d   f o r   i s   w r i t t e n   o u t   o f   b o u n d s                                 * d s t + +   =   ' . ' ;                         } / /   5 )   A f t e r w a r d s ,   t h e   p o i n t e r   i s   f o l l o w e d ,                 i f   ( n   &   0 x c 0 )   {                         n   =   ( ( n   &   0 x 3 f )   < <   8 )   +   * s r c ;                         s r c   =   & b u f [ n ] ;                         n   =   * s r c + + ;                 } / /   6 )   a n d   a   N U L L   b y t e   i s   f o u n d ,   s i g n a l i n g   t h e   e n d   o f   t h e   f u n c t i o n                 i f   ( n   = =   0 )   {                         n a m e - > l e n   =   d s t   -   n a m e - > d a t a ;                         r e t u r n   N G X _ O K ;                 } = = 7 8 6 3 = =   I n v a l i d   w r i t e   o f   s i z e   1 = = 7 8 6 3 = =         a t   0 x 1 3 7 C 2 E :   n g x _ r e s o l v e r _ c o p y   ( n g x _ r e s o l v e r . c : 4 0 1 8 ) = = 7 8 6 3 = =         b y   0 x 1 3 D 1 2 B :   n g x _ r e s o l v e r _ p r o c e s s _ a   ( n g x _ r e s o l v e r . c : 2 4 7 0 ) = = 7 8 6 3 = =         b y   0 x 1 3 D 1 2 B :   n g x _ r e s o l v e r _ p r o c e s s _ r e s p o n s e   ( n g x _ r e s o l v e r . c : 1 8 4 4 ) = = 7 8 6 3 = =         b y   0 x 1 3 D 4 6 A :   n g x _ r e s o l v e r _ u d p _ r e a d   ( n g x _ r e s o l v e r . c : 1 5 7 4 ) = = 7 8 6 3 = =         b y   0 x 1 4 A B 1 9 :   n g x _ e p o l l _ p r o c e s s _ e v e n t s   ( n g x _ e p o l l _ m o d u l e . c : 9 0 1 ) = = 7 8 6 3 = =         b y   0 x 1 4 1 4 D 4 :   n g x _ p r o c e s s _ e v e n t s _ a n d _ t i m e r s   ( n g x _ e v e n t . c : 2 4 7 ) = = 7 8 6 3 = =         b y   0 x 1 4 8 E 5 7 :   n g x _ w o r k e r _ p r o c e s s _ c y c l e   ( n g x _ p r o c e s s _ c y c l e . c : 7 1 9 ) = = 7 8 6 3 = =         b y   0 x 1 4 7 4 D A :   n g x _ s p a w n _ p r o c e s s   ( n g x _ p r o c e s s . c : 1 9 9 ) = = 7 8 6 3 = =         b y   0 x 1 4 8 0 A 8 :   n g x _ s t a r t _ w o r k e r _ p r o c e s s e s   ( n g x _ p r o c e s s _ c y c l e . c : 3 4 4 )
n g i n x P o C P o C p o c . p y 广 v a l g r i n d n g i n x D N S 1 0 5 3 = = 7 8 6 3 = =         b y   0 x 1 4 9 5 2 D :   n g x _ m a s t e r _ p r o c e s s _ c y c l e   ( n g x _ p r o c e s s _ c y c l e . c : 1 3 0 ) = = 7 8 6 3 = =         b y   0 x 1 2 2 3 7 F :   m a i n   ( n g i n x . c : 3 8 3 ) = = 7 8 6 3 = =     A d d r e s s   0 x 4 b b c f b 8   i s   0   b y t e s   a f t e r   a   b l o c k   o f   s i z e   2 4   a l l o c ' d = = 7 8 6 3 = =         a t   0 x 4 8 3 E 7 7 F :   m a l l o c   ( v g _ r e p l a c e _ m a l l o c . c : 3 0 7 ) = = 7 8 6 3 = =         b y   0 x 1 4 4 8 C * 4 :   n g x _ a l l o c   ( n g x _ a l l o c . c : 2 2 ) = = 7 8 6 3 = =         b y   0 x 1 3 7 A E 4 :   n g x _ r e s o l v e r _ a l l o c   ( n g x _ r e s o l v e r . c : 4 1 1 9 ) = = 7 8 6 3 = =         b y   0 x 1 3 7 B 2 6 :   n g x _ r e s o l v e r _ c o p y   ( n g x _ r e s o l v e r . c : 3 9 9 4 ) = = 7 8 6 3 = =         b y   0 x 1 3 D 1 2 B :   n g x _ r e s o l v e r _ p r o c e s s _ a   ( n g x _ r e s o l v e r . c : 2 4 7 0 ) = = 7 8 6 3 = =         b y   0 x 1 3 D 1 2 B :   n g x _ r e s o l v e r _ p r o c e s s _ r e s p o n s e   ( n g x _ r e s o l v e r . c : 1 8 4 4 ) = = 7 8 6 3 = =         b y   0 x 1 3 D 4 6 A :   n g x _ r e s o l v e r _ u d p _ r e a d   ( n g x _ r e s o l v e r . c : 1 5 7 4 ) = = 7 8 6 3 = =         b y   0 x 1 4 A B 1 9 :   n g x _ e p o l l _ p r o c e s s _ e v e n t s   ( n g x _ e p o l l _ m o d u l e . c : 9 0 1 ) = = 7 8 6 3 = =         b y   0 x 1 4 1 4 D 4 :   n g x _ p r o c e s s _ e v e n t s _ a n d _ t i m e r s   ( n g x _ e v e n t . c : 2 4 7 ) = = 7 8 6 3 = =         b y   0 x 1 4 8 E 5 7 :   n g x _ w o r k e r _ p r o c e s s _ c y c l e   ( n g x _ p r o c e s s _ c y c l e . c : 7 1 9 ) = = 7 8 6 3 = =         b y   0 x 1 4 7 4 D A :   n g x _ s p a w n _ p r o c e s s   ( n g x _ p r o c e s s . c : 1 9 9 ) = = 7 8 6 3 = =         b y   0 x 1 4 8 0 A 8 :   n g x _ s t a r t _ w o r k e r _ p r o c e s s e s   ( n g x _ p r o c e s s _ c y c l e . c : 3 4 4 ) = = 7 8 6 3 = =         b y   0 x 1 4 9 5 2 D :   n g x _ m a s t e r _ p r o c e s s _ c y c l e   ( n g x _ p r o c e s s _ c y c l e . c : 1 3 0 ) v a l g r i n d   - - t r a c e - c h i l d r e n = y e s   o b j s / n g i n x   - p   . . / r u n t i m e   - c   c o n f / r e v e r s e - p r o x y . c o n f p y t h o n   p o c . p y c u r l   h t t p : / / 1 2 7 . 0 . 0 . 1 : 8 0 8 0 /
v a l g r i n d A d r e s s S a n i t i z e r 使 使 n g i n x h t t p s : / / g o o g l e p r o j e c t z e r o . b l o g s p o t . c o m / 2 0 1 6 / 1 2 / c h r o m e - o s - e x p l o i t - o n e - b y t e - o v e r f l o w - a n d . h t m l h t t p s : / / g o o g l e p r o j e c t z e r o . b l o g s p o t . c o m / 2 0 1 4 / 0 8 / t h e - p o i s o n e d - n u l - b y t e - 2 0 1 4 - e d i t i o n . h t m l h t t p s : / / w w w . s l i d e s h a r e . n e t / c o d e b l u e _ j p / c b 1 6 - m a t s u k u m a - e n - 6 8 4 5 9 6 0 6 c o r r u p t e d   s i z e   v s .   p r e v _ s i z e 2 0 2 1 / 0 4 / 1 6   1 3 : 3 5 : 1 5   [ a l e r t ]   2 5 0 1 # 0 :   w o r k e r   p r o c e s s   2 5 0 2   e x i t e d   o n   s i g n a l   6   ( c o r e   d u m p e d ) m a l l o c ( ) :   i n v a l i d   n e x t   s i z e   ( u n s o r t e d ) 2 0 2 1 / 0 4 / 1 6   1 3 : 3 5 : 3 4   [ a l e r t ]   2 5 2 5 # 0 :   w o r k e r   p r o c e s s   2 5 2 6   e x i t e d   o n   s i g n a l   6   ( c o r e   d u m p e d ) d a e m o n   o f f ; h t t p {         a c c e s s _ l o g   l o g s / a c c e s s . l o g ;         s e r v e r {                 l i s t e n   8 0 8 0 ;                 l o c a t i o n   /   {                         r e s o l v e r   1 2 7 . 0 . 0 . 1 : 1 0 5 3 ;                         s e t   $ d n s   h t t p : / / e x a m p l e . n e t ;                         p r o x y _ p a s s   $ d n s ;                 }         } } e v e n t s   {         w o r k e r _ c o n n e c t i o n s     1 0 2 4 ; }

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

本版积分规则