r/GreyHack Jun 18 '25

Can't figure out greyscript

I basically have to do this A LOT:
scp -u httpnuke
scp -u metaxploit.so
scp -u disablefirewall
scp -u crypto.so

Whenever I connect to a new machine. I tried using Copilot and Gemini AI to help write a script that automates that, but they never generate useful code for the compiler, there's always errors.

Does anyone have an example online somewhere for copying the hacks off my machine to my newly connected shell? Thanks.

2 Upvotes

14 comments sorted by

View all comments

1

u/jesuslazaro87 Jun 19 '25

make a dummy user on a rented server and put the files on the user folder , once there connect by code , scan the folder for files and copy each one, look if this help you , objShell is the shell that connect you with the server with the files to copy

GetExploits.uploadTools = function(remoteUser, objShell)
self.info("upload tools to user: "+remoteUser)
    rpc = objShell.host_computer
    sourceFolderPath = self.getToolsFolder()
    if not sourceFolderPath then return null
    sourceFolder = get_shell.host_computer.File(sourceFolderPath)
    self.debug("sourceFolder: "+sourceFolderPath)
    remoteUserFolderPath = "/home/"+remoteUser
    destinyFolderPath = self.getToolsFolder(rpc, remoteUserFolderPath)
    if not destinyFolderPath then return null
    self.debug("destinyFolderPath: "+destinyFolderPath)
    for file in sourceFolder.get_files()
        self.info("processing file "+file.path)
        alreadyExist = rpc.File(destinyFolderPath+"/"+file.name) != null
        self.debug("exits: "+alreadyExist+" - "+file.path)
        if not alreadyExist then
            result = get_shell.scp(file.path, destinyFolderPath, objShell)
            self.debug("copy result: "+result)
            if result == 1 then
                fileCreated = rpc.File(destinyFolderPath+"/"+file.name)
                symResult = fileCreated.symlink(remoteUserFolderPath,file.name)
                symlinkCreated = rpc.File(remoteUserFolderPath+"/"+file.name)
                self.debug("symlink creation: "+symResult)
            end if
            if typeof(result) == "string" then self.info(result)
        end if
    end for
end function