🤬
  • ■ ■ ■ ■ ■ ■
    README.md
    skipped 7 lines
    8 8  OpenAi api
    9 9   
    10 10  ## Understanding the code
     11 + 
     12 +Profiles:
     13 + 
     14 +| Parameter | Return data | Description | Nmap Command |
     15 +| :-------- | :------- | :-------------------------------- | :---------|
     16 +| `p1` | `json` | Effective Scan | `-Pn -sV -T4 -O -F`|
     17 +| `p2` | `json` | Simple Scan | `-Pn -T4 -A -v`|
     18 +| `p3` | `json` | Low Power Scan | `-Pn -sS -sU -T4 -A -v`|
     19 +| `p4` | `json` | Partial Intense Scan | `-Pn -p- -T4 -A -v`|
     20 +| `p5` | `json` | Complete Intense Scan | `-Pn -sS -sU -T4 -A -PE -PP -PS80,443 -PA3389 -PU40125 -PY -g 53 --script=vuln`|
     21 + 
    11 22  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 23   
     24 +The entire structure of request that has to be sent to the openai API is designed in the completion section of the Program.
    13 25  ```python
    14 26  def profile(ip):
    15 27   nm.scan('{}'.format(ip), arguments='-Pn -sS -sU -T4 -A -PE -PP -PS80,443 -PA3389 -PU40125 -PY -g 53 --script=vuln')
    skipped 13 lines
    29 41   return response
    30 42  ```
    31 43   
     44 + 
     45 + 
Please wait...
Page is in error, reload to recover