Skip to content
KitploitKITPLOIT
工具漏洞利用博客
Log in
提交
工具漏洞利用博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

订阅源联系隐私© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
perl-XML-Sig — XML::Sig - A Perl toolkit to help sign and verify XML Digital Signatures. | Kitploit
工具/GitHubGitHub/perl-net-saml2/perl-xml-sig
Defensive ToolsIdentity ManagementWeb SecurityCryptographyUtilities & FrameworksAuthentication
GitHubperl-net-saml2/perl-xml-sig

perl-XML-Sig

XML::Sig - A Perl toolkit to help sign and verify XML Digital Signatures.

查看仓库
129小时36分前尚未审核
分享
网站
内容在请求的语言中不可用。显示英文版本。

NAME XML::Sig - XML::Sig - A toolkit to help sign and verify XML Digital Signatures

VERSION version 0.74

SYNOPSIS my $xml = '123'; my $signer = XML::Sig->new({ key => 'path/to/private.key', });

   # create a signature
   my $signed = $signer->sign($xml);
   print "Signed XML: $signed\n";

   # verify a signature
   $signer->verify($signed)
     or die "Signature Invalid.";
   print "Signature valid.\n";

DESCRIPTION This perl module provides two primary capabilities: given an XML string, create and insert digital signatures, or if one is already present in the string verify it -- all in accordance with the W3C standard governing XML signatures.

NAME XML::Sig - A toolkit to help sign and verify XML Digital Signatures.

PREREQUISITES * Digest::SHA

*   XML::LibXML

*   MIME::Base64

*   Crypt::OpenSSL::X509

*   Crypt::OpenSSL::Bignum

*   Crypt::PK::RSA

*   Crypt::OpenSSL::DSA (>= 0.20 Optional - required for DSA signatures)

*   Crypt::PK::ECC

USAGE SUPPORTED ALGORITHMS & TRANSFORMS This module supports the following signature methods:

*   DSA

*   RSA

*   RSA encoded as x509

*   ECDSA

*   ECDSA encoded as x509

*   HMAC

This module supports the following canonicalization methods and
transforms:

*   Enveloped Signature

*   REC-xml-c14n-20010315#

*   REC-xml-c14n-20010315#WithComments

*   REC-xml-c14n11-20080502

*   REC-xml-c14n11-20080502#WithComments

*   xml-exc-c14n#

*   xml-exc-c14n#WithComments

OPTIONS Each of the following options are also accessors on the main XML::Sig object. TODO Not strictly correct rewrite

key The path to a file containing the contents of a private key. This
    option is used only when generating signatures.

cert
    The path to a file containing a PEM-formatted X509 certificate. This
    option is used only when generating signatures with the "x509"
    option. This certificate will be embedded in the signed document,
    and should match the private key used for the signature.

cert_text
    A string containing a PEM-formatted X509 certificate. This option is
    used only when generating signatures with the "x509" option. This
    certificate will be embedded in the signed document, and should
    match the private key used for the signature.

x509
    Takes a true (1) or false (0) value and indicates how you want the
    signature to be encoded. When true, the X509 certificate supplied
    will be encoded in the signature. Otherwise the native encoding
    format for RSA, DSA and ECDSA will be used.

sig_hash
    Passing sig_hash to new allows you to specify the SignatureMethod
    hashing algorithm used when signing the SignedInfo. RSA and ECDSA
    supports the hashes specified sha1, sha224, sha256, sha384 and
    sha512

    DSA supports only sha1 and sha256 (but you really should not sign
    anything with DSA anyway). This is over-ridden by the key's
    signature size which is related to the key size. 1024-bit keys
    require sha1, 2048-bit and 3072-bit keys require sha256.

digest_hash
    Passing digest_hash to new allows you to specify the DigestMethod
    hashing algorithm used when calculating the hash of the XML being
    signed. Supported hashes can be specified sha1, sha224, sha256,
    sha384, sha512, ripemd160

hmac_key
    Base64 encoded hmac_key

key_name
    The name of the key that should be referenced. In the case of xmlsec
    the --keys-file (ex. t/xmlsec-keys.xml) holds keys with a KeyName
    that is referenced by this name.

no_xml_declaration
    Some applications such as Net::SAML2 expect to sign a fragment of
    the full XML document so is this is true (1) it will not include the
    XML Declaration at the beginning of the signed XML. False (0) or
    undefined returns an XML document starting with the XML Declaration.

The following options act similar to "xmlsec --id-attr:ID
<node-namespace-uri>:<name>"

ns  A HashRef to namespaces you want to define to select the correct
    attribute ID on

id_attr
    The xpath string you want to sign your XML message on.

METHODS new(...) Constructor; see OPTIONS above.

sign($xml) When given a string of XML, it will return the same string with a signature generated from the key provided when the XML::Sig object was initialized.

This method will sign all elements in your XML with an ID (case
sensitive) attribute. Each element with an ID attribute will be the
basis for a seperate signature. It will correspond to the URI attribute
in the Reference element that will be contained by the signature. If no
ID attribute can be found on an element, the signature will not be
created.

The elements are signed in reverse order currently assuming (possibly
incorrectly) that the lower element in the tree may need to be signed
inclusive of its Signature because it is a child of the higher element.

Arguments: $xml: string XML string

Returns: string Signed XML

verify($xml) Returns true or false based upon whether the signature is valid or not.

When using XML::Sig exclusively to verify a signature, no key needs to
be specified during initialization given that the public key should be
transmitted with the signature.

XML::Sig checks all signature in the provided xml and will fail should
any signature pointing to an existing ID in the XML fail to verify.

Should there be a Signature included that does not point to an existing
node in the XML it is ignored and other Signaures are checked. If there
are no other Signatures it will return false.

Arguments: $xml: string XML string

Returns: string Signed XML

signer_cert() Following a successful verify with an X509 certificate, returns the signer's certificate as embedded in the XML document for verification against a CA certificate. The certificate is returned as a Crypt::OpenSSL::X509 object.

Arguments: none

Returns: Crypt::OpenSSL::X509: Certificate used to sign the XML

verified_ids() Following a successful verify, returns an ARRAY reference of the ID attribute values that were covered by a verified signature - that is, the Reference URIs whose digests were checked and matched.

Callers that extract a specific element from a verified document (for
example "//saml:Assertion") should confirm that the element's ID appears
in this list. Without that check the element acted on may not be the
element that was signed, which is the basis of the XML Signature
Wrapping (XSW) attack class.

    if ($sig->verify($xml)) {
        my %signed = map { $_ => 1 } @{ $sig->verified_ids };
        die "element was not signed"
            unless $signed{ $element->getAttribute('ID') };
    }

Arguments: none

Returns: ARRAY reference of ID strings. Empty after a failed verify or
before verify is called.

verified_elements() Following a successful verify, returns an ARRAY reference of the XML::LibXML::Element objects that were covered by a verified signature, in the order the signatures were processed.

This is the safer counterpart to verified_ids(): rather than
re-extracting an element from the document and checking its ID, work
directly from the elements returned here and no re-extraction step
exists to get wrong.

    if ($sig->verify($xml)) {
        for my $el (@{ $sig->verified_elements }) {
            my @attrs = $el->findnodes('.//saml:Attribute');
        }
    }
下载工具

最受欢迎

查看全部 →

发现我们社区最常用的工具。

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 终极 OSINT 工具包:调查图谱、置信度评分、别名家族、地图、时间线和报告。49 个模块、400+ 个站点,无需 API 密钥。

    915
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock 一键执行应用(CVE-2026-43499)

    891
  • 3

    wifit3

    derv82/wifit3

    Wifite 但仅限 USB 且跨平台。

    678
  • 4

    jumpserver

    jumpserver/jumpserver

    JumpServer是一个开源的特权访问管理(PAM)平台,为DevOps和IT团队提供通过Web浏览器按需安全访问SSH、RDP、Kubernetes、数据库和RemoteApp端点的能力。

    454
  • 5

    SafeLine

    chaitin/safeline

    自托管WAF和反向代理,可过滤恶意HTTP流量、阻止SQL注入、XSS和机器人攻击,具备速率限制和动态HTML/JS加密功能。

    404
  • 6

    looking-glass

    anonghosty/looking-glass

    CSIRT 平台,可将 Shadowserver 报告导入 MongoDB,并将其重放为交互式地图、分析、发现、公告和高管仪表板。

    388

探索所有工具

浏览我们的工具集合

查看所有工具 →