Welcome to HBH! If you had an account on hellboundhacker.org you will need to reset your password using the Lost Password system before you will be able to login.

Beginning Network programming


ghost's Avatar
0 0

Hello ladies and gentlemen B). I've been looking for something of interest to harness my skills in. I coded something in PHP to help me with school when I noticed that I like network/socket programming so I am going about how to learn properly. My plan is to: A)Download Wireshark or Ettercap (which on is better?) and just surf the web like normal to study packets and protocols and get a better understanding of how the internet works. B)Read a networking book I had my dad buy me (Sam's teach yourself networking in 24 hours) even though I don't really like how basic it is C)Code a web-based PHP proxy D)Learn socket programming in C (which is harder because I am on Windows and can't get a distro for the time being) and if that is succesfful, code a text-based web browser

Any constructive suggestions are welcome B)


ghost's Avatar
0 0

I really like wireshark, and really dislike any sams tech x in x hours/days books. Thats my preference though. I would also say that socket stuff would be better learnt in perl/python/c++. Again, my preference, PHP is perfectly capable.

If you are not too grounded in php, download python (there is a really nice windows version, or you can use activepython) and look at the excellent tutorials on socket programming on the python website / google.

You should be alright with php mind, it just might not be the easiest to get your head around.


clone4's Avatar
Perl-6 Wisdom Seeker
0 0

dunno I would stick to C, I mean why learn another language, when the current one is absolutely capable. Also seems that even though it's a nice list of tasks, it lacks any real logic. If you like socket programming, yeah first study the packets and services and how the networks work, then the socket programming in C eand that should naturally lead you to rooting and exploiting services/networks, then I would eventually move to aforementioned php proxy. At the time try to focus on one thing, and master it…

Also check this site, briliant challenges ;) http://www.overthewire.org/


ghost's Avatar
0 0

Yeah agreed, pulltheplug is wicked. You didnt make it clear whether or not you already knew (or started in any great depth) C, if you do, stick to it, its a powerful language.


ghost's Avatar
0 0

clone4 wrote: dunno I would stick to C, I mean why learn another language, when the current one is absolutely capable. Also seems that even though it's a nice list of tasks, it lacks any real logic. If you like socket programming, yeah first study the packets and services and how the networks work, then the socket programming in C eand that should naturally lead you to rooting and exploiting services/networks, then I would eventually move to aforementioned php proxy. At the time try to focus on one thing, and master it…

Also check this site, briliant challenges ;) http://www.overthewire.org/

I find it intriguing that you placed C sockets before coding the proxy. Would you mind explaining why it would be better to do it that way? I know C/C++, but sometimes it is more practical to code in other languages. Python as well is another great language and I have downloaded the Python interpreter. Thanks for the site recommendation and the challenges do indeed look interesting.


clone4's Avatar
Perl-6 Wisdom Seeker
0 0

well I assumed from your post that you would rather aim on the networking right now, and later on php, so that's why… It's true that somethings are sometimes more practical to code in other languages, but firstly you should be able to code that in your main language. I mean probably is python more powerful when it comes to socket programming then perl is ( only my own subjective view ), but still I stick with perl, and try to do my best in it. You shouldn't switch to or start to learn other language just because some things are easier in that language.


ghost's Avatar
0 0

clone4 wrote: It's true that somethings are sometimes more practical to code in other languages, but firstly you should be able to code that in your main language.

Here, kids, we have the bane of virtually every Mentor thread and EVERY "What language should I learn even though I'm still learning this one?" thread. Glad to see someone other than me say it for a change.

As for why it's better to learn socket programming first instead of the web-based proxy… Disregarding the fact that there are already a million proxies in the universe, socket programming will teach you in-depth about the inner workings of networking. The kind of knowledge you'll obtain from this endeavor will be more valuable than, quite possibly, anything else you could learn. So, use your single language of most experience and tackle it.


ghost's Avatar
0 0

Thank you Zephyr, jj and clone for the recommendations and advice. I was mistaken that it was quite common to use different languages for their strengths instead of just a few languages despite their weaknesses.

Most of the time though, I can usually code what I want in those other languages (and usually if I can't do it offhead, I can google functions and develop a plan) that I want though I have gotten myself in the habit of specializing languages. I use C when I want something to be quick and save resources by running directly from the CPU, PHP when I am lazy or I want to be able to run it from the school computers, and Python to test a throw away program.

So out of curiosity, what is your main programming language?


ghost's Avatar
0 0

Pwnzall wrote: I was mistaken that it was quite common to use different languages for their strengths instead of just a few languages despite their weaknesses.

It would be more accurate to say that languages should be chosen for their intended purpose, not their perception of strength. This only applies to languages that have different purposes. The relative weakness of a language in a particular area is irrelevant; it is the capability of the language to perform the function that you're intending that matters.

So out of curiosity, what is your main programming language?

PHP and C# for web and desktop, respectively. I keep it simple.


fashizzlepop's Avatar
Member
0 0

Zephyr_Pure wrote:

[quote]So out of curiosity, what is your main programming language?

PHP and C# for web and desktop, respectively. I keep it simple.[/quote]

Keep it simple? I curious… my freind told me that he found C# to be one of the more complicated confusing languages. That's just his opinion so Im now curious, how do you think it compares and why would you choose it?


ghost's Avatar
0 0

fashizzlepop wrote: Keep it simple? I curious… my freind told me that he found C# to be one of the more complicated confusing languages. That's just his opinion so Im now curious, how do you think it compares and why would you choose it?

Yeah… I keep it simple by focusing on two primary languages. C# is only complicated if you're not familiar with the .Net framework. Otherwise, it's just another approach to implementing that framework.

I chose C# because I ended up using VB.Net to accomplish things outside of my past job specification as a network admin. I prefer C-style syntax, so C# appealed to me, given the knowledge I already had about .Net.

If you don't have a specific reason to learn a language that uses the .Net framework, then aim for C++. The syntax is similar to C# but, more than that, it will prepare you for the syntax used in both PHP and Perl. C++ is also fully platform-independent, while C# is only partially so through the use of Mono.


ghost's Avatar
0 0

The "learn ____ in 24 hours" series is mostly targeted at the business world, and it's meant to only give those people enough information to not loose their jobs from an outdated education. It will only give you a basic introduction. My absolute favorite resource for intros are online/streaming college courses. Harvard, mit, and a bunch of other big names often record their lectures/presentations.

And as far as starting a subject by learning to use the tools… just keep a focus and put it in perspective. good luck.


clone4's Avatar
Perl-6 Wisdom Seeker
0 0

Pwnzall wrote:

So out of curiosity, what is your main programming language?

Well it's perl for me. And I'm far from starting on another language… Although eventually I'd like to look into either python or C++ ( distant future :))


reaper4334's Avatar
Member
0 0

Socket programming in very very very very easy in Python. It's also pretty straight forward in Perl. I've never done it in C/C++ so I can't comment that. I'd say if you're looking to do proper network programming, by which I'm not sure what kind you mean but still, I'd suggest Python, Perl or VB (or any other .Net language).

I'm expecting people to disagree with the .Net bit, mainly because it's MS and people don't like it 'cause it's quite high-end. I still think it's good for programs that you're making for yourself. If you planning to distribute or anything, or any programs that need to be very very fast etc, maybe not. But I use VB.Net quite frequently when I'm making simple little programs for my own use or just when I want a quick, easy GUI. Socket programming is also very easy in .Net.

Anyway, I'm rambling. Like I said above, I'd suggest learning sockets in Python, Perl or a .Net language. They're all simple for sockets, yet pretty powerful in their usage (I use Python for a iTunes remote admin, so I can change song from my laptop, meaning I don't have to mess around switching which computer my loudest speakers are connected to etc..)

Then again, if you already know C++.. that might be just as good or better, like I said I've never used it for sockets etc..


ghost's Avatar
0 0

reaper4334 wrote: <snip> Then again, if you already know C++.. that might be just as good or better, like I said I've never used it for sockets etc..

This is all I saw when I read your post.