[11021] 2017-02-13_使用Burpsuite代理和pypcap抓包进行抢红包的尝试

文档创建者:s7ckTeam
浏览次数:6
最后更新:2025-01-18
2017-02-13_使用Burpsuite代理和pypcap抓包进行抢红包的尝试 使 B u r p s u i t e p y p c a p w h o i s y o u r d a d d y   F r e e B u f   2 0 1 7 - 0 2 - 1 3 * w h o i s y o u r d a d d y F r e e b u f F r e e B u f A P P A P P A P P b u r p s u i t e P O S T   / u s r / u r m / v 1 / g e t P a c k e t . d o   H T T P / 1 . 1 [ . . . ] { t e r m I d : [ ] , a p p V e r s i o n : 1 . 0 . 0 , t e r m T y p : I O S , c h a n n e l I d : [ ] , o s V e r s i o n : 1 0 . 2 , d e v i c e I d : a b c , c l i e n t I d : e e e e e e e e e , p a c k e t I d : 2 0 1 7 0 1 1 2 2 2 1 8 1 0 0 0 5 7 , r e q u e s t T m : 2 0 1 7 0 1 1 2 2 2 1 8 1 1 , t o k e n I d : [ ] , u s r N o : [ ] } p a c k e t I d r e q u e s t T m 便 p a c k e t I d b u r p s u i t e p a c k e t I d w i r e s h a r k p a c k e t I d P y P c a p P y t h o n d p k t l i n u x w i n 使 k a l i   l i n u x P y P c a p a p t - g e t   i n s t a l l   l i b p c a p - d e v p i p   i n s t a l l   p y p c a p I P
i m p o r t   p c a p i m p o r t   d p k t i m p o r t   d a t e t i m e i m p o r t   s o c k e t f r o m   d p k t . c o m p a t   i m p o r t   c o m p a t _ o r d   p c = p c a p . p c a p ( e t h 0 )         # e t h 0 p c . s e t f i l t e r ( s r c   h o s t   1 9 2 . 1 6 8 . 2 . 5   o r   d s t   h o s t   1 9 2 . 1 6 8 . 2 . 5 )         # , i p d e f   m a c _ a d d r ( a d d r e s s ) :   # m a c       r e t u r n   : . j o i n ( % 0 2 x   %   c o m p a t _ o r d ( b )   f o r   b   i n   a d d r e s s ) d e f   i n e t _ t o _ s t r ( i n e t ) :   # i p       t r y :               r e t u r n   s o c k e t . i n e t _ n t o p ( s o c k e t . A F _ I N E T ,   i n e t )       e x c e p t   V a l u e E r r o r :               r e t u r n   s o c k e t . i n e t _ n t o p ( s o c k e t . A F _ I N E T 6 ,   i n e t ) f o r   t i m e s t a m p , b u f   i n   p c :         # t i m e s t a m p b u f       e t h = d p k t . e t h e r n e t . E t h e r n e t ( b u f )             i f   n o t   i s i n s t a n c e ( e t h . d a t a ,   d p k t . i p . I P ) : #   i p               p r i n t   N o n   I P   P a c k e t   t y p e   n o t   s u p p o r t e d   % s n   % e t h . d a t a . _ _ c l a s s _ _ . _ _ n a m e _ _               c o n t i n u e       i p   =   e t h . d a t a             i f   i s i n s t a n c e ( i p . d a t a ,   d p k t . t c p . T C P ) : #   t c p               t c p   =   i p . d a t a                             t r y :         # h t t p                       r e q u e s t   =   d p k t . h t t p . R e q u e s t ( t c p . d a t a )               e x c e p t   ( d p k t . d p k t . N e e d D a t a ,   d p k t . d p k t . U n p a c k E r r o r ) :                       c o n t i n u e               #               d o _ n o t _ f r a g m e n t   =   b o o l ( i p . o f f   &   d p k t . i p . I P _ D F )               m o r e _ f r a g m e n t s   =   b o o l ( i p . o f f   &   d p k t . i p . I P _ M F )               f r a g m e n t _ o f f s e t   =   i p . o f f   &   d p k t . i p . I P _ O F F M A S K               p r i n t   T i m e s t a m p :   ,   s t r ( d a t e t i m e . d a t e t i m e . u t c f r o m t i m e s t a m p ( t i m e s t a m p ) )               p r i n t   E t h e r n e t   F r a m e :   ,   m a c _ a d d r ( e t h . s r c ) ,   m a c _ a d d r ( e t h . d s t ) ,   e t h . t y p e               p r i n t   I P :   % s   - >   % s       ( l e n = % d t t l = % d   D F = % d   M F = % d   o f f s e t = % d )   %   ( i n e t _ t o _ s t r ( i p . s r c ) , i n e t _ t o _ s t r ( i p . d s t ) ,   i p . l e n ,   i p . t t l ,   d o _ n o t _ f r a g m e n t ,   m o r e _ f r a g m e n t s , f r a g m e n t _ o f f s e t )               p r i n t   H T T P   r e q u e s t :   % s n   %   r e p r ( r e q u e s t )
b u r p s u i t e P y P c a p b u r p s u i t e w i f i b u r p s u i t e A P P I P p a c k e t I d 使 r e q u e s t T m d e f   p o s t _ d o ( p a c k e t I d ) :                   c u r r e n t t i m e =   t i m e . s t r f t i m e ( % Y % m % d % H % M % S , t i m e . l o c a l t i m e ( t i m e . t i m e ( ) ) )                   r e q u r l   =   h t t p : / / e x a m p l e . c o m / u s r / u r m / v 1 / g e t P a c k e t . d o                   h e a d e r =   {                   H o s t   :   e x a m p l e . c o m ,                   C o n t e n t - T y p e   :   a p p l i c a t i o n / j s o n ,                   C o n n e c t i o n     :   c l o s e ,                   U s e r - A g e n t   :   M a p S o c i a l / 1 . 0 . 0   ( i P h o n e ;   i O S   1 0 . 2 ;   S c a l e / 3 . 0 0 ) ,                   A c c e p t :   * / * ,                   A c c e p t - E n c o d i n g   :   g z i p ,   d e f l a t e ,
                  A c c e p t - L a n g u a g e   :   z h - H a n s - C N ; q = 1 ,   e n - C N ; q = 0 . 9 ,   z h - H a n t - C N ; q = 0 . 8 ,                   C o o k i e   :   S D J H _ J S E S S I O N I D = [ ]                   }                   b o d y _ v a l u e   =   { t e r m I d : [ ] , a p p V e r s i o n : 1 . 0 . 0 , t e r m T y p : I O S , c h a n n e l I d : [ ] , o s V e r s i o n : 1 0 . 2 , d e v i c e I d : a b c , c l i e n t I d : e e e e e e e e e , p a c k e t I d : p a c k e t I d , r e q u e s t T m : c u r r e n t t i m e , t o k e n I d : [ ] , u s r N o : [ ] }                   b o d y _ v a l u e _ j s o n   =   j s o n . J S O N E n c o d e r ( ) . e n c o d e ( b o d y _ v a l u e )                         r e q u e s t   =   u r l l i b 2 . R e q u e s t ( r e q u r l ,   b o d y _ v a l u e _ j s o n ,   h e a d e r )                   r e s u l t   =   u r l l i b 2 . u r l o p e n ( r e q u e s t ) . r e a d ( )                   r e t u r n   r e s u l t A P P P y P c a p * w h o i s y o u r d a d d y F r e e b u f F r e e b u f
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则