The Ease of Hacking Websites

Most web sites today use one form or another to generate their web site content. Some utilize the “offline” database back-ended approach, where pages are generated every so-often but the web site itself is made of static pages (HTML). Others utilize the “on-line” database back-ended approach, where pages are generated on-the-fly whenever a user requests them.

It is considered harder to hack an “offline” database back-ended web site, as you have no direct way to influence the content displayed by the web site if you send the web site malformed data. However as most webmasters would tell you the “offline” approach is harder to maintain, is slower to adapt to changes in content and requires greater thought into what is placed on-line – as content can take several minutes to hours to propagate into the static web site, that is why most of today’s web sites use the “on-line” approach.

This comes at a price – I will skip the hardware and software aspects – security wise of course. As the web site is built according to user provided data, this opens up the opportunity for the user in this case malicious in nature to manipulate the results returned by the server.

How common is it to see a web site get defaced via an IIS/Apache vulnerability? not very, and it usually occurs due to some newly discovered vulnerability in the mentioned products. How common it is to see a web site get defaced via a Windows/Linux vulnerability, it is roughly the same as seeing an IIS/Apache web site get defaced because of use of an old version of the software.

What is more common? web sites that get defaced due to improper usage of user provided data. These vulnerabilities are usually divided to the following categories:

  • Cross Site Scripting
  • SQL Injection
  • Code Execution

Would it be difficult to detect these vulnerabilities? no, would it be difficult to avoid having them in the first place? no.

Therefore why are these vulnerabilities still present in high profile web sites? I could name a few such web sites, major news agencies and broadcasting networks, but it won’t help the end-user or the web site’s owner. Everyone knows there are numerous solutions of preventing, detecting and stopping these vulnerabilities from happening, so why isn’t it happening?

Are web site vulnerabilities, such as those caused by bad usage of user provided data, considered low risk vulnerabilities? I don’t think these vulnerabilities can be regarded as low risk.

Take this example, I was able in a few minutes of wandering through one of these news agency, which utilizes the unbreakable Oracle database, to discover the complete structure of their articles table/schema as well as read any entry present in the table by utilizing columns such as author, date, priority and keywords – that would be otherwise impossible to use through their normal web access interface.

The next logical step for a hacker discovering this would be to insert or modify an article found in the database, insert into it some form of malicious content – I can name a few: Ad-Ware installing page, fraud related “donation” button, etc. Does this sound factious? nope, it has been done and there is nothing stopping anyone from doing this again.

As history has taught us, these kind of vulnerabilities would go unnoticed until someone will write a worm that would exploit these vulnerabilities to skip from one server to another, which like CodeRed, will create enough havoc to create an understanding by the security community to the importance of addressing such vulnerabilities.

Future NOTE: Even if I say that such a worm will be written, it doesn’t mean I wrote it :)

Share

The Changing Face of Crime – What’s Out There?

what constitutes a crime?
what crime is more serious than another?

both questions of great magnitude that i fear to even begin and approach in this blog. still, whatever the answer is there is one thing i am sure of; it isn’t black and white.

in the changing world we live in with constant revolutions of a grand magnitude happening continually, with a global economy, internet society and many others, we all try and cope. our world is used to a major revolution in our way or life and how we think once every few dozens to hundreds years, allowing us time to adjust.

in today’s world we no longer have that luxury.

i often struggle with how law enforcement today operates. organizations whose business it is to keep the public safe are years behind on what’s actually going on. where they are not behind they often face policy from above that tells them not to work on “cyber”-issues (i hate “cyber-”) as there are far more pressing matters about.

that policy is correct. catching murderers and rapists is by far more critical than catching the kid next door in his latest “computer prank”. plus, petty theft is something the public cares about. “hackers”.. well. we are often proud of our overly intelligent kids and the feats the accomplish.

as i already said though – nothing is ever black and white unless it is how we view it. online crime is no longer about kids. it is not a bored employee who hates his boss and tries to hack the company’s servers after-hours. online crime is a business.

much like with every other society, the “attacker” may be a bored kid, a disgruntled employee or a small-time criminal. the “attacker” can also just as easily be the mob, a competing company (industrial espionage) and maybe even a nation.

who owns a gun in our world? who owns a gun in the “cyber-”world? the comparison is very acute.

today, this is not just fud. internet crime is no longer (only) about kids trading bots like candy. today it is about organized crime taking over and investing vast amounts of money in r&d of both their /technological/ and /operational/ capabilities.

we often do not see behind the scenes, but if we do take a few choice cases -
1. the israeli trojan horse scandal, where leading companies hired private investigation firms to spy on their competition using trojan horses. the price-tag was 17k uk pounds per computer being tapped, per month.
2. google it, but there were similar cases discovered in the last 6 months in both the uk and the us.

i’ve personally been approached about doing such illegal “thingies” two times, thus far. once by a middle-man and once by the ceo of a global private investigation firm. i didn’t take the jobs but it is pretty obvious that “hidden” world is very much alive. we just don’t hear about it _very_ often.

what we do hear about, see and get annoyed by every day is phishing. it is public and might give us some sort of an indication to what this is all about.

the apwg reports thousands on thousands of new unique phishing sites every month. losses from phishing in the us amount to 10-20 million usd for some banks.

in germany, there is a phishing attack every few days by several different scammer groups. in each such attack about 2000 people get fooled and about 6 people do not get their money back (banks are very good at moving money around).
on average, about 6k euro are lost per person. that’s 1.2 million euro per year, for one group. these numbers keep increasing.

it is estimated that globally, in the first half of 2005 roughly half a billion usd were lost for scammers from phishing alone.

all these numbers do not include damages, recovery and money paid for prevention.

what does this mean?

it means there is clear-cut roi (return on investment – bahh, management talk) to the bad guys. they are not going to stop as long as the economics of it are in their favor and the only way to change the economics is to make it not worth their while.
today they do not take much of a risk though, do they?

a second important point is that indeed, this is no longer just an online issue. money is real. the attackers are not bored kids, they are more often than not the russian mob.

as an example for a meat-space connection; earlier this year a woman got her account cleaned up at a branch of her bank in the west coast, following her account details being phished.
a week later a fedex package came in to a different branch of the bank – in the east coast.
that package held a fake check meant to re-fill that account.

law enforcement has made incredible improvements in both ability and willingness to cope with online issues, especially these past two years. still, they are under-staffed, often burdened by handling computers for meat-space cases over actual “cyber-” cases and the policy guys upstairs still do not see the problem for what it is.

that’s it in a nutshell. next time, as time allows, maybe we will go into what actually gets done, who the players are and where we are all headed.

gadi evron,
ge@beyondsecurity.com.

Share

The most secure code in the world

I’m going to say some things, that might be the last thing I’ll ever be able to say (You’ll see why in the next paragraph :) ). Open source is as secure as much as the developers made it secure. It is not more secure then close source, and it’s not better then closed code. It’s merely code !

Most of the open source community (Hey I also develop open source tools and programs) try to sell us that Open = Secure. When Internet Explorer had a lot of security risks one after the other, firefox developers came and told us that in Open source it would have never happen. there are 10000000 (I must have missed few O :) ) eyes on the code so it’s can not be less secure, only more secure….

Ammm.. OK (I’m starting to look for a place to hide right about now :P )

The fact is, that for better, and more secure code, the first thing we have to do, is to educate people to think and be paranoid. Yeah! You can not trust any user input, any result of system function, and you must validate them over and over again.

You must check the input and see that it does not overflow the amount of memory you are willing to give your buffers.

You must sanitize (filter) any char you do not wish to see and have.
And escape anything that you must have, but may effect your program.

But wait, thats still does not give us secure programs and code, only start making us understand better the risks. For example, Off by one can happen to every one… specially after alcohol is involved :)

And what about the user control our function jumps (you know change hard coded our machine code of the program), or inject us with system functions of his like… We can sanitize the input we getting back form the function, but we can not control what happen on the function itself…

Or even bugs that we didn’t thought we had, and someone found them and exploit them. Or as Knuth one said: “I just proved that my claim is right, but I haven’t tested my code with a compiler” (I’m quoting from memory…)

But I just realize that thats not the thing I needed to start with… I should have said, that we are not educated to think in more secure manners. In high schools and universities we are taught to assume that the user input is somewhat correct, and all we need to do is focus on the functionality of the program.
We are also taught that there is only one “right” way to do thing and thats the professor way :)

So before every one starts jumping and accusing something to be more/less secure, lets start teaching people to do things in a more secure way… So how do we start ?

Share

The Zen of Password Management

this was on networkcomputing, pretty funny:

—–

the zen of password management

stage 1: denial
they don’t really mean that i have to change my password. it’s just a suggestion, really, more of a guideline than a hard and fast rule. really, that warning will go away if i ignore it.

stage 2: anger
i will not change my password. i can’t believe that the security of the entire company depends on me changing my password at this time. it’s just a silly policy that it uses to exercise digital control over the rest of the world.

stage 3: fear
but if i change my password i might forget it! i like my password the way it is – right now. i probably won’t be able to remember what i changed it to and then i’ll have to ::shudder:: call the help desk. oh god, why is this happening to me?

stage 4: acceptance
okay, i’ll change my password but i won’t like it. i guess maybe it really is important. after all, someone used mary’s password to hack into the corporate database yesterday and now we’re under investigation by like every agency with a three letter acronym. i’ll do it, but i hope they don’t think i’m happy about it.

stage 5: wonder
hey, that wasn’t so bad. i remembered what my password is and when i told bob and jim and the counter guy at starback’s about the phrase technique i use to remember it they thought i was pretty cool. i’m sure the guy at starbuck’s was writing down my method so he could use it himself.

stage 6: joy
wow, this new password is great! i wish i’d thought of it before. in fact, i’ve changed all my passwords to match the one i use at work! gmail, hotmail, paypal, ebay… everything! it’s such a great password! i love it! maybe i’ll name my first born after it!

two weeks later …

stage 1: denial
i can’t believe i changed my password and told the counter guy at starbuck’s about it. i can’t believe he used it to buy a giant cheetoh on ebay with my paypal account and spammed everyone at corporate hq from my hotmail accout. at least he didn’t…oh my, why are those men in suits with dark glasses coming my way? they aren’t, they’re just … out for a stroll. i’m sure of it. turn around and face the screen and whistle, they’ll just pass me by, i just know it!

—–

gadi evron,
ge@beyondsecurity.com.

Share

Exploit for ca$h

An exploit that I can not give you exists for Mozilla (Gecko) based web browsers, and I also tested it on KDE’s Konqueror to find out that the problem exists there as well…

The bug was found by Georgi Guninski. For those who don’t know him, he is almost a “bug hunter for hire”.

So why can’t I give you the exploit ?

Well Mr. Guninski wrote the following in his Exploit:

Cannot be used in vulnerability databases
Especially securityfocus/mitre/cve/cert

And when we (SecuriTeam) sent him a private email about it, he told the entire world:

no.

you don’t have my permission.
try buying a licence with ca$h.

BTW If you really wish to see the Exploit, you can visit bugzilla

So I have one question, what ever happened to the idea of full disclosure?! I believe in it, and I saw how good it does for many products, that only when exploits and advisories came out, the vendor actually fixed the problems …

Share

PSP Buffer Overflow Allows Downgrading of Firmware

SonyxTeam has released a downgrader for the PSP. The downgrade works by exploiting a buffer overflow in libtiff which resides in PSP’s toc2rta 2.0. The downgrade utilizes the overflow as there is no other way to run non-Sony approved software on the PSP 2.0. The downgrade opens up the PSP device to independent software development for Sony’s device which hasn’t been Sony-approved.

In my opinion this is the first time a buffer overflow has been used for “good“, i.e. execute a good piece of software, rather than for “evil“, execute a bad piece of software. It would be interesting to see how would Sony react to this, and whether this will speed Sony’s responsiveness to software vulnerabilities found in their product.

Share

Paul Vixie on Internet Naming and Alternate-Roots

this was just posted by paul vixie, and i believe it is the shortest and most to-the-point summary of the problem that i’ve seen.

the discussion was about alternate roots and people using alternate roots, causing chaos on the internet by hurting the stability and flow of the domains/dns system, and thus the internet.

some may say, they suck! others may say – who can blame them?

—————————————-

(“christopher l. morrow”) writes:

>> so… why is it again that folks want to balkanize the internet like this?

the dreams fulfilled and/or still promised by the internet mostly involve
some kind of disintermediation, increases in freedom or autonomy, that kind
of thing.

in that context, centralized control over things like address assignments
and tld creation is like fingernails on a chalkboard. a lot of folks feel
that “if it has to be centrally controlled, then $me should be in charge”
or at best “if it has to be centrally controlled, then $me want a voice.”

this desire is more powerful than any appreciation or understanding of the
benefits of naming universality or address uniqueness. human nature,
especially when individuals interact with herds, is predictable but not
necessarily rational.

>> i’m confused by the reasoning behind this public-root (alternate root)
>> problem… it seems to me … that there is no way for it to work, ever.
>> so why keep trying to push it and break other things along the way?

i think it’s because of what margaret mead wrote:

“never doubt that a small group of thoughtful, committed people can
change the world. indeed, it is the only thing that ever has.”

the internet is supernational. control over it is held by the ruling
political party, and their backers, in one country. thus there’s plenty of
money and power ready to back the next hair-brained scheme to break the
lock, even if (as i expect) lack of naming universality would be worse
than lack of naming autonomy.
– paul vixie

—————————————-

gadi evron,
ge@beyondsecurity.com.

Share

Don’t listen to the priests

One of the most damaging misconceptions in the world of security is the phrase “there is no 100% security”. This phrase is from the time of the security alchemists – the black-magic-voodoo-witch-doctor experts that knew how to install configure a firewall or harden a UNIX machine when it was a full-day task that required unusual expertise.
Back then, security was complicated and thus mysterious. Security experts were the selected few, and the common people needed and relied on them. In return, the priests chanted obscure statements such as “security is as good as the weakest link” (translation: after I fix this problem you will need to hire me to strengthen the second-weakest link) and my favorite phrase of all: “there is no 100% security”. The original intention of this phrase was to pack the 10 page legal disclaimer into a one-liner: “if someone hacks you after I finish securing your network, that’s not my fault”.

Only it backfired.

The “common people” tend to take things at face value. If you tell them there is no complete security, they understand just that – and the natural conclusion is that if there’s no complete security, why spend a small fortune on a partial solution? We might as well spend the bare minimum that’s required; we’ll never reach 100% anyway, the expert said so himself!

And so you have a whole generation of sys admins telling their boss that if they can’t spend a fortune on security they might as well do nothing. If only I had a nickel for every time I heard the “100%” as an excuse not to invest money in security…

But this climate is finally changing. How can I tell? First, the ‘security for dummies’ books and courses. This is the equivalent of teaching farmers to read the bible, taking away the power from the Church. Second, the availability of automated tools that make it easy for the average sys admin to secure their network properly (no, it’s still not 100%. But so is every other thing in life). And finally, people like Ira Winkler, formerly the NSA, who says “[people] could prevent 95 percent of their problems by making a few simple changes in the way they do things with what they have already”. Amen.

Share

eBay solved Phishing! (joke, which is reality)

> your registered name is included to show this message originated from ebay. learn more.

we are saved, ebay solved phishing.

i suppose that is why i got this spam email message in my inbox the other day:

> *ebay sent this message from kathy halmoes. (samsungltd).*
> sender registered name is included to show this message originated from ebay.
> learn more .

ahh, so much for that assurance that it came from ebay. the ideas some people come up with…

gadi evron,
ge@beyondsecurity.com.

Share

Online extortion (bahh) and a new buzzword – “Ransomware”

i really like it when people invent new terms.

it can be spit and spim for spam coming from sources other than email. it can be pharming for phishing that is done by “misusing” dns. it’s always “new” and always invented by a commercial company.

annoying, but it’s how things are. one has to find ways to get media attention.

the latest invented term is “ransomware”:

http://www.networkworld.com/buzz/2005/092605-ransom.html

basically, a trojan horse will get on your machine and without warning will at some point encrypt your files. then the attacking party will demand some cash for the files to be restores/opened.

it’s a pretty cute idea, but it is nothing new. the whole idea behind trojan horses is to be able to do stuff such as this, covertly, whether for quiet spying or for overt annoying and destroying.

true, this way of employing the said trojan horse is fascinating, but no more than that.

leaving the trojan horse itself behind, let us discuss the concept of online extortion for a bit.

online extortion is one of the silliest ideas i ever heard. not because it doesn’t work out for the bad guys, but because it simply makes no sense to the good guys.

say you are in meat-space and you run a convenient store in down-town [bad city here]. a gang comes by and threatens that if you don’t pay them protection money they will burn down your store.
it is pretty clear that in fact:
1. they will burn down your store if you don’t pay up.
2. it is likely that they will not burn down your store if you do.
3. they will come back for more if you pay them.
4. it is also likely that if another gang comes by and demands some money, the original gang will protect you from the new one.

online, you have no face. you never really know who you are talking to. you have no guarantee that they are real, what they mean toward you and if they are trust-worthy.

say somebody emails your ceo and says: “pay up 10k bucks or we will ddos you out of business”.
that can be rough on any company and especially on companies whose business models are based on being online, still -
say you pay up:
1. what prevents the bad guys from attacking you anyway?
2. what prevents that bad guys from not attacking you regardless, wasting their resources on someone who won’t pay?
3. the bad guys cannot protect you from other bad guys.
4. there are so many bad guys out there, who is to say others won’t attack you?

and besides, meat-space basics apply here – if you give them money, they will come back and they will also bring friends. unlike real life they cannot burn down your store. whatever they do you can most likely come back from it and you can most likely also prepare for it.

the solution is simple. if your business model demands internet access and you make money off the internet, you should invest in protecting yourself accordingly.

ddos is a problem, but one that you can cope with, especially if you plan ahead and consult with the right people, beginning with your uplink isp and ending up with people who actually understand ddos and security.

trojan horses? “ransomware”? it all comes down to planning security for your organization – in-depth.

besides, as part of your business continuity plan (plan security, it’s not a bad idea) you could.. *shock* backup your files regularly?

i can’t teach anyone how to do security in one blog entry, but the points i am trying to make are:
1. security is something you need to invest in, over time and as part of a through plan.
2. online extortion is a scam,

any of these threats can hurt you but you can either respond to them as a micro-issue and make sure that because somebody smuggled something on an airplane using their shoes no one will ever again smuggle anything on an air plain using their shoes, or you can make sure airline security is better all-together. there is always a new threat out there, dealing with each on-the-spot doesn’t really work and will end up draining more funds.

as to online extortion, i do not belittle the issue in any way. i do believe though that most who are forced to deal with it do not really understand the problem.

the times come where meat-space organized crime is getting involved with a lot of what’s going on online, and if we don’t get ready now, we will simply fall behind.

i’d like to thank paul schmehl for a conversation we had on the subject a couple of years back, he gave me some very good ideas to consider.

also, i am waiting to hear from dan hubbard from websense to find out what really happened in the story discussed (see url to article above).
[ having just heard from dan this issue is dated back to may 2005:
http://www.websensesecuritylabs.com/alerts/alert.php?alertid=194 ]

gadi evron,
ge@beyondsecurity.com.

Share

Analysis of the Texas Instruments DST RFID

Although the article isn’t new, it is still good reading material to those that are looking into implementing some sort of RFID for security or identification.

The Texas Instruments DST tag is a cryptographically enabled RFID transponder used in several wide-scale systems including vehicle immobilizers and the ExxonMobil SpeedPass system. This page serves as an overview of our successful attacks on DST enabled systems. A preliminary version of the full academic paper describing our attacks in detail is also available below.

To summarize the article you can do almost anything with their DST simulator and reader:

  • Sniff a DST tag in a victim’s pocket
  • Crack the key in a DST tag
  • Start a car
  • Buy gas
Share

Yeah and no sleeping too!

Nice” poster outside the school, a bit stranger than you would expect though:

Share

Help us determine what’s a Rita phish

http://isc.sans.org/charityurls.php

you may have to choose a category (new).

gadi evron,
ge@beyondsecurity.com.

Share

Side-channel attacks and listening to keyboards

this item recently hit the news:
http://blogs.securiteam.com/index.php/archives/65

about how by listening to keyboard key strokes, one can re-build the original message typed.

i recently posted about this somewhere else.

side channel attacks are not new. you can listen to the keyboard, cpu, hdd, etc. you can go with em radiation. you can use a telescope to view through a window a reflection off a wall. all you have to do is google. :)

but yes, side channel attacks are cool. thing is, there are usually *much* easier ways of doing things.

a trojan horse can also be considered a side-channel attack if we are talking encryption, which is exactly the difference between how crypto guys and security guys think.

if you ask a crypto guy what the best way of breaking rsa is, you’d get a complicated answer with if’s, maybe’s and math. if you ask a security guy (or in this case, me), i’d just say use a trojan horse.

for crypto guys, once an algorithm is found weak it is no longer trusted and they try and develop new ones, which is good for their science. as security people the more vulnerabilities are found and fixed the more secure we feel (except for worrying that the coders suck and the holes will keep showing).

back to side-channel attacks, try googling for what adi shamir has to say on them. i love this subject. it’s way cool.

jeremy richards from ncircle recently posted the following links to a mailing list i am on, detailing just a few of the possible side-channel attacks out there:
1) acoustic cryptanalysis.

“adi shamir, eran tromer have done some remarkable research into a side
channel attack that is able to extract private rsa keys just by monitoring the
sound output of your computer!”

2) power analysis.

“dpa is a powerful tool that allows cryptanalysts to extract secret keys
and compromise the security of smart cards and other cryptographic devices
by analyzing their power consumption.”

3) led leakage.

“a previously unknown form of compromising emanations has been
discovered. led status indicators on data communication equipment, under certain
conditions, are shown to carry a modulated optical signal that is significantly
correlated with information being processed by the device….experiments show that
it is possible to intercept data under realistic conditions at a considerable distance. many different sorts of devices, including modems and internet protocol routers, were found to be vulnerable.”

try also googling for tempest for the classics.

gadi evron,
ge@beyondsecurity.com.

Share

Practical Exploiation of MD5 Collisions

A post at Code Project brings to light the first case I have seen to making two binary version of two different pieces of software that while both have the same MD5, one is dubbed evil while the other is dubbed good.

The evil piece of software can do anything good or evil that the good piece of software doesn’t, while still having the same MD5 signature.

For the time being the resulting binary files require an extractor to “release” the piece of software embedded within it, but this is no big deal as most of software you download from the Internet comes packed and requires some sort of an extractor or running an installation program.

Share

Orbital Electronic Warfare

http://www.washtimes.com/national/20050921-102706-1524r.htm

the us put a satellite in space to help jam other satellites.

naturally, technology such as this exists for many years now and out dates information warfare by a few years.

however, by putting active targeted weaponry in space, what’s next? just because it is em radiation does not mean it is not a weapon.

i believe that weapon development to counter satellites is going to become more and more in the spot light in the next few years.

from blinding spy satellites through disturbing ground communication all the way to (maybe) herf and emp.

it’s not all about missiles, however much americans like them. one thing i do know is – if the americans have them, soon china and the eu will as well if they don’t already.

gadi evron,
ge@beyondsecurity.com.

Share