Deploy Invicti Shark for .NET - AWS Elastic Beanstalk
This document shows you how you can run a .NET application in AWS Elastic Beanstalk and then use Invicti Shark (IAST) to run an interactive application security testing (IAST) scan for that application.
Step 1: Create your target in Invicti Enterprise
For this example, assume that the URL for your target is http://eb.acunetixexample.com. Create a target with your URL, turn on Invicti Shark, download the Shark agent file Shark(IASTandSCA).zip, and save this file to use later on.
Step 2: Create your web application using Visual Studio
- From the menu, choose File > New > Project.
- From the Create a new project window, search for "web application."
- Choose ASP.NET Web Application (.NET Framework), then Next.
- Enter a friendly name for your project. For this illustration, use
axexample-dotnet. - Choose Create.

- From the Create a new ASP.NET Web Application window, choose Empty, clear Configure for HTTPS, then choose Create.
- Right-click the
axexample-dotnetproject name. - Choose Add > HTML Page.
- On the Specify Name for Item dialog, enter
indexto the Item name field and choose OK. - Edit your
index.htmlfile to read as follows:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
<h1>Test dotNET Site Example for AWS Elastic Beanstalk</h1>
<br>
Hello World! - Main Page
<br>
<a href="/page1.html">Goto Page 1</a>
</body>
</html>
- Do the same to create a
page1.htmlfile; edit it to read as follows:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
<h1>Test dotNET Site Example for AWS Elastic Beanstalk</h1>
<br>
Hello World! - Page 1
<br>
<a href="/">Goto Main Page</a>
</body>
</html>
- Save your changes to
index.htmlandpage1.htmlfiles. - Right-click the
axexample-dotnetproject name and choose Publish. - From the Publish window, choose Web Server (IIS), then Next.

- Choose Web Deploy Package.
- Choose Next.
- Now, set your Package location to
C:\axexample-dotnet\axexample-dotnet.zip, set your site name toaxexample-dotnet. - Choose Finish. If necessary, create the
C:\axexample-dotnetfolder to hold your files. - Choose Publish.
- Using Windows Explorer, navigate to the
C:\axexample-dotnetfolder and remove the following files:axexample-dotnet.deploy.cmdaxexample-dotnet.deploy-readme.txtaxexample-dotnet.SourceManifest.xml
- At this stage, the
C:\axexample-dotnetfolder should contain the following two files:axexample-dotnet.zipaxexample-dotnet.SetParameters.xml
Step 3: Complete your application source code bundle
This simple web application is defined through the following file structure:
C:\axexample-dotnet\.ebextensions
C:\axexample-dotnet\.ebextensions\acesensor.config
C:\axexample-dotnet\aws-windows-deployment-manifest.json
C:\axexample-dotnet\axexample-dotnet.SetParameters.xml
C:\axexample-dotnet\axexample-dotnet.zip
C:\axexample-dotnet\Shark(IASTandSCA).zip
- Create a folder
C:\axexample-dotnet\.ebextensions - Create your
C:\axexample-dotnet\.ebextensions\acesensor.configfile to read as follows:
files:
"C:\\Program Files\\Amazon\\ElasticBeanstalk\\hooks\\appdeploy\\post\\90create_folder.bat":
content: mkdir C:\shark
"C:\\Program Files\\Amazon\\ElasticBeanstalk\\hooks\\appdeploy\\post\\91extract_shark.bat":
content: powershell Expand-Archive -force C:\staging-previous\Shark(IASTandSCA).zip -DestinationPath C:\shark
"C:\\Program Files\\Amazon\\ElasticBeanstalk\\hooks\\appdeploy\\post\\92inject_shark.bat":
content: "C:\shark\.NET Framework\injector.exe" -m inject -t http://localhost:80/
- Create your
C:\axexample-dotnet\aws-windows-deployment-manifest.jsonfile to read as follows:
{
"manifestVersion": 1,
"deployments": {
"msDeploy": [
{
"name": "axexample-dotnet",
"parameters": {
"appBundle": "axexample-dotnet.zip",
"iisPath": "/"
}
}
]
}
}
- Copy the
Shark(IASTandSCA).zipfile you created earlier intoC:\axexample-dotnet\Shark(IASTandSCA).zip - Build the source code bundle from the command line with:
powershell Compress-Archive -Path C:\axexample-dotnet\* -DestinationPath %USERPROFILE%\Desktop\axexample-dotnet-aws.zip
- Retain your ZIP file for the deployment steps as specified in the following section.
Step 4: Deploy your web application to AWS Elastic Beanstalk
- From your AWS Dashboard, navigate to Elastic Beanstalk > Environments.
- Choose Create a new environment.

- Set your environment tier to Web server environment.
- Click Select.
- In the Elastic Beanstalk > Create environment page:
- Set the Application name field to the name for your web application. For this illustration, use
axexample-dotnet. - From the Platform drop-down, choose .NET on Windows Server.
- Set the Application name field to the name for your web application. For this illustration, use

- Enable Upload your code.
- Select Choose file.
- Choose your
axexample-dotnet.zipsource code bundle for upload.

- Click Create environment.
- AWS Elastic Beanstalk creates your environment; this can take a few minutes. When the process is complete, you're redirected to your environment's dashboard.

- Take note of your environment's new URL created by AWS Elastic Beanstalk:
- You need this to create a CNAME to point to this URL.
- In this example, create a CNAME for
eb.acunetixexample.comto point toaxexampledotnet-env.eba-phzhexiv.us-east-1.elasticbeanstalk.com; here is an example using the Namecheap cPanel interface:

- Once the CNAME record has been added (giving time for DNS records to propagate), you can see the web application you have created by browsing to your URL (in this example
http://eb.acunetixexample.com):

Step 5: Test and scan your web application
- Point your browser to your web application—in this example
http://eb.acunetixexample.comto confirm it's running as intended. - You can run a scan on your target.
Need help?
Invicti Support team is ready to provide you with technical help. Go to Help Center
Was this page useful?