尝试仅剥离此xml页面中列出的域名:https://us-cert.cisa.gov/sites/default/files/publications/AA20-301A.stix.xml
因此,从下面的数据可以看出:
<indicator:Title>Malicious FQDN Indicator</indicator:Title>
<indicator:Type xsi:type="stixVocabs:IndicatorTypeVocab-1.1">Domain Watchlist</indicator:Type>
<indicator:Observable id="CISA:Observable-1a97193f-7206-4bda-aadb-a9876943629b">
<cybox:Object id="CISA:Object-8ee878fd-147c-4438-be3a-ad61470eec80">
<cybox:Properties xsi:type="DomainNameObj:DomainNameObjectType" type="FQDN">
<DomainNameObj:Value condition="Equals">jp-ssl[.]work</DomainNameObj:Value>
</cybox:Properties>
</cybox:Object>
</indicator:Observable>
<indicator:Sightings sightings_count="1">
<indicator:Sighting timestamp="2018-05-01T00:00:00"/>
</indicator:Sightings>
</stix:Indicator>
<stix:Indicator id="CISA:Indicator-90e0da37-5c97-49f1-8fe5-5a4db57513fa" timestamp="2020-10-23T18:29:40.163791+00:00" xsi:type="indicator:IndicatorType">
<indicator:Title>Malicious FQDN Indicator</indicator:Title>
<indicator:Type xsi:type="stixVocabs:IndicatorTypeVocab-1.1">Domain Watchlist</indicator:Type>
<indicator:Observable id="CISA:Observable-40f4bf4d-db81-4560-bbaa-73ce4a9ead99">
<cybox:Object id="CISA:Object-da253d57-6148-435a-ae55-a4a9cd1d4661">
<cybox:Properties xsi:type="DomainNameObj:DomainNameObjectType" type="FQDN">
<DomainNameObj:Value condition="Equals">intemet[.]work</DomainNameObj:Value>
</cybox:Properties>
</cybox:Object>
</indicator:Observable>
<indicator:Sightings sightings_count="1">
<indicator:Sighting timestamp="2018-05-01T00:00:00"/>
</indicator:Sightings>
</stix:Indicator>我想找到一种打印域名的方法: jp-ssl.work,intemet.work
(被混淆的链接,因为它们是恶意的)使用python请求内容
发布于 2020-11-02 09:55:57
试试美人汤。这里的xml_data是您的输入数据
>>> from bs4 import BeautifulSoup
>>> soup = BeautifulSoup(xml_data, 'html.parser')
>>> for tag in soup.find_all('domainnameobj:value'):
... print(tag.text)
jp-ssl[.]work
intemet[.]workhttps://stackoverflow.com/questions/64638774
复制相似问题