Hack Forums
[C#] Download and Execute from Bot + WebClient - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [C#] Download and Execute from Bot + WebClient (/showthread.php?tid=5608146)



Download and Execute from Bot + WebClient - Sai Hung - Apr 25, 2017

Hi everyone,

I have a challenge. I do know how to use Web Client to do download and execute, no problem, but suppose i am to get the Information from a PHP File hosted on a server, how do i ask it to get it from there, download and execute it on Victim PC?


* - FaXe - Apr 25, 2017

PHP runs serverside, the PHP code itself is never shown to the user, only the html part


* - Sai Hung - Apr 25, 2017

(Apr 25, 2017 09:20 AM)FaXe Wrote:  PHP runs serverside, the PHP code itself is never shown to the user, only the html part

I know. but when someone wants to initiate download and execute. like the C++ File gets commands from the php file. one of the commands it should get from the PHP file should be downloaded and executed, to get the file from the url (http://www.xxxxxxxxxx.de/soft/server.exe) and execute on Victim PC


* - FaXe - Apr 25, 2017

(Apr 25, 2017 09:24 AM)Sai Hung Wrote:  I know. but when someone wants to initiate download and execute. like the C++ File gets commands from the php file. one of the commands it should get from the PHP file should be downloaded and executed, to get the file from the url (http://www.xxxxxxxxxx.de/soft/server.exe) and execute on Victim PC

If you want to download and execute a file you could just use WebClient.DownloadFile() to download the file, then Process.Start() to run the file.
If you're trying to make the PHP file return the download URL, just use the echo() function and use WebClient.DownloadData() to get the URL.