Created
November 10, 2014 17:50
-
-
Save potetisensei/40a3b7d2b0604667574b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from commands import getoutput | |
stages = [] | |
for i in range(0, 10): | |
stages.append("stage0{num}".format(num=i)) | |
for i in range(10, 16): | |
stages.append("stage{num}".format(num=i)) | |
print stages | |
os.chdir("/home") | |
for stage in stages: | |
os.mkdir(stage) | |
print getoutput("echo FLAG_IS_HOGEHOGE > /home/{stage}/keyword.txt".format(stage=stage)) | |
print getoutput("cp /home/poteti/dist_package/{stage}_conf /etc/xinetd.d/".format(stage=stage)) | |
print getoutput("cp /home/poteti/dist_package/{stage} /home/{stage}/{stage}".format(stage=stage)) | |
print getoutput("groupadd {stage}group".format(stage=stage)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment