Skip to content
KitploitKITPLOIT
OutilsExploitsBlog
Log in
Soumettre
OutilsExploitsBlog
Soumettre

Outils de Hacking, PenTest et Cybersécurité pour votre Arsenal de Sécurité !

Kitploit est un répertoire d'outils de hacking, de cybersécurité et de pentesting. Découvrez les dernières mises à jour des projets pour trouver des vulnérabilités, analyser des systèmes, automatiser les tests et renforcer votre sécurité.

FluxContactConfidentialité© 2026 Kitploit

Répertoire d'outils

Catégories

Voir toutes les catégories
Loading categories
perl-XML-Sig — XML::Sig - A Perl toolkit to help sign and verify XML Digital Signatures. | Kitploit
Outils/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.

Voir le dépôt
12il y a 9h 21mPas encore vérifié
Partager
Site web
Contenu non disponible dans la langue demandée. Affichage de la version anglaise.

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');
        }
    }
Télécharger l’outil

Populaires

Voir tout →

Découvrez les outils les plus utilisés par notre communauté.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 La boîte à outils OSINT ultime : graphe d'enquête, notation de confiance, familles d'alias, carte, chronologie et rapports. 49 modules, plus de 400 sites, aucune clé API requise.

    915
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    # Application d'exécution en un clic GhostLock (CVE-2026-43499)

    891
  • 3

    wifit3

    derv82/wifit3

    Wifite mais uniquement USB et multiplateforme.

    678
  • 4

    jumpserver

    jumpserver/jumpserver

    JumpServer est une plateforme open-source de Gestion des Accès Privilégiés (PAM) qui offre aux équipes DevOps et IT un accès sécurisé et à la demande aux terminaux SSH, RDP, Kubernetes, bases de données et RemoteApp via un navigateur web.

    454
  • 5

    SafeLine

    chaitin/safeline

    WAF auto-hébergé et proxy inverse qui filtre le trafic HTTP malveillant, bloque les injections SQL, les XSS et les attaques de robots, avec limitation de débit et chiffrement dynamique HTML/JS.

    404
  • 6

    looking-glass

    anonghosty/looking-glass

    Plateforme CSIRT qui ingère les rapports Shadowserver dans MongoDB et les rejoue sous forme de cartes interactives, d'analyses, de constats, d'avis et de tableaux de bord exécutifs.

    388

Explorer tous les outils

Parcourez notre collection d'outils

Voir tous les outils →