Archive for January, 2006

Server Security Brainstorm - Port Knocking…

Monday, January 2nd, 2006

Lately, with my commencement of self-study for my Red Hat Certified Engineer exam and my continual drive to add yet more to my knowledge-base, to make myself a more valuable employee for those who do eventually employ me. I looked recently, after having been prodded with the idea by one of my class-mates, at ‘port knocking”, a form of client-to-server connection establishment and authentication.

This basic premise of port knocking is this:

Client A wants to establish a connection to secure server B

Server B is set to a ’stealth’ mode (all ports are closed, and connection attempts on these ports do not return an ICMP “connection Refused” packet. They are simply ignored, making it appear to the client as if the server itself doesn’t exist).

Server B has a port knock daemon (hereon called a PKD) running, and monitoring the firewall logs for connection attempts.

Client A has a file that contains the port-knock sequence. This is a series of ports that they will attempt to connect to, in sequence, to identify themselves to the PKD.

The PKD detects the port-knock sequence in the firewall’s logs, and sends the firewall a message instructing it to open a pre-decided port (not part of the knock sequence) for communication to take place through.

Client A does its communicating, then sends a second port-knock sequence to close the connection again.

Now, that’s port-knocking, basically. My brainstorm starts here: As port-knocking stands it’s nice and secure to the server, but still vulnerable to such attacks as man-in-the-middle. A skilled intruder could, theoretically, sit on the single-line path between client and server, and monitor the connection attempts, and learn the sequence, right? Right. Which, in the end, invalidates the hole process, an you may as well just leave the whole server open. I see the best implementation of this working like this:

The PKD is intergrated into the firewall itself, so it can monitor and control the IP stack itself directly, instead of having to work through another application to open and close access. Port knock sequences will be limited life-span, preferably one-use only. The new sequence will be transmitted to the client as part of the connection establishment sequence. Connections themselves will use an public/private key ecryption type, such as Kerberos, to encrypt transmissions between the serverand the authenticated client.

When the connection is opened the opening sequence is immediately moved to another database of ‘old sequences’, to prevent someone trying a playback attack with it. If the server detects this sequence being used again within a certain time-frame, then it will record the originating IP address and blacklist it for another set amount of time. As part of the connection-establishment, after the excryption sequence is complete, the server will generate and send to the client the next sequence, registering it in its own database. By this method the sequences are kept expirable, and secure from recording and playback-attack.

Sequence generation itself is the last point I’ve been thinking on. There’s two paths I could see here: multi-level randomisation to generate a series of numbers between 1024 and 65535 (the public, un-registered port number range). That could easily give you a nice long string of port numbers. That’s okay, but the problem with it is that true randomisation is difficult to achieve, and is processor intensive. The other option is algorithmic generation. Several factors can be taken into consideration and fed as variables into the algorithm to pull out the port numbers. The connection ID of the client. Their IP address. Their location in the world. The time of day. The phase of the moon. Anything, really, so long as you can assign a number to it. I personally like this one, for a couple of reasons. One, it messes with the attacker’s malicious little mind; that’s always fun. Two, and most importantly, the attack, through careful analysis, could theoretically find out the numbers used to generate the sequence, and the algorithm behind it. However, if they’re obscure enough they won’t have a snowball’s chance in hell of figuring out what the numbers mean, and so won’t be able to predict the next incarnation of that value.

Anyway, that’s the end of my brainstorm for now. If I had better (much better) programming skills, I think I could really make something out of this. Port knocking, in my opinion, represents one of the better security concepts of the last few years. I’d like to make it a part of my repetoire. Now I just have to find out how.

The Tea Party - One Step Closer Away

Monday, January 2nd, 2006

I know your name, I heard you call.
A distant voice behind the wall.
“But something stands in our way,”
She said, she said.

I know a place where we can go,
Where on one cares and no one knows
If it’s passion or play.

You speak in tongues,
You read my mind.
I’d give it all
To see a sign.
But you’re taking forever.

Time stands still and you stand
One step closer away.
Will it take us forever?

And so I climbed the wall, I needed proof
Of certain signs, and certain truths.
“With every step you take,”
She said, she said.

“You need to search, between the seams.
You need to twist within the dream.
You’re one step closer away.”

You speak in tongues,
You read my mind.
I’d give it all
To see a sign.
But you’re taking forever.

Time stands still and you stand
One step closer away.
Will it take us forever?

Time stands still and you stand
One step closer away.
Will it take us forever?

You’ve always been,
You’ve always known.
That all this time,
I’ve been alone.
I’ve always searched
For what I’ve lost.
Beneath a rose,
Behind a cross.
You’re always there,
You’re everywhere.

Will it take us forever?

You speak in tongues,
You read my mind.
I’d give it all
To see a sign.
But you’re taking forever.

Time stands still and you stand
One step closer away.
Will it take us forever?

Time stands still and you stand
One step closer away.
Will it take us forever?

The Offspring - Come Out and Play

Monday, January 2nd, 2006

I actually really like this one. The social commentary on the evils of gang-membership and warfare are quite nice.

You gotta keep ‘em separated

They’re like the latest fashion
They’re like a spreading disease
The kids are strappin’ on the way to the classroom
Getting weapons with the greatest of ease
The gangs stake out their own campus locale
And if they catch ya slippin’ then it’s all over pal
If one guy’s colours and the other’s don’t mix
They’re gonna bash it up, bash it up, bash it up, bash it up

Hey! Man you talkin’ back to me? Take him out
You gotta keep ‘em separated
Hey! Man you disrespectin’ me? Take him out
You gotta keep ‘em separated
Hey! Don’t pay no mind
You’re under eighteen you won’t be doin’ any time
Hey! Come out and play!

By the time you hear the siren
It’s already too late
One goes to the morgue and the other jail
One got wasted and the other’s a waste
It goes down the same like the thousand before
No one’s gettin’ smarter no one’s learnin’ the score
Your never-ending spree of death and violence and hate
Is gonna tie your own rope, tie your own rope, tie your own

Hey! Man you disrespectin’ me? Take him out
You gotta keep ‘em separated
Hey! Man you talkin’ back to me? Take him out
You gotta keep ‘em separated
Hey! Don’t pay no mind
You’re under eighteen you won’t be doin’ any time
Hey! Come out and play!

It goes down the same like the thousand before
No one’s gettin’ smarter no one’s learnin’ the score
Your never-ending spree of death and violence and hate
Is gonna tie your own rope, tie your own rope, tie your own

Hey! Man you talkin’ back to me? Take him out
You gotta keep ‘em separated
Hey! Man you disrespectin’ me? Take him out
You gotta keep ‘em separated
Hey! Don’t pay no mind
You’re under eighteen you won’t be doin’ any time
Hey! Come out and play!

Gary Jules - Mad World

Monday, January 2nd, 2006

All around me are familiar faces,
worn out places, worn out faces.
Bright and early for the daily races,
Going nowhere, going nowhere.
Their tears are filling up their glasses,
No expression, no expression.
Hide my head I want to drown my sorrow,
No tomorrow, no tomorrow.

And I find it kind of funny,
I find it kind of sad.
The dreams in which I’m dying are the best I’ve ever had.
I find it hard to tell you,
I find it hard to take.
When people run in circles its a very very
Mad World
Mad World

Children waiting for the day they feel good,
Happy birthday, happy birthday.
And they feel the way that every child should,
Sit and listen, sit and listen.
Went to school and I was very nervous,
No one knew me, no one knew me.
Hello teacher tell me whats my lesson?
Look right through me, look right through me.

And I find it kind of funny,
I find it kind of sad.
The dreams in which I’m dying are the best I’ve ever had.
I find it hard to tell you,
I find it hard to take.
When people run in circles its a very very
Mad World
Mad World

Gin Blossoms - Hey Jealousy

Monday, January 2nd, 2006

As I read and study and jobhunt, lately (as I always do, frankly) I’m letting my music play. I’ve decided to share some of my favourite songs (some I’ve decided not to share). Here’s the first in the series of what amount to filler posts:

Well tell me d’you think it’d be alright
If I could just crash here tonight.
You can see I’m in no shape for driving,
And, anyway, I’ve got no place to go.

And you know it might not be that bad,
You were the best I never had.
If I hadn’t blown the whole thing years ago
I might not be alone.

Tomorrow we can drive aorund this down,
And let the cops chase us around.
The past is gone something might be found to take its place.
Hey jealousy
Hey jealousy
Hey jealousy
Hey jealousy

And you can trust me not to think
And not to sleep around.
And, if you don’t expect too much from me,
You might not be let down.

‘Cause all I really want is to be with you,
Feeling like I matter too.
If I hadn’t blown the whole thing years ago
I might be here with you.

Tomorrow we can drive around this town,
And let the cops chase us around.
The past is gone but something might be found to take its place.
Hey Jealousy

Tomorrow we can drive around this town,
And let the cops chase us around.
The past is gone but something might be found to take its place.
Hey Jealousy
Hey Jealousy
Hey Jealousy
Hey Jealousy

Well tell me d’you think it’d be alright
If I could just crash here tonight.
You can see I’m in no shape for driving,
And anyway I’ve got no place to go

And you know it might not be that bad,
You were the best I’d ever had.
If I hadn’t blown the whole thing years ago
I may not be alone.

Tomorrow we can drive around this town,
And let the cops chase us around.
The past is gone but something might be found to take its place.
Hey Jealousy
Hey Jealousy

You know she took my heart.
Well there’s only one thing I couldn’t start.


FireStats icon Powered by FireStats