<s>
Sockstress	B-Protocol
is	O
a	O
method	O
that	O
is	O
used	O
to	O
attack	O
servers	O
on	O
the	O
Internet	O
and	O
other	O
networks	O
utilizing	O
TCP	B-Protocol
,	O
including	O
Windows	B-Application
,	O
Mac	B-Device
,	O
Linux	B-Application
,	O
BSD	B-Operating_System
and	O
any	O
router	B-Protocol
or	O
other	O
internet	O
appliance	O
that	O
accepts	O
TCP	B-Protocol
connections	O
.	O
</s>
<s>
Sockstress	B-Protocol
was	O
developed	O
as	O
internal	O
proof-of-concept	O
by	O
the	O
late	O
Jack	O
C	O
.	O
Louis	O
at	O
Outpost24	O
.	O
</s>
<s>
Louis	O
discovered	O
anomalies	O
using	O
Unicornscan	O
to	O
test	O
and	O
probe	O
networks	O
for	O
corporate	O
security	O
,	O
which	O
led	O
to	O
the	O
development	O
of	O
Sockstress	B-Protocol
.	O
</s>
<s>
A	O
proof-of-concept	O
tool	O
,	O
Nkiller2	O
,	O
that	O
demonstrated	O
an	O
attack	O
similar	O
to	O
sockstress	B-Protocol
was	O
released	O
by	O
Fotis	O
Chantzis	O
aka	O
ithilgore	O
on	O
Phrack	O
ezine	O
.	O
</s>
<s>
Nkiller2	O
works	O
completely	O
statelessly	O
,	O
using	O
packet-parsing	O
techniques	O
and	O
virtual	O
states	O
,	O
and	O
exploits	O
an	O
inherent	O
mechanism	O
of	O
TCP	B-Protocol
,	O
the	O
Persist	O
Timer	O
,	O
thus	O
being	O
able	O
to	O
perform	O
and	O
infinitely	O
prolong	O
a	O
generic	O
DoS	O
attack	O
with	O
a	O
minimal	O
amount	O
of	O
network	O
traffic	O
.	O
</s>
<s>
Sockstress	B-Protocol
is	O
a	O
user-land	O
TCP	B-Protocol
socket	O
stress	O
framework	O
that	O
can	O
complete	O
arbitrary	O
numbers	O
of	O
open	O
sockets	O
without	O
incurring	O
the	O
typical	O
overhead	O
of	O
tracking	O
state	O
.	O
</s>
<s>
Once	O
the	O
socket	O
is	O
established	O
,	O
it	O
is	O
capable	O
of	O
sending	O
TCP	B-Protocol
attacks	O
that	O
target	O
specific	O
types	O
of	O
kernel	O
and	O
system	O
resources	O
such	O
as	O
Counters	O
,	O
Timers	O
,	O
and	O
Memory	O
Pools	O
.	O
</s>
<s>
The	O
sockstress	B-Protocol
attack	O
tool	O
consists	O
of	O
two	O
main	O
parts	O
:	O
</s>
<s>
1	O
)	O
Fantaip	B-Protocol
:	O
Fantaip	B-Protocol
is	O
a	O
"	O
Phantom	O
IP	O
"	O
program	O
that	O
performs	O
ARP	O
for	O
IP	O
addresses	O
.	O
</s>
<s>
To	O
use	O
fantaip	B-Protocol
,	O
type	O
'	O
fantaip	B-Protocol
-i	O
interface	O
CIDR	O
 '	O
,	O
Ex.	O
,	O
'	O
fantaip	B-Protocol
-i	O
eth0	O
192.168.0.128/25	O
'	O
.	O
</s>
<s>
Since	O
sockstress	B-Protocol
completes	O
TCP	B-Protocol
sockets	O
in	O
user-land	O
,	O
it	O
is	O
not	O
advisable	O
to	O
use	O
sockstress	B-Protocol
with	O
an	O
IP	O
address	O
configured	O
for	O
use	O
by	O
the	O
kernel	O
,	O
as	O
the	O
kernel	O
would	O
then	O
RST	O
the	O
sockets	O
.	O
</s>
<s>
2	O
)	O
Sockstress	B-Protocol
:	O
In	O
its	O
most	O
basic	O
use	O
,	O
sockstress	B-Protocol
simply	O
opens	O
TCP	B-Protocol
sockets	O
and	O
sends	O
a	O
specified	O
TCP	B-Protocol
stress	O
test	O
.	O
</s>
<s>
It	O
can	O
optionally	O
send	O
an	O
application	O
specific	O
TCP	B-Protocol
payload	O
(	O
i.e.	O
</s>
<s>
The	O
client	O
side	O
cookies	O
,	O
heavily	O
discussed	O
in	O
blogs	O
,	O
news	O
and	O
discussion	O
lists	O
,	O
is	O
an	O
implementation	O
detail	O
of	O
sockstress	B-Protocol
,	O
and	O
not	O
strictly	O
necessary	O
for	O
carrying	O
out	O
these	O
attacks	O
.	O
</s>
<s>
Every	O
attack	O
in	O
the	O
sockstress	B-Protocol
framework	O
has	O
some	O
impact	O
on	O
the	O
system/service	O
it	O
is	O
attacking	O
.	O
</s>
<s>
Sockstress	B-Protocol
does	O
not	O
have	O
a	O
special	O
attack	O
module	O
for	O
performing	O
a	O
simple	O
connection	O
flood	O
attack	O
,	O
but	O
any	O
of	O
the	O
attack	O
modules	O
can	O
be	O
used	O
as	O
such	O
if	O
the	O
-c-1	O
(	O
max	O
connections	O
unlimited	O
)	O
and	O
-m-1	O
(	O
max	O
syn	O
unlimited	O
)	O
options	O
are	O
used	O
.	O
</s>
<s>
A	O
further	O
variation	O
would	O
be	O
to	O
occasionally	O
advertise	O
a	O
TCP	B-Protocol
window	I-Protocol
larger	O
than	O
0	O
,	O
then	O
go	O
back	O
to	O
0-window	O
.	O
</s>
<s>
Create	O
a	O
connection	O
to	O
a	O
listening	O
socket	O
and	O
upon	O
3	O
way	O
handshake	O
(	O
inside	O
last	O
ACK	O
)	O
set	O
window	O
size	O
of	O
4	O
bytes	O
,	O
then	O
create	O
an	O
ACK/PSH	O
packet	O
with	O
a	O
TCP	B-Protocol
payload	O
(	O
into	O
a	O
window	O
that	O
is	O
hopefully	O
large	O
enough	O
to	O
accept	O
it	O
)	O
with	O
a	O
window	O
still	O
set	O
to	O
4	O
bytes	O
.	O
</s>
<s>
This	O
has	O
reliably	O
put	O
Linux/Apache	O
and	O
Linux/sendmail	O
systems	O
into	O
defunct	O
states	O
.	O
</s>
<s>
Look	O
at	O
the	O
payload.c	O
file	O
in	O
the	O
sockstress	B-Protocol
source	O
.	O
</s>
<s>
This	O
attack	O
was	O
originally	O
created	O
to	O
target	O
Linux	B-Application
.	O
</s>
<s>
It	O
is	O
also	O
quite	O
effective	O
against	O
Windows	B-Application
.	O
</s>
<s>
After	O
enough	O
of	O
such	O
sockets	O
,	O
the	O
router	B-Protocol
could	O
no	O
longer	O
communicate	O
TCP	B-Protocol
correctly	O
.	O
</s>
<s>
Look	O
at	O
the	O
payload.c	O
file	O
in	O
the	O
sockstress	B-Protocol
source	O
.	O
</s>
<s>
Look	O
at	O
the	O
payload.c	O
file	O
in	O
the	O
sockstress	B-Protocol
source	O
.	O
</s>
<s>
The	O
result	O
of	O
which	O
has	O
been	O
systems	O
that	O
no	O
longer	O
have	O
event	O
timers	O
for	O
TCP	B-Protocol
communication	O
,	O
frozen	O
systems	O
,	O
and	O
system	O
reboots	O
.	O
</s>
<s>
As	O
a	O
general	O
rule	O
,	O
the	O
more	O
services	O
a	O
system	O
has	O
,	O
the	O
faster	O
it	O
will	O
succumb	O
to	O
the	O
devastating	O
(	O
broken	O
TCP	B-Protocol
,	O
system	O
lock	O
,	O
reboot	O
,	O
etc	O
.	O
)	O
</s>
<s>
The	O
attack	O
requires	O
a	O
successful	O
TCP	B-Protocol
3	O
way	O
handshake	O
to	O
effectively	O
fill	O
the	O
victims	O
connection	O
tables	O
.	O
</s>
<s>
A	O
sockstress	B-Protocol
style	O
exploit	O
also	O
needs	O
access	O
to	O
raw	B-Protocol
sockets	I-Protocol
on	O
the	O
attacking	O
machine	O
because	O
the	O
packets	O
must	O
be	O
handled	O
in	O
userspace	B-Operating_System
rather	O
than	O
with	O
the	O
OS	O
's	O
connect( )	O
API	B-General_Concept
.	O
</s>
<s>
Raw	B-Protocol
sockets	I-Protocol
are	O
disabled	O
on	O
Windows	B-Application
XP	O
SP2	O
and	O
above	O
,	O
but	O
device	O
drivers	O
are	O
readily	O
available	O
to	O
put	O
this	O
facility	O
back	O
into	O
Windows	B-Application
.	O
</s>
<s>
The	O
exploit	O
is	O
able	O
to	O
be	O
executed	O
as-is	O
on	O
other	O
platforms	O
with	O
raw	B-Protocol
sockets	I-Protocol
such	O
as	O
*	B-Operating_System
nix	I-Operating_System
and	O
requires	O
root	O
(	O
superuser	O
)	O
privileges	O
.	O
</s>
<s>
Since	O
an	O
attacker	O
must	O
be	O
able	O
to	O
establish	O
TCP	B-Protocol
sockets	O
to	O
affect	O
the	O
target	O
,	O
white-listing	O
access	O
to	O
TCP	B-Protocol
services	O
on	O
critical	O
systems	O
and	O
routers	B-Protocol
is	O
the	O
currently	O
most	O
effective	O
means	O
for	O
mitigation	O
.	O
</s>
<s>
Using	O
IPsec	B-Protocol
is	O
also	O
an	O
effective	O
mitigation	O
.	O
</s>
<s>
According	O
to	O
the	O
Cisco	O
Response	O
the	O
current	O
mitigation	O
advice	O
is	O
to	O
only	O
allow	O
trusted	O
sources	O
to	O
access	O
TCP-based	O
services	O
.	O
</s>
<s>
On	O
Linux	B-Application
using	O
iptables	B-Application
with	O
connection	O
tracking	O
and	O
rate	O
limiting	O
can	O
limit	O
the	O
impact	O
of	O
exploitation	O
significantly	O
.	O
</s>
