News for hackers. Stuff that matters.
Re:Security by obscurity is underrated by weare138 on Friday September 11, 2020 @01:09PM (#24444865)
But the examples given won't help and is just bad advice in general.

- Assume for every code obfuscator there's a deobfuscator or at least someone as clever as you out there.

- Randomizing variable names it just a nuisance, it won't stop any competent pen tester or attacker.

- Encrypting the database is an odd one. Your program will also have to decrypt the data to use it. Where do you store the encryption keys? In your code? Don't assume obfuscating your code and/or randomizing variables will protect your encryption keys.

Re:Security by obscurity is underrated by jerf on Friday September 11, 2020 @01:19PM (#24445004)
You seem to be thinking in terms of security mechanisms either perfectly blocking attacks or being useless. That's the wrong model. It's about costs. Obfuscating otherwise-open code doesn't mean that nobody can ever figure out what it does, but it raises their costs. Randomizing variables raises costs. Encrypting the DB raises costs on an amortized basis (some cracks may get the key and then it may not raise the cost much, but other cracks may only get the data in which case cost is raised a lot). Things are "secure" not when it's impossible for any actor in the world you don't want to get access to get access, but when the costs to those actors exceed the loss you may experience. (Preferably by a solid margin, for various reasons.)

As to whether this is good or bad advice, that depends on how expensive these things are (e.g., encrypting database fields may be very expensive if you write raw SQL calls as your primary DB interface but may be dirt cheap if you're using an ORM that has it as a built-in feature) and your local threat model (e.g., "dedicated, personalized attackers reading your source" is very different from "does it defeat automated scanners?"). You can't know whether these are good or bad ideas without that additional context.

Re:Security by obscurity is underrated by thaumasiotes on Friday September 11, 2020 @01:28PM (#24445127)
> You seem to be thinking in terms of security mechanisms either perfectly blocking attacks or being useless. That's the wrong model. It's about costs.

This is something that bothered me quite a bit in Bruce Schneier's various comments on airline security. He repeatedly wrote that profiling young Arab men as likely terrorists was pointless, because if it became harder for young Arab men to get through security, terrorist organizations would simply start sending Japanese grandmothers.

But of course where it's relatively easy to find young men willing to die for a cause, it's much more difficult to find grandmothers who will do the same. And where it's relatively easy for an Islamic group based in the Middle East to connect to Arabic social networks, it's much harder for that group to connect to Japanese networks.

Re:Security by obscurity is underrated by czzr on Friday September 11, 2020 @01:52PM (#24445381)
But it’s easier to find Arab women. Or an Irish girlfriend of an Arab man. Or two old Korean people.

(All real examples)

Re:Security by obscurity is underrated by jfk13 on Friday September 11, 2020 @01:59PM (#24445467)
I'm pretty sure the potential recruitment pool of young Arab men is still many times greater than the pool of Irish girlfriends of Arab men.

It's about improving the odds/reducing the exposure, not achieving some theoretical absolute perfection.

Re:Security by obscurity is underrated by gowld on Friday September 11, 2020 @02:35PM (#24445888)
It's bad math. It doesn't matter if you have 1 arab man and 1 korean woman, or 1000 arab men and 1 korean woman. You only need 1.

If you calculate the probabilities correctly, you get very different results.

Re:Security by obscurity is underrated by thaumasiotes on Friday September 11, 2020 @09:04PM (#24448953)
No, obviously it's harder to find two old Korean people than one old Japanese person. Everything you've listed is hundreds, thousands, or millions of times more difficult than the young-Arab-man case.

Suppose you take down a plane with a young Arab man, and then you want to take down a second plane. There is a neverending stream of similar men willing to do the job. If your strategy requires you to use elderly Korean couples, you're done after the first plane -- you'll never find a second one.

Re:Security by obscurity is underrated by gfodor on Friday September 11, 2020 @02:30PM (#24445820)
This is also absent in the analysis of "security theater." I've often felt the "theater" does in fact have a material impact on target selection. One doesn't need to actually have a methodology that results in better capture of terrorists to deter them to other targets: one just needs a methodology that has plausibility of increasing the risk of failure. The unfalsifiability of "security theater" is actually a feature not a bug: it means there's always a non-zero weight on it's potential risk impact to terrorist considering air travel as a target.

All other things being equal, the opportunity cost will shift towards targets that have less elements akin to "security theater", since it's basically 'money on the table' to de-risk the attack.

So, the real question to ask about "security theater" is not if it has a material impact on human safety with flying, but if its deterrent effect pushes risk to places we'd rather it not go or if the costs of performing it do not outweigh this deterrence benefit. Given the potentially paralyzing effect it would have on the global economy if air travel were covered in a blanket of fear of flying, it's hard to argue that "decentralizing" this risk to other targets is a bad idea.

Re:Security by obscurity is underrated by bleepblorp on Friday September 11, 2020 @02:04PM (#24445522)
The problem with heavily focusing on Arabs while paying less attention to other threats is that Arab Islamist terrorists aren't the only problem aviation security needs to deal with.

Focusing most of the security effort on Arabs is a good way to fight the war of 19 years ago, but it leaves the air travel system vulnerable to upstart terrorist movements that see the lack of universal security as an exploitable vulnerability.

For example, there's nothing to say that America's right wing terrorist groups won't decide to switch from shootings and vehicle ramming attacks to attacks on air travel. The TSA ought to be prepared for this, or any other, emerging threat.

Re:Security by obscurity is underrated by BurningFrog on Friday September 11, 2020 @02:05PM (#24445533)
> You seem to be thinking in terms of security mechanisms either perfectly blocking attacks or being useless.

Ours is an industry with a lot of people "on the spectrum".

https://thesilentwaveblog.wordpress.com/2017/03/08/aspergers...

Re:Security by obscurity is underrated by AmericanChopper on Friday September 11, 2020 @05:16PM (#24447394)
You’re only considering one side of the costs. Obfuscation mechanisms also impose a cost on your legitimate users. There’s lots of reasons why you want your users to actually buy in to using your security controls, and annoying controls with highly questionable effectiveness is the best way to kill that buy in. Users will only tolerate so much burden from user facing controls, so you want to make sure all of the controls you impose upon them are actually useful.

The other thing that’s harmful is relying on something to provide security, when it actually can’t. That’s actually going to have a negative impact on your threat model. People will say (they’re even saying it in this thread) that their port knocking or non-standard port usage has cut out the port scanning noise in their logs. But who cares? A properly secured ssh port isn’t going to be cracked by an automated scanning tool. But a poorly secured hidden one will be easily found and cracked by any motivated attacker. You have to implement the proper control anyway, and the obfuscation one ends up providing no benefit while simply annoying your users.

Security by obscurity is dumb, it doesn’t provide any benefit. Security in depth doesn’t mean multiple layers of controls that don’t work add up to one that does. Obscurity is just a way of spending your scarce resources on controls that don’t work, and wastes your scarce command of your users attention on controls that don’t work. So in reality, they’re also always coming at the opportunity cost of controls that actually do.

Re:Security by obscurity is underrated by wglb on Friday September 11, 2020 @07:42PM (#24448518)
> but it raises their costs.

I would ask by how much.

Having to perform source audits on code with obfuscated variable names added almost no time to the task.

Again, these methods work against not-so-determined attackers. If you as a defender have limited resources, where would you choose to spend it--on defending against unskilled attackers, or attackers that are more likely to cause you damage?

>but when the costs to those actors exceed the loss you may experience.

There are several problems with this logic. First, it kind of presumes that there is a symmetry in the costs for the attacker and defender. Wise defenders will use methods that have high leverage. Also, the attacker doesn't care at all about your costs. They care about what they can get from you--whether it is access to something that you aren't thinking of, or your crown jewels.

Encrypting databases is sometimes required by compliance, but is no defense against a good attack.

Re:Security by obscurity is underrated by cgriswald on Friday September 11, 2020 @02:21PM (#24445719)
It's still bad security.

Sure, it increases costs for a certain subset of attackers. Instead of sending easily found and trained young Arab men, they have to put more effort into recruitment. However, in return for that, they get far reduced scrutiny.

Therein lies the problem. It is the real-world equivalent of dropping all packets from a country instead of properly analyzing the packets. You'll stop the low-cost automated garbage attacks, but you won't stop a dedicated attacker, even if the attacker is in that country.

Re:Security by obscurity is underrated by umvi on Friday September 11, 2020 @01:22PM (#24445044)
> Assume for every code obfuscator there's a deobfuscator or at least someone as clever as you out there.

There is still some information lost in the process:

- "let eigenvector_coefficient = 23" => "let x = 23"

A de-obfuscator isn't going to be able to recover the valuable information contained in the original name. Will it stop a determined attacker? Maybe not, but it would surely slow them down as they now need to spend an order of magnitude longer trying to understand what the code is doing.

> Randomizing variable names it just a nuisance, it won't stop any competent pen tester or attacker.

Believe it or not, nuisances are enough to stop some people. A lot of would be attackers are just cruising for low hanging fruit.

Remember, the goal is to "reduce risk" and not "stop any highly skilled targeted/tailored attack". Because let's face it, even if you are the greatest crypto wizard in the world, you will fall victim to a highly sophisticated attack tailored specifically to you.

Re:Security by obscurity is underrated by wglb on Friday September 11, 2020 @07:54PM (#24448586)
>Believe it or not, nuisances are enough to stop some people. A lot of would be attackers are just cruising for low hanging fruit.

It is not "some people" that I worry about. I worry about attackers with a level of skill.

As I noted elsewhere in the thread, I have audited obfuscated code and the obfuscation is only a speed bump. I can only presume that attackers are smarter than I am, and obfuscation is effectively not an issue. And it is not an order of magnitude. This is another example of developer thinking that this form of obscurity is of any real value. Reviewing code will tell you if eigenvector_coefficient is really what it claims to be or something that morphed into something that the developer didn't originally intend.

Also keep in mind that code reviews approach code from a totally different angle than a developer would either developing or during a code walkthrough.

Re:Security by obscurity is underrated by aeternum on Friday September 11, 2020 @01:48PM (#24445339)
It might make sense in some contexts, but code obfuscation is a great example of where software engineers think it provides security where it provides none.

Developers often have some idealized notion that an attacker is going to need to piece their program logic back together and try to decode the purpose of each obfuscated variable in order to find a hardcoded password/value.

In reality an attacker is just going to dump strings and try them all or simply set a breakpoint just before the important syscall and let your program do the work. Code obfuscation provides little to no value for these common methods, yet we cannot resist the urge to list it as a bullet point in security meetings, leading to a false sense of security.

Re:Security by obscurity is underrated by saagarjha on Friday September 11, 2020 @01:55PM (#24445415)
Exactly. If you're running crypto and think getting rid of variable names is going to stop people; it's not. Any off-the-shelf algorithm is usually easy to recognize to an accomplished reverse engineer with a basic background of what kind of things they're looking for.
Re:Security by obscurity is underrated by XMPPwocky on Friday September 11, 2020 @02:00PM (#24445481)
Honestly, the modern JavaScript toolchain is better at giving reverse engineers a headache than 80% of binary obfuscators.
Re:Security by obscurity is underrated by saagarjha on Friday September 11, 2020 @02:03PM (#24445516)
As someone who is not very good at JavaScript reverse engineering, I would tend to agree that minifiers are pretty annoying.
Re:Security by obscurity is underrated by wglb on Friday September 11, 2020 @07:55PM (#24448595)
So the first thing that I do with one of those is to parse it and convert it to s-expressions. Problem solved.
Re:Security by obscurity is underrated by perl4ever on Friday September 11, 2020 @06:59PM (#24448220)
>simply set a breakpoint

I knew nothing about this topic in general, but elsewhere in this thread there was a link to a blog post about obfuscation methods used in a piece of commercial software. One item was a function that detects a breakpoint, obfuscates its boolean return value so you can't tell if it did, and makes the program hang when it does. Pretty neat.

I think your (and my) ignorance of such methods is evidence that they probably are reasonably effective, even though when explained, they're not quantum physics.

Re:Security by obscurity is underrated by weare138 on Friday September 11, 2020 @01:53PM (#24445391)
Let me give you an example. At a previous job as a devops, of my predecessors frequently used these "techniques, minus the encrypted database but I sure he would have done it if he knew how. So there was some buggy internal app they needed some new features added to and the person who wrote it thought he was clever and obfuscated the code. It took me a whopping 30 minutes churn through his 'clever' obfuscation scheme and the randomized variable were just a nuisance. Honestly his best obfuscation technique was his horrible code that made no sense.

Even OP's advice about running services on non-standard ports isn't sound. Who doesn't run a service scan? Even sites like Shodan do service discovery for you. I'm going to find whatever port your running ssh on if your running it.

Re:Security by obscurity is underrated by kstrauser on Friday September 11, 2020 @02:15PM (#24445660)
> I'm going to find whatever port your running ssh on if your running it.

I still think it's a good idea. With SSH on port 22, ten thousand bots plus an attacker try to hammer it (so says fail2ban). With SSH on port 9278, zero bots plus an attacker try to hammer it. By throwing away the 99.99% of the chaff, you can see the remaining wheat you care about.

Changing SSH ports isn't about saying "yep, we fixed it!" and calling it a day. It's about decreasing the amount of stuff you have to deal with, which is quite useful. It's something you can do in addition to everything else that gives a decent bang for its buck. No, it doesn't keep you out, but it does keep out those thousands of bots crawling around looking for an open 22 to pester.

Re:Security by obscurity is underrated by weare138 on Friday September 11, 2020 @06:53PM (#24448154)
But new people in the industry shouldn't think that the things recommended in the article should be used as a primary defense and are accepted industry practices. Moving SSH to a new port to reduce false security alerts is one thing, having people read that article and walk away thinking this is how we do things is another. We don't.
Re:Security by obscurity is underrated by kstrauser on Friday September 11, 2020 @07:30PM (#24448424)
I didn't take that away from the article at all. It said:

> So let’s talk about security by obscurity. It’s a bad idea to use it as a single layer of defense. If the attacker passes it, there is nothing else to protect you. But it’s actually would be good to use it as an “additional” layer of defense. Because it has a low implementation cost and it usually works well.

I think it's good to do those things in addition to the other stuff. Obscurity isn't sufficient by itself, but is another layer of defense.

Re:Security by obscurity is underrated by weare138 on Friday September 11, 2020 @09:24PM (#24449052)
In addition to the stuff you should really being doing? That stuff is hard enough for beginners, without confusing them with speculation like this that goes against best practices and common sense, especially without clearly explaining the pitfalls and real dangers to each of these hypothetical scenarios. Besides, if you're already using industry accepted solutions to security problems and someone manages to gain unauthorized access anyways don't expect any of this amateur crap to offer any real protection at that point.
Re:Security by obscurity is underrated by kstrauser on Saturday September 12, 2020 @01:14AM (#24450012)
I don’t feel as though you came away with the real intent of the article, which didn’t make the arguments you’re shouting down.
Re:Security by obscurity is underrated by umvi on Friday September 11, 2020 @01:59PM (#24445470)
> I'm going to find whatever port your running ssh on if your running it.

Not if you have to port knock before the ssh port is open to new connections.

Re:Security by obscurity is underrated by gowld on Friday September 11, 2020 @02:38PM (#24445930)
Why not? I'll run my automated port knocker
Re:Security by obscurity is underrated by umvi on Friday September 11, 2020 @03:08PM (#24446241)
Huh? How would that work? You have no idea what my port knocking scheme is.

For all you know you have to knock ports 22, 46, 1776, and 8998 to the timing of "shave and a haircut" switching between udp and icmp along the way... Good luck, the entropy you have to overcome is astronomical.

Re:Security by obscurity is underrated by minerjoe on Friday September 11, 2020 @03:14PM (#24446300)
I would thing that blocking IP's of insessant knockers would be easy to implement.
Re:Security by obscurity is underrated by pravda on Friday September 11, 2020 @08:32PM (#24448796)
They use proxies! So many proxies.
Re:Security by obscurity is underrated by drchopchop on Friday September 11, 2020 @01:25PM (#24445088)
>Randomizing variable names it just a nuisance, it won't stop any competent pen tester or attacker.

Sure it will. Imagine that your old, unpatched Wordpress admin is at /random-gobbledygook instead of /wp-admin. An attacker would have to try to hit random alphanumeric directories of your webserver over and over again, hoping that he stumbles across a specific thing that they can attack. This is completely impractical, unless they're somehow clued in that the URL exists.

It's really about making life difficult for an attacker, so much so that they will simply give up, or find an easier target. That can be achieved by throwing up a series of difficult/obscure barriers, each which makes it less likely you'll be trivially penetrated.

Re:Security by obscurity is underrated by mncharity on Friday September 11, 2020 @02:01PM (#24445495)
I ran a world-writable off-the-shelf wiki for years. Trivially tweaked the edit url, visible on every page. But that was enough to break automated spam tooling defaults, so the spamming human might get to see a note, pointing out that robots.txt was blocking indexing, so there was really no reason to waste both our times. The dominant threat wasn't the spammer, but their dumb automation.
Re:Security by obscurity is underrated by scarface74 on Friday September 11, 2020 @01:48PM (#24445338)
One of the first widespread security vulnerabilities I had to deal with was this one:

https://www.giac.org/paper/gcih/115/iis-unicode-exploit/1011...

You could basically encode DOS commands in the URL bar for a site running IIS and it would run remotely.

The automated attack basically replaced the index.html pages. But if you didn’t use the default pages. It didn’t have any effect.

Re:Security by obscurity is underrated by skipants on Friday September 11, 2020 @01:26PM (#24445097)
> Assume for every code obfuscator there's a deobfuscator or at least someone as clever as you out there.

Then it filters out people who are not using a deobfuscator or are less clever than I.

> Randomizing variable names it just a nuisance, it won't stop any competent pen tester or attacker.

Then it will stop incompetent pen testers.

I don't see how your comment refutes the point made. The point is not that it makes your likelihood of attack zero, it just reduces the likelihood via adding more roadblocks.

Re:Security by obscurity is underrated by typon on Friday September 11, 2020 @01:24PM (#24445072)
> competent pen tester

So it does eliminate incompetent ones? That's kind of the point of the article.

Re:Security by obscurity is underrated by marcosdumay on Friday September 11, 2020 @02:25PM (#24445766)
If you have any bit of real security, incompetent people wouldn't pose a risk.

So, what's the gain?

Re:Security by obscurity is underrated by outworlder on Friday September 11, 2020 @01:26PM (#24445102)
> - Randomizing variable names it just a nuisance, it won't stop any competent pen tester or attacker.

But it will stop incompetent attackers - of which there are many. In fact, they are the vast majority.

None of those 'obscurity' techniques will stop a targeted attack. That's not their function. But each of them raises the bar. The more hoops, the better.

Re:Security by obscurity is underrated by xt00 on Friday September 11, 2020 @01:58PM (#24445455)
Isn't there some model where the keys that you use to decrypt the database are acting something like one time codes, and you have to use particular credentials to access the key server? So the attacker would need to be able to stay in the network to be able to actually access the data -- they couldn't just download the entire database and crack it offline. I don't know how that actually is implemented, but just curious on that.. I also wonder how many people put things in their various systems that are obvious attacker trip-mines -- like having some fake button that says like "copy image of database to disk" or something that the actual internal employees are told to never click that button -- but maybe they have even some confluence page that talks about "how to download the database", but is actually a fake entry meant to trip up an attacker in case they get access to your confluence pages as well as your database.. so they click that button and the admins get alerted...
Re:Security by obscurity is underrated by dublin on Friday September 11, 2020 @04:03PM (#24446752)
Overloading names is a good code obfuscation strategy, but tricky and best done with code for obvious reasons (unless you like your regular code to present the challenges of BrainF). For instance, depending on your language, you may be able to have a variable, a function, an object, a pointer, a data structure, an index variable, etc. all called just "a".

Making sense out of code obfuscated this way is really* hard for humans, but will compile or interpret just fine so long as your obfuscator obeys the rules of your language. (We started on this at one of my early startups nearly 20 years ago, but didn't get funded soon enough for protecting the IP in our unique JS to matter. It was unique enough that we actually applied for a patent on part of it - drawing a 16 trace live strip chart of data from network sources at better than 4-10 Hz per channel was really hard with the bowsers and computers of 2002!)

Re:Security by obscurity is underrated by deeringc on Saturday September 12, 2020 @02:21AM (#24450288)
The database key should be generated per encrypted database and then stored using something like the OSX keychain. The OS enforces that only a given application can retrieve that key (via application code signing).