-
Notifications
You must be signed in to change notification settings - Fork 15
/
05-file_injection.txt
80 lines (66 loc) · 2.55 KB
/
05-file_injection.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Create some files to inject
cat > ~/textfile.txt <<EOF
Welcome to OpenStack Summit Austin!
EOF
cat > ~/texas.txt <<EOF
| | \
| | |
| | |
| | |__
| | __ \______
| |/ \_____ |_________________
| O \___________________/ \
| \\*****; \ \
| \\***********; \ \
____________| \\************;;;;;;;;;;;;;;;;; \ \
/____________| \\***** ***; ; | |
\ \\*** *; ; \ \
| \\*** * ***;________________; | |
\_ \\*** ****;;;;;;;;;;;;;;;;;; | |
|_ \\***********;;;;;;;;;;;;;;;;;; _|_|
| \\*.***;*****;;;;;;;;;;;;;;;;;; _/_/
\ \\ ******;;;;;;;;;;;;;;;;;; _/_/
\ ____ \\ ;;;;;;;;;;;;;;;;;; /
|_/__/ \ \\ / /
\ \\ / /
\ \\ _ /_/
\ \\ / /
\ \\ _ / /
\ | |
\ / /
| / /
\ / /
| \ \
\ | |
\_ | |
\_ | |
\__|/
EOF
# Boot an instance injecting files
nova boot --image cirros --flavor m1.summit --file /home/cirros/textfile.txt=textfile.txt --file /home/cirros/texas.txt=texas.txt myfileinjectioninstance
# List instances, notice status of instance
nova list
# Get VNC console
nova get-vnc-console myfileinjectioninstance novnc
# Open the URL in your browser.
# username: cirros
# password: cubswin:)
# View files
sudo cat textfile.txt
sudo cat texas.txt
# List block devices
sudo blkid
# Mount config drive
sudo mount /dev/sr0 /mnt
# Examine contents of config drive
cd /mnt/openstack/content
ls
# Examine contents of first file
cat 0000
# Examine contents of the second file
cat 0001
# Log out of instance
exit
######!!!From Your SSH Session!!!######
# Delete the instance
nova delete myfileinjectioninstance