On your Windows system, in a Web browser, go to https://sourceforge.net/projects/mingw/files/
Click the big green "Download Latest Version" button, as shown below.
In your Downloads folder, double-click the mingw-get-setup.exe file.
Click the Install button, as shown below.
On the "Step 1" page, click the Continue button.
On the "Step 2" page, wait for files to download and then click the Continue button.
The MinGW Installation Manager opens.
Check all the boxes, as shown below.
Then click Installation, "Apply Changes".
In the "Okay to proceed?" box, click the Apply button.
Wait for software to install.
When it's done, you'll see a message saying "All changes were applied successfully".
Click Close.
Close the MinGW Installation Manager.
Execute this command, as shown below.
setx path "%PATH%;C:\MinGW\bin"
Close the Command Prompt window and open a new one.
Execute this command, as shown below.
gcc
You get a "fatal error", showing that
the gcc program was found (although
there was no code to compile),
as shown below.
Click the green Code button, and click "Download ZIP, as shown below.
In your Downloads folder, right-click the vulnserverSC-master.zip file and click "Extract All..., Extract.
A window opens showing the vulnserverSC-master folder.
Double-click the vulnserverSC-master folder.
You should see a folder containing two C source files, along with some other files, as shown below.
cd %USERPROFILE%
mkdir vs
cd vs
copy ..\Downloads\vulnserverSC-master\vulnserverSC-master\*.c .
dir
You see a folder containing the C source files,
as shown below.
gcc -c essfunc.c
gcc -shared -o essfunc.dll -Wl,--out-implib=libessfunc.a -Wl,--image-base=0x62500000 essfunc.o
gcc vulnserver.c -o vulnserver.exe -lws2_32 ./libessfunc.a
dir
vulnserver
An executable file "vulnserver.exe" is created, and when it
runs, it begins waiting for client connections,
as shown below.
Click "Windows Defender Firewall".
On the left side, click "Turn Windows Defender Firewall on or off".
Click both "Turn off Windows Defender Firewall (not recommended)" buttons.
Click OK.
https://console.cloud.google.comAt the top left, click the three-bar icon.
Point to "Compute Engine" and click "VM instances", as shown below.
On the "VM instances" page, click the name of your Windows server, as shown below.Note your External IP address, outlined in yellow in the image below. You'll need it later.
On the next page, in the "Network interfaces" section, click your Network name, which is probably "default", as shown below. On the "VPC network details" page, on the left side, click Firewall, as shown below. On the "Firewall policies" page, at the top, click "CREATE FIREWALL RULE" and enter these values:
Windows
On your Windows machine, install Nmap from https://nmap.org/downloadThen execute this command, replacing the IP address with the external IP of your cloud Windows server:
ncat 34.72.162.255 9999
You should see a welcome message, as shown below.
Linux or MacOS
On your Linux or MacOS machine, execute this command, replacing the IP address with the external IP of your cloud Windows server:
nc 34.72.162.255 9999
Enter these commands:
HELP
EXIT
Flag SC 105.1: Original Server Test (15 pts)
In a Web browser, open this page:https://samlols.samsclass.info/SC/SC105.htmEnter the IP address of your cloud Windows server in the form for flag SC 105.1, as shown below, and submit the form.If your code is correct, the flag will appear.
Then execute this command:
notepad vulnserver.c
Change the welcome message,
as shown in the highlighted line
in the image below. Note that you
must also change the length
parameter after the text.
Save the file. Close Notepad.
Execute these commands to rebuild and start the app:
gcc vulnserver.c -o vulnserver.exe -lws2_32 ./libessfunc.a
vulnserver
Flag SC 105.2: Modified Server Test (10 pts)
In a Web browser, open this page:https://samlols.samsclass.info/SC/SC105.htmEnter the IP address of your cloud Windows server in the form for flag SC 105.2, as shown below, and submit the form.If your code is correct, the flag will appear.
Posted 3-21-24