Been a while since I last posted something.
Have been very busy with ma study Computer Science which I started this year.
Anyway:
A few days ago my dummie book: ‘HTML5, CSS, JavaScript, PHP and MySQL for Dummies’.
So I’ve gone trough most of the book now and decided it was time to write a PHP + JavaScript shell.
I opened a GitHub repo which can be found here:
EDIT: https://git.0x00sec.org/unh0lys0da/PHPshell/tree/master
So if anyone wants to help me, please go ahead!
The idea is as following:
This piece of code is inserted in a normal page of the website you hacked.
Ofcourse the page should be one that doesn’t create too much traffic.
Now the idea is that it checks the useragent of the visitor.
As you can see here:
This way, users with normal useragents (for example people browsing with firefox) don’t see the shell.
But if you set your useragent string in your browser as “Haxor” you can see the shell!
Now this is only the beginning of the code, all parts are yet unfinished.
If anyone feels like working on this project, please let me know!
It’s already got jQuery ^^
Eehm ye well if you look at the source of the webpage, you’ll no matter what find that the page was not the original.
But you could do it with PHP
I’ve just seen your code and I think you should make the most server sided you can. You’re relying on javascript to do most of the work which make it hackable. If you need something just text me.
We are having shell acess here, which means we have already hacked the site, We have to make it more client side to make it look less suspicious. (You did’t want to add files that can conform your attack. Did’t you )
1 Like
pry0cc
(Leader & Offsec Engineer & Forum Daddy)
12
Firstly. We are not relying on JavaScript to do most of the work. We have a backend (PHP), to do server side functions, and then the front-end (JavaScript) to do client side functions.
The compartmentalisation is sound. Since it’s using the backend as an API it would be possible to write a CLI client for it. Heck. Write an iPhone app. All it has to do is call the PHP script with a get request.
Secondly, @_k_h is 100% correct. It’s a shell xD therefore you aren’t going to gain much by hacking it. In fact. You won’t gain anything. If you could hack it for more functionality we would actually impliment those features into the shell
Hi, I would like to help you on this project. It looks very interesting. I also have few ideas for you. Maybe you should use native XHR api for issuing requests from client side. You use jQuery in your code from third party CDN for building only one request. Also, you can set some kind of a hard coded md5 token in PHP doc comment. You can then send string/word in authorization header from client. On server side you hash that word with md5 and compare with token in PHP doc using reflection. This way you are implemented single-factor authentication and only you can use shell. Tell me what you think about my ideas.
2 Likes
pry0cc
(Leader & Offsec Engineer & Forum Daddy)
15
That’s a very good idea. In fact, that’s miles ahead of the user agent idea.
If you’d like to implement it, fork the repo on Gitlab and then issue a pull request. I’m sure we’ll accept it