# SPDX-FileCopyrightText: 2014 Greenbone AG
# Some text descriptions might be excerpted from (a) referenced
# source(s), and are Copyright (C) by the respective right holder(s).
#
# SPDX-License-Identifier: GPL-2.0-only
if(description)
{
script_oid("1.3.6.1.4.1.25623.1.0.105018");
script_version("2026-03-13T05:54:58+0000");
script_tag(name:"cvss_base_vector", value:"AV:N/AC:L/Au:N/C:N/I:N/A:N");
script_tag(name:"cvss_base", value:"0.0");
script_tag(name:"last_modification", value:"2026-03-13 05:54:58 +0000 (Fri, 13 Mar 2026)");
script_tag(name:"creation_date", value:"2014-05-06 14:16:10 +0100 (Tue, 06 May 2014)");
script_name("SSL/TLS: Report Perfect Forward Secrecy (PFS) Cipher Suites");
script_category(ACT_GATHER_INFO);
script_family("SSL and TLS");
script_copyright("Copyright (C) 2014 Greenbone AG");
script_dependencies("gb_ssl_tls_ciphers_gathering.nasl");
script_mandatory_keys("ssl_tls/ciphers/supported_ciphers", "ssl_tls/port");
script_tag(name:"summary", value:"This routine reports all SSL/TLS cipher suites accepted by a
service which are supporting Perfect Forward Secrecy (PFS).");
script_tag(name:"qod_type", value:"remote_app");
exit(0);
}
include("ssl_funcs.inc");
include("host_details.inc");
cipherText = "Cipher suites supporting Perfect Forward Secrecy (PFS) are accepted by this service via the";
if( ! port = tls_ssl_get_port() )
exit( 0 );
if( ! sup_ssl = tls_get_supported_kb_versions( port:port ) )
exit( 0 );
# In theory PFS is supported since SSLv3
if( "SSLv3" >< sup_ssl ) {
sslv3CipherList = tls_get_supported_kb_ciphers( port:port, version:"sslv3" );
if( ! isnull( sslv3CipherList ) ) {
# Sort to not report changes on delta reports if just the order is different
sslv3CipherList = sort( sslv3CipherList );
foreach sslv3Cipher( sslv3CipherList ) {
if( egrep( pattern:'^TLS_(EC)?DHE_', string:sslv3Cipher ) ) {
sslv3Pfs = TRUE;
sslv3tmpReport += sslv3Cipher + '\n';
}
}
if( sslv3Pfs ) {
report += cipherText + ' SSLv3 protocol:\n\n';
report += sslv3tmpReport;
report += '\n';
}
}
}
if( "TLSv1.0" >< sup_ssl ) {
tlsv1_0CipherList = tls_get_supported_kb_ciphers( port:port, version:"tlsv1" );
if( ! isnull( tlsv1_0CipherList ) ) {
# Sort to not report changes on delta reports if just the order is different
tlsv1_0CipherList = sort( tlsv1_0CipherList );
foreach tlsv1_0Cipher( tlsv1_0CipherList ) {
if( egrep( pattern:'^TLS_(EC)?DHE_', string:tlsv1_0Cipher ) ) {
tlsv1_0Pfs = TRUE;
tlsv1_0tmpReport += tlsv1_0Cipher + '\n';
}
}
if( tlsv1_0Pfs ) {
report += cipherText + ' TLSv1.0 protocol:\n\n';
report += tlsv1_0tmpReport;
report += '\n';
}
}
}
if( "TLSv1.1" >< sup_ssl ) {
tlsv1_1CipherList = tls_get_supported_kb_ciphers( port:port, version:"tlsv1_1" );
if( ! isnull( tlsv1_1CipherList ) ) {
# Sort to not report changes on delta reports if just the order is different
tlsv1_1CipherList = sort( tlsv1_1CipherList );
foreach tlsv1_1Cipher( tlsv1_1CipherList ) {
if( egrep( pattern:'^TLS_(EC)?DHE_', string:tlsv1_1Cipher ) ) {
tlsv1_1Pfs = TRUE;
tlsv1_1tmpReport += tlsv1_1Cipher + '\n';
}
}
if( tlsv1_1Pfs ) {
report += cipherText + ' TLSv1.1 protocol:\n\n';
report += tlsv1_1tmpReport;
report += '\n';
}
}
}
if( "TLSv1.2" >< sup_ssl ) {
tlsv1_2CipherList = tls_get_supported_kb_ciphers( port:port, version:"tlsv1_2" );
if( ! isnull( tlsv1_2CipherList ) ) {
# Sort to not report changes on delta reports if just the order is different
tlsv1_2CipherList = sort( tlsv1_2CipherList );
foreach tlsv1_2Cipher( tlsv1_2CipherList ) {
if( egrep( pattern:'^TLS_(EC)?DHE_', string:tlsv1_2Cipher ) ) {
tlsv1_2Pfs = TRUE;
tlsv1_2tmpReport += tlsv1_2Cipher + '\n';
}
}
if( tlsv1_2Pfs ) {
report += cipherText + ' TLSv1.2 protocol:\n\n';
report += tlsv1_2tmpReport;
report += '\n';
}
}
}
# TLS 1.3 separate the cipher suite from the key exchange handshake.
# Every Key Exchange mechanism in TLS 1.3 is of type DHE, but we don't
# currently collect key exchange mechanisms.
if( "TLSv1.3" >< sup_ssl ) {
tlsv1_3CipherList = tls_get_supported_kb_ciphers( port:port, version:"tlsv1_3" );
if( ! isnull( tlsv1_3CipherList ) ) {
# Sort to not report changes on delta reports if just the order is different
tlsv1_3CipherList = sort( tlsv1_3CipherList );
foreach tlsv1_3Cipher( tlsv1_3CipherList ) {
tlsv1_3tmpReport += tlsv1_3Cipher + '\n';
}
report += cipherText + ' TLSv1.3 protocol:\n\n';
report += tlsv1_3tmpReport;
report += '\n';
}
}
if( report ) {
# nb:
# - Store the reference from this one to gb_ssl_tls_ciphers_report.nasl to show a cross-reference within the
# reports
# - We don't want to use get_app_* functions as we're only interested in the cross-reference here
register_host_detail( name:"detected_by", value:"1.3.6.1.4.1.25623.1.0.802067" ); # gb_ssl_tls_ciphers_report.nasl
register_host_detail( name:"detected_at", value:port + "/tcp" );
log_message( port:port, data:report );
exit( 0 );
} else {
set_kb_item( name:"SSL/PFS/no_ciphers", value:TRUE );
set_kb_item( name:"SSL/PFS/no_ciphers/port", value:port );
exit( 0 );
}
Data
Build on a solid foundation with Vulners data
We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data
Api
Power your application with Vulners API
The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access
App
Assess and manage vulnerabilities with Vulners tools
Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation