Unix Technical Forum

SEO

vBulletin Search Engine Optimization


Go Back   Unix Technical Forum > Unix Operating Systems > OpenBSD > comp.unix.bsd.openbsd.misc

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-16-2008, 07:07 AM
integer
 
Posts: n/a
Default [F1 Security] Need help to accomplish the following

1. The first one is to prevent users from seeing information about
processes that are being run under another UID.

2. Enable the concept of blackholing. This is so RST packets don't
get sent back in response to closed ports. This helps to block port
scans.

3. Generate a random ID for the IP packets as opposed to incrementing
them by one. This will prevent remote observers from determining the
rate packets are being generated by watching the counter.

4. Disabling ctrl+alt+del so somebody can't walk up to your box and
reboot the server.

5. Drop SYN/FIN packets

6. Enable stealth forwarding. Stealth forwarding passes packets
without touching the TTL, so this is useful for hiding firewalls from
traceroutes.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-16-2008, 07:07 AM
Newbie
 
Posts: n/a
Default Re: [F1 Security] Need help to accomplish the following

> 1. The first one is to prevent users from seeing information about
> processes that are being run under another UID.


You can modify ps, top source code. Of course is not a perfect
solution.

> 2. Enable the concept of blackholing. This is so RST packets don't
> get sent back in response to closed ports. This helps to block port
> scans.


You can use pf to make this.

> 3. Generate a random ID for the IP packets as opposed to incrementing
> them by one.


Ehm , I think that OpenBSD just make this.

> 4. Disabling ctrl+alt+del so somebody can't walk up to your box and
> reboot the server.


What the difference to reboot console from ctrl+alt+del or
power off , reset with key, cut the power cable?

> 5. Drop SYN/FIN packets


You can use pf

> 6. Enable stealth forwarding. Stealth forwarding passes packets
> without touching the TTL, so this is useful for hiding firewalls from
> traceroutes.


I don't know how to make this with open.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-16-2008, 07:07 AM
jKILLSPAM.schipper@math.uu.nl
 
Posts: n/a
Default Re: [F1 Security] Need help to accomplish the following

Newbie <newbie@newbie.it> wrote:
>> 1. The first one is to prevent users from seeing information about
>> processes that are being run under another UID.

>
> You can modify ps, top source code. Of course is not a perfect
> solution.


Alternatively, search the misc@openbsd.org archives for a more
comprehensive patch.

>> 6. Enable stealth forwarding. Stealth forwarding passes packets
>> without touching the TTL, so this is useful for hiding firewalls from
>> traceroutes.

>
> I don't know how to make this with open.


Configure your firewall as a bridge.

Joachim
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-16-2008, 07:07 AM
Newbie
 
Posts: n/a
Default Re: [F1 Security] Need help to accomplish the following

> Configure your firewall as a bridge.

Is not the same thing. I've made a brutal patch to hiding
it from traceroute:

in ip_input.c:

if (ip->ip_ttl <= IPTTLDEC) {
icmp_error(m, ICMP_TIMXCEED, ICMP_TIMXCEED_INTRANS, dest, 0);
return;
}

I've comment out this row and the following row

ip->ttl -= IPTTLDEC;

In the ip_forward subroutine.
I don't know which kind of problems this modify can have on
the tcp/ip stack. Maybe can be destruptive. Anyway i use it.

We can set a sysctl variable to enable/disable it.




>
> Joachim

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-16-2008, 07:07 AM
jKILLSPAM.schipper@math.uu.nl
 
Posts: n/a
Default Re: [F1 Security] Need help to accomplish the following

Newbie <newbie@newbie.it> wrote:
>> Configure your firewall as a bridge.

>
> Is not the same thing. I've made a brutal patch to hiding
> it from traceroute:
>
> in ip_input.c:
>
> if (ip->ip_ttl <= IPTTLDEC) {
> icmp_error(m, ICMP_TIMXCEED, ICMP_TIMXCEED_INTRANS, dest, 0);
> return;
> }
>
> I've comment out this row and the following row
>
> ip->ttl -= IPTTLDEC;
>
> In the ip_forward subroutine.
> I don't know which kind of problems this modify can have on
> the tcp/ip stack. Maybe can be destruptive. Anyway i use it.
>
> We can set a sysctl variable to enable/disable it.


Well, at the very least, it will make routing loops rather destructive.
After all, the TTL field is there for a reason.

If you want to do this, I'd set min-ttl, personally. It doesn't break
quite as much, and usually works as well. (After all, very few systems
will send packets which arrive at your firewall with a TTL lower than,
say, 16; and very few people will wait that long for their traceroute to
return.)

And simply configuring as a bridge, while decidedly not the same thing,
does work in most practical circumstances. If you're doing NAT, it makes
little sense to try and hide the firewall; and if you are not altering
anything, a bridge works just fine. (There are some issues with, for
example, FTP, though.)

Joachim
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-16-2008, 07:07 AM
DMFH
 
Posts: n/a
Default Re: [F1 Security] Need help to accomplish the following

On 2006-01-09, integer <can2two@hotmail.com> wrote:

> 1. The first one is to prevent users from seeing information about
> processes that are being run under another UID.


The simple answer might be to generate a list of commands that reveal PID
information and restrict them to the root user, also changing the name
of root to something else so it's non-obvious which login account may get
you root access. This will not prevent savvy coders from writing their
own code, but that also assumes that there will be live users logging into
the box.

>> 2. Enable the concept of black-holing. This is so RST packets don't

> get sent back in response to closed ports. This helps to block port
> scans.


OpenBSD does this natively with PF, and I believe it is the default
behavior of the PF firewall. You can give your PF configuration the
directive "set block-policy drop" for silent non-RFC operation.

> 3. Generate a random ID for the IP packets as opposed to incrementing
> them by one. This will prevent remote observers from determining the
> rate packets are being generated by watching the counter.


OpenBSD also does this natively with PF, using the directive to scrub
packets to "normalize them", which looks like "scrub in on $interface
random-id <other directive> <other directive>", etc.

> 4. Disabling ctrl+alt+del so somebody can't walk up to your box and
> reboot the server.


I believe this has to be added into the console configuration via the
wsconsctl command to enable the CTRL-ALT-DEL reboot. If you're truly
paranoid, you could compile a kernel without keyboard support - the
boot loader would still allow you to use a keyboard, but then not the
running kernel once booted. If you wanted to boot into a maintenance
mode, you could carry a floppy or some other media, including an
alternate kernel on the disk, to boot from that contains keyboard
support.

>> 5. Drop SYN/FIN packets


A little too general for me to answer, I'm guessing you mean you want
to filter out TCP SYN "half-opens" to defend against DDOS and perhaps
aggressively close open sockets? PF will do all these things. PF has
a feature called SYN-Proxy, similar to the "SYN-Cookie" concept, that
makes sure the TCP 3-way handshake completes before passing the socket
connection to the real host. There are also features to tweak and tune
the closing of sockets / how long a closing FIN is waited for, etc.

>> 6. Enable stealth forwarding. Stealth forwarding passes packets

> without touching the TTL, so this is useful for hiding firewalls from
> traceroutes.


I'd debate with you the viability and usefulness of this feature. There
are other ways to detect a firewall is in play, such as packet latency,
and while TTL masking is a useful feature, it does foul some basic RFC
operations of TCP/IP. Toss operating a routing protocol, or any
multicast out once you use a feature like this (chances are, you're not
using either a routing protocol or multicast, however). If you're really
wanting this feature, I wouldn't hack the code up, I'd build a
transparent bridge with PF, and filter. This is a current, industry
accepted way of achieving a firewall that doesn't act like an IP router
or end-point to filter traffic. You'll find a lot more support for this
type of configuration than asking questions after compiling a custom
kernel / feature.

In general, read the PF man pages, and notes about tweaking PF for your
desired performance goals. I'm a big fan, and I doubt you'll find a more
flexible, easy-to-use firewall-in-an-OS anywhere. Those notes can
help contribute to you scaling a machine correctly for your needs. If
you're going the PC way on your project, don't scrimp on the NIC's -
spend the money to get good quality NIC's so you don't run into
performance issues. I typically buy NIC's for firewall or production
interfaces and use the on-board NIC for management or backup.

Hope this helps a bit, and good luck with your project.

-DMFH

----
__| |_ __ / _| |_ ____ __
dmfh @ / _` | ' \| _| ' \ _ / _\ \ /
\__,_|_|_|_|_| |_||_| (_) \__/_\_\
----
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 02-16-2008, 07:07 AM
jKILLSPAM.schipper@math.uu.nl
 
Posts: n/a
Default Re: [F1 Security] Need help to accomplish the following

DMFH <dmfh@n0spam.dmfh.cx.spamn0t> wrote:
> On 2006-01-09, integer <can2two@hotmail.com> wrote:
>> 1. The first one is to prevent users from seeing information about
>> processes that are being run under another UID.

>
> The simple answer might be to generate a list of commands that reveal PID
> information and restrict them to the root user, also changing the name
> of root to something else so it's non-obvious which login account may get
> you root access. This will not prevent savvy coders from writing their
> own code, but that also assumes that there will be live users logging into
> the box.


It does also not present anyone with half a clue from getting src.tar.gz
and compiling them by hand. I.e., only the worst script kiddies will
actually be stopped by this if they do not wish to be.

(And while cutting down on access to prevent file copying is annoying,
it's just a little scripting challenge to anything with a bit of a
clue.)

<snip>
>> 3. Generate a random ID for the IP packets as opposed to incrementing
>> them by one. This will prevent remote observers from determining the
>> rate packets are being generated by watching the counter.

>
> OpenBSD also does this natively with PF, using the directive to scrub
> packets to "normalize them", which looks like "scrub in on $interface
> random-id <other directive> <other directive>", etc.


I'm not certain how to interpret this, but for OpenBSD generated packets
pf(4) is not necessary:

See http://www.cert.org/advisories/CA-2001-09.html - OpenBSD randomizes
pretty well by default. (In fact, I'd think modulate state would produce
pretty much the same as just the default.)

Also note that in pf.conf(5), under 'STATE MODULATION', 'some popular
stack implementations' are criticized for exactly this failing, which
strongly suggests OpenBSD does it right.

However, when acting as a firewall, modulate state'ing forwarded traffic
is a good idea.

<snip>
>> 5. Drop SYN/FIN packets

>
> A little too general for me to answer, I'm guessing you mean you want
> to filter out TCP SYN "half-opens" to defend against DDOS and perhaps
> aggressively close open sockets? PF will do all these things. PF has
> a feature called SYN-Proxy, similar to the "SYN-Cookie" concept, that
> makes sure the TCP 3-way handshake completes before passing the socket
> connection to the real host. There are also features to tweak and tune
> the closing of sockets / how long a closing FIN is waited for, etc.


People who ask this question tend to be very happy when told that
OpenBSD can block nmap (via pf's 'OS detection').

>> 6. Enable stealth forwarding. Stealth forwarding passes packets
>> without touching the TTL, so this is useful for hiding firewalls from
>> traceroutes.

>
> I'd debate with you the viability and usefulness of this feature.


I agree with you here; reasons (pretty much the same as yours) upthread.

Joachim
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 02-16-2008, 07:08 AM
DMFH
 
Posts: n/a
Default Re: [F1 Security] Need help to accomplish the following

On 2006-01-16, jKILLSPAM.schipper@math.uu.nl <jKILLSPAM.schipper@math.uu.nl>
wrote:

> DMFH <dmfh@n0spam.dmfh.cx.spamn0t> wrote:


>>
>> The simple answer might be to generate a list of commands that reveal PID
>> information and restrict them to the root user, also changing the name
>> of root to something else so it's non-obvious which login account may get
>> you root access. This will not prevent savvy coders from writing their
>> own code, but that also assumes that there will be live users logging into
>> the box.

>
> It does also not present anyone with half a clue from getting src.tar.gz
> and compiling them by hand. I.e., only the worst script kiddies will
> actually be stopped by this if they do not wish to be.
>
> (And while cutting down on access to prevent file copying is annoying,
> it's just a little scripting challenge to anything with a bit of a
> clue.)


Absolutely - assuming a compiler will always be on hand for users to user,
which would always be the case with PERL on the system. I got that idea
from my old days of SunOS 4.1.3_U1, making menu systems for users and trying
to prevent shell escapes.


> I'm not certain how to interpret this, but for OpenBSD generated packets
> pf(4) is not necessary:
>
> See http://www.cert.org/advisories/CA-2001-09.html - OpenBSD randomizes
> pretty well by default. (In fact, I'd think modulate state would produce
> pretty much the same as just the default.)


I think we're talking about two different features here perhaps? I was
referring to the random IP ID generator in PF, and I think you're
talking about the state modulation function, which indeed doesn't need
PF and is a part of the IP core of OpenBSD - where a strong, random
ISN (Initial Sequence Number) is generated for TCP/IP sockets, instead of
the brain-dead way other OS's do it, like adding +10 to the last, etc.
This prevenets "man-in-the-middle" attacks to some degree, etc., etc.

> People who ask this question tend to be very happy when told that
> OpenBSD can block nmap (via pf's 'OS detection').


I've never quite used this, but I have considered using it on my mailer to
automagically drop what must be bogon MTA's coming from Windows desktop
systems that probably are SPAM trafficers - what's your opinion?


----
__| |_ __ / _| |_ ____ __
dmfh @ / _` | ' \| _| ' \ _ / _\ \ /
\__,_|_|_|_|_| |_||_| (_) \__/_\_\
----
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 02-16-2008, 07:08 AM
jKILLSPAM.schipper@math.uu.nl
 
Posts: n/a
Default Re: [F1 Security] Need help to accomplish the following

DMFH <dmfh@n0spam.dmfh.cx.spamn0t> wrote:
> On 2006-01-16, jKILLSPAM.schipper@math.uu.nl <jKILLSPAM.schipper@math.uu.nl>
> wrote:
>
>> DMFH <dmfh@n0spam.dmfh.cx.spamn0t> wrote:

>
>>>
>>> The simple answer might be to generate a list of commands that reveal PID
>>> information and restrict them to the root user, also changing the name
>>> of root to something else so it's non-obvious which login account may get
>>> you root access. This will not prevent savvy coders from writing their
>>> own code, but that also assumes that there will be live users logging into
>>> the box.

>>
>> It does also not present anyone with half a clue from getting src.tar.gz
>> and compiling them by hand. I.e., only the worst script kiddies will
>> actually be stopped by this if they do not wish to be.
>>
>> (And while cutting down on access to prevent file copying is annoying,
>> it's just a little scripting challenge to anything with a bit of a
>> clue.)

>
> Absolutely - assuming a compiler will always be on hand for users to user,
> which would always be the case with PERL on the system. I got that idea
> from my old days of SunOS 4.1.3_U1, making menu systems for users and trying
> to prevent shell escapes.


Neat, I didn't know perl had a syscall interface.

But ultimately, it's much easier to just compile on another system and
copy the binary. There are a near-infinite number of amusing hacks to
get the file copied, anyway.

(Of course, if you have access to cat, dd, or pretty much any editor,
no hacks are necessary.)

>> I'm not certain how to interpret this, but for OpenBSD generated packets
>> pf(4) is not necessary:
>>
>> See http://www.cert.org/advisories/CA-2001-09.html - OpenBSD randomizes
>> pretty well by default. (In fact, I'd think modulate state would produce
>> pretty much the same as just the default.)

>
> I think we're talking about two different features here perhaps? I was
> referring to the random IP ID generator in PF, and I think you're
> talking about the state modulation function, which indeed doesn't need
> PF and is a part of the IP core of OpenBSD - where a strong, random
> ISN (Initial Sequence Number) is generated for TCP/IP sockets, instead of
> the brain-dead way other OS's do it, like adding +10 to the last, etc.
> This prevenets "man-in-the-middle" attacks to some degree, etc., etc.


Oh, I understand now. Sorry.

Still, if you're talking about random-id, isn't that part of the default
OpenBSD stack, too?

>> People who ask this question tend to be very happy when told that
>> OpenBSD can block nmap (via pf's 'OS detection').

>
> I've never quite used this, but I have considered using it on my mailer to
> automagically drop what must be bogon MTA's coming from Windows desktop
> systems that probably are SPAM trafficers - what's your opinion?


I've heard it used in that way. Blocking *all* Windows traffic is a bit
much - after all, there are Exchange servers that are not sending spam,
or not only sending spam - but I've been contemplating dropping all
Windows hosts, as well as the better part of the world, into a rule that
sends them to spamd first.

I often see passive detection abused as a security feature. While
stopping nmap has some value, in that it might make scanning you
sufficiently difficult that a casual attacker will move on to
lower-hanging fruit, it does not in any way prevent someone from
scanning your network and finding out anything that nmap can find out.
Or hacking the nmap source to use a different TTL or somesuch (I don't
know how much difference is necessary to stop p0f from recognizing nmap,
but I imagine it wouldn't be that much.)
And casual attackers are not likely to be that big a danger to
moderately well-secured network, anwyay.

However, while stopping 90% of all attackers is near-useless - after
all, the 90% of attackers stopped by such a trick is likely to be the
90% that don't succeed in anything but generating a couple of logs -
stopping 90% of spam before it even enters the system - or even 50% - is
rather neat.

All in all, I'd be wary of absolutely dropping any mail - there are some
weird setups out there, and while there is no reason to accept the truly
broken ones, there are valid reasons for running a Windows mailserver at
home - but I'm quite willing to inconvenience anyone who tries running a
Windows mailserver at home a little.

Joachim
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:17 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
UnixAdminTalk.com

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533