Finding HTML comments in a web page

HTML comments can sometimes hold amazing pieces of information. I have personally seen websites with the admin username and password in HTML comments. I have also seen an entire menu commented out, but the links still worked and could be reached directly. You never know what kind of information a careless developer might leave behind.

If you are going to leave comments in your code, it is always ideal to leave them in the server-side code and not in the client-facing HTML and JavaScript. Comment in the PHP, Ruby, Python, or whatever backend code you have. You never want to give the client more information than they need in the code.

The regular expression used in this program consists of a few special sequences. ...

Get Security with Go now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.