Skip to content

Instantly share code, notes, and snippets.

@potetisensei
Created November 10, 2014 17:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save potetisensei/40a3b7d2b0604667574b to your computer and use it in GitHub Desktop.
Save potetisensei/40a3b7d2b0604667574b to your computer and use it in GitHub Desktop.
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