Note that there are some explanatory texts on larger screens.

plurals
  1. POParsing xml with namespace using Perl XML::Simple
    primarykey
    data
    text
    <p>All, I could really use some help here. My end goal is to be able to read an xml file using perl and insert it into a database to track CVE. At this stage if I could just reference the variables out of the XML file in my code I'm sure I could get it inserted into a database. For now all I'm trying to do is, print it out to the screen and I can not get it to work. </p> <p>Here is my simple code and the XML file. </p> <p>Hopefully someone can get me going here. </p> <p>--start of Perl code--</p> <pre><code>#!/usr/bin/perl # use module use XML::Simple; use Data::Dumper; # create object xml = new XML::Simple (KeyAttr=&gt;[]); # read XML file #$data = $xml-&gt;XMLin("tms.xml"); # print output - used this to see if it was even reading it #print Dumper($data); # access XML data print "Here is the BugTrackID: $data-&gt;{'x:BugTraqID'}\n"; </code></pre> <p>--end of perl code---</p> <p>--start of xml--</p> <pre><code>&lt;?xml version="1.0" encoding="us-ascii"?&gt; &lt;Alerts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:alerts.symantec.com https://alerts.symantec.com/vulalert.xsd"&gt; &lt;x:AlertDocument xmlns:x="urn:alerts.symantec.com" AlertStatusID="57982" Type="1" DetailLevel="25" Language="1"&gt; &lt;x:BugTraqID&gt;57982&lt;/x:BugTraqID&gt; &lt;x:Title&gt;Sonar Multiple Cross Site Scripting Vulnerabilities&lt;/x:Title&gt; &lt;x:StatusID&gt;1&lt;/x:StatusID&gt; &lt;x:CVE&gt;CVE-MAP-NOMATCH&lt;/x:CVE&gt; &lt;x:Published&gt;Feb 12 2013&lt;/x:Published&gt; &lt;x:LastUpdated&gt;2013-02-15T19:03:48&lt;/x:LastUpdated&gt; &lt;x:Remote&gt;Yes&lt;/x:Remote&gt; &lt;x:Local&gt;No&lt;/x:Local&gt; &lt;x:Credibility&gt;Single Source&lt;/x:Credibility&gt; &lt;x:Classification&gt;Input Validation Error&lt;/x:Classification&gt; &lt;x:Availability&gt;User Initiated&lt;/x:Availability&gt; &lt;x:Ease&gt;Exploit Available&lt;/x:Ease&gt; &lt;x:Authentication&gt;Not Required&lt;/x:Authentication&gt; &lt;x:CVSS2_BaseScore&gt;5.8&lt;/x:CVSS2_BaseScore&gt; &lt;x:CVSS2_TemporalScore&gt;5&lt;/x:CVSS2_TemporalScore&gt; &lt;x:CVSS2_BaseVector&gt;AV:N/AC:M/Au:N/C:P/I:P/A:N&lt;/x:CVSS2_BaseVector&gt; &lt;x:CVSS2_TemporalVector&gt;E:F/RL:U/RC:UC&lt;/x:CVSS2_TemporalVector&gt; &lt;x:CVSS1_BaseScore&gt;3.7&lt;/x:CVSS1_BaseScore&gt; &lt;x:CVSS1_TemporalScore&gt;3.2&lt;/x:CVSS1_TemporalScore&gt; &lt;x:NVD_CVSS2_BaseScore&gt;4.3&lt;/x:NVD_CVSS2_BaseScore&gt; &lt;x:NVD_CVSS2_ComponentString&gt;AV:N/AC:M/Au:N/C:N/I:P/A:N&lt;/x:NVD_CVSS2_ComponentString&gt; &lt;x:ImpactRating&gt;4&lt;/x:ImpactRating&gt; &lt;x:Severity&gt;6.1&lt;/x:Severity&gt; &lt;x:EaseofExploit&gt;8&lt;/x:EaseofExploit&gt; &lt;x:UrgencyRating&gt;6.1&lt;/x:UrgencyRating&gt; &lt;x:LastChange&gt;Initial analysis.&lt;/x:LastChange&gt; &lt;x:VulnerableSystems&gt; &lt;x:VulnerableSystem&gt; &lt;x:Title&gt;&lt;![CDATA[SonarSource Sonar 3.4.1 cpe:/a:sonarsource:sonar:3.4.1 SYMC]]&gt;&lt;/x:Title&gt; &lt;/x:VulnerableSystem&gt; &lt;/x:VulnerableSystems&gt; &lt;x:ShortSummary&gt;&lt;![CDATA[Sonar is prone to multiple cross-site scripting vulnerabilities.]]&gt;&lt;/x:ShortSummary&gt; &lt;x:Impact&gt;An attacker may leverage these issues to execute arbitrary script code in the browser of an unsuspecting user in the context of the affected site. This may allow the attacker to steal cookie-based authentication credentials and launch other attacks.&lt;/x:Impact&gt; &lt;x:TechnicalDescription&gt;&lt;![CDATA[Sonar is the open source platform for code quality inspection. The application is prone to multiple cross-site scripting vulnerabilities because it fails to sanitize user-supplied input submitted to the following scripts and parameters: &amp;apos;index.php &amp;apos; : &amp;apos;search&amp;apos;, &amp;apos;assignee_login&amp;apos;, &amp;apos;author_login&amp;apos; &amp;apos;sources.php&amp;apos; : &amp;apos;resource&amp;apos; An attacker may leverage these issues to execute arbitrary script code in the browser of an unsuspecting user in the context of the affected site. This may allow the attacker to steal cookie-based authentication credentials and launch other attacks. Sonar 3.4.1 is vulnerable; other versions may also be affected.]]&gt; &lt;/x:TechnicalDescription&gt; &lt;x:AttackScenario&gt;&lt;![CDATA[1. An attacker scans for and locates a site running the affected application. 2. The attacker crafts a URI link that includes malicious script code designed to leverage one of these issues. 3. The attacker uses email or other means to distribute the malicious link and entices an unsuspecting user to follow it. 4. When the user follows the link, the attacker-specified script code runs in their browser in the context of the affected site. A successful exploit may let the attacker steal cookie-based authentication credentials and launch other attacks.]]&gt;&lt;/x:AttackScenario&gt; &lt;x:Exploit&gt;&lt;![CDATA[Attackers can exploit these issues by enticing an unsuspecting victim into following a malicious URI. The following example URIs are available: http://www.example.com/dependencies/index? search="&amp;amp;gt;&amp;amp;lt;script&amp;amp;gt;alert(/devilteam.pl/)&amp;amp;lt;/script&amp;amp;gt; http://www.example.com/dashboard/index/41730? did=4&amp;amp;amp;period=3"&amp;amp;gt;&amp;amp;lt;script&amp;amp;gt;alert(/devilteam.pl/)&amp;amp;lt;/script&amp;am p;gt; http://www.example.com/reviews/index?review_id=&amp;amp;amp;statuses[]=OPEN&amp;amp;amp;statuses[]=REOPENED&amp;amp;amp;severities[]=&amp;amp;amp;projects[]=&amp;amp;amp;amp;author_login=&amp;amp;amp;assignee_login="&amp;amp;gt;&amp;amp;lt;script&amp;amp;gt;alert(/devilteam.pl/)&amp;amp;lt;/script&amp;amp;gt;&amp;amp;amp;false_positives=without&amp;amp;amp;sort=&amp;amp;amp;asc=false&amp;amp;amp;commit=Search http://www.example.com/reviews/index?review_id=&amp;amp;amp;statuses[]=OPEN&amp;amp;amp;statuses[]=REOPENED&amp;amp;amp;severities[]=&amp;amp;amp;projects[]=&amp;amp;amp;amp;author_login="&amp;amp;gt;&amp;amp;lt;script&amp;amp;gt;alert(/devilteam.pl/)&amp;amp;lt;/script&amp;amp;gt;&amp;amp;amp;assignee_login=&amp;amp;amp;false_positives=without&amp;amp;amp;sort=&amp;amp;amp;asc=false&amp;amp;amp;commit=Search http://www.example.com/api/sources?resource=&amp;amp;lt;script&amp;amp;gt;alert(/devilteam.pl/)&amp;amp;lt;/script&amp;amp;gt;&amp;amp;amp;format=txt ]]&gt;&lt;/x:Exploit&gt; &lt;x:MitigatingStrategies&gt; &lt;x:MitigatingStrategy&gt; &lt;x:Title&gt;&lt;![CDATA[Block external access at the network boundary, unless external parties require service.]]&gt;&lt;/x:Title&gt; &lt;x:Description&gt;&lt;![CDATA[If global access isn&amp;apos;t needed, filter access to the affected computer at the network boundary. Restricting access to only trusted computers and networks might greatly reduce the likelihood of a successful exploit.]]&gt;&lt;/x:Description&gt; &lt;/x:MitigatingStrategy&gt; &lt;x:MitigatingStrategy&gt; &lt;x:Title&gt;&lt;![CDATA[Run all software as a nonprivileged user with minimal access rights.]]&gt;&lt;/x:Title&gt; &lt;x:Description&gt;&lt;![CDATA[Attackers may successfully exploit client flaws in the browser through cross-site scripting vulnerabilities. When possible, run client software as regular user accounts with limited access to system resources. This may limit the immediate consequences of client-side vulnerabilities. ]]&gt;&lt;/x:Description&gt; &lt;/x:MitigatingStrategy&gt; &lt;x:MitigatingStrategy&gt; &lt;x:Title&gt;&lt;![CDATA[Do not follow links provided by unknown or untrusted sources.]]&gt;&lt;/x:Title&gt; &lt;x:Description&gt;&lt;![CDATA[Web users should be cautious about following links to websites that are provided by unfamiliar or suspicious sources. Filtering HTML from emails may help remove a possible vector for transmitting malicious links to users. ]]&gt;&lt;/x:Description&gt; &lt;/x:MitigatingStrategy&gt; &lt;x:MitigatingStrategy&gt; &lt;x:Title&gt;&lt;![CDATA[Set web browser security to disable the execution of script code or active content.]]&gt;&lt;/x:Title&gt; &lt;x:Description&gt;&lt;![CDATA[Since exploiting cross-site scripting issues often requires malicious script code to run in browsers, consider disabling script code and active content support within a client browser as a way to prevent a successful exploit. Note that this mitigation tactic might adversely affect legitimate sites that rely on the execution of browser-based script code. ]]&gt;&lt;/x:Description&gt; &lt;/x:MitigatingStrategy&gt; &lt;/x:MitigatingStrategies&gt; &lt;x:Solutions&gt; &lt;x:Workaround&gt;&lt;![CDATA[Workaround ]]&gt;&lt;/x:Workaround&gt; &lt;x:Solution&gt;&lt;![CDATA[Currently, we are not aware of any vendor-supplied patches. If you feel we are in error or are aware of more recent information, please mail us at: vuldb@securityfocus.com.]]&gt;&lt;/x:Solution&gt; &lt;/x:Solutions&gt; &lt;x:Credit&gt;DevilTeam&lt;/x:Credit&gt; &lt;x:ChangeLogs&gt; &lt;x:ChangeLog&gt; &lt;x:Title&gt;&lt;![CDATA[2013.02.15: Initial analysis.]]&gt;&lt;/x:Title&gt; &lt;/x:ChangeLog&gt; &lt;/x:ChangeLogs&gt; &lt;x:References&gt; &lt;x:Reference&gt; &lt;x:Title&gt;&lt;![CDATA[Web Page:Sonar Homepage (SonarSource) SonarSource]]&gt;&lt;/x:Title&gt; &lt;x:URL&gt;&lt;![CDATA[http://www.sonarsource.com/products/software/sonar/]]&gt;&lt;/x:URL&gt; &lt;x:Description&gt;&lt;![CDATA[http://www.sonarsource.com/products/software/sonar/]]&gt;&lt;/x:Description&gt; &lt;/x:Reference&gt; &lt;x:Reference&gt; &lt;x:Title&gt;&lt;![CDATA[Web Page:Sonar v.3.4.1 =&amp;amp;gt; XSS (CWE-79) (DevilTeam) DevilTeam]]&gt;&lt;/x:Title&gt; &lt;x:URL&gt;&lt;![CDATA[http://cxsecurity.org/issue/WLB-2013020088]]&gt;&lt;/x:URL&gt; &lt;x:Description&gt;&lt;![CDATA[http://cxsecurity.org/issue/WLB-2013020088]]&gt;&lt;/x:Description&gt; &lt;/x:Reference&gt; &lt;/x:References&gt; &lt;x:URL&gt;https://alerts.symantec.com/loaddocument.aspx?GUID=cffd18f0-7b75-4c6a-adc0-74f480808fff&lt;/x:URL&gt; &lt;x:OVALDefinitions /&gt; &lt;/x:AlertDocument&gt; &lt;/Alerts&gt; </code></pre> <p>--end of xml---</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload