Jump to content

Recommended Posts

Posted

Hey everybody. I need to copy a file to the users @homedrive. the problem is that these users do not have permissions to do so. the file source is inside of a UNC path that all users have access to. How can i copy the file with higher credentials?

Posted

That macro only returns a drive letter, maybe a complete path is needed for your operation?

Try this:

ConsoleWrite(@HomeDrive & @HomePath & @LF)

Well i think its more of a credential problem because Users are not allowed to create files on their C:\ drives. i just need to find a way to create a file in the C: root with elevated privileges.
Posted (edited)

You may want to look at doing it like this.

$usr = 'Administrator'
$pwd = 'password'
$dom = @ComputerName

RunAs($usr, $dom, $pwd, "", @ComSpec & ' /k ' & 'mkdir c:\test123' & ' ' & '&&' & ' ' & 'dir' & ' ' & '&&' & ' ' & 'cd c:\test123', @SystemDir, @SW_SHOW)

or you can do just bare basic

$usr = 'Administrator'
$pwd = 'password'
$dom = @ComputerName

RunAs($usr, $dom, $pwd, "", @ComSpec & ' /k ' & 'mkdir' & ' ' & @HomeDrive & '\test123', @SystemDir, @SW_SHOW)

only down side is the creds are stored within the exe, but you could have it read from an ini file or include encrypt string etc etc.

just remember that my example is just that an example showing you the potential of what you can do, not many people know how to trunk multiple commands in DoS.

ftc

Edited by failedtocompile

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...