How do i reverse engineer every single aspect and functionality of a website so that i get an exact fully working copy of it?. All interactions including JavaScript, cascade style sheets, PHP to make a perfect clone of it?

  • Are you trying to comprehend the interactions with the web site or are you trying to create a clone? I don't think cloning a website is considered reverse engineering and predicting outputs for every possible input is a problem difficult to solve.
    – NirIzr
    Aug 13 '16 at 21:49

You can get pretty close, but if the site uses PHP, ASP.NET, or some other form of server-side html rendering, you'll never be able to completely reproduce a copy of it. This is because that server-side rendering code is just that, only on the server, and it is never sent down to the browser.

But if you want to ignore all that, you can certainly assume the html that comes back is static and work from there. The first request made to a website (once all redirects are done) is always a single response containing an html page. The browser then renders this html onto the window. It will download and run any scripts (js) when it hits a script tag. The scripts are run in-place, even if the whole html page hasn't been rendered yet. This is why web frameworks like Angular or React will recommend putting the script tags after the main content container has been rendered. The process is similar for style sheets. Each style tag will download a style sheet and compile it.

The great thing is that all this is laid out in order in the network tab of your browser's developer tools. You can view each http request made to the website's server, including the latency, full request contents, and full response contents, and a bunch of other helpful information. I'm not sure how it works for Firefox or other browsers, but if you're on Chrome you can open the developer tools by hitting F12 on Windows or Alt+Shift+I on Mac. There's a bunch of other really cool stuff you can see as well.


You may be able to reverse engineer the Javascript, CSS, and HTML, but not PHP or ASP. Using PHP as an example, if you have a command echo "foo";, the echo code gets executed on the server itself, and you see only the "foo" in the HTML you get. If you want to get PHP, you should test the functionality of the webpage, and hand-code the PHP accordingly.

You do not need to reverse-engineer CSS. You can simply copy it from the HTML if it's inline, and cURL the CSS from the link element, or simply use Chrome's dev tools to find the location and source.

To reverse-engineer Javascript, I heavily recommend using Chrome's developer tools. Features include a JS console, pretty printing (making obfuscated code way easier to read by spacing out), a timeline to see when different functions are called, a debugger with breakpoints, and a sources section to see the script's location.

  • i dont know PHP yet ...ive read that you can hack into servers and grab the file ....im on kali linux ...can you advise me on how to get access to them? ....its not a complex site...its a simple one... www.musicforyou.ga
    – user87552
    Aug 12 '16 at 9:45
  • I think you should not attempt to do this. That would be illegal to do. You could hire someone who knows PHP though. Apart from that, "knowing how to hack" might not be a good term. A hacker finds an exploit with creativity
    – John K
    Aug 12 '16 at 12:37
  • 1
    ill take your advise ....ill try to learn PHP ...thank you good sir :-)
    – user87552
    Aug 12 '16 at 17:46
  • @TheBro21 ("knowing how to hack" might not be a good term. A hacker finds an exploit with creativity.) Exactly! Oct 23 '19 at 22:13

Not the answer you're looking for? Browse other questions tagged or ask your own question.