Formats the back-end operating system fingerprint value and return its values formatted as a human readable string. Example of info (kb.headersFp) dictionary: { 'distrib': set(['Ubuntu']), 'type': set(['Linux']), 'technology': set(['PH
(target, info)
| 286 | |
| 287 | @staticmethod |
| 288 | def getOs(target, info): |
| 289 | """ |
| 290 | Formats the back-end operating system fingerprint value |
| 291 | and return its values formatted as a human readable string. |
| 292 | |
| 293 | Example of info (kb.headersFp) dictionary: |
| 294 | |
| 295 | { |
| 296 | 'distrib': set(['Ubuntu']), |
| 297 | 'type': set(['Linux']), |
| 298 | 'technology': set(['PHP 5.2.6', 'Apache 2.2.9']), |
| 299 | 'release': set(['8.10']) |
| 300 | } |
| 301 | |
| 302 | Example of info (kb.bannerFp) dictionary: |
| 303 | |
| 304 | { |
| 305 | 'sp': set(['Service Pack 4']), |
| 306 | 'dbmsVersion': '8.00.194', |
| 307 | 'dbmsServicePack': '0', |
| 308 | 'distrib': set(['2000']), |
| 309 | 'dbmsRelease': '2000', |
| 310 | 'type': set(['Windows']) |
| 311 | } |
| 312 | |
| 313 | @return: detected back-end operating system based upon fingerprint |
| 314 | techniques. |
| 315 | @rtype: C{str} |
| 316 | """ |
| 317 | |
| 318 | infoStr = "" |
| 319 | infoApi = {} |
| 320 | |
| 321 | if info and "type" in info: |
| 322 | if conf.api: |
| 323 | infoApi["%s operating system" % target] = info |
| 324 | else: |
| 325 | infoStr += "%s operating system: %s" % (target, Format.humanize(info["type"])) |
| 326 | |
| 327 | if "distrib" in info: |
| 328 | infoStr += " %s" % Format.humanize(info["distrib"]) |
| 329 | |
| 330 | if "release" in info: |
| 331 | infoStr += " %s" % Format.humanize(info["release"]) |
| 332 | |
| 333 | if "sp" in info: |
| 334 | infoStr += " %s" % Format.humanize(info["sp"]) |
| 335 | |
| 336 | if "codename" in info: |
| 337 | infoStr += " (%s)" % Format.humanize(info["codename"]) |
| 338 | |
| 339 | if "technology" in info: |
| 340 | if conf.api: |
| 341 | infoApi["web application technology"] = Format.humanize(info["technology"], ", ") |
| 342 | else: |
| 343 | infoStr += "\nweb application technology: %s" % Format.humanize(info["technology"], ", ") |
| 344 | |
| 345 | if conf.api: |
no test coverage detected