Skip to content

reesep/csci476-code

 
 

Repository files navigation

Code & Examples Computer Security @ MSU

Includes code examples from class.

Many of our examples are adapted from SEED Labs [1, 2].

Tips & Tricks

Updating the Shell

On the SEED VM, /bin/sh is actually an alias for /bin/dash.

# sh is actually an alias
$ which sh
/bin/sh
$ ls -l /bin/sh
lrwxrwxrwx 1 root root 8 Jan 23 03:32 /bin/sh -> /bin/dash

/bin/dash has countermeasures against some of our exercises. So, at times we may need to use another shell, such as /bin/zsh. Here are examples of how to set/reset the shell symlinks:

$ sudo ln -sf /bin/zsh /bin/sh   # make sh symlink to zsh
$ sudo ln -sf /bin/dash /bin/sh  # sh is symlink to dash (default)

Updating the Hostname

Sometimes for clarity it is nice to change the hostname. For example, I will often set the hostname to a descriptive name (e.g., attacker, user, server) in demos to clarify the role of a particular VM. Here is a simple way to achieve this:

sudo hostnamectl set-hostname NEW_NAME_YOU_WANT

Configure gdb to use Intel / AT&T syntax for Dissasembled Code

$ show disassembly-flavor

I think the Intel syntax is cleaner, but use whichever syntax is best for you:

# make sure default assembly syntax is att syntax. ONLY NEED TO RUN THIS ONCE!
$ echo 'set disassembly-flavor intel' >> ~/.gdbinit
# or
$ echo 'set disassembly-flavor att' >> ~/.gdbinit

Ref: https://visualgdb.com/gdbreference/commands/set_disassembly-flavor

About

Source code for CSCI 476 @ MSU (Computer Security)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 66.6%
  • PHP 16.2%
  • Python 10.1%
  • HTML 2.8%
  • Makefile 1.6%
  • JavaScript 0.8%
  • Other 1.9%