added more code
This commit is contained in:
1
CPE455/alpha/.vscode/configurationCache.log
vendored
Normal file
1
CPE455/alpha/.vscode/configurationCache.log
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"buildTargets":["clean","fixme","fortified","make","vulnerable"],"launchTargets":[],"customConfigurationProvider":{"workspaceBrowse":{"browsePath":[]},"fileIndex":[]}}
|
5
CPE455/alpha/.vscode/dryrun.log
vendored
Normal file
5
CPE455/alpha/.vscode/dryrun.log
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
make --dry-run --keep-going --print-directory
|
||||
make: Entering directory `/home/student/anw0044/CPE455/alpha'
|
||||
make: `fixme' is up to date.
|
||||
make: Leaving directory `/home/student/anw0044/CPE455/alpha'
|
||||
|
3
CPE455/alpha/.vscode/settings.json
vendored
Normal file
3
CPE455/alpha/.vscode/settings.json
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"makefile.extensionOutputFolder": "./.vscode"
|
||||
}
|
327
CPE455/alpha/.vscode/targets.log
vendored
Normal file
327
CPE455/alpha/.vscode/targets.log
vendored
Normal file
@ -0,0 +1,327 @@
|
||||
make all --print-data-base --no-builtin-variables --no-builtin-rules --question
|
||||
# GNU Make 3.82
|
||||
# Built for x86_64-redhat-linux-gnu
|
||||
# Copyright (C) 2010 Free Software Foundation, Inc.
|
||||
# License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
|
||||
# This is free software: you are free to change and redistribute it.
|
||||
# There is NO WARRANTY, to the extent permitted by law.
|
||||
|
||||
# Make data base, printed on Tue Feb 15 13:54:28 2022
|
||||
|
||||
# Variables
|
||||
|
||||
# automatic
|
||||
<D = $(patsubst %/,%,$(dir $<))
|
||||
# automatic
|
||||
?F = $(notdir $?)
|
||||
# environment
|
||||
DESKTOP_SESSION = gnome-classic
|
||||
# default
|
||||
.SHELLFLAGS := -c
|
||||
# environment
|
||||
XDG_SESSION_TYPE = x11
|
||||
# environment
|
||||
VSCODE_LOG_NATIVE = false
|
||||
# environment
|
||||
MODULEPATH = /usr/share/Modules/modulefiles:/etc/modulefiles
|
||||
# automatic
|
||||
?D = $(patsubst %/,%,$(dir $?))
|
||||
# automatic
|
||||
@D = $(patsubst %/,%,$(dir $@))
|
||||
# environment
|
||||
XAUTHORITY = /run/gdm/auth-for-anw0044-pmYcFt/database
|
||||
# environment
|
||||
GDMSESSION = gnome-classic
|
||||
# environment
|
||||
XMODIFIERS = @im=ibus
|
||||
# makefile
|
||||
CURDIR := /home/student/anw0044/CPE455/alpha
|
||||
# makefile
|
||||
SHELL = /bin/sh
|
||||
# environment
|
||||
GDM_LANG = en_US.UTF-8
|
||||
# environment
|
||||
VSCODE_NLS_CONFIG = {"locale":"en-us","availableLanguages":{},"_languagePackSupport":true}
|
||||
# environment
|
||||
_ = /usr/bin/make
|
||||
# makefile (from `Makefile', line 10)
|
||||
CFLAGS = -g
|
||||
# environment
|
||||
ftp_proxy = http://172.21.0.47:3128/
|
||||
# environment
|
||||
LESSOPEN = ||/usr/bin/lesspipe.sh %s
|
||||
# makefile (from `Makefile', line 1)
|
||||
MAKEFILE_LIST := Makefile
|
||||
# automatic
|
||||
@F = $(notdir $@)
|
||||
# environment
|
||||
GIO_LAUNCHED_DESKTOP_FILE = /home/student/anw0044/Desktop/code.desktop
|
||||
# environment
|
||||
USERNAME = anw0044
|
||||
# environment
|
||||
XDG_DATA_DIRS = /home/student/anw0044/.local/share/flatpak/exports/share/:/var/lib/flatpak/exports/share/:/usr/local/share/:/usr/share/
|
||||
# environment
|
||||
DBUS_SESSION_BUS_ADDRESS = unix:abstract=/tmp/dbus-wNNfwQpyb2,guid=c935a732f53252293842ee20620c02bb
|
||||
# environment
|
||||
VSCODE_VERBOSE_LOGGING = true
|
||||
# environment
|
||||
VSCODE_IPC_HOOK_EXTHOST = /run/user/17833/vscode-ipc-32fa229d-a9df-4645-a585-8e3779e8a09b.sock
|
||||
# environment
|
||||
VSCODE_CWD = /home/student/anw0044
|
||||
# environment
|
||||
HISTCONTROL = ignoredups
|
||||
# environment
|
||||
PATH = /opt/Qt/5.12.4/gcc_64/bin/:/opt/Qt/Tools/QtCreator/bin:/opt/Qt/5.12.4/gcc_64/bin/:/opt/Qt/Tools/QtCreator/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin
|
||||
# environment
|
||||
LM_LICENSE_FILE = 1717@lm1
|
||||
# environment
|
||||
SESSION_MANAGER = local/unix:@/tmp/.ICE-unix/26133,unix/unix:/tmp/.ICE-unix/26133
|
||||
# environment
|
||||
XDG_RUNTIME_DIR = /run/user/17833
|
||||
# environment
|
||||
BREAKPAD_DUMP_LOCATION = /home/student/anw0044/.config/Code/exthost Crash Reports
|
||||
# environment
|
||||
XDG_MENU_PREFIX = gnome-
|
||||
# environment
|
||||
VSCODE_LOG_STACK = false
|
||||
# environment
|
||||
VSCODE_CRASH_REPORTER_START_OPTIONS = {"companyName":"Microsoft","productName":"VSCode","submitURL":"appcenter://code?aid=fba07a4d-84bd-4fc8-a125-9640fc8ce171&uid=3e139751-5b03-4856-ae18-f236e55a02bc&iid=3e139751-5b03-4856-ae18-f236e55a02bc&sid=3e139751-5b03-4856-ae18-f236e55a02bc","uploadToServer":true}
|
||||
# default
|
||||
.FEATURES := target-specific order-only second-expansion else-if shortest-stem undefine oneshell archives jobserver check-symlink
|
||||
# environment
|
||||
XDG_SESSION_DESKTOP = gnome-classic
|
||||
# environment
|
||||
SSH_AUTH_SOCK = /run/user/17833/keyring/ssh
|
||||
# environment
|
||||
GIO_LAUNCHED_DESKTOP_FILE_PID = 28008
|
||||
# automatic
|
||||
%F = $(notdir $%)
|
||||
# environment
|
||||
DISPLAY = :0
|
||||
# environment
|
||||
IMSETTINGS_INTEGRATE_DESKTOP = yes
|
||||
# environment
|
||||
PWD = /home/student/anw0044/CPE455/alpha
|
||||
# environment
|
||||
XDG_SEAT = seat0
|
||||
# environment
|
||||
SSH_AGENT_PID = 26258
|
||||
# environment
|
||||
ORIGINAL_XDG_CURRENT_DESKTOP = GNOME-Classic:GNOME
|
||||
# environment
|
||||
VSCODE_AMD_ENTRYPOINT = vs/workbench/services/extensions/node/extensionHostProcess
|
||||
# environment
|
||||
HOME = /home/student/anw0044
|
||||
# environment
|
||||
LD_LIBRARY_PATH = /opt/Qt/5.12.4/gcc_64/lib:/opt/Qt/5.12.4/gcc_64/lib:
|
||||
# environment
|
||||
VSCODE_CODE_CACHE_PATH = /home/student/anw0044/.config/Code/CachedData/f80445acd5a3dadef24aa209168452a3d97cc326
|
||||
# environment
|
||||
LOGNAME = anw0044
|
||||
# environment
|
||||
APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL = 1
|
||||
# environment
|
||||
VSCODE_HANDLES_UNCAUGHT_ERRORS = true
|
||||
# default
|
||||
MAKE_VERSION := 3.82
|
||||
# environment
|
||||
GNOME_DESKTOP_SESSION_ID = this-is-deprecated
|
||||
# automatic
|
||||
^D = $(patsubst %/,%,$(dir $^))
|
||||
# environment
|
||||
HOSTNAME = eb216-03
|
||||
# environment
|
||||
XDG_VTNR = 1
|
||||
# environment
|
||||
MAKELEVEL := 0
|
||||
# default
|
||||
MAKE = $(MAKE_COMMAND)
|
||||
# default
|
||||
MAKECMDGOALS := all
|
||||
# environment
|
||||
QT_IM_MODULE = ibus
|
||||
# environment
|
||||
SHLVL = 3
|
||||
# makefile (from `Makefile', line 9)
|
||||
CC = gcc
|
||||
# environment
|
||||
GNOME_SHELL_SESSION_MODE = classic
|
||||
# environment
|
||||
XDG_SESSION_ID = 797
|
||||
# environment
|
||||
USER = anw0044
|
||||
# makefile
|
||||
.DEFAULT_GOAL := fixme
|
||||
# environment
|
||||
XDG_CURRENT_DESKTOP = GNOME-Classic:GNOME
|
||||
# automatic
|
||||
%D = $(patsubst %/,%,$(dir $%))
|
||||
# environment
|
||||
define BASH_FUNC_module()
|
||||
() { eval `/usr/bin/modulecmd bash $*`
|
||||
}
|
||||
endef
|
||||
# default
|
||||
MAKE_COMMAND := make
|
||||
# default
|
||||
.VARIABLES :=
|
||||
# environment
|
||||
IMSETTINGS_MODULE = none
|
||||
# automatic
|
||||
*F = $(notdir $*)
|
||||
# environment
|
||||
VSCODE_IPC_HOOK = /run/user/17833/vscode-cca9002f-1.64.2-main.sock
|
||||
# makefile
|
||||
MAKEFLAGS = Rrqp
|
||||
# environment
|
||||
MFLAGS = -Rrqp
|
||||
# automatic
|
||||
*D = $(patsubst %/,%,$(dir $*))
|
||||
# environment
|
||||
MAIL = /var/spool/mail/anw0044
|
||||
# environment
|
||||
LOADEDMODULES =
|
||||
# automatic
|
||||
+D = $(patsubst %/,%,$(dir $+))
|
||||
# environment
|
||||
GDK_BACKEND = x11
|
||||
# environment
|
||||
MODULESHOME = /usr/share/Modules
|
||||
# automatic
|
||||
+F = $(notdir $+)
|
||||
# environment
|
||||
NO_AT_BRIDGE = 1
|
||||
# environment
|
||||
VSCODE_PIPE_LOGGING = true
|
||||
# default
|
||||
MAKEFILES :=
|
||||
# automatic
|
||||
<F = $(notdir $<)
|
||||
# environment
|
||||
https_proxy = https://172.21.0.47:3128/
|
||||
# environment
|
||||
ELECTRON_RUN_AS_NODE = 1
|
||||
# environment
|
||||
LC_ALL = C
|
||||
# automatic
|
||||
^F = $(notdir $^)
|
||||
# default
|
||||
SUFFIXES :=
|
||||
# environment
|
||||
HISTSIZE = 1000
|
||||
# environment
|
||||
CHROME_DESKTOP = code-url-handler.desktop
|
||||
# environment
|
||||
WINDOWPATH = 1:1
|
||||
# default
|
||||
.INCLUDE_DIRS = /usr/include /usr/local/include /usr/include
|
||||
# default
|
||||
.RECIPEPREFIX :=
|
||||
# environment
|
||||
http_proxy = http://172.21.0.47:3128/
|
||||
# environment
|
||||
LANG = C
|
||||
# environment
|
||||
TERM = dumb
|
||||
# environment
|
||||
VSCODE_PID = 28008
|
||||
# variable set hash-table stats:
|
||||
# Load=106/1024=10%, Rehash=0, Collisions=13/128=10%
|
||||
|
||||
# Pattern-specific Variable Values
|
||||
|
||||
# No pattern-specific variable values.
|
||||
|
||||
# Directories
|
||||
|
||||
# . (device 40, inode 196412580): 8 files, no impossibilities.
|
||||
|
||||
# 8 files, no impossibilities in 1 directories.
|
||||
|
||||
# Implicit Rules
|
||||
|
||||
# No implicit rules.
|
||||
|
||||
# Files
|
||||
|
||||
# Not a target:
|
||||
all:
|
||||
# Command line target.
|
||||
# Implicit rule search has been done.
|
||||
# File does not exist.
|
||||
# File has not been updated.
|
||||
|
||||
# Not a target:
|
||||
fixme.c:
|
||||
# Implicit rule search has not been done.
|
||||
# Modification time never checked.
|
||||
# File has not been updated.
|
||||
|
||||
# Not a target:
|
||||
.SUFFIXES:
|
||||
# Implicit rule search has not been done.
|
||||
# Modification time never checked.
|
||||
# File has not been updated.
|
||||
|
||||
# Not a target:
|
||||
Makefile:
|
||||
# Implicit rule search has been done.
|
||||
# Last modified 2022-02-15 10:22:48.042964896
|
||||
# File has been updated.
|
||||
# Successfully updated.
|
||||
|
||||
# Not a target:
|
||||
.DEFAULT:
|
||||
# Implicit rule search has not been done.
|
||||
# Modification time never checked.
|
||||
# File has not been updated.
|
||||
|
||||
vulnerable: fixme.c
|
||||
# Implicit rule search has not been done.
|
||||
# Modification time never checked.
|
||||
# File has not been updated.
|
||||
# recipe to execute (from `Makefile', line 16):
|
||||
$(CC) $(CFLAGS) fixme.c -o vulnerable
|
||||
|
||||
clean:
|
||||
# Implicit rule search has not been done.
|
||||
# Modification time never checked.
|
||||
# File has not been updated.
|
||||
# recipe to execute (from `Makefile', line 22):
|
||||
rm vulnerable fortified fixme
|
||||
|
||||
fortified: fixme.c
|
||||
|
||||
make: *** No rule to make target `all'. Stop.
|
||||
|
||||
# Implicit rule search has not been done.
|
||||
# Modification time never checked.
|
||||
# File has not been updated.
|
||||
# recipe to execute (from `Makefile', line 19):
|
||||
$(CC) $(CFLAGS) -D_FORTIFY_SOURCE=1 -O1 fixme.c -o fortified
|
||||
|
||||
fixme: fixme.c
|
||||
# Implicit rule search has not been done.
|
||||
# Modification time never checked.
|
||||
# File has not been updated.
|
||||
# recipe to execute (from `Makefile', line 13):
|
||||
$(CC) fixme.c -o fixme
|
||||
|
||||
# files hash-table stats:
|
||||
# Load=9/1024=1%, Rehash=0, Collisions=0/22=0%
|
||||
# VPATH Search Paths
|
||||
|
||||
# No `vpath' search paths.
|
||||
|
||||
# No general (`VPATH' variable) search path.
|
||||
|
||||
# # of strings in strcache: 0 / lookups = 28 / hits = 28
|
||||
# # of strcache buffers: 1 (* 8176 B/buffer = 8176 B)
|
||||
# strcache used: total = 0 (118) / max = 0 / min = 8176 / avg = 0
|
||||
# strcache free: total = 0 (8058) / max = 0 / min = 8176 / avg = 0
|
||||
|
||||
# strcache hash-table stats:
|
||||
# Load=14/8192=0%, Rehash=0, Collisions=1/28=4%
|
||||
# Finished Make data base on Tue Feb 15 13:54:28 2022
|
||||
|
||||
|
22
CPE455/alpha/Makefile
Normal file
22
CPE455/alpha/Makefile
Normal file
@ -0,0 +1,22 @@
|
||||
#
|
||||
# alpha makefile
|
||||
#
|
||||
# type 'make fixme' to build the vulnerable version of the program without GDB support
|
||||
# type 'make vulnerable' to build the vulnerable version of the program
|
||||
# type 'make fortified' to build the fortified version of the program
|
||||
#
|
||||
|
||||
CC = gcc
|
||||
CFLAGS = -g
|
||||
|
||||
fixme: fixme.c
|
||||
$(CC) fixme.c -o fixme
|
||||
|
||||
vulnerable: fixme.c
|
||||
$(CC) $(CFLAGS) fixme.c -o vulnerable
|
||||
|
||||
fortified: fixme.c
|
||||
$(CC) $(CFLAGS) -D_FORTIFY_SOURCE=1 -O1 fixme.c -o fortified
|
||||
|
||||
clean:
|
||||
rm vulnerable fortified fixme
|
BIN
CPE455/alpha/fixme
Executable file
BIN
CPE455/alpha/fixme
Executable file
Binary file not shown.
16
CPE455/alpha/fixme.c
Normal file
16
CPE455/alpha/fixme.c
Normal file
@ -0,0 +1,16 @@
|
||||
/*
|
||||
* fixme.c
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
int main(int argc, char* argv[ ])
|
||||
{
|
||||
char buffer[5];
|
||||
|
||||
strcpy(buffer, argv[1]);
|
||||
puts(buffer);
|
||||
|
||||
return 0;
|
||||
}
|
BIN
CPE455/alpha/fortified
Executable file
BIN
CPE455/alpha/fortified
Executable file
Binary file not shown.
BIN
CPE455/alpha/vulnerable
Executable file
BIN
CPE455/alpha/vulnerable
Executable file
Binary file not shown.
Reference in New Issue
Block a user