Table of Contents
0×01Foreword
0×02 training process
0×03CVE-2010-2861
3.1 Semi-automatic writing
0×04 Self-study
4.1 Comparison of different sessions
4.2 Comparison of different accounts
0×05 ChatGPT3 and 4
0×06 Summary
Home Technology peripherals AI ChatGPT writes PoC and gets the vulnerability!

ChatGPT writes PoC and gets the vulnerability!

Apr 07, 2023 pm 02:54 PM
network chatgpt Training model

0×01Foreword

ChatGPT (Chat Generative Pre-trained Transformer) is one of the most anticipated intelligent AI chat robots today. It not only enables basic language communication, but also has many powerful functions, such as article writing, code scripting, translation, and more. So can we use ChatGpt to assist us in completing some work? For example, when a product has security risks and needs vulnerability detection, we need to write the corresponding POC to implement it. Through multiple verifications, we have initially confirmed the feasibility of this experiment. ChatGPT can be trained to write simple PoC, but its control of details is not perfect enough, such as writing regular expressions to match output content and some There are certain errors in the processing of complex logic, and manual intervention and modification are required. In addition, we used comparison methods to verify the accuracy of some of ChatGPT's security conjectures and training models. The following is the implementation effect of combining it with Goby's practical network attack and defense tools for exploitation detection.

ChatGPT writes PoC and gets the vulnerability!

0×02 training process

We use ChatGPT and Goby to write PoC and EXP. There are two methods: semi-automatic writing and fully automatic writing (in the process Use ChatGPT-Plus account).

Semi-automatic writing uses ChatGPT for language format conversion. The code generated after conversion may have detailed problems and needs further troubleshooting and improvement. Finally, the corresponding statements and function content are modified to complete the writing of PoC and EXP.

Fully automatic writing gives the used code templates and vulnerability details to ChatGPT, so that it can automatically generate the PoC corresponding to the template. When giving detailed information, you need to pay attention to the completeness and accuracy of the information. At present, it is possible to automatically write simple PoC. For EXP, further training on ChatGPT's use of Goby's built-in functions is required.

0×03CVE-2010-2861

Adobe ColdFusion is an efficient web application server development environment. Multiple directory traversal vulnerabilities exist in the administrative console of Adobe ColdFusion 9.0.1 and earlier. A remote attacker could read arbitrary files via the locale parameter sent to /CFIDE/administrator/enter.cfm, /CFIDE/administrator/archives/index.cfm, etc.

3.1 Semi-automatic writing

First try to let ChatGPT convert the Python format EXP of the CVE-2010-2861 directory traversal vulnerability into Go language format code. In this way, ChatGPT can be used to replace manual code interpretation and The process of code conversion.

We select the EXP code of the vulnerability in the vulnerability disclosure platform:

ChatGPT writes PoC and gets the vulnerability!

Before using ChatGPT to convert the EXP code of the corresponding vulnerability, first demonstrate the original The execution effect of the Python code is as follows:

ChatGPT writes PoC and gets the vulnerability!

Start converting the format:

ChatGPT writes PoC and gets the vulnerability!

In addition, he also provided the How to use the program. However, ChatGPT's answer may not be exactly the same every time. The previous answer did not explain the specific usage of the function in detail, but the following explanation was given in another answer: (If necessary, you can add "and introduce the specific usage of the function" to the question)

ChatGPT writes PoC and gets the vulnerability!

After debugging the code, I found that it could not be used immediately and failed to successfully read the required file content:

ChatGPT writes PoC and gets the vulnerability!

Then you need to start arranging Wrong, the following is the troubleshooting process:

Check whether the string is empty after regular matching:

ChatGPT writes PoC and gets the vulnerability!

ChatGPT writes PoC and gets the vulnerability!

Check the return Check whether the content of the package is normal and whether there is required content. The returned data packet is normal as shown below:

ChatGPT writes PoC and gets the vulnerability!

It is judged that there is a problem with the regular expression and the corresponding content cannot be matched:

Through investigation, it was found that there was no correct match in the regular expression, so the content of the file could not be retrieved correctly. The following modifications were made. The modified contents are as follows:

ChatGPT writes PoC and gets the vulnerability!

Before modification:

ChatGPT writes PoC and gets the vulnerability!

Final execution result, complete Python-Go conversion:

ChatGPT writes PoC and gets the vulnerability!

We have successfully converted the EXP in Python format to Go language format. Now we try to convert it to PoC and EXP in Goby format.

Since Goby uses a self-developed vulnerability framework based on the Go language, for the convenience of users, there are many built-in functions available for users to use, so you only need to use the above part of the code to complete the PoC and EXP , the following is the general description and details of the EXP modification:

ChatGPT writes PoC and gets the vulnerability!

ChatGPT writes PoC and gets the vulnerability!

##Modify the import content:

ChatGPT writes PoC and gets the vulnerability!

Since the generated EXP requires manual input of parameters when using the command line:

ChatGPT writes PoC and gets the vulnerability!

Then when converting PoC, you need to redefine the constants and use Goby's httpclient.FixUrl.IP and httpclient.FixUrl.Port obtain the test IP and port number, and determine the test file path path:

ChatGPT writes PoC and gets the vulnerability!

Then add conditional judgment statements in the PoC, Determine the characteristics of the vulnerability and return true (there is a vulnerability):

ChatGPT writes PoC and gets the vulnerability!

Finally, delete the redundant output printing code to complete the PoC conversion, such as:

ChatGPT writes PoC and gets the vulnerability!

When converting EXP, you need to redefine the variables, use expResult.HostInfo.IP and expResult.HostInfo.Port in Goby to obtain the test IP and port number, and use ss.Params["filePath"] . (string) Get the EXP parameter input by the user - test file path filePath:

ChatGPT writes PoC and gets the vulnerability!

Then add a conditional judgment statement in the EXP code to determine whether the EXP execution is successful and output EXP execution result, complete EXP conversion:

ChatGPT writes PoC and gets the vulnerability!

3.2 Fully automatic writing

After using ChatGPT combined with manual writing, we further tried to use it to write PoC in Goby format.

First give the template in Goby format:

ChatGPT writes PoC and gets the vulnerability!

Then give the vulnerability number, product, type, Url, vulnerability file, parameters and success conditions Given and describing the relevant field formats, we finally got the following code, which can be compiled by the Goby front-end and can successfully generate a simple PoC:

ChatGPT writes PoC and gets the vulnerability!

The model training is initially completed. Continue to use the second case to verify the completeness of the model:

ChatGPT writes PoC and gets the vulnerability!

It is found that the Name field still has a format error, train again and modify it (if the Name field and other outputs in the verification Correct, then you can skip this error correction step):

ChatGPT writes PoC and gets the vulnerability!

Finally, use the third case to verify the final training results, and the training is successful:

ChatGPT writes PoC and gets the vulnerability!

Put the code into Goby and fill in the missing vulnerability description information (you can continue to train in depth later). The running effect is as follows:

ChatGPT writes PoC and gets the vulnerability!

0×04 Self-study

When we use ChatGPT to help write a fresh 0day vulnerability or other confidential vulnerability detection PoC, will this process lead to program injection or information leakage, etc. What's the problem? That is to say, when the model training is completed and other users ask related questions, will ChatGPT directly output the trained model or data?

In order to verify whether ChatGPT's self-learning conjecture exists, training is conducted through "different sessions" and "different accounts". After the following practice, the conclusion is that ChatGPT does not perform cross-session and cross-account self-learning. The trained models and data are in the hands of OpenAI, and other users will not get the relevant models, so it does not exist yet. There are security risks associated with data leakage of relevant information, but future situations still need to be judged based on the decisions taken by OpenAI.

4.1 Comparison of different sessions

The template used (the diagram is omitted here) and the vulnerability information are given. It can be seen that the Name and Description fields in the PoC do not follow the previous session. to fill in the training mode, so ChatGPT will not learn by itself in different sessions. The training model between each session is independent:

ChatGPT writes PoC and gets the vulnerability!

4.2 Comparison of different accounts

The template (schematic diagram is omitted here) and vulnerability information are also given. It can also be seen that the relevant fields in the PoC are not filled according to the previous training model. From this, it can be known that ChatGPT will not cross Account self-study:

ChatGPT writes PoC and gets the vulnerability!

0×05 ChatGPT3 and 4

ChatGPT4 has been updated and launched, then use ChatGPT4 to perform the same fully automatic writing training and ChatGPT3 training What is the difference between the models that come out? The answer is that ChatGPT4 is more "smart and flexible" than ChatGPT 3, and the model generation is more accurate.

We gave all the information we needed, and after one training (part of the schematic diagram is omitted here), we achieved the correct effect in the picture below:

ChatGPT writes PoC and gets the vulnerability!

In addition, we conducted 10 rounds of training and compared the Name field in the model to determine the PoC writing accuracy of ChatGPT3 and 4. We found that there will be probabilistic errors in both cases, among which the model output accuracy of 3 It is lower than 4, and error correction training is still required under certain circumstances, as shown in the following table:

ChatGPT writes PoC and gets the vulnerability!

0×06 Summary

In general In other words, ChatGPT can indeed help complete part of the work. For daily work such as writing vulnerability PoC, you can use its code conversion capabilities to speed up writing; you can also give detailed information about the vulnerability, use ChatGPT to train an appropriate model, and directly output a A simple vulnerability verification PoC code is more convenient and faster. However, the answer content it provides may not necessarily be directly copied and used, and some manual corrections are needed to improve it. In addition, currently we can use ChatGPT with relative peace of mind. It will not output the training model data of a single user to other users for use (not confusing sessions may be due to concerns about mutual contamination of user data), but in the future, we will need to make decisions based on the OpenAI headquarters. decision-making for further judgment. Therefore, the reasonable use of ChatGPT can help improve a certain degree of work efficiency. If further training and development can be continued in the future, for example, whether it can be used to write standardized and more complex PoC or even EXP with information description specifications, or it can be engineered to complete content in batches. To explore more application scenarios and potential.

Reference

[1] https://gobysec.net/exp

[2] https://www.exploit-db.com/exploits/14641

[3] https://zhuanlan.zhihu.com/p/608738482?utm_source=wechat_session&utm_medium=social&utm_oi=1024775085344735232

[4] Use ChatGPT to generate the encoder and supporting Webshell

  • The article comes from a member of the Goby community: LPuff@白hathui Security Research Institute. Please indicate the source when reprinting.
  • Get the version: https://gobysec.net

The author of this article: GobySec, please indicate the source of reprint from FreeBuf.COM

The above is the detailed content of ChatGPT writes PoC and gets the vulnerability!. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

WLAN expansion module has stopped [fix] WLAN expansion module has stopped [fix] Feb 19, 2024 pm 02:18 PM

If there is a problem with the WLAN expansion module on your Windows computer, it may cause you to be disconnected from the Internet. This situation is often frustrating, but fortunately, this article provides some simple suggestions that can help you solve this problem and get your wireless connection working properly again. Fix WLAN Extensibility Module Has Stopped If the WLAN Extensibility Module has stopped working on your Windows computer, follow these suggestions to fix it: Run the Network and Internet Troubleshooter to disable and re-enable wireless network connections Restart the WLAN Autoconfiguration Service Modify Power Options Modify Advanced Power Settings Reinstall Network Adapter Driver Run Some Network Commands Now, let’s look at it in detail

How to solve win11 DNS server error How to solve win11 DNS server error Jan 10, 2024 pm 09:02 PM

We need to use the correct DNS when connecting to the Internet to access the Internet. In the same way, if we use the wrong dns settings, it will prompt a dns server error. At this time, we can try to solve the problem by selecting to automatically obtain dns in the network settings. Let’s take a look at the specific solutions. How to solve win11 network dns server error. Method 1: Reset DNS 1. First, click Start in the taskbar to enter, find and click the "Settings" icon button. 2. Then click the "Network & Internet" option command in the left column. 3. Then find the "Ethernet" option on the right and click to enter. 4. After that, click "Edit" in the DNS server assignment, and finally set DNS to "Automatic (D

ChatGPT now allows free users to generate images by using DALL-E 3 with a daily limit ChatGPT now allows free users to generate images by using DALL-E 3 with a daily limit Aug 09, 2024 pm 09:37 PM

DALL-E 3 was officially introduced in September of 2023 as a vastly improved model than its predecessor. It is considered one of the best AI image generators to date, capable of creating images with intricate detail. However, at launch, it was exclus

What should I do if the earth is displayed in the lower right corner of Windows 10 when I cannot access the Internet? Various solutions to the problem that the Earth cannot access the Internet in Win10 What should I do if the earth is displayed in the lower right corner of Windows 10 when I cannot access the Internet? Various solutions to the problem that the Earth cannot access the Internet in Win10 Feb 29, 2024 am 09:52 AM

This article will introduce the solution to the problem that the globe symbol is displayed on the Win10 system network but cannot access the Internet. The article will provide detailed steps to help readers solve the problem of Win10 network showing that the earth cannot access the Internet. Method 1: Restart directly. First check whether the network cable is not plugged in properly and whether the broadband is in arrears. The router or optical modem may be stuck. In this case, you need to restart the router or optical modem. If there are no important things being done on the computer, you can restart the computer directly. Most minor problems can be quickly solved by restarting the computer. If it is determined that the broadband is not in arrears and the network is normal, that is another matter. Method 2: 1. Press the [Win] key, or click [Start Menu] in the lower left corner. In the menu item that opens, click the gear icon above the power button. This is [Settings].

Check network connection: lol cannot connect to the server Check network connection: lol cannot connect to the server Feb 19, 2024 pm 12:10 PM

LOL cannot connect to the server, please check the network. In recent years, online games have become a daily entertainment activity for many people. Among them, League of Legends (LOL) is a very popular multiplayer online game, attracting the participation and interest of hundreds of millions of players. However, sometimes when we play LOL, we will encounter the error message "Unable to connect to the server, please check the network", which undoubtedly brings some trouble to players. Next, we will discuss the causes and solutions of this error. First of all, the problem that LOL cannot connect to the server may be

What's going on when the network can't connect to the wifi? What's going on when the network can't connect to the wifi? Apr 03, 2024 pm 12:11 PM

1. Check the wifi password: Make sure the wifi password you entered is correct and pay attention to case sensitivity. 2. Confirm whether the wifi is working properly: Check whether the wifi router is running normally. You can connect other devices to the same router to determine whether the problem lies with the device. 3. Restart the device and router: Sometimes, there is a malfunction or network problem with the device or router, and restarting the device and router may solve the problem. 4. Check the device settings: Make sure the wireless function of the device is turned on and the wifi function is not disabled.

ICLR'24 new ideas without pictures! LaneSegNet: map learning based on lane segmentation awareness ICLR'24 new ideas without pictures! LaneSegNet: map learning based on lane segmentation awareness Jan 19, 2024 am 11:12 AM

Written above & The author’s personal understanding of maps as key information for downstream applications of autonomous driving systems is usually represented by lanes or center lines. However, the existing map learning literature mainly focuses on detecting geometry-based topological relationships of lanes or sensing centerlines. Both methods ignore the inherent relationship between lane lines and center lines, that is, lane lines bind center lines. Although simply predicting two types of lanes in one model are mutually exclusive in the learning objective, this paper proposes lanesegment as a new representation that seamlessly combines geometric and topological information, thus proposing LaneSegNet. This is the first end-to-end mapping network that generates lanesegments to obtain a complete representation of road structure. LaneSegNet has two levels

Windows 11 Folder Sharing Guide: Easily Share Your Files and Data Windows 11 Folder Sharing Guide: Easily Share Your Files and Data Mar 13, 2024 am 11:49 AM

In daily life and work, we often need to share files and folders between different devices. Windows 11 system provides convenient built-in folder sharing functions, allowing us to easily and safely share the content we need with others within the same network while protecting the privacy of personal files. This feature makes file sharing simple and efficient without worrying about leaking private information. Through the folder sharing function of Windows 11 system, we can cooperate, communicate and collaborate more conveniently, improving work efficiency and life convenience. In order to successfully configure a shared folder, we first need to meet the following conditions: All devices (participating in sharing) are connected to the same network. Enable Network Discovery and configure sharing. Know the target device

See all articles