How to do it...

We will write an NSE script that exploits a path traversal vulnerability in several TP-link routers. We will take advantage of a few NSE libraries and Lua's string library:

  1. Create the file http-tplink-dir-traversal.nse and fill the required NSE information tags:
   description = [[    Exploits a directory traversal vulnerability existing in several       TP-link wireless routers. Attackers may exploit this       vulnerability to read any of the configuration and password    files remotely and without authentication.    This vulnerability was confirmed in models WR740N, WR740ND and       WR2543ND but there are several models that use the same HTTP       server so I believe they could be vulnerable as well. I     appreciateany help confirming the vulnerability ...

Get Nmap: Network Exploration and Security Auditing Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.