@@ -57,7 +57,8 @@ def generateDockerfile(filelist, flags):
57
57
# copy bin
58
58
copybin = ""
59
59
for filename in filelist :
60
- copybin += "COPY " + PWN_BIN_PATH + "/" + filename + " /home/" + filename + "/" + filename + "\n "
60
+ copybin += "COPY " + PWN_BIN_PATH + "/" + filename + " /home/" + filename + "/" + filename + "\n "
61
+ copybin += "COPY ./catflag" + " /home/" + filename + "/bin/sh\n "
61
62
# print copybin
62
63
63
64
# chown & chmod
@@ -72,16 +73,20 @@ def generateDockerfile(filelist, flags):
72
73
# print chown_chmod
73
74
74
75
# copy lib,/bin
75
- dev = '''mkdir /home/%s/dev && mknod /home/%s/dev/null c 1 3 && mknod /home/%s/dev/zero c 1 5 && mknod /home/%s/dev/random c 1 8 && mknod /home/%s/dev/urandom c 1 9 && chmod 666 /home/%s/dev/* && '''
76
- ness_bin = '''mkdir /home/%s/bin && cp /bin/sh /home/%s/bin && cp /bin/ls /home/%s/bin && cp /bin/cat /home/%s/bin'''
76
+ # dev = '''mkdir /home/%s/dev && mknod /home/%s/dev/null c 1 3 && mknod /home/%s/dev/zero c 1 5 && mknod /home/%s/dev/random c 1 8 && mknod /home/%s/dev/urandom c 1 9 && chmod 666 /home/%s/dev/* && '''
77
+ dev = '''mkdir /home/%s/dev && mknod /home/%s/dev/null c 1 3 && mknod /home/%s/dev/zero c 1 5 && mknod /home/%s/dev/random c 1 8 && mknod /home/%s/dev/urandom c 1 9 && chmod 666 /home/%s/dev/* '''
78
+ # ness_bin = '''mkdir /home/%s/bin && cp /bin/sh /home/%s/bin && cp /bin/ls /home/%s/bin && cp /bin/cat /home/%s/bin'''
79
+ # ness_bin = '''cp /bin/sh /home/%s/bin && cp /bin/ls /home/%s/bin && cp /bin/cat /home/%s/bin'''
77
80
copy_lib_bin_dev = "RUN "
78
81
for x in xrange (0 , len (filelist )):
79
82
copy_lib_bin_dev += "cp -R /lib* /home/" + filelist [x ] + " && "
80
83
copy_lib_bin_dev += dev % (filelist [x ], filelist [x ], filelist [x ], filelist [x ], filelist [x ], filelist [x ])
81
84
if x == len (filelist ) - 1 :
82
- copy_lib_bin_dev += ness_bin % (filelist [x ], filelist [x ], filelist [x ], filelist [x ])
85
+ # copy_lib_bin_dev += ness_bin % (filelist[x], filelist[x], filelist[x])
86
+ pass
83
87
else :
84
- copy_lib_bin_dev += ness_bin % (filelist [x ], filelist [x ], filelist [x ], filelist [x ]) + " && "
88
+ # copy_lib_bin_dev += ness_bin % (filelist[x], filelist[x], filelist[x]) + " && "
89
+ copy_lib_bin_dev += " && "
85
90
86
91
# print copy_lib_bin_dev
87
92
0 commit comments