ED 501: Codacy (15 pts extra)

What You Need

Purpose

Use a free code analysis tool to find vulnerabilities.

Make a Github Account

Make an account at https://github.com

After you create an account, it will offer to "Create a new repository". Close that page.

Forking Vulnserver

Go here:

https://github.com/stephenbradshaw/vulnserver

At the center right, click Fork.

Making a Codacy Account

Start here:

https://www.codacy.com/

At the top right, click "Get started".

Click "Sign up with Github".

Allow all the permissions it requests.

Adding the Vulnserver Repository

At the "My Repositories" page, at the bottom, click "Add your personal repositories, as shown below.

On the next page, click your vulnserver repository.

At the bottom right, click "Let's move on!".

You should see some issues found, as shown below.


Flag ED 501.1: Red-Lined Issue (10 pts extra)

On the left side, click Issues.

Find the issue marked with a red line. The flag is covered by a green rectangle in the image below.


Creating a New Github Repository

In Github, at the main page, on the top left, click the green New button, as shown below.

Name your repository fs

At the bottom of the page, click the green "Create repository" button.

On the next page, at the bottom, click "creating a new file", as shown below.

Name the new file fs.c and paste in the code below, which we used in a previous project:

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main(int argc, char **argv){
        char buf[1024];

	if ( argc != 2) {
		printf("Usage: %s string\n", argv[0]);
		exit(0);
	}

        strcpy(buf, argv[1]);
        printf(buf);
        printf("\n");
        exit(0);
}

At the bottom of the page, click the green "Commit new file" button.

Scanning the New Project

In the Codacy page, at the top left, click "My Repositories".

In the drop-down list, click "My Repositories".

At the top right, click the blue "Add repository" button.

In the next page, in the line showing your fs repository, click the Add.

At the bottom right, click "Let's move on!".


Flag ED 501.2: Issues (5 pts extra)

On the right side, the flag appears, covered by a green rectangle in the image below.



Posted 11-20-19