Lect99 - Example papers Flashcards

(95 cards)

1
Q

The /proc directory is a location for

A

Virtual file system for process and kernel information

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

The /etc directory is a location for

A

Configuration files

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

The passwd file can be found in

A

/etc

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

To transfer ownership of the file toto from dave to nicola type

A

chown nicola toto

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

The /etc/services file contains

A

a list of port mappings for the system (tcp and udp)

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

To set the read, execute permission of the file toto for group and other type

A

chmod 755 toto

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

In an Ubuntu system, the command sudo apt-get dist-upgrade is used to

A

Upgrade an existing installation and add new packages if needed.

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

To identify which shell an user is using, (s)he looks in

A

/etc/passwd (shows default shell)

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

The command ls -lh is used to show:

A

a long listing of a file or directory of files, including permissions mod time and size in human readable format.

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

The /bin directory is a

A

directory for common executables

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

The /sbin directory is a location for

A

for system executables usually used by root

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

To view the boot message from the kernel type:

A

dmesg

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

To show the IP address of the current host, type:

A

ifconfig

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

The command ls [t][ne]* is used to list:

A

files that start with the letter t followed by either an n or e

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

The /usr directory is a

A

user binaries, libraries and other software (the majority of the system is in here)

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

The command cat /etc/passwd | egrep /bin/bash is used to show:

A

entries in /etc/passwd that contain the string /bin/bash

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

To run a command vi as root, type:

A

sudo vi or su – vi

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

To extract the usernames of all users on your system from /etc/passwd type:

A

cat /etc/passwd | awk -F’:’ ‘{print $1}’ cat /etc/passwd | cut -d’:’ -f1

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

To count the lines in a file toto, type:

A

cat toto | wc -l

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

To print the result of the command who to a file users.txt, type:

A

who > users.txt

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

Change to home directory

A

cd /home cd ~

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

Move a file

A

mv file /destination/file

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

Delete lines 2 to 3 of a file called toto

A

sed -e ‘2,3d’ toto

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

Create a directory tata

A

mkdir tata

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Extract characters 6 to 8 from each line of a file called data
cut -c 6-8 data
26
To display the content of a text file
cat file less file
27
To display all lines in a file called toto that contains a number
grep [:digit:] toto
28
Display all lines of the file data that contain a number from 0 to 9
grep [0-9] toto
29
Calculate the SHA1 hashes of all files in a directory without showing filenames
sha1sum \* | cut -d' ' -f1 sha1sum \* | awk '{print $1}'
30
Display all lines except line 10 of file toto
sed -e ‘10d’ toto
31
Search for the string “hacker” in ps.dd
grep -a hacker ps.dd
32
Search for IP addresses in ps.dd and place the results in a file called IP.log
egrep -a --color=always '([0-9]{1,3}\.){3}[0-9]{1,3}' ps.dd \> IP.log
33
Search for Friday May 26, 2017 and “gmail” in the IP.log file above
egrep ‘Friday May 26, 2017.\*gmail’ IP.log
34
Extract lines that contain the userID=12345 from the file IP.log and place the results in a file called User.log
grep ‘userID=12345’ IP.log \> User.log
35
Extract lines that contain the email address from the file User.log above
grep “email address” User.log
36
List the first ten characters of the SHA1 sum of sp.e01
sha1sum sp.E01 | cut -c 1-10
37
Convert sp.E01 to a raw image
ewfexport sp.E01
38
List the partitions in the image, reporting in units of sectors
mmls sp.E01
39
List the file system of its bootable partition
fls -o 48195 sp.E01
40
Mount its Windows NTFS partitions
mkdir /mnt/ewf mkdir /mnt/part2 mkdir /mnt/part4 ewfmount sp.E01 /mnt/ewf mount -o loop,offset=$(48195\*512) /mnt/ewf/ewf mnt/part2 mount -o loop,offset=$( \*512) /mnt/ewf/ewf /mnt/part4
41
The /var directory is a location for
data which may be modified in real time by programs
42
The /mnt directory is a location for
directory in which to mount devices
43
To show the currently mounted partitions on a Linux system, type:
mount -l
44
The command netstat -l is used to show:
only listening socket
45
The command ls -lSr is used to show:
lists files in current directory with long listing, sorting the list by file size
46
To substitute more than one occurrence per line of ‘one’ with ‘two’ in file called toto, type:
sed 's/one/two/g' toto
47
To find every occurrence of the word car in a file called engines, type:
grep car engines
48
To see if user ryan is logged on, type:
who | grep ryan
49
To display all lines in a file called engines that contain three characters long, starting with a capital letter and ending with a digit, type:
grep [[:upper:]].[[:digit:]] engines
50
In Linux, to identify the type of a file, the file command is based on:
The header of a file
51
In Linux, to list the content of an archive toto.tgz, type:
tar tzvf toto.tgz
52
To print usernames from /etc/passwd, type:
awk –F: ‘{print $1}’ /etc/passwd
53
To calculate the MD5 hashes of all files in a directory without keeping filenames, type:
md5sum \* | cut –c1-32
54
The output of the command grep -q $(md5sum toto | cut –c1-32) hashes.txt && echo Match is:
Match, if the MD5 hash of the file toto exists in hashes.txt
55
The command dd if=/dev/hda of=~/hdadisk.img is used to:
create an image of hda device
56
The command xxd -l 120 -c 20 toto prints:
hexdump the first 120 bytes with 20 bytes per line of the file toto
57
The command sfdisk -l -uS able2.dd :
shows partition table of the disk image able2.dd
58
To change directory to the last directory, type:
cd -
59
To view the boot message from the kernel type:
dmesg
60
To calculate the SHA1 hashes of all files in a directory, type:
sha1sum \*
61
In Ubuntu, to check who is running what, type:
top
62
The command icat -o 10260 able2.dd 2139 \> lrkn.tgz.2139:
recovers a deleted file from the image able2.dd and store to a report file
63
The command dd if=/dev/hdx | gzip \> ~/image.gz is used to:
create an image of hdx device
64
The command fls -o 10260 –r able2.dd:
provides file system specific information about the file system of able2.dd
65
To sum file sizes of all files stored in an archive toto.tgz, type:
tar tzvf toto.tgz | awk ‘{ sum += $3} END {print “Total size: ” sum “ bytes.”}’
66
ls -lh
List directory contents in long format with human readable sizes.
67
head -n13 file1.txt
Print first 13 lines.
68
cp file1 file2
Copy file1 to file2
69
mkdir /mnt/usb/evidence
Create directory called "evidence" under /mnt/usb
70
wc -l filename
Count lines in file "filename"
71
cat /etc/passwd | egrep /bin/bash
Print all lines of /etc/passwd that contains /bin/bash
72
cut -d: -f1 /etc/passwd
Prints all usernames of /etc/passwd - d : delimiter - f1 : field number
73
grep [[:upper:]] engines
Print all lines that contain at least one upper case letters.
74
tail /etc/passwd \> smallpass
Output the last 10 lines of file /etc/passwd to smallpass
75
awk –F: ‘{print $1}’ /etc/passwd
Prints out username from /etc/passwd
76
Rename a file:
mv file1 file2
77
Delete a file:
rm file1
78
Find differences between file1 and file2:
diff file1 file2
79
Create a file:
touch file1
80
Display a file:
cat file1
81
To display lines in a file:
sed -n 2p file.txt
82
Count the number of lines in a file:
wc -l filename
83
Calculate the MD5 hashes of all files in a directory:
find . -type f -exec md5sum {} \;
84
Extract files in a tarball:
tar xvf filename
85
Extract a field from a file:
cut -d: -f1 filename
86
List the first five characters of the MD5 sum of file.e01:
md5sum filename | cut -c1-5
87
Convert suspect.E01 to a raw image:
ewfexport -t [NewFileName] -f raw -u suspect.E01
88
List the partitions in the image suspect.e01:
mmls suspect.e01
89
List the file system of a partition, which starts at sector 48:
fsstat -o 48 suspect.e01
90
Mount a Linux partition, which starts at sector 102400:
mount -t ext4 -o ro,loop,offset=$((512\*102400)) image.raw /mnt/hdd
91
Check the file type of access\_log:
file access\_log
92
Print the number of lines in this file of access\_log:
wc -l access\_log
93
Display and sort the first column of access\_log:
cat access\_log | awk '{print $1}' | sort
94
Display and filter out duplicates in the first column of access\_log:
cat access\_log | awk '{print $1}' | sort -u
95
Count the number of different IP addresses (suppose that the first column contains the IP addresses) of access\_log:
cat access\_log | awk '{print $1}' | sort -u | wc -l