U
    @6^                     @   s0   d dl Z d dlmZmZmZ G dd deZdS )    N)
SpiderFootSpiderFootPluginSpiderFootEventc                   @   sJ   e Zd ZdZi Zi ZdZe fddZdd Z	dd Z
d	d
 Zdd ZdS )sfp_h1nobbddezHackerOne (Unofficial):Footprint,Investigate,Passive:Leaks, Dumps and Breaches::Check external vulnerability scanning/reporting service h1.nobbd.de to see if the target is listed.Nc                 C   s4   || _ |  | _t| D ]}|| | j|< qd S )N)sftempStorageresultslistkeysopts)selfsfcuserOptsopt r   8/var/www/spiderfoot.crq.systems/modules/sfp_h1nobbdde.pysetup    s    
zsfp_h1nobbdde.setupc                 C   s   dgS )NDOMAIN_NAMEr   r   r   r   r   watchedEvents*   s    zsfp_h1nobbdde.watchedEventsc                 C   s   dgS )NVULNERABILITYr   r   r   r   r   producedEvents.   s    zsfp_h1nobbdde.producedEventsc           	   
   C   s   t  }d}d| }| jj|d| jd d}|d d krF| jd d S zVtdtjtjB }|	|d D ].}||d	 krj|
|d	 d
 |d  d  qjW n> tk
r } z | jdt| d W Y d S d }~X Y nX |S )Nzhttp://www.h1.nobbd.dez http://h1.nobbd.de/search.php?q=   
_useragent)timeout	useragentcontentz$No content returned from h1.nobbd.dez2<a class="title" href=.(.[^"]+).*?title=.(.[^"']+)   z
<SFURL>r   z</SFURL>z,Error processing response from h1.nobbd.de: F)r	   r   fetchUrlr   debugrecompile
IGNORECASEDOTALLfindallappend	Exceptionerrorstr)	r   qryretbaseurlresrxmer   r   r   queryOBB2   s     $zsfp_h1nobbdde.queryOBBc           	      C   s   |j }|j}|j}t }| jd| d |  || jkrR| jd| d  d S d| j|< | |}|rt|| |D ]}t	d|| j
|}| | qxd S )NzReceived event, z, from z	Skipping z as already mapped.Tr   )	eventTypemoduledatar	   r   r   r   r1   extendr   __name__notifyListeners)	r   event	eventNamesrcModuleName	eventDatar4   Zobbnr0   r   r   r   handleEventG   s    



zsfp_h1nobbdde.handleEvent)r6   
__module____qualname____doc__r   optdescsr   dictr   r   r   r1   r=   r   r   r   r   r      s   
r   )r    sflibr   r   r   r   r   r   r   r   <module>   s   