MyKings / python-masscan

python-masscan is a python library which helps in using masscan port scanner.
https://pypi.org/project/python-masscan/
GNU General Public License v3.0
281 stars 60 forks source link

Include endtime in results about each port #13

Closed goncalor closed 5 years ago

goncalor commented 5 years ago

I think it can be valueable to have in the results the time each port was found. This information is already included in the XML output of masscan. This simple patch adds that information to scan_results.

Before:

"10.0.0.1": {
  "tcp": {
    "80": {
      "state": "open",
      "reason": "syn-ack",
      "reason_ttl": "63",
      "services": []
    }
  },
  "icmp": {
    "0": {
      "state": "open",
      "reason": "none",
      "reason_ttl": "63",
      "services": []
    }
  }
}

After:

"10.0.0.1": {
  "tcp": {
    "80": {
      "state": "open",
      "reason": "syn-ack",
      "reason_ttl": "63",
      "endtime": "1555237371",
      "services": []
    }
  },
  "icmp": {
    "0": {
      "state": "open",
      "reason": "none",
      "reason_ttl": "63",
      "endtime": "1555237377",
      "services": []
    }
  }
}