Hack Forums
How do PHP RATs communicate? - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Hacks, Exploits, and Various Discussions (https://hackforums.net/forumdisplay.php?fid=45)
+--- Forum: Grayhat • Purple Team • Hybrid Security (https://hackforums.net/forumdisplay.php?fid=449)
+---- Forum: Beginner Hacking (https://hackforums.net/forumdisplay.php?fid=4)
+---- Thread: How do PHP RATs communicate? (/showthread.php?tid=5704758)



How do PHP RATs communicate? - SIM-3187190 - Aug 27, 2017

I'm learning how a PHP RAT works so I can expand my knowledge. Does the client check a database every x seconds for a command or do they utilise websockets for nearly instantaneous response times? If someone could give a breakdown of how this process happens it would be appreciated, thanks.


* - SIM-3187190 - Aug 27, 2017

Thanks for the fast response. How often do they usually check the database if you don't mind me asking?


* - SIM-3187190 - Aug 28, 2017

(Aug 27, 2017 03:18 PM)Yani Wrote:  Depends..

There isn't a set time. Most do something like 5 minutes.

Any good developer would be able to make it dynamic based on load though.

Thankyou for the help.


* - Vuln - Aug 28, 2017

WebSocket (e.g. Ratchet or Socket.IO) RATs are relatively uncommon, but they do definitely exist. How they communicate is entirely up to you.


* - SIM-3187190 - Aug 28, 2017

(Aug 28, 2017 06:04 AM)Jailbyte Wrote:  WebSocket (e.g. Ratchet or Socket.IO) RATs are relatively uncommon, but they do definitely exist. How they communicate is entirely up to you.

I thought they were fairly common but then again, I only know a few communication methods. Thanks.


* - SysAdmin - Aug 28, 2017

(Aug 28, 2017 09:52 AM)orbit._ Wrote:  I thought they were fairly common but then again, I only know a few communication methods. Thanks.

Instead of a PHP RAT, which is seemingly rare, you can use a PHP Reverse Shell

http://pentestmonkey.net/tools/web-shells/php-reverse-shell


* - SIM-3187190 - Aug 28, 2017

(Aug 28, 2017 10:10 AM)SysAdmin Wrote:  Instead of a PHP RAT, which is seemingly rare, you can use a PHP Reverse Shell

http://pentestmonkey.net/tools/web-shells/php-reverse-shell

I'm going to have to check this out, it looks quite interesting. Thanks.


* - SysAdmin - Aug 28, 2017

(Aug 28, 2017 10:15 AM)orbit._ Wrote:  I'm going to have to check this out, it looks quite interesting. Thanks.

Well, it will require you to have access to a root directory's .php file, in turn, you'll need an admin account, which is essentially easy to get after some SQL Injection or other forms of attack. From the Reverse Shell you can then try to Escalate Privilages on the web server if you haven't done so yet.


* - SIM-3187190 - Aug 28, 2017

(Aug 28, 2017 11:02 AM)SysAdmin Wrote:  Well, it will require you to have access to a root directory's .php file, in turn, you'll need an admin account, which is essentially easy to get after some SQL Injection or other forms of attack. From the Reverse Shell you can then try to Escalate Privilages on the web server if you haven't done so yet.

At the moment I am trying to break into my own website to patch loopholes and expand knowledge on security. No SQL injection I am capable of performing worked but I found an exploit in my image uploader. With this I uploaded my shell (I used metasploit instead of netcat) and got a way in. Thanks for the help. My host removed the file within a few minutes, so I guess that is good. I'm sure there will be more vulnerabilities but they shall be found in the near future (hopefully). Thanks again.