[2349] 2015-10-10_PostgresSQL5加密方式弱口令检测

文档创建者:s7ckTeam
浏览次数:1
最后更新:2025-01-16
2015-10-10_PostgresSQLmd5加密方式弱口令检测 P o s t g r e s S Q L   m d 5 B u g s c a n   E   2 0 1 5 - 1 0 - 1 0 E E I D : E A Q a p p P o s t g r e s S Q L P o s t g r e S Q L   - ( )   B S D - (   M y S Q L   F i r e b i r d ) (   O r a c l e S y b a s e I B M     D B 2     M i c r o s o f t   S Q L   S e r v e r ) p o s t g r e S Q L t r u s t   m d 5 c r y p t     p a s s w o r d   M D 5 M D 5 p o s t g r e S Q L # ! / 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   - * - # _ _ A u t h o r _ _   =   D W B H #   _ _ t y p e _ _   =   p o s t g r e s S Q L   m d 5 i m p o r t   u r l p a r s e i m p o r t   s o c k e t i m p o r t   r e i m p o r t   h a s h l i b i m p o r t   s t r u c t d e f   g e t a u t h ( s , u s e r n a m e , p a s s w o r d ) : t y p e u = " x 0 0 x 0 3 x 0 0 x 0 0 " u s e r = " x 7 5 x 7 3 x 6 5 x 7 2 x 0 0 " u s e r v a l u e = u s e r n a m e + " x 0 0 " d b = " x 6 4 x 6 1 x 7 4 x 6 1 x 6 2 x 6 1 x 7 3 x 6 5 x 0 0 " d b v a l u e = " x 0 0 " a p p = " x 6 1 x 7 0 x 7 0 x 6 C x 6 9 x 6 3 x 6 1 x 7 4 x 6 9 x 6 F x 6 E x 5 F x 6 E x 6 1 x 6 D x 6 5 x 0 0 "
a p p v a l u e = " p s q l " + " x 0 0 " e n c o d e = " x 6 3 x 6 C x 6 9 x 6 5 x 6 E x 7 4 x 5 F x 6 5 x 6 E x 6 3 x 6 F x 6 4 x 6 9 x 6 E x 6 7 x 0 0 " e n c o d e v a l u e = " x 4 7 x 4 2 x 4 B x 0 0 " d a t a = t y p e u + u s e r + u s e r v a l u e + d b + d b v a l u e + a p p + a p p v a l u e + e n c o d e + e n c o d e v a l u e + " x 0 0 " p a y l o a d = s t r u c t . p a c k ( " ! i " , l e n ( d a t a ) + 4 ) + d a t a t r y : s . s e n d a l l ( p a y l o a d ) r e s   =   s . r e c v ( 1 0 2 4 ) a u t h t y p e   =   s t r u c t . u n p a c k ( " ! i " , r e s [ 5 : 9 ] ) [ 0 ] i f   r e s [ 0 ] = = " R " : i f   a u t h t y p e = = 0 : r e t u r n   ' n o a u t h ' , 0 i f   a u t h t y p e = = 5 : r e t u r n   " m d 5 " , m a k e a u t h ( u s e r n a m e , p a s s w o r d , r e s [ - 4 : ] ) e l s e : r e t u r n   " a u t h " , s t r u c t . u n p a c k ( " ! i " , r e s [ 5 : 9 ] ) [ 0 ] e x c e p t : p a s s r e t u r n   " b a d u s e r " , - 1 d e f   m d 5 ( d a t a ) : r e t u r n   h a s h l i b . m d 5 ( d a t a ) . h e x d i g e s t ( ) d e f   m a k e a u t h ( u s e r n a m e , p a s s w o r d , k e y ) : r e t u r n   ' m d 5 ' + m d 5 ( m d 5 ( p a s s w o r d + u s e r n a m e ) + k e y ) d e f   s e n d a u t h ( s , a u t h ) : a u t h s t y e = " x 7 0 x 0 0 x 0 0 x 0 0 x 2 8 " a u t h = a u t h s t y e + a u t h + " x 0 0 " t r y : s . s e n d a l l ( a u t h )  
d a t a = s . r e c v ( 1 0 2 4 ) i f   d a t a [ 0 ] = = " R "   a n d   d a t a [ 5 : 9 ] = = " x 0 0 x 0 0 x 0 0 x 0 0 " : r e t u r n   T r u e e x c e p t : p a s s r e t u r n   F a l s e d e f   c r e a t e s o c k e t ( i p , p o r t ) : f o r   x   i n   r a n g e ( 1 0 ) : t r y : s   =   s o c k e t . s o c k e t ( ) s . c o n n e c t ( ( i p , p o r t ) )   r e t u r n   s e x c e p t : p a s s d e f   a s s i g n ( s e r v i c e ,   a r g ) : i f   s e r v i c e   = =   " p o s t g r e s q l " : r e t u r n   T r u e ,   a r g d e f   a u d i t ( a r g s ) : i p , p o r t = a r g s b a d u s e r   =   [ ] g o o d u s e r   =   [ ] t r y : s   =   s o c k e t . s o c k e t ( ) s . c o n n e c t ( ( i p , p o r t ) ) p a s s _ l i s t   =   u t i l . l o a d _ p a s s w o r d _ d i c t ( i p , u s e r f i l e = ' d a t a b a s e / m y s q l _ u s e r . t x t ' ,   p a s s f i l e = ' d a t a b a s e / m y s q l _ p a s s . t x t ' , m i x = T r u e , u s e r l i s t = [ ' p o s t g r e s : p o s t g r e s ' , ' p o s t g r e s : r o o t ' , ' p o s t g r e s ' ] , ) f o r   u s e r n a m e , p a s s w o r d   i n   p a s s _ l i s t : i f   u s e r n a m e   i n   b a d u s e r :
c o n t i n u e a u t h = g e t a u t h ( s , u s e r n a m e , p a s s w o r d ) i f   a u t h [ 0 ] = = ' n o a u t h ' : s e c u r i t y _ h o l e ( " p o s t g r e s q l : / / % s : % d "   %   ( i p , p o r t ) ) r e t u r n i f   a u t h [ 0 ] = = " m d 5 " : i f   s e n d a u t h ( s , a u t h [ 1 ] ) : s e c u r i t y _ h o l e ( " p o s t g r e s q l : / / % s : % s @ % s : % d "   %   ( u s e r n a m e , p a s s w o r d , i p , p o r t ) ) s . c l o s e ( ) r e t u r n e l s e : i f   u s e r n a m e   n o t   i n   g o o d u s e r : s e c u r i t y _ n o t e ( " p o s t g r e s q l   u s e r :   % s @ % s : % d   a u t h t y p e : m d 5 "   %   ( u s e r n a m e , i p , p o r t ) ) g o o d u s e r . a p p e n d ( u s e r n a m e ) i f   a u t h [ 0 ] = = ' a u t h ' : i f   u s e r n a m e   n o t   i n   g o o d u s e r : s e c u r i t y _ n o t e ( " p o s t g r e s q l   u s e r :   % s @ % s : % d   a u t h t y p e : % d "   %   ( u s e r n a m e , i p , p o r t , a u t h [ 1 ] ) ) g o o d u s e r . a p p e n d ( u s e r n a m e ) i f   a u t h [ 0 ] = = ' b a d u s e r ' : b a d u s e r . a p p e n d ( u s e r n a m e ) s . c l o s e ( ) s   =   c r e a t e s o c k e t ( i p , p o r t ) e x c e p t   E x c e p t i o n , e : p a s s s . c l o s e ( ) i f   _ _ n a m e _ _   = =   ' _ _ m a i n _ _ ' : f r o m   d u m m y   i m p o r t   * a u d i t ( a s s i g n ( ' p o s t g r e s q l ' ,   ( ' 1 9 2 . 1 6 8 . 0 . 1 3 2 ' , 5 4 3 2 ) ) [ 1 ] ) 访 访 b u g s c a n h t t p : / / q . b u g s c a n . n e t / h t t p s : / / w w w . b u g s c a n . n e t   E E E 便

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

本版积分规则