Unix Edition
Feb. 15th, 2000
.... ._ .__. .__. _.__ .... ._ _._. _._ . ._. _.. .. __. .
... _
See the Happy Hacker web site at http://www.happyhacker.org
Firewall gives you problems? Try http://happyhacker.org
.... ._ .__. .__. _.__ .... ._ _._. _._ . ._. _.. .. __. . ...
_
***********************************************************************
*** Editor's Comments
***********************************************************************
Well, this is the 10th issue for me, and I've been rethinking
some things.
Someone wrote to me about putting more content into these newsletters.
I'm
going to try and do my best, but I need your help. If anyone
wants to help
out by contributing an article, I'd be really appreciative. Newbie
Perlers
will be glad to know the Perl 101 is back, don't ask what happened
the last
few weeks. I'm also including the transcript of a conversation
I had with a
real clueless ev1l haxor wannabe on AOL Instant Messenger...
I've fubared
the names, and while it's not quite as funny as the now famous
<>< (that
means phish, as in fishing for passwords by impersonating AOL
personnel)
reversal, it's still quite humorous (I think so, at least). Finally,
I'm not
sure what happened to mail volume this week... very few emails.
Hmmm.
As a followup to last weeks KAK worm warning, I've been in
contact with the
individual who sent me the virus, and he assures me that it was
an
accidental infection. I believe him, at least since he forwarded
two other
emails from people who he also infected... and if he went to
the trouble of
writing two fake letters (as well as answering my emails... a
real evil
individual would've forged a reply address, if it _was_ deliberate...
well... for that much effort, he practically deserves my trust.
I think next
week I might post parts of it... I don't think there's any techniques
that
any aspiring evil virus coder couldn't think of after about 2
minutes of
directed thought.
And finally, if anyone is wondering what those funky lines
are, they're
morse code for "happy hacker digest".
***********************************************************************
*** Readers' Submissions
***********************************************************************
Alexei <alexei@germany.gelitten.org> asks:
Where would be the best place to search for answer to this
strange
problem. I scouered the net already and asked a whole bunch of
people on
IRC. No one has even heard of it and on the web several posts
exist with
most of them involving badly configured ISDN cards.
I am using kernel 2.2.5-15 on RH6. On, the first reboot after
install I
get the msg::
Code 89 50 04 b8 01 00 00 00 eb 03 90 31 c0 c7 41 04 00 00
00 00
Aiee, killing interrupt handler.
Kernel panic: Attempted to kill the idle task!
In interrupt handler - not syncing.
Then it freezes. There is no ISDN card in the box and the
memory seems to
be good. The board shows no noticable problems.
Do you know where I could go to find a solution to this problem?
[Editor: Of course, the happyhacker list is the best place
<g>. Seriously,
you said the memory seems to be good... did you test it and the
motherboard
under another OS? I'm not a kernel hacker... is there anyone
out there who
might know what "Code 89 50 04 b8 01 00 00 00 eb 03 90 31
c0 c7 41 04 00 00 00 00" means?]
-----------------------------------------------------------------------
Brendan Cullen <ts_psycho@primus.com.au>:
Hi Ms Meinel,
I just want to start off by saying YOUR MY HERO! If it wasn't
for you and
the team at Happy Hacker I wouldn't have the great passion for
hacking/computer security I do nowadays. I'm fifteen and live
in
Queensland, Australia and have a dream to become and OS programmer
and i'm
teaching myself to program in C. It's such a pain trying to teach
myself
but i did manage to track down and buy K&R as well as finding
other free
online C tutorials. But i'm shocked that i cannot find any courses
anywhere
at all in the Rockhampton (central queensland area). I've tried
searching
at TAFE and looked in the newspaper for advertisements about
computer
courses but to no avail. I'm making very slow progress but i'm
getting
there.
I'm sure i'm boring you right now but before i finish up i
must ask you for
help.
I found myself a book and a copy of Red Hat 6.0 linux and installed
it no
problems. I luved linux......in fact my friends started to whinge
because i
was never on ICQ talking to them......i was always on linux craving
for more
information. This is not my problem. My problem was that i went
to work
one afternoon and left my linux box running connected to the
internet. My
sister was having a sleepover with numerous friends watching
scary movies so
as a joke i went to the power box at the side of the house and
turned the
power off.......i forgot all about my computer running........anyway
i
restarted my computer a short time later only to find that i
recieved an
error message when trying to connect to the internet stating
that my kernel
did not have kppp ability or something similar......i tried re
installing
the kernel and upgrading and everything. I eventually uninstalled
my linux
and deleted my partion using FDISK......however something is
no wrong
because when i try to re install Red Hat it comes up with kernel
panic at
8:32 (i think that's it) so i thought oh no what have i done.....i
tried to
install Caldera OpenLinux 2.2 and found the same proplem.........can
i fix
this or will i have to format my whole computer and try again...please
please help me......i've tried linux newsgroups and everything....no
one is
offering any help and i'm stuck with gay Windows 98 until i either
re format
or fix it somehow.......i really hope i don't have to as i have
my files
such as mp3's etc i wish not lose......but if it's what it takes
to get
linux back then i'll do anything.
Oh yeah..my grandfather wants me to set up a web server for
him too. That's
another reason i want linux back as well
I will thank you very much in advance for any help you can
give me.
Your fan always
@x3m@n
[Editor: Good for you. Or better yet, great for you (in studying,
at least).
Just out of curiousity, are you near Melbourne? I have a good
friend out
there... if you're nearby, let me know, and I can put you guys
in touch. I
guess the first important lesson you should have learned is not
to try and
scare your sister. Then again, having done that myself, maybe
I should
talk... anyway... as I'm sure you're aware, powering off a Linux
(or any
Unix) system is a big, BIG, no-no. The reason is that open files
are often
not written to disk until later, so your files might not be saved.
You might
(and it's a little late), set up a cron job to sync files periodically...
maybe every two minutes. Now, however, I'm not sure what you
can do. If you
FDISK'ed your drive, you know everything is gone... I'm not sure
why
reinstalling still gave you an error. Do any of the diagnostic
utilities
under Win98 tell you if any hardware was damaged? As far as software
goes,
there's no reason why a reformat shouldn't have provided a clean
slate. It's
always possible, however unlikely, that your little power stunt
somehow
damaged some hardware... Linux is much more sensitive to things
like a tiny
problem in memory, for example, than Windows is. I guess next
time you might
want to resort to less dramatic forms of torture... good luck.]
-----------------------------------------------------------------------
Pat Lawrence <gwen@antionline.org> wonders:
I've tried reading several Linux sites - can't find anything
about system
tuning in Linux. I'm sure there must be shared memory, semaphore
structures, buffer configurations, TCP/IP connection timeouts
and the like,
but how do I change it and check the results ?? I've needed to
do this for
SCO enterprise stuff that I've put together, and now need to
try using Linux
in a similar way.
Anybody out there able to point me to some good documentation
??
Any information would be appreciated !!
[Editor: Hmmm. I really don't know... well... I know shared
memory is pretty
bad, but other than the general rule of thumb for swap file size,
I know
very little about tweaking Linux. Excellent question... and it
would
probabaly be a great topic for an feature... *cough* *ahem*]
-----------------------------------------------------------------------
***********************************************************************
*** Perl 101 Lesson 4
***********************************************************************
I ought to note one thing before I begin. The structure for
these articles
is taken from the O'Reilly Book _Learning Perl_. I've actually
been
following their outline pretty closely, using my own explanations,
but
following their orders. I highly recommend anyone serious about
buy this
book. Actually, buy all the O'Reilly books :).
Anyway... onto Scalar Data. Scalar Data, like the mathematic
definition of
scalar, contains one thing (as opposed to an array/vector). Unlike
a
mathematical scalar, a scalar variable can contain either a number
or a
string. Basically, a scalar variable is what non-programmers
(who aren't
familiar with arrays) would usually think of when they think
of a variable.
The first way to use a scalar is by using it as a constant. This
is known as
hard coding the variable. The source code contains the value
of the
variable. You can declare floating points (numbers with a decimal
place) or
integars (whole numbers), but be aware that perl does not (by
default)
differenciate between integars and floating points. In other
words, all ints
(integars) are stored as floats. So unlike C, where you would
try to
optimize by using the least data necessary, that's usually not
worthwhile in
perl. You may be familiar with the difference between 50, 050,
and 0x50...
if not, the first is decimal (base 10... normal), the second
is octal (base
eight... numbers 0-7, so you count by going
01,02,03,04,05,06,07,010,011,012...020...076,077,0100... the
convention is a
leading zero to indicate octal), and the last is base 16 (hex...
0-9,A,B,C,D,E,F,10,etc.). Ox is the prefix for a hex number.
In declaring a
constant, perl will interpert 0 and 0x to mean octal and hexidecimal,
respectively.
The next type of scalar is a string. A string is collection
of characters
(the entire ASCII range). While normally a string would be human
readable
(in the ASCII 33-127 range), but you can actually handle _any_
set of data,
and _Learning Perl_ notes that you can patch your OS by treating
as a giant
string.
There are two ways to declare a string: double quoted and
single quotes. A
single quoted string is defined by all characters between two
single quotes
(the one below the double quotes... not the one below the tilde,
which does
something different, so it 'string', not `string`.), and a double
quoted
just has double quotes (") bracketing the string. What's
the difference?
Well, the single quote string is much more literal. This means
that "escape
codes" like \n (newline... see Lesson 2) are not processed.
All chacters are
taken literally, except for a backslash, which can have two meanings.
A
backslash followed by a single quote will put a real single quote
inside the
string. Two backslashes will put in a literal backslash. Other
than that,
there are no escape codes.
The double quoted string has much more expansion. Inside a
double quoted
string, the backslash can declare a lot of codes. The following
list was
stolen:
Code: Meaning:
================
\n Newline
\r Return
\t Tab
\f Formfeed
\b Backspace
\a Bell
\e Escape
\007 Any octal ASCII value (here, 007 = bell)
\x7f Any hex ASCII value (here, 7f = delete)
\cC Any "control" character (here, CTRL-C)
\\ Backslash
\" Double quote
\l Lowercase next letter
\L Lowercase all following letters until \E
\u Uppercase next letter
\U Uppercase all following letters until \E
\Q Backslash-quote all nonalphanumerics until \E
\E Terminate \L , \U, or \Q
I think this is pretty self explanatory. We saw in Digest
#4 the following
statement
print("Hello $planetname\n");
This string being passed to print is "Hello $planetname\n".
First, if this
would have been a single quote string ('Hello $planetname\n'),
the \n
(newline) would not have been expanded. But more importantly,
remember that
$planetname is a variable. In the double quotes, the variable
name will be
replaced with the vale of that variable. If it were a single
quote, it would
have actually displayed: Hello $planetname\n. Now it displays
(for Mars,
say): Hello Mars^M (I used ^M to represent the newline). I think
that'll do
it for this week, next week we'll discuss how to handle scalar
variables.
More--->>