helpers/vuln_importer.rb
# For now, we need this to clean up import text a bit
For now, we need this to clean up import text a bit
For now we need this to clean up import text a bit
def clean(text)
    return unless text
    text = text.squeeze(" ")
    text = text.gsub("<br>", "\n")
    text = text.gsub("<p>", "\n")
    text = text.gsub("<description>","")
    text = text.gsub("</description>","")
    text = text.gsub("<Score>","")
    text = text.gsub("</Score>","")
    text = text.gsub("<AV>","")
    text = text.gsub("</AV>","")
    text = text.gsub("<Au>","")
    text = text.gsub("</Au>","")
    text = text.gsub("<AC>","")
    text = text.gsub("</AC>","")
    text = text.gsub("<PR>","")
    text = text.gsub("</PR>","")
    text = text.gsub("<UI>","")
    text = text.gsub("</UI>","")
    text = text.gsub("<S>","")
    text = text.gsub("</S>","")
    text = text.gsub("<C>","")
    text = text.gsub("</C>","")
    text = text.gsub("<I>","")
    text = text.gsub("</I>","")
    text = text.gsub("<A>","")
    text = text.gsub("</A>","")
    text = text.gsub("<E>","")
    text = text.gsub("</E>","")
    text = text.gsub("<RL>","")
    text = text.gsub("</RL>","")
    text = text.gsub("<RC>","")
    text = text.gsub("</RC>","")
    text = text.gsub("<CDP>","")
    text = text.gsub("</CDP>","")
    text = text.gsub("<TD>","")
    text = text.gsub("</TD>","")
    text = text.gsub("<MAV>","")
    text = text.gsub("</MAV>","")
    text = text.gsub("<MAC>","")
    text = text.gsub("</MAC>","")
    text = text.gsub("<MPR>","")
    text = text.gsub("</MPR>","")
    text = text.gsub("<MUI>","")
    text = text.gsub("</MUI>","")
    text = text.gsub("<MS>","")
    text = text.gsub("</MS>","")
    text = text.gsub("<MC>","")
    text = text.gsub("</MC>","")
    text = text.gsub("<MI>","")
    text = text.gsub("</MI>","")
    text = text.gsub("<MA>","")
    text = text.gsub("</MA>","")
    text = text.gsub("<CR>","")
    text = text.gsub("</CR>","")
    text = text.gsub("<IR>","")
    text = text.gsub("</IR>","")
    text = text.gsub("<AR>","")
    text = text.gsub("</AR>","")
    text = text.gsub("<cvss_base_score>","")
    text = text.gsub("</cvss_base_score>","")
    text = text.gsub("<solution>","")
    text = text.gsub("</solution>","")
    text = text.gsub("<see_also>","")
    text = text.gsub("</see_also>","")
    text = text.gsub("<plugin_output>\n\n","")    
    text = text.gsub("<plugin_output>\n","")    
    text = text.gsub("<plugin_output>","")
    text = text.gsub("</plugin_output>","")
    text = text.gsub("</p>", "")
    text = text.gsub("<li>", "\n")
    text = text.gsub("</li>", "")
    text = text.gsub("<ul>", "\n")
    text = text.gsub("</ul>", "")
    text = text.gsub("<table>", "")
    text = text.gsub("</table>", "")
    text = text.gsub("<td>", "\n")
    text = text.gsub("</td>", "")
    text = text.gsub("<tr>", "")
    text = text.gsub("</tr>", "")
    text = text.gsub("<b>", "")
    text = text.gsub("</b>", "")
    text = text.gsub("<![CDATA[","")
    text = text.gsub("]]>","")
    text = text.gsub("\n\n","\n")
    text = text.gsub("\n","\r\n")
    text_ = url_escape_hash({'a' => text})
    text = text_['a']
    return text
end
def clean ( text ) return unless text text = text . squeeze ( " " ) text = text . gsub ( "<br>" , "\n" ) text = text . gsub ( "<p>" , "\n" ) text = text . gsub ( "<description>" , "" ) text = text . gsub ( "</description>" , "" ) text = text . gsub ( "<Score>" , "" ) text = text . gsub ( "</Score>" , "" ) text = text . gsub ( "<AV>" , "" ) text = text . gsub ( "</AV>" , "" ) text = text . gsub ( "<Au>" , "" ) text = text . gsub ( "</Au>" , "" ) text = text . gsub ( "<AC>" , "" ) text = text . gsub ( "</AC>" , "" ) text = text . gsub ( "<PR>" , "" ) text = text . gsub ( "</PR>" , "" ) text = text . gsub ( "<UI>" , "" ) text = text . gsub ( "</UI>" , "" ) text = text . gsub ( "<S>" , "" ) text = text . gsub ( "</S>" , "" ) text = text . gsub ( "<C>" , "" ) text = text . gsub ( "</C>" , "" ) text = text . gsub ( "<I>" , "" ) text = text . gsub ( "</I>" , "" ) text = text . gsub ( "<A>" , "" ) text = text . gsub ( "</A>" , "" ) text = text . gsub ( "<E>" , "" ) text = text . gsub ( "</E>" , "" ) text = text . gsub ( "<RL>" , "" ) text = text . gsub ( "</RL>" , "" ) text = text . gsub ( "<RC>" , "" ) text = text . gsub ( "</RC>" , "" ) text = text . gsub ( "<CDP>" , "" ) text = text . gsub ( "</CDP>" , "" ) text = text . gsub ( "<TD>" , "" ) text = text . gsub ( "</TD>" , "" ) text = text . gsub ( "<MAV>" , "" ) text = text . gsub ( "</MAV>" , "" ) text = text . gsub ( "<MAC>" , "" ) text = text . gsub ( "</MAC>" , "" ) text = text . gsub ( "<MPR>" , "" ) text = text . gsub ( "</MPR>" , "" ) text = text . gsub ( "<MUI>" , "" ) text = text . gsub ( "</MUI>" , "" ) text = text . gsub ( "<MS>" , "" ) text = text . gsub ( "</MS>" , "" ) text = text . gsub ( "<MC>" , "" ) text = text . gsub ( "</MC>" , "" ) text = text . gsub ( "<MI>" , "" ) text = text . gsub ( "</MI>" , "" ) text = text . gsub ( "<MA>" , "" ) text = text . gsub ( "</MA>" , "" ) text = text . gsub ( "<CR>" , "" ) text = text . gsub ( "</CR>" , "" ) text = text . gsub ( "<IR>" , "" ) text = text . gsub ( "</IR>" , "" ) text = text . gsub ( "<AR>" , "" ) text = text . gsub ( "</AR>" , "" ) text = text . gsub ( "<cvss_base_score>" , "" ) text = text . gsub ( "</cvss_base_score>" , "" ) text = text . gsub ( "<solution>" , "" ) text = text . gsub ( "</solution>" , "" ) text = text . gsub ( "<see_also>" , "" ) text = text . gsub ( "</see_also>" , "" ) text = text . gsub ( "<plugin_output>\n\n" , "" ) text = text . gsub ( "<plugin_output>\n" , "" ) text = text . gsub ( "<plugin_output>" , "" ) text = text . gsub ( "</plugin_output>" , "" ) text = text . gsub ( "</p>" , "" ) text = text . gsub ( "<li>" , "\n" ) text = text . gsub ( "</li>" , "" ) text = text . gsub ( "<ul>" , "\n" ) text = text . gsub ( "</ul>" , "" ) text = text . gsub ( "<table>" , "" ) text = text . gsub ( "</table>" , "" ) text = text . gsub ( "<td>" , "\n" ) text = text . gsub ( "</td>" , "" ) text = text . gsub ( "<tr>" , "" ) text = text . gsub ( "</tr>" , "" ) text = text . gsub ( "<b>" , "" ) text = text . gsub ( "</b>" , "" ) text = text . gsub ( "<![CDATA[" , "" ) text = text . gsub ( "]]>" , "" ) text = text . gsub ( "\n\n" , "\n" ) text = text . gsub ( "\n" , "\r\n" ) text_ = url_escape_hash ( { 'a' => text } ) text = text_ [ 'a' ] return text end
For now, we need this to clean up import text a bit
For now we need this to clean up import text a bit
#cvss #nessus #cvss #remove leading newline characters from nessus plugin output too! #remove leading newline character from nessus plugin output too! # burp stores html and needs to be removed, TODO better way to handle this
text
<not_specific>