开发者

Encrypt CSS external link and restrict access to it

I have a new client who asked me to make 2 websites and no paym开发者_JAVA技巧ent so far! I have the ftp accounts, but he can always close my access and leave me without pay. Can I upload the CSS to another server of mine and encrypt the link to CSS file? If yes, can I restrict peoples to see the file if they find the URL to CSS file?

Thank you!


If they are his hosting accounts, then accessing them to tamper with the code for the purpose of disabling his sites without his authorisation is probably illegal.

If he hasn't paid you, you own the copyright. If he refuses to pay you, file a DMCA complaint with his hosting company.

Technological measures like this are futile and unprofessional. Next time use a contract.


This is simple. Same scenario happened to me, and what I did was added an new index.html which was an under-construction page, and renamed the original index.php as index_to_be.php.

I then added a redirection using htaccess to the new index.html. The client contacted me straight away and paid up in no time.

If you don't know how to use htaccess, you can simply add a header location value to the top php page.

header("location:index.html");


The best way to do this is to create a simple PHP file that allows you to access, edit and delete files on the server. You can also search for a ready made lightweight ftp script. Place the PHP file somewhere on the server nested in other folders and name it something like temp.php. Now even if the client blocked you access to the server, you can still access, edit and delete files on the server by pointing your URL to temp.php. When you get paid, be kind enough to remove the file. Don't forget to password protect it.

In your PHP file you can use opendir() to read files from a directory, and unlink() to delete files. If all you want to do is be able to delete files, then the script will not take you more then a minute to create.

UPDATE You can use the following lightweight ftp script that will let you view, edit delete files and also give you the option to password protect it. http://sourceforge.net/projects/pafm/


You could remove the style sheet from the client's site, upload it to one of your servers and embed it from there:

<link rel="stylesheet" href="http://your.server/styles.css">

however, you will not be able to seriously obfuscate this. One idea that comes to mind is to add a huge number of spaces before the "link" tag to hide it in the source code view.

                                                                                                               <link rel="stylesheet".....>

You could also lazy load it using jQuery, but that would disable the style sheet for users who have JavaScript turned off - mostly a no-go.

In the end, no matter what you do, all this will be trivially easy to circumvent. There is no way to reliably keep control over the site in the scenario you describe. Like @thirtydot says, the best thing to do is to send a screenshot instead.


This is probably like trying to kill a fly with a ICBM but...

You could always use a JavaScript to add the link element to the DOM, and run the JavaScript code through a JS obfusticator.

But still, that's hackish, and overkill, and ways you can get the link anyway.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜