我想用 perl 打开一个日志文件,使用正则表达式查找我想要的内容,然后仅列出文本下方的路径“# Known exploit = [Fingerprint Match] [PHP Exploit [P0008]]:”
sript 应该只列出这条路径:
/home/avocatma/public_html/raul/mambo/administrator/components/com_mynetwork/141163.php
/home/avocatma/public_html/raul/mambo/administrator/components/com_mynetwork/images/120541.php
/home/avocatma/public_html/raul/mambo/administrator/components/com_mynetwork/language/200724.php
/home/avocatma/public_html/raul/mambo/components/com_mynetwork/228469.php
原始日志文件
# Known exploit = [Fingerprint Match] [PHP Exploit [P0008]]:
'/home/avocatma/public_html/raul/mambo/administrator/components/com_mynetwork/141163.php'
# Known exploit = [Fingerprint Match] [PHP Exploit [P0008]]:
'/home/avocatma/public_html/raul/mambo/administrator/components/com_mynetwork/images/120541.php'
# Regular expression match = [symlink\s*\(]:
'/home/axacert/public_html/administrator/components/com_akeeba/akeeba/engines/archiver/jpa.php'
# Regular expression match = [symlink\s*\(]:
'/home/axacert/public_html/administrator/components/com_akeeba/akeeba/engines/archiver/zip.php'
# Regular expression match = [decode regex: 1]:
'/home/axacert/public_html/administrator/components/com_director/includes/stats.php'
# Known exploit = [Fingerprint Match] [PHP Exploit [P0008]]:
'/home/avocatma/public_html/raul/mambo/administrator/components/com_mynetwork/language/200724.php'
# Known exploit = [Fingerprint Match] [PHP Exploit [P0008]]:
'/home/avocatma/public_html/raul/mambo/components/com_mynetwork/228469.php'
我有基本的 perl 技能,我知道如何使用正则表达式,但我不知道如何告诉 perl 如果字符串 mach 仅列出字符串下方的路径而没有其他内容。
欢迎所有建议。