-
Security threats Toolkit
How security will look in 10 years
1. Ubiquitous cloud computing.
2. ID and access management.
3. Public sector moves online.
4. The internet of things.
5. Mesh networks.
6. Mobile botnets.
7. Super-fast broadband.
8. DNS SEC.
9. IPv6.
10. Cyber warfare and industrial espionage.
Read this full article.
security & hack
السبت، 28 أبريل 2012
الجمعة، 27 أبريل 2012
Hacking Vs. Programming
What is the difference between Hacking and programming? One opinion I have heard expressed is that a hacker can put a lot of code together in a hurry but if a change is needed the code has to be completely rewritten. A programmer may take a little longer but if changes are needed they are more quickly and easily installed without the need for a complete rewrite. One source I heard attributed an observation like this to Maggie Johnson of Google. It rings true to me though. Hacking is usually described as “quick and dirty.” You though a bunch of code together and make it up as you go along. Some hackers are quite brilliant and can do amazing things in incredibly short periods of time. And then they move to the next thing. Or perhaps they stay with the same thing because no one else can understand it well enough to fix it, modify it or improve it. Job security? Perhaps but not a good thing for the people who use, or importantly pay for, the software.
I do a little hacking – that is to say toss something together in a short period of time without a lot of planning – from time to time. I’m not a genius though and typically this ends poorly. The performance is poor, the maintainability is poor, and no one else wants to use it. This may make be biased against this way of doing things I guess. I prefer to program – to think things out, to plan, to proceed in an organized fashion. I saw the difference made clear to me my first year of teaching (a long time ago). I was working on a little game programming of my own and decided to show it to some of my students. As I explained how I had set things up around a number of constants that is hoped would make the program more easily expandable one of the students turned to another and said “Look at that. He’s just starting and already he is planning for additions.” That is one of the real keys, in my opinion, to real programming.
I was a major in Systems Analysis in college. This was during a time when computer science majors were rare and software engineering majors rarer still. But one of the things my professors drilled into our heads was that programs had to be maintainable and extensible. We were taught from day one that programs are not finished but, in a sense, abandoned. More likely at some point you declare victory and more on. But others will maintain these programs and expand them and adapt them. Making their lives easier is a good thing. Think of the Golden Rule – program was you would want the programmers whose code you are modifying to have programmed. I think that is how it is written.
The hackers get a lot of attention these days. These are the basketball players who make the slam dunk that makes it to the highlight reel. But basketball games are won by teams of players executing on the basics – the solid play well executed, the dribble, the layup, the pass that gets the ball to the star. In the long run we need more real programmers to make solid, dependable programs that don’t have be be rewritten from scratch when a change is needed.
Author : Alfred Thompson Source : http://blogs.msdn.com/b/alfredth/archive/2011/07/27/hacking-vs-programming.aspx
الأربعاء، 25 أبريل 2012
لا تبحث كثيرا حول كيفية ان تصبح هاكر لانة بعد ان تضيع وقتك سوف تندم اذا لم تاخذ بهذا الكلام
How To Become A Hacker
Eric Steven Raymond
Copyright © 2001 Eric S. Raymond
Revision History | ||
---|---|---|
Revision 1.43 | 07 Feb 2011 | esr |
Python passed Perl in popularity in 2010. | ||
Revision 1.42 | 22 Oct 2010 | esr |
Added "Historical note". | ||
Revision 1.40 | 3 Nov 2008 | esr |
Link fixes. | ||
Revision 1.39 | 14 Aug Jan 2008 | esr |
Link fixes. | ||
Revision 1.38 | 8 Jan 2008 | esr |
Deprecate Java as a language to learn early. | ||
Revision 1.37 | 4 Oct 2007 | esr |
Recommend Ubuntu as a Unix distro for newbies. |
Table of Contents
Why This Document?
If you are reading a snapshot of this document offline, the current version lives at http://catb.org/~esr/faqs/hacker-howto.html.
Note: there is a list of Frequently Asked Questions at the end of this document. Please read these—twice—before mailing me any questions about this document.
Numerous translations of this document are available: Arabic Belorussian Chinese (Simplified), Danish, Dutch, Estonian, German, Greek Italian Hebrew, Norwegian, Portuguese (Brazilian), Romanian Spanish, Turkish, and Swedish. Note that since this document changes occasionally, they may be out of date to varying degrees.
The five-dots-in-nine-squares diagram that decorates this document is called a glider. It is a simple pattern with some surprising properties in a mathematical simulation called Life that has fascinated hackers for many years. I think it makes a good visual emblem for what hackers are like — abstract, at first a bit mysterious-seeming, but a gateway to a whole world with an intricate logic of its own. Read more about the glider emblem here.
What Is a Hacker?
There is a community, a shared culture, of expert programmers and networking wizards that traces its history back through decades to the first time-sharing minicomputers and the earliest ARPAnet experiments. The members of this culture originated the term ‘hacker’. Hackers built the Internet. Hackers made the Unix operating system what it is today. Hackers run Usenet. Hackers make the World Wide Web work. If you are part of this culture, if you have contributed to it and other people in it know who you are and call you a hacker, you're a hacker.
The hacker mind-set is not confined to this software-hacker culture. There are people who apply the hacker attitude to other things, like electronics or music — actually, you can find it at the highest levels of any science or art. Software hackers recognize these kindred spirits elsewhere and may call them ‘hackers’ too — and some claim that the hacker nature is really independent of the particular medium the hacker works in. But in the rest of this document we will focus on the skills and attitudes of software hackers, and the traditions of the shared culture that originated the term ‘hacker’.
There is another group of people who loudly call themselves hackers, but aren't. These are people (mainly adolescent males) who get a kick out of breaking into computers and phreaking the phone system. Real hackers call these people ‘crackers’ and want nothing to do with them. Real hackers mostly think crackers are lazy, irresponsible, and not very bright, and object that being able to break security doesn't make you a hacker any more than being able to hotwire cars makes you an automotive engineer. Unfortunately, many journalists and writers have been fooled into using the word ‘hacker’ to describe crackers; this irritates real hackers no end.
The basic difference is this: hackers build things, crackers break them.
If you want to be a hacker, keep reading. If you want to be a cracker, go read the alt.2600 newsgroup and get ready to do five to ten in the slammer after finding out you aren't as smart as you think you are. And that's all I'm going to say about crackers.
The Hacker Attitude
But if you think of cultivating hacker attitudes as just a way to gain acceptance in the culture, you'll miss the point. Becoming the kind of person who believes these things is important for you — for helping you learn and keeping you motivated. As with all creative arts, the most effective way to become a master is to imitate the mind-set of masters — not just intellectually but emotionally as well.
Or, as the following modern Zen poem has it:
    To follow the path:
    look to the master,
    follow the master,
    walk with the master,
    see through the master,
    become the master.
1. The world is full of fascinating problems waiting to be solved.
If you aren't the kind of person that feels this way naturally, you'll need to become one in order to make it as a hacker. Otherwise you'll find your hacking energy is sapped by distractions like sex, money, and social approval.
(You also have to develop a kind of faith in your own learning capacity — a belief that even though you may not know all of what you need to solve a problem, if you tackle just a piece of it and learn from that, you'll learn enough to solve the next piece — and so on, until you're done.)
2. No problem should ever have to be solved twice.
To behave like a hacker, you have to believe that the thinking time of other hackers is precious — so much so that it's almost a moral duty for you to share information, solve problems and then give the solutions away just so other hackers can solve new problems instead of having to perpetually re-address old ones.
Note, however, that "No problem should ever have to be solved twice." does not imply that you have to consider all existing solutions sacred, or that there is only one right solution to any given problem. Often, we learn a lot about the problem that we didn't know before by studying the first cut at a solution. It's OK, and often necessary, to decide that we can do better. What's not OK is artificial technical, legal, or institutional barriers (like closed-source code) that prevent a good solution from being re-used and force people to re-invent wheels.
(You don't have to believe that you're obligated to give all your creative product away, though the hackers that do are the ones that get most respect from other hackers. It's consistent with hacker values to sell enough of it to keep you in food and rent and computers. It's fine to use your hacking skills to support a family or even get rich, as long as you don't forget your loyalty to your art and your fellow hackers while doing it.)
3. Boredom and drudgery are evil.
To behave like a hacker, you have to believe this enough to want to automate away the boring bits as much as possible, not just for yourself but for everybody else (especially other hackers).
(There is one apparent exception to this. Hackers will sometimes do things that may seem repetitive or boring to an observer as a mind-clearing exercise, or in order to acquire a skill or have some particular kind of experience you can't have otherwise. But this is by choice — nobody who can think should ever be forced into a situation that bores them.)
4. Freedom is good.
(This isn't the same as fighting all authority. Children need to be guided and criminals restrained. A hacker may agree to accept some kinds of authority in order to get something he wants more than the time he spends following orders. But that's a limited, conscious bargain; the kind of personal surrender authoritarians want is not on offer.)
Authoritarians thrive on censorship and secrecy. And they distrust voluntary cooperation and information-sharing — they only like ‘cooperation’ that they control. So to behave like a hacker, you have to develop an instinctive hostility to censorship, secrecy, and the use of force or deception to compel responsible adults. And you have to be willing to act on that belief.
5. Attitude is no substitute for competence.
Therefore, you have to learn to distrust attitude and respect competence of every kind. Hackers won't let posers waste their time, but they worship competence — especially competence at hacking, but competence at anything is valued. Competence at demanding skills that few can master is especially good, and competence at demanding skills that involve mental acuteness, craft, and concentration is best.
If you revere competence, you'll enjoy developing it in yourself — the hard work and dedication will become a kind of intense play rather than drudgery. That attitude is vital to becoming a hacker.
Basic Hacking Skills
This toolkit changes slowly over time as technology creates new skills and makes old ones obsolete. For example, it used to include programming in machine language, and didn't until recently involve HTML. But right now it pretty clearly includes the following:
1. Learn how to program.
I used to recommend Java as a good language to learn early, but this critique has changed my mind (search for “The Pitfalls of Java as a First Programming Language†within it). A hacker cannot, as they devastatingly put it “approach problem-solving like a plumber in a hardware storeâ€; you have to know what the components actually do. Now I think it is probably best to learn C and Lisp first, then Java.
There is perhaps a more general point here. If a language does too much for you, it may be simultaneously a good tool for production and a bad one for learning. It's not only languages that have this problem; web application frameworks like RubyOnRails, CakePHP, Django may make it too easy to reach a superficial sort of understanding that will leave you without resources when you have to tackle a hard problem, or even just debug the solution to an easy one.
If you get into serious programming, you will have to learn C, the core language of Unix. C++ is very closely related to C; if you know one, learning the other will not be difficult. Neither language is a good one to try learning as your first, however. And, actually, the more you can avoid programming in C the more productive you will be.
C is very efficient, and very sparing of your machine's resources. Unfortunately, C gets that efficiency by requiring you to do a lot of low-level management of resources (like memory) by hand. All that low-level code is complex and bug-prone, and will soak up huge amounts of your time on debugging. With today's machines as powerful as they are, this is usually a bad tradeoff — it's smarter to use a language that uses the machine's time less efficiently, but your time much more efficiently. Thus, Python.
Other languages of particular importance to hackers include Perl and LISP. Perl is worth learning for practical reasons; it's very widely used for active web pages and system administration, so that even if you never write Perl you should learn to read it. Many people use Perl in the way I suggest you should use Python, to avoid C programming on jobs that don't require C's machine efficiency. You will need to be able to understand their code.
LISP is worth learning for a different reason — the profound enlightenment experience you will have when you finally get it. That experience will make you a better programmer for the rest of your days, even if you never actually use LISP itself a lot. (You can get some beginning experience with LISP fairly easily by writing and modifying editing modes for the Emacs text editor, or Script-Fu plugins for the GIMP.)
It's best, actually, to learn all five of Python, C/C++, Java, Perl, and LISP. Besides being the most important hacking languages, they represent very different approaches to programming, and each will educate you in valuable ways.
But be aware that you won't reach the skill level of a hacker or even merely a programmer simply by accumulating languages — you need to learn how to think about programming problems in a general way, independent of any one language. To be a real hacker, you need to get to the point where you can learn a new language in days by relating what's in the manual to what you already know. This means you should learn several very different languages.
I can't give complete instructions on how to learn to program here — it's a complex skill. But I can tell you that books and courses won't do it — many, maybe most of the best hackers are self-taught. You can learn language features — bits of knowledge — from books, but the mind-set that makes that knowledge into living skill can be learned only by practice and apprenticeship. What will do it is (a) reading code and (b) writing code.
Peter Norvig, who is one of Google's top hackers and the co-author of the most widely used textbook on AI, has written an excellent essay called Teach Yourself Programming in Ten Years. His "recipe for programming success" is worth careful attention.
Learning to program is like learning to write good natural language. The best way to do it is to read some stuff written by masters of the form, write some things yourself, read a lot more, write a little more, read a lot more, write some more ... and repeat until your writing begins to develop the kind of strength and economy you see in your models.
Finding good code to read used to be hard, because there were few large programs available in source for fledgeling hackers to read and tinker with. This has changed dramatically; open-source software, programming tools, and operating systems (all built by hackers) are now widely available. Which brings me neatly to our next topic...
2. Get one of the open-source Unixes and learn to use and run it.
Yes, there are other operating systems in the world besides Unix. But they're distributed in binary — you can't read the code, and you can't modify it. Trying to learn to hack on a Microsoft Windows machine or under any other closed-source system is like trying to learn to dance while wearing a body cast.
Under Mac OS X it's possible, but only part of the system is open source — you're likely to hit a lot of walls, and you have to be careful not to develop the bad habit of depending on Apple's proprietary code. If you concentrate on the Unix under the hood you can learn some useful things.
Unix is the operating system of the Internet. While you can learn to use the Internet without knowing Unix, you can't be an Internet hacker without understanding Unix. For this reason, the hacker culture today is pretty strongly Unix-centered. (This wasn't always true, and some old-time hackers still aren't happy about it, but the symbiosis between Unix and the Internet has become strong enough that even Microsoft's muscle doesn't seem able to seriously dent it.)
So, bring up a Unix — I like Linux myself but there are other ways (and yes, you can run both Linux and Microsoft Windows on the same machine). Learn it. Run it. Tinker with it. Talk to the Internet with it. Read the code. Modify the code. You'll get better programming tools (including C, LISP, Python, and Perl) than any Microsoft operating system can dream of hosting, you'll have fun, and you'll soak up more knowledge than you realize you're learning until you look back on it as a master hacker.
For more about learning Unix, see The Loginataka. You might also want to have a look at The Art Of Unix Programming.
To get your hands on a Linux, see the Linux Online! site; you can download from there or (better idea) find a local Linux user group to help you with installation.
During the first ten years of this HOWTO's life, I reported that from a new user's point of view, all Linux distributions are almost equivalent. But in 2006-2007, an actual best choice emerged: Ubuntu. While other distros have their own areas of strength, Ubuntu is far and away the most accessible to Linux newbies.
You can find BSD Unix help and resources at www.bsd.org.
A good way to dip your toes in the water is to boot up what Linux fans call a live CD, a distribution that runs entirely off a CD without having to modify your hard disk. This will be slow, because CDs are slow, but it's a way to get a look at the possibilities without having to do anything drastic.
I have written a primer on the basics of Unix and the Internet.
I used to recommend against installing either Linux or BSD as a solo project if you're a newbie. Nowadays the installers have gotten good enough that doing it entirely on your own is possible, even for a newbie. Nevertheless, I still recommend making contact with your local Linux user's group and asking for help. It can't hurt, and may smooth the process.
3. Learn how to use the World Wide Web and write HTML.
This doesn't just mean learning how to drive a browser (anyone can do that), but learning how to write HTML, the Web's markup language. If you don't know how to program, writing HTML will teach you some mental habits that will help you learn. So build a home page. Try to stick to XHTML, which is a cleaner language than classic HTML. (There are good beginner tutorials on the Web; here's one.)
But just having a home page isn't anywhere near good enough to make you a hacker. The Web is full of home pages. Most of them are pointless, zero-content sludge — very snazzy-looking sludge, mind you, but sludge all the same (for more on this see The HTML Hell Page).
To be worthwhile, your page must have content — it must be interesting and/or useful to other hackers. And that brings us to the next topic...
4. If you don't have functional English, learn it.
Back around 1991 I learned that many hackers who have English as a second language use it in technical discussions even when they share a birth tongue; it was reported to me at the time that English has a richer technical vocabulary than any other language and is therefore simply a better tool for the job. For similar reasons, translations of technical books written in English are often unsatisfactory (when they get done at all).
Linus Torvalds, a Finn, comments his code in English (it apparently never occurred to him to do otherwise). His fluency in English has been an important factor in his ability to recruit a worldwide community of developers for Linux. It's an example worth following.
Being a native English-speaker does not guarantee that you have language skills good enough to function as a hacker. If your writing is semi-literate, ungrammatical, and riddled with misspellings, many hackers (including myself) will tend to ignore you. While sloppy writing does not invariably mean sloppy thinking, we've generally found the correlation to be strong — and we have no use for sloppy thinkers. If you can't yet write competently, learn to.
Status in the Hacker Culture
السبت، 21 أبريل 2012
Mail.java
MailClient
//Here is the code for the client side of the application:
// you must add the apache jar file to the project it's not java built in
import java. io. * ;
import java. net. *;
import java.util.Scanner;
import org.apache.commons.codec.binary.Base64;
public class Mail
{
public static void main(String argv[])
{
try {
String RData;
Socket sock = new Socket("smtp.gmail.com", 25);
//=======================================================
DataOutputStream toServer;
DataInputStream fromServer;
//========================================================
fromServer = new DataInputStream(sock.getInputStream());
toServer =new DataOutputStream(sock.getOutputStream());
// Create an output stream to send data to the server
toServer.writeUTF("helo google");
RData=fromServer.readUTF();
System.out.println(RData);
//============================================
toServer.writeUTF("ehlo google");
RData=fromServer.readUTF();
System.out.println(RData);
//===================================AuTHORIZATION==========================
toServer.writeUTF("AUTH LOGIN");
RData=fromServer.readUTF();
System.out.println(RData);
//==================================LOGIN===================================
Scanner scanner = new Scanner(System.in);
System.out.println("please login you user name and password ");
System.out.println("user name");
String user=scanner.next();
System.out.println("password please");
String pwd=scanner.next();
String UserEncoded = new String(Base64.encodeBase64(user.getBytes()));
toServer.writeUTF(UserEncoded);
RData=fromServer.readUTF();
System.out.println(RData);
String PwdEncoded = new String(Base64.encodeBase64(pwd.getBytes()));
toServer.writeUTF(PwdEncoded);
RData=fromServer.readUTF();
System.out.println(RData);
//====================================Sender & RECEIVER========================
System.out.println("Enter the Sender Email");
String From= scanner.next();
String temp="MAIL FROM:<"+From+">";
toServer.writeUTF(temp);
RData=fromServer.readUTF();
System.out.println(RData);
//------------------------
System.out.println("Enter the Reciver Email");
String TO= scanner.next();
temp="RCPT TO:<"+TO+">";
toServer.writeUTF(temp);
RData=fromServer.readUTF();
System.out.println(RData);
//====================================THE MESSAGE WILL SEND=====================
toServer.writeUTF("DATA");
RData=fromServer.readUTF();
System.out.println(RData);
System.out.println("Enter your message");
String message= scanner.next();
System.out.println("Enter YOUR name");
String yournName= scanner.next();
System.out.println("Enter RECEIVER name");
String reciverName= scanner.next();
String newMS=String.format("From: %s <%s>\nTo: %s <%s>\nSubject:%s",yournName,From,reciverName,TO,message);
toServer.writeUTF(newMS);
RData=fromServer.readUTF();
System.out.println(RData);
//==================================END OF MESSAGE================================
toServer.writeUTF(".");
RData=fromServer.readUTF();
System.out.println(RData);
//==================================COLSE THE CONNECTION========================
toServer.writeUTF("QUIT");
RData=fromServer.readUTF();
System.out.println(RData);
sock.close();
}
catch (IOException ex)
{
ex.toString();
}
}
}
// you must add the apache jar file to the project it's not java built in
import java. io. * ;
import java. net. *;
import java.util.Scanner;
import org.apache.commons.codec.binary.Base64;
public class Mail
{
public static void main(String argv[])
{
try {
String RData;
Socket sock = new Socket("smtp.gmail.com", 25);
//=======================================================
DataOutputStream toServer;
DataInputStream fromServer;
//========================================================
fromServer = new DataInputStream(sock.getInputStream());
toServer =new DataOutputStream(sock.getOutputStream());
// Create an output stream to send data to the server
toServer.writeUTF("helo google");
RData=fromServer.readUTF();
System.out.println(RData);
//============================================
toServer.writeUTF("ehlo google");
RData=fromServer.readUTF();
System.out.println(RData);
//===================================AuTHORIZATION==========================
toServer.writeUTF("AUTH LOGIN");
RData=fromServer.readUTF();
System.out.println(RData);
//==================================LOGIN===================================
Scanner scanner = new Scanner(System.in);
System.out.println("please login you user name and password ");
System.out.println("user name");
String user=scanner.next();
System.out.println("password please");
String pwd=scanner.next();
String UserEncoded = new String(Base64.encodeBase64(user.getBytes()));
toServer.writeUTF(UserEncoded);
RData=fromServer.readUTF();
System.out.println(RData);
String PwdEncoded = new String(Base64.encodeBase64(pwd.getBytes()));
toServer.writeUTF(PwdEncoded);
RData=fromServer.readUTF();
System.out.println(RData);
//====================================Sender & RECEIVER========================
System.out.println("Enter the Sender Email");
String From= scanner.next();
String temp="MAIL FROM:<"+From+">";
toServer.writeUTF(temp);
RData=fromServer.readUTF();
System.out.println(RData);
//------------------------
System.out.println("Enter the Reciver Email");
String TO= scanner.next();
temp="RCPT TO:<"+TO+">";
toServer.writeUTF(temp);
RData=fromServer.readUTF();
System.out.println(RData);
//====================================THE MESSAGE WILL SEND=====================
toServer.writeUTF("DATA");
RData=fromServer.readUTF();
System.out.println(RData);
System.out.println("Enter your message");
String message= scanner.next();
System.out.println("Enter YOUR name");
String yournName= scanner.next();
System.out.println("Enter RECEIVER name");
String reciverName= scanner.next();
String newMS=String.format("From: %s <%s>\nTo: %s <%s>\nSubject:%s",yournName,From,reciverName,TO,message);
toServer.writeUTF(newMS);
RData=fromServer.readUTF();
System.out.println(RData);
//==================================END OF MESSAGE================================
toServer.writeUTF(".");
RData=fromServer.readUTF();
System.out.println(RData);
//==================================COLSE THE CONNECTION========================
toServer.writeUTF("QUIT");
RData=fromServer.readUTF();
System.out.println(RData);
sock.close();
}
catch (IOException ex)
{
ex.toString();
}
}
}
الأربعاء، 28 مارس 2012
Network Assignment
Now it's time to send the email.
In windows, go to start=>run=>cmd
Once the command line is opened write the following: telnet localhost 2301
>telnet smtp.gmail.com 25
you should see the following:
220 mx.google.com ESMTP f14sm1400408wbe.2
we send a hello message:
helo google
250 mx.google.com at your service
ehlo google
250-mx.google.com at your service, [212.28.228.49]
250-SIZE 35651584
250-8BITMIME
250-AUTH LOGIN PLAIN XOAUTH
250 ENHANCEDSTATUSCODES
Then the authentication request:
AUTH LOGIN
334 VXNlcm5hbWU6
Now we have to authenticate by using our gmail address and password.
However
since this is an encrypted session, we're gonna have to send the email
and password encrypted in base64. To encrypt your email and password,
you can use a program or an online website to encrypt it (search on
google for: base64 online encryption).
For example the sentence "my email address" in base64 will become: bXkgZW1haWwgYWRkcmVzcw==
and the word "password" will become: cGFzc3dvcmQ=
Now
you should have your email address and password encrypted in base64, go
back to the command line and write your base64 email first, (I will use
"my email address" as my email address and "password" as my password
for this example):
bXkgZW1haWwgYWRkcmVzcw==
334 UGFzc3dvcmQ6
Enter your password:
cGFzc3dvcmQ=
235 2.7.0 Accepted
Enter your email:
MAIL FROM:<etienne.rached@gmail.com>
250 2.1.0 OK x23sm1104292weq.10
Enter the recipient email (I'll email myself for testing):
RCPT TO:<etienne.rached@gmail.com>
250 2.1.5 OK x23sm1104292weq.10
250 2.1.5 OK x23sm1104292weq.10
Now comes the message part:
DATA
354 Go ahead x23sm1104292weq.10
From: Etienne <etienne.rached@gmail.com>
To: Meeeeeeee <etienne.rached@gmail.com>
Subject: Testing email from telnet
This is the body
Adding more lines to the body message.
To: Meeeeeeee <etienne.rached@gmail.com>
Subject: Testing email from telnet
This is the body
Adding more lines to the body message.
Finish the DATA with a dot:
.
250 2.0.0 OK 1288307376 x23sm1104292weq.10
And quit:
QUIT
221 2.0.0 closing connection x23sm1104292weq.10
Connection to host lost.
.
250 2.0.0 OK 1288307376 x23sm1104292weq.10
And quit:
QUIT
221 2.0.0 closing connection x23sm1104292weq.10
Connection to host lost.
The email should now be sent and you can find it in your "sent mail" in your gmail.
Using
Telnet with stunnel is very easy, I will try and show how to receive an
email with pop3 using telnet, and how to send an email using TLS in my
future posts.
Hope you enjoyed this one :)
this is assignment just convert it to your programming language
this is assignment just convert it to your programming language
الاثنين، 26 مارس 2012
مميزات بيثون
- بسيطة
- بيثون لغة بسيطة لأبعد الحدود. قراءة برنامج بيثون جيد يكاد يشبه قراءة اللغة الإنكليزية على الرغم من أنها إنجليزية صارمة!هذه الطبيعة الشبه رمزية (pseudo-code) لبيثون أحد أعظم أسرار قوتها. فتتيح لك التركيز على حل المشكلة لا اللغة نفسها.
- سهلة التعلم
- كما سترون، بيثون سهلة للغاية لتبدأ بها في تعلم البرمجة. بيثون تحتوي تراكيب سهلة بشكل غير معتاد، كما سبق ذكره.
- حرة ومفتوحة المصدر
- بيثون هي مثال على البرمجيات الحرة مفتوحة المصدر. بعبارات بسيطة، يمكنك بحرية توزيع نسخ من هذه البرمجيات، وقراءة كود المصدر، و القيام ببعض التغييرات عليها واستخدام أجزاء منها في برمجيات حرة جديدة، وأنت تعرف أنه يمكنك أن تفعل هذه الأشياء. البرمجيات الحرية تقوم على مبدأ المجتمع الذي يتشارك في المعرفة. هذا واحد من أسباب كون بيثون جيدة جدا - لأنه قد تم إنشاؤها وتحسينها بشكل مستمر من خلال المجتمع الذي يريد فقط أن يرى بيثون أفضل.
- لغة برمجة عالية المستوى
- عندما تكتب البرامج في بيثون، لا تحتاج للاهتمام بالتفاصيل دقيقة المستوى مثل إدارة الذاكرة التي يستخدمها برنامجك، إلخ.
- محمولة
- نظرا
لطبيعتها كبرمجية مفتوحة المصدر، تم نقل بيثون إلى (أي تم جعلها تعمل على)
العديد من المنصات. كل ما تكتبه من برامج بيثون يمكن أن يعمل على أي من
هذه المنصات دون أن يتطلب ذلك أي تغييرات على الإطلاق إذا كنت دقيقا بما
فيه الكفاية لتجنب أي خصائص تعتمد على نظام بعينه.
يمكنك استخدام بيثون على لينكس، ويندوز، فري بيإسدي، ماكينتوش، سولاريس، OS/2، Amiga، AROS، AS/400، BeOS، OS/390، z/OS، Palm OS، QNX، VMS، Psion، Acorn RISC OS، VxWorks، PlayStation، Sharp Zaurus، Windows CE وحتى الحاسوب الكفي. - مفسَّرة
- هذا يتطلب شيئا من الشرح.
البرنامج المكتوب بلغة مصرّفة (compiled) مثل سي أو سي++ يتم تحويله من اللغة المصدر (سي أو سي++) إلى اللغة التي يتكلمها حاسوبك (كود ثنائي من أصفار وآحاد) باستخدام المصرّف مع مختلف الخيارات والتعليمات. عند تشغيلك البرنامج، يقوم الرابط/المحمّل (linker/loader) بنسخ البرنامج من القرص الصلب إلى الذاكرة ويبدأ في تشغيله.
بيثون -من ناحية أخرى- لا تحتاج التصريف إلى كود ثنائي. فقط شغل البرنامج مباشرة من الكود المصدر. داخليا، فإن بيثون يحول كود المصدر إلى شكل وسيط يسمى bytecode ثم يترجم هذا إلى اللغة الأصلية لجهازك، ثم يشغله. كل هذا يجعل من الأسهل بكثير استخدام بيثون حيث لست بحاجة للاهتمام بتصريف البرنامج، أو التأكد من صحة مكتبات الربط وتحميلها، الخ، الخ. وهذا أيضا يجعل برامج بيثون الخاصة بك أكثر محمولية، بحيث يمكنك مجرد نسخ برنامج بيثون الخاص بك إلى حاسوب آخر، وبعدها يعمل! - كائنية التوجه
- تدعم بيثون البرمجة الإجرائية (procedure-oriented) وكذلك البرمجة الكائنية (object-oriented). في اللغات إجرائية التوجه، يتمحور البرنامج حول الإجراءات أو الدوال التي ليست سوى قطع من البرامج يمكن إعادة استخدامها. وفي اللغات كائنية التوجه، يتمحور البرنامج حول الكائنات (objects) التي تجمع بين البيانات والوظائف. ولبيثون طريقة قوية جدا ولكن تبسيطية لعمل البرمجة الكائنية خاصة عند مقارنتها باللغات الكبيرة مثل سي++ أو جافا.
- قابلة للامتداد
- إذا كنت في حاجة لجعل جزء حيوي من الكود يعمل سريعا جدا أو تريد إخفاء بعض الخوازميات، فيمكنك كتابة هذا الجزء من برنامجك بلغة سي أو سي++ وبعدها تستخدمه من برنامج بيثون الخاص بك.
- قابلة للتضمين
- يمكنك تضمين بيثون في برامج سي/سي++ لإعطاء قدرات ال'scripting' لمستخدمي برنامجك.
- مكتبات شاملة
- مكتبة
بيثون القياسية مكتبة ضخمة حقا. تساعدك على عمل مختلف الأشياء العادية بما
فيها التعابير النمطية (regular expressions)، توليد التوثيق، اختبار
الوحدات، الخيوط (threading)، قواعد البيانات، متصفحات وب، CGI، ftp، بريد
إلكتروني، XML، XML-RPC، HTML، ملفات WAV، التعمية، الواجهات الرسومية
وغيرها من الأشياء التي تعتمد على النظام. تذكر، كل هذا متاح دائما أينما
يثبت بيثون. وهذا ما يسمى فلسفة 'البطاريات مضمنة' في بيثون.
بجانب المكتبات القياسية توجد العديد من المكتبات المتنوعة الأخرى عالية الجودة مثل wxPython، و Twisted، و Python Imaging Library وغيرها الكثير.
الخلاصة
الاشتراك في:
الرسائل (Atom)