@@ -57,7 +57,8 @@ def generateDockerfile(filelist, flags):
5757 # copy bin
5858 copybin = ""
5959 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 "
6162 # print copybin
6263
6364 # chown & chmod
@@ -72,16 +73,20 @@ def generateDockerfile(filelist, flags):
7273 # print chown_chmod
7374
7475 # 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'''
7780 copy_lib_bin_dev = "RUN "
7881 for x in xrange (0 , len (filelist )):
7982 copy_lib_bin_dev += "cp -R /lib* /home/" + filelist [x ] + " && "
8083 copy_lib_bin_dev += dev % (filelist [x ], filelist [x ], filelist [x ], filelist [x ], filelist [x ], filelist [x ])
8184 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
8387 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 += " && "
8590
8691 # print copy_lib_bin_dev
8792
0 commit comments