[28299] 2020-05-14_使用Python中开发子域扫描器

文档创建者:s7ckTeam
浏览次数:13
最后更新:2025-01-19
2020-05-14_使用Python中开发子域扫描器 使 P y t h o n O t s   2 0 2 0 - 0 5 - 1 4 便 使 P y t h o n 使 P y t h o n 使 g o o g l e . c o m 使 g o o g l e 使 1 0 0 使 g i t h u b 1   s u b d o m a i n s . t x t U R L 使 r e q u e s t s . g e t H T T P C o n n e c t i o n E r r o r t r y   /   e x c e p t p i p 3   i n s t a l l   r e q u e s t s p i p 3   i n s t a l l   r e q u e s t s i m p o r t i m p o r t   r e q u e s t s   r e q u e s t s #   t h e   d o m a i n   t o   s c a n   f o r   s u b d o m a i n s #   t h e   d o m a i n   t o   s c a n   f o r   s u b d o m a i n s d o m a i n   d o m a i n   = =     " g o o g l e . c o m " " g o o g l e . c o m " #   r e a d   a l l   s u b d o m a i n s #   r e a d   a l l   s u b d o m a i n s f i l e f i l e     = =     o p e n o p e n ( ( " s u b d o m a i n s . t x t " " s u b d o m a i n s . t x t " ) ) #   r e a d   a l l   c o n t e n t #   r e a d   a l l   c o n t e n t c o n t e n t   c o n t e n t   = =     f i l e f i l e . . r e a d r e a d ( ( ) ) #   s p l i t   b y   n e w   l i n e s #   s p l i t   b y   n e w   l i n e s s u b d o m a i n s   s u b d o m a i n s   = =   c o n t e n t   c o n t e n t . . s p l i t l i n e s s p l i t l i n e s ( ( ) ) f o r f o r   s u b d o m a i n     s u b d o m a i n   i n i n   s u b d o m a i n s   s u b d o m a i n s : :                 #   c o n s t r u c t   t h e   u r l #   c o n s t r u c t   t h e   u r l         u r l           u r l   = =     f " h t t p : / / f " h t t p : / / { { s u b d o m a i n s u b d o m a i n } } . . { { d o m a i n d o m a i n } } " "                 t r y t r y : :                                 #   i f   t h i s   r a i s e s   a n   E R R O R ,   t h a t   m e a n s   t h e   s u b d o m a i n   d o e s   n o t   e x i s t #   i f   t h i s   r a i s e s   a n   E R R O R ,   t h a t   m e a n s   t h e   s u b d o m a i n   d o e s   n o t   e x i s t                 r e q u e s t s                 r e q u e s t s . . g e t g e t ( ( u r l u r l ) )                 e x c e p t e x c e p t   r e q u e s t s   r e q u e s t s . . C o n n e c t i o n E r r o r C o n n e c t i o n E r r o r : :                                 #   i f   t h e   s u b d o m a i n   d o e s   n o t   e x i s t ,   j u s t   p a s s ,   p r i n t   n o t h i n g #   i f   t h e   s u b d o m a i n   d o e s   n o t   e x i s t ,   j u s t   p a s s ,   p r i n t   n o t h i n g                                 p a s s p a s s                 e l s e e l s e : :                                 p r i n t p r i n t ( ( " [ + ]   D i s c o v e r e d   s u b d o m a i n : " " [ + ]   D i s c o v e r e d   s u b d o m a i n : " , ,   u r l   u r l ) )
I n t e r n e t 使 线 线
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则