Navigating the *NIX File System:
Solving the Challenges should prompt you to research
By now you're familiar with man pages. Find and read manuals for:
Built-in shell commands have no man pages. We use
help. Read the help pages for
How would you run the command
gedit tool.c in background?
gedit tools.c &
What signals do the following send:
SIGINT Can be intercepted incase the program wishes to clean up nicely
EOF Not really a signal
SIGSTOP Cannot be intercepted by program
Why or when would you ever use the
Answer: Enumerate processes, investigate running processes.
What are the most common options used with the
I ran a program or command. I think it's stuck. Suggest two ways I can end the program?
What are child and parent processes?
Answer: A process that forks to create another process is called parent. The forked process is child.
What process has ID 1
Answer: The init process owned by root.
Briefly explain the output of the
Answer: Lists all processes attached to terminal or not, in user oriented format. this is different from
ps -aux. See the man page.
chmod, file extensions or not
Write a script to:
What is command injection (CI)?
Answer: A type fo vulnerability that allows user input to be executed with a shell. Possibly due to improper sanitization. See exploit-exercises.com Nebula level 07
Why is it bad idea to write code that calls system() on user input
Answer: Improper user input sanitization may result in CI vulnerability.
I can prevent CI by using any of the following:
Sanitize user input by removing spaces (T/F)
Sanitize user input by converting to upper case (T/F)
See exploit-exercises.com Nebula level 16
What is the shebang?
#!/path/to/executable Specifies the executable with which the following instructions should be executed
How do I make my script executable?
Answer: By adding the executable bit to the corresponding type of users; owner, group and others. For example,
chmod ugo+x script.py adds the executable bit for owner, group and others.
chmod u+x script.py adds the bit for just owner.
How do I find out if a script is executable?
ls -l <script> to list permissions on the script. An
x specifies for whom this script is executable.
How important is a file extension?
Answer: Doesn't matter much in Linux env. However, it's up to programmers to uphold this. For example, you don't need
.sh extension to run a shell script.
How do I know the format of a file without an extension?
file <file>. Example
file steps.pdf yields: steps.pdf: PDF document, version 1.5.
Stripping the pdf extension doesn't change the output.