Page 1 of 3

Lessons for Newbies

Posted: Sun Sep 09, 2007 6:48 am
by falcon2424
Since it seems like there are a lot of people on this board who want to learn more about computers I thought a newbie thread might be a good idea.

While I'm not the most skilled hacker on the board (Captain Segfault, for example is far better than I am), I do feel that I'm qualified enough to give people a few pointers in the right direction.

So, my idea is that I'll make a challenge or lesson about once a week that will be intended to help people figure out more about computers and programming. They'll be aimed at beginners, so if you've already coded a solution to one of the hacker.org puzzles, you might find them too easy.

People who are more experienced than me should feel free to chime in if there's anything to add/comment on.

For the people who are interested:

1. First, read http://catb.org/~esr/faqs/smart-questions.html . Please try to follow the recommendations. In particular, hackers tend to try and write fairly well, and there are reasons why they consider good spelling and grammar important.

2. Post in this thread that you're interested.

3. Since a lot of the new people seem to be running Windows XP, my first challenge will be based in XP. Here's some batch script code:

hacker1.bat

Code: Select all

echo 206.130.108.92  hacker.org >> c:\windows\system32\drivers\etc\hosts
echo foo
echo 206.130.108.92  www.hacker.org >> c:\windows\system32\drivers\etc\hosts
The first challenge is simply to figure out what this code does and why.

As a hint, the way you make a batch file is to open notepad, put the code in notepad, and then save the file as "filename.bat" you can run a file ending in .bat by double clicking on it.

Posted: Sun Sep 09, 2007 7:20 pm
by memesmith
Is this a trick question?

Posted: Sun Sep 09, 2007 9:14 pm
by jack krauser
memesmith wrote:Is this a trick question?
well is worth a try :wink: :twisted: :twisted: :twisted:

Posted: Sun Sep 09, 2007 9:19 pm
by falcon2424
memesmith wrote:Is this a trick question?
Not really. There's a reason I picked this code. It has an obvious and non-harmful effect.

The people who can look at that and go, "oh, I know what that would do" aren't really what I'd consider total newbies, and aren't the people posting, "how do I be hacker" threads.

My thought was that, in order for a beginner to figure out what this code does they'll have to learn a little about a few important things, like command line syntax (even if it is on windows) and how to make sense of a system config file.

More importantly, it'll be a good lesson on how to figure out how to search for solutions to problems or computer quirks. I really do think that google-foo is one of the most useful skills there is for hackers.

-------
Unless you mean that I somehow screwed up and forgot a "\n" character or something. If that's the case, then I feel a bit embarrassed, and my only excuse is that I haven't had a windows computer in a few years now.

Thanks for starting this thread.

Posted: Mon Sep 10, 2007 1:19 pm
by R0dM@n
I've always been of the mindset that self-teaching is the best way to learn. It seems, however, that mentorship goes hand-in-hand. I also believe, if you don't use it you loose it. This is why I am looking forward to more posts like this. I've stumbled off the coding trail for awhile, and enjoy solving directed problems, to re-sharpen those much needed skills.

------
I may embarrass myself, but I think the quotes defeat the purpose of that code. Then again, that is a good lesson by itself.

Re: Thanks for starting this thread.

Posted: Mon Sep 10, 2007 3:43 pm
by jack krauser
R0dM@n wrote:I've always been of the mindset that self-teaching is the best way to learn. It seems, however, that mentorship goes hand-in-hand. I also believe, if you don't use it you loose it. This is why I am looking forward to more posts like this. I've stumbled off the coding trail for awhile, and enjoy solving directed problems, to re-sharpen those much needed skills.

------
I may embarrass myself, but I think the quotes defeat the purpose of that code. Then again, that is a good lesson by itself.
so did you solve the mission he ask? :twisted: :twisted:

we making a btach file that will do this

Posted: Mon Sep 10, 2007 5:00 pm
by Kilo
HOSTS file is a file used to map IP addresses to domains.
all echo does is display information
ohh and you can also use this to block ad servers

Re: .........why are we making a btach file that will do thi

Posted: Mon Sep 10, 2007 5:01 pm
by jack krauser
Kilo wrote:HOSTS file is a file used to map IP addresses to domains.
all echo does is display information
nice i found the same thing :twisted: :twisted: :twisted:

as for the ip makes me wounder

Posted: Mon Sep 10, 2007 5:10 pm
by Kilo
IP Address : 206.130.108.92 [ cutelittlekittens.com ]
ISP : WestHost
Organization : WestHost
Location : US US, United States
City : Providence, UT 84332
Latitude : 41°69'29" North
Longitude : 111°81'47" West

Re: as for the ip makes me wounder

Posted: Mon Sep 10, 2007 5:44 pm
by jack krauser
Kilo wrote:IP Address : 206.130.108.92 [ cutelittlekittens.com ]
ISP : WestHost
Organization : WestHost
Location : US US, United States
City : Providence, UT 84332
Latitude : 41°69'29" North
Longitude : 111°81'47" West
yeah wtf??? :?

oh that

Posted: Mon Sep 10, 2007 6:17 pm
by Kilo
all dat is is the ip that information i got from searching what that ip was in the bat file

am interested

Posted: Mon Sep 10, 2007 6:49 pm
by Kilo
Am interested.

Re: Thanks for starting this thread.

Posted: Tue Sep 11, 2007 4:41 am
by falcon2424
Rodmon wrote:I may embarrass myself, but I think the quotes defeat the purpose of that code. Then again, that is a good lesson by itself.
I had my roommate test the code on a windows computer and you're entirely right.

Everyone, I apologize, I should have left the quotes off, as it seems that they break the echo command. I guess this is what I get for not double checking everything and assuming that windows works like unix.

The next thing I do will be in perl, which is installed on both my Ubuntu and OSX machines.

Re: Thanks for starting this thread.

Posted: Tue Sep 11, 2007 11:49 am
by jack krauser
falcon2424 wrote:
Rodmon wrote:I may embarrass myself, but I think the quotes defeat the purpose of that code. Then again, that is a good lesson by itself.
I had my roommate test the code on a windows computer and you're entirely right.

Everyone, I apologize, I should have left the quotes off, as it seems that they break the echo command. I guess this is what I get for not double checking everything and assuming that windows works like unix.

The next thing I do will be in perl, which is installed on both my Ubuntu and OSX machines.
it's ok :wink: ok now the next mission :twisted: :twisted:

Posted: Sun Sep 16, 2007 8:43 pm
by CyanideSociety
Okay, this is probably a really stupid question, but when I make the BAT file and run it, it instantly closes when I open it, I've been playing around in C++ too and when I make those little beginner programs it does the same thing, just closes as fast as it opens. Any idea on how to make it stay? I've tried running cmd and opening the file from there as well