🤬
Revision indexing in progress... (symbol navigation in revisions will be accurate after indexed)
  • ■ ■ ■ ■ ■ ■
    README.md
    skipped 1 lines
    2 2   
    3 3  This is a Proof Of Concept application that demostrates how AI can be used to generate accurate results for vulnerability analysis and also allows further utilization of the already super useful ChatGPT.
    4 4   
     5 +## Requirements
     6 +Python 3.10
     7 +All the packages mentioned in the requirements.txt file
     8 +OpenAi api
     9 + 
     10 +## Understanding the code
     11 +The profile is the type of scan that will be executed by the nmap subprocess. The Ip or target will be provided via argparse. At first the custom nmap scan is run which has all the curcial arguments for the scan to continue. nextly the scan data is extracted from the huge pile of data which has been driven by nmap. the "scan" object has a list of sub data under "tcp" each labled according to the ports opened. once the data is extracted the data is sent to openai API davenci model via a prompt. the prompt specifically asks for an JSON output and the data also to be used in a certain manner.
     12 + 
     13 +```python
     14 +def profile(ip):
     15 + nm.scan('{}'.format(ip), arguments='-Pn -sS -sU -T4 -A -PE -PP -PS80,443 -PA3389 -PU40125 -PY -g 53 --script=vuln')
     16 + json_data = nm.analyse_nmap_xml_scan()
     17 + analize = json_data["scan"]
     18 + # Prompt about what the quary is all about
     19 + prompt = "do a vulnerability analysis of {} and return a vulnerabilty report in json".format(analize)
     20 + # A structure for the request
     21 + completion = openai.Completion.create(
     22 + engine=model_engine,
     23 + prompt=prompt,
     24 + max_tokens=1024,
     25 + n=1,
     26 + stop=None,
     27 + )
     28 + response = completion.choices[0].text
     29 + return response
     30 +```
    5 31   
Please wait...
Page is in error, reload to recover