3
@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   s8   || _ | j | _x"t|j D ]}|| | j|< qW 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jd d S yZtjdtjtjB }x@|j	|d D ].}||d	 krl|j
|d	 d
 |d  d  qlW W n6 tk
r } z| jjdt| d d S d }~X 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jd| d |  || jkrR| jjd| d  d S d| j|< | j|}|rt|j| x&|D ]}t	d|| j
|}| j| qzW d S )NzReceived event, z, from z	Skipping z as already mapped.Tr   )	eventTypemoduledatar	   r   r   r   r0   extendr   __name__notifyListeners)	r   event	eventNamesrcModuleName	eventDatar3   Zobbnr/   r   r   r   handleEventG   s    




zsfp_h1nobbdde.handleEvent)r5   
__module____qualname____doc__r   optdescsr   dictr   r   r   r0   r<   r   r   r   r   r      s   
r   )r   sflibr   r   r   r   r   r   r   r   <module>   s   