traversal.es.tst 465 B

123456789101112131415161718192021222324
  1. /*
  2. Test directory traversal
  3. */
  4. const HTTP = tget('TM_HTTP') || "127.0.0.1:8080"
  5. http = new Http
  6. http.get(HTTP + "/../auth.conf")
  7. ttrue(http.status == 400)
  8. http.close()
  9. http.get(HTTP + "/../../index.html")
  10. ttrue(http.status == 400)
  11. http.close()
  12. /* Test windows '\' delimiter */
  13. http.get(HTTP + "/..%5Cauth.conf")
  14. ttrue(http.status == 400)
  15. http.close()
  16. http.get(HTTP + "/../../../../../.x/.x/.x/.x/.x/.x/etc/passwd")
  17. ttrue(http.status == 400)
  18. http.close()