Exemplo n.º 1
0
 public static API_WebGoat start(this API_WebGoat webGoat)
 {
     if (webGoat.installOk())
     {
         if (webGoat.serverOnWebGoatPort())
         {
             "[API_WebGoat] Aborting start since there is already a web server on the expected location".error();
         }
         else
         {
             var startCommand = webGoat.startWebGoatCommand();
             "Starting webgoat with the command: {0}".info(startCommand);
             webGoat.WebGoatProcess = Processes.startProcess(startCommand);
             webGoat.sleep(4000);
             if (webGoat.serverOnWebGoatPort())
             {
                 "[API_WebGoat] Web server started ok".info();
             }
             else
             {
                 "[API_WebGoat After 5 secs the web server was still not available".error();
             }
         }
     }
     return(webGoat);
 }
Exemplo n.º 2
0
 public static bool installOk(this API_WebGoat webGoat)
 {
     if (webGoat.Dir_LocalInstallation.dirExists().isFalse())
     {
         return(false);
     }
     if (webGoat.startWebGoatCommand().fileExists().isFalse())
     {
         return(false);
     }
     return(true);
 }
Exemplo n.º 3
0
        public static API_WebGoat openMainPage(this API_WebGoat webGoat)
        {
            webGoat.ie.openWithBasicAuthentication(webGoat.url_HomePage(), "guest", "guest");

            /*var pageTitle = webGoat.ie.title();
             * if (pageTitle == "How to work with WebGoat")
             *      "[API_WebGoat] Found expected title, all seems to be ok".info();
             * else
             *      "API_WebGoat: Could not find expected title, current title is: '{0}'".error(pageTitle);
             */
            return(webGoat);
        }
Exemplo n.º 4
0
        public static API_WebGoat download(this API_WebGoat webGoat)
        {
            webGoat.ie.open("http://www.owasp.org/index.php/Category:OWASP_WebGoat_Project");
            webGoat.ie.link("WebGoat Google code downloads")
            .flash()
            .click();
            webGoat.ie.link("WebGoat-OWASP_Standard-5.3_RC1.7z ")
            .flash()
            .click();
            //webGoat.ie.silent(false);				// so that we get the 'save as' pop-up
            webGoat.ie.link("WebGoat-OWASP_Standard-5.3_RC1.7z")
            .flash()
            .click();

            return(webGoat);
        }