Trustwave's 2024 Retail Report Series Highlights Alarming E-Commerce Threats and Growing Fraud Against Retailers. Learn More

Trustwave's 2024 Retail Report Series Highlights Alarming E-Commerce Threats and Growing Fraud Against Retailers. Learn More

Services
Managed Detection & Response

Eliminate active threats with 24/7 threat detection, investigation, and response.

Co-Managed SOC (SIEM)

Maximize your SIEM investment, stop alert fatigue, and enhance your team with hybrid security operations support.

Advisory & Diagnostics

Advance your cybersecurity program and get expert guidance where you need it most.

Penetration Testing

Test your physical locations and IT infrastructure to shore up weaknesses before exploitation.

Database Security

Prevent unauthorized access and exceed compliance requirements.

Email Security

Stop email threats others miss and secure your organization against the #1 ransomware attack vector.

Digital Forensics & Incident Response

Prepare for the inevitable with 24/7 global breach response in-region and available on-site.

Firewall & Technology Management

Mitigate risk of a cyberattack with 24/7 incident and health monitoring and the latest threat intelligence.

Solutions
BY TOPIC
Microsoft Security
Unlock the full power of Microsoft Security
Offensive Security
Solutions to maximize your security ROI
Rapidly Secure New Environments
Security for rapid response situations
Securing the Cloud
Safely navigate and stay protected
Securing the IoT Landscape
Test, monitor and secure network objects
Why Trustwave
About Us
Awards and Accolades
Trustwave SpiderLabs Team
Trustwave Fusion Security Operations Platform
Trustwave Security Colony
Partners
Technology Alliance Partners
Key alliances who align and support our ecosystem of security offerings
Trustwave PartnerOne Program
Join forces with Trustwave to protect against the most advance cybersecurity threats

Network Map NMAP Meets ChatGPT

We’ve now seen a number of different use cases for ChatGPT from marketing, sales, software development and others including from the security field. This platform continues to dominate most of the headlines and impress based on how it’s able to handle questions and topics from various backgrounds.

Many security consultants have started using ChatGPT to assist them in identifying security vulnerabilities in code, write scripts, bug bounties and other creative ways to facilitate the use of this A.I. platform. It’s always a plus to have different views and assistance during a project, and ChatGPT has shown that in this context on how its capabilities can be a valuable tool.

Asking it Security-Related Questions

After seeing numerous examples in blog posts on various ways ChatGPT can be used, I tried to query its knowledge on vulnerabilities, specifically missing CVEs. The idea behind this is to assist security consultants in extracting common vulnerabilities associated with varoius software. 

I used the ‘OpenAI’ library in python to achieve this. Using a simple script found online, I modified it to add a parameter ‘-a’ to ask questions.

19617_image002

Figure 1: Added parameter ‘a’ to ask questions

This is interesting as it has some knowledge on commonly exploited vulnerabilities, which I thought it would, but also CVE ID related to the version. It was interesting to note that ChatGPT knowledge bank consists of CVE ID without being connected to the internet, which means at some point it was potentially introduced to the Common Vulnerability Database by its creators.

Automating NMAP Results and Asking CHATGPT

This then gave me an idea to extract information out of NMAP and feed it to ChatGPT in order to get more information on missing CVEs and potentially more information surrounding the outdated version.

19618_image004

Figure 2: Script running through the NMAP xml file

The image above simply shows the script running through the NMAP xml file, extracting information such as port number, state, server, software, and version. The information fed to ChatGPT is the port number, software, and version, and getting it to list the missing patches and security vulnerabilities related to it. The syntax prompt used is as follows:

Based on port NUMBER and the software SOFTWARE + VERSION running, what are the missing patches and vulnerabilities that can be exploited?

Figure 3: ChatGPT syntax prompt

However, looking at some of the CVE IDs, not all of them were related to OpenSSH. For example, CVE-2019-6103 is still in reserve and has no vulnerability report associated with it.  While it has some information on CVE ID related to the software, not all of it was accurate, as seen above where some of the CVE IDs were not related to the specific version and this in turn provides a false positive during a security assessment.  

Getting ChatGPT to Write Scripts Based on the Results

The following step was to get ChatGPT to write a script in an attempt to create a PoC to enumerate the version (if possible) and verify if the version is vulnerable to specific CVE.

However, the outcome was not what I had in mind. While some of the scripts did make sense; the others probably needed a more in-depth prompt to be provided to ChatGPT to get the right scripts out of it. The following is an example of an inaccurate script:

19619_image006

Figure 4: Example of inaccurate script

Although, when it gets the right CVE and writes an accurate script:

19620_image008

Figure 5: Example of accurate script written with correct CVE

Conclusion:

ChatGPT is still growing. While some inaccurate information was shown, the ChatGPT platform is still growing, and its knowledge bank is evolving. This is still a great assistance to security consultants to create tools/scripts during an engagement where time is limited or learning about a vulnerability by using ChatGPT to create a script in order to understand how a vulnerability can be found/exploited and also learn about services/protocols which is new to a consultant during an engagement.

About the Author

Dhervesh Singh is Senior Security Consultant for Trustwave’s EMEA team with over 10 years of working in the information security field and has led IT Health Checks (ITHC) for the local government in the UK.

ABOUT TRUSTWAVE

Trustwave is a globally recognized cybersecurity leader that reduces cyber risk and fortifies organizations against disruptive and damaging cyber threats. Our comprehensive offensive and defensive cybersecurity portfolio detects what others cannot, responds with greater speed and effectiveness, optimizes client investment, and improves security resilience. Learn more about us.

Latest Intelligence

Discover how our specialists can tailor a security program to fit the needs of
your organization.

Request a Demo