Tuesday, May 17, 2011

Basics of am 3mp33j3w

                         :::::::::   ::::::::  :::::::::  ::::::::::                          :+:    :+: :+:    :+: :+:   

:+: :+:                                 +:+    +:+ +:+        +:+    +:+ +:+                                 +#++:++#+  +#

++:++#++ +#++:++#:  :#::+::#                            +#+    +#+        +#+ +#+    +#+ +#+                               

 #+#    #+# #+#    #+# #+#    #+# #+#                                 #########   ########  ###    ### ###                 

                                              http://blacksun.box.sk                                   ____________________ 

         _______________________I      Topic:        I_____________________          \                       I   Bascis of

am     I                    /           \     E-mail:          I    3mp33j3w        I   Written by:     /            >     

               I                    I                  <            /    fu@ckz.org        I____________________I     

Ralph        \          /___________________________>           <_________________________\         Basics of am 3mp33j3wby

Ralph (fu@ckz.org)    -AWC (http://awc.rejects.net) 1.  Introduction    -About this thing    -Who should read this?    -

Brief intro to Mircoprocessors2.  Basics    -ALU    -Accumulator    -Data Register    -Address Register    -Program Counter

   -Stack Pointer    -Instruction Register    -Instruction Decoder3.  Architecture    -Buses    -Instruction Responses     

-Fetch      -Decode      -Execute    -Microprocessor Instructions    -Modes of Addressing      -Inherent Mode      -

Immediate Mode      -Direct Mode4.  Machine Cycles5.  Interfacing    -Digital    -Analog    -Robotics6.  Other1. 

Introduction================About this thing----------------This article will explain the basics of general MPUs.  It is by

no means in-depth or anything, but it should be enough.  I'm taking a fairly lowlevel approach to this thing.As in, I will

be talking about the circuits and such.Please note that while I tryed to keep this information as acurate as possible by

reading multiple views on something, I can't guarentee that this info is actually all true since I don't know anyone who

wants to and knows enough to proof-read it.Also, this thing is very general!  Just by reading it you won't be able to

distinguish an Apple from an IBM or even a calculator.Finally, even though this thing only explains the very basics of

CPUs, it's not really recommended reading material for people who are new to computers.  I assume you'refamiliar with

concepts such as the binary numbering system, PC hardware, circuits, etc.Who should read this?---------------------I have

honestly no idea.  Maybe low level programmers, or people new to this might beable to put this to some use.  This is

basicly just background information you shouldknow, but will most likely never actually use it.  Kinda the way most people

inhigh school math are thinking.  In addition, this information is fairly old, thus some of this shit has long since been

replaced or added on to.Brief intro to Mircoprocessors------------------------------Inside every computer, there is a

little ceramic block of purified crystaline silicon, coated with impurities that give it electronic swithing abilities, and

etched with poisonous gases.  This little block was developt in 1971 by Integrated Electronics (Intel).  The earliest

version of this thing was the 4004 chip used in Japanesecalculators.  One year later, the founders of Intel, Robert Noyce

and Gorden Moore, designed the 8008 chip.  These things sold rapidly and Motorola produced it's own chip,the 6800.  I

little later more companies like Signetics (the 2650) and Rockwell (the PPS8) produced their own chips.  Still later many

companies started releasing anew generations of chips with more functions build into a single chip.  Those are forexample

Fairchild and Mostek's F8, Intels 8048, and my favourite, Zilog's Z80 (still used in GameBoys).  The Z80 stands out because

it can handle the numbers DEAD and BEEF.Ph33r!  Anyway, eventually most of these companies droped out of the race, and

onlyIntel and Motorola kept on developing new processors.  Intel started to work with IBMand produced such famous chips as

the 8088 and the 8086.  Later a number was addedwith each new version: 80286, 80386, 80486.  The 80586 was renamed to

Pentium.  Motorolaon the other hand went to Apple.  I don't like Apples, so I have no idea what the current chip versions

are.Basics======A microprocessor is a chip which must perform at least all following functions:* Receive and store binary

data* Perform arithmetic operations* Make Logical decisions* Deliver processed data to output circuitsThese statements are

very general, and along the way, I will explain how each isperformed.ALU---ALU stands for Arithmetic Logic Unit, and is

just that.  It performs all the arithmeticand logical operations based on binary data being fed to it.  It performs

additionsviva combinational logic based on usually a Full Adder Circuit.  Subtractions is doneby first negetating the

numbers, than adding them.  Mulitplication and Division is doneby repeaded adding or subtracting respectivly.This k-rad

ASCII shows you how the ALU would go about adding two numbers (well it'ssupposed to anyway):            +----------+       

    |  Memory  |            +----------+            |          |         Number 2   Number 1            |          |

+-----------+          +-------------+|Accumalator|          |Data Register|+-----------+          +-------------+      \  

                    /    Number 2             Number 1        \                   /         \                 /         

+---------------+             |      ALU      |          +---------------+                  |               Result         

        |            +-----------+            |Accumulator|            +-----------+NOTE: The accumalator that stores the

result is the same that stored number 2, I       just couldn't figure out how to express that in

ASCII.Accumulator-----------This is a multi-purpose circuit section.  As you can see from my ASCII picture it willnot only

hold a number to be mulitplied, but also store the result.  Usually, the resultwill than be transfered to some form of

memory.Data Register-------------Temporary storage for data comming from, and going to the bus.Address

Register----------------Conains the address of the current memory data.  Used to access specific points in memory.Program

Counter---------------As the name implies, this thing keeps track of the memory location containing the nextinstruction to

be executed.  Whenever a break in the flow of the program (a jump, call,interrupt, etc), the current number in the program

counter is stored in on the stack andthe new location goes into the program counter.  When the break is finished and

controlis returned to the original routine, the number on the stack gets poped back into theprogram counter.  On most

modern CPUs this part would be the Instruction Pointe (IP)register.Stack Pointer-------------A data structure that records

the last program step prior to a break in the routine.  There are two basics systems.  One is to store the last program

step in memory and usethe stack-point counter to index the address.  The other is the one used on almost allsystems today,

Last In First Out, or LIFO.  Think of it as a stack of books.  You put one on top of it, and that one will be the first one

to come of next.  Putting stuff on the stack is called Pushing, getting stuff from the stack is called Poping.  For

example, say you have 5 books called A, B, C, D, and E stack on top of each other like this:ABCDENow you add (push) book F

to the stack:FABCDEIf you pop the stack, you get book F back and the stack looks like this again:ABCDEInstruction

Register--------------------The IR holds the binary data fetched from memory during the decoding and executing ofthat

instruction.  Instruction Decoder-------------------The ID sets up the logic which controls the entire MPU.  This includes

the control lines, the clock, and bus access.  Everything happending in your processor is controlled from this section of

the chip.  Sometimes you may here that everything is controled by the Control Unit, but in fact CU is just a name that

summarizes the previously discussedunits.3.  Architecture================Architecture in terms of processors means the

layout of a chip.  This might not seemas important, but the architecture is what has so far kept Intel alive and

dominant.Every single micrometer has to carefully layed out for best performance and efficiency.Buses-----Buses are a

conductors that transfer binary data in a system.  A bus can be external, or internal.  External buses are known as System

Buses, but we're only interested in theinternal buses, as they dictate the architecture of the CPU.  The most basic bus

design is the Single-Bus System.  In this design one one set ofconductors is used to connect all the units.31337 ASCII

warning!=======<>=============================              |       |     |    |   |              |       |     |  +---+ | 

              |       |     |  |ACU| |              |       |     |  +---+ |              |       |     |    |   |         

  +---+   +---+   |    +---+            |R1 |   |R2 |   |    |ALU|            +---+   +---+   |    +---+                   

        |===<==|<> - Two-way data flow<  - One-way data flowSorry, didn't feel like making a detailed diagram here, but you

can kinda see what Imean.  There is only a single major bus connectiong all registers and the ALU.  There are other

conducting paths branching, but those aren't important.  This design is not being used anymore as it is very slow.  You can

see that doing a simple multiplication would already require to be done on a time-sharing basis.  This of course slows the

whole thing down by quite a bit.  However this design does have one advantage, size.  It's very small, thus the next

generation of pens will most likely be using it (that was a joke by the way).To get around this speed problem, designers

used the Triple-Bus System.  In this design3 seperate main buses are being used.  Sorry, no ASCII for this one, just too

complexfor notpadActual chips today are even more detailed.  They use a decendent of the triple-bus design and the bus can

be anywhere from 8-bit to 64-bit in size (that is, between 8 and 64 conducting wires).  And again, no ASCII for this one,

if you're a good ASCIIartist, please contact me and I could send you a .bmp or something.  Might not beeasy to draw a

detailed 8080 chip with characters though :).Instruction Responses---------------------Every instruction invloves a three-

stage sequence, Fetch, Decode and Execute.FetchIn this stage the Program Counter is switched to the address bus and the

binary sequenceis read by the Address Decoder.  Then latched into the Instruction Register.DecodeWhen the fetch was

completed successfully, the decoder kicks in.  The binary datarecieved represents a specific instruction, and will be

conditioned in the ProgrammableLogic Array (PLA) in the decoder.  This part of the MPU is a complex network ofcombinational

logic.  The sequences that occur in the decoder are controled by an internal ROM called CROM, or Control Read-Only Memory. 

This thing sets up a controlsequence corosponding to the instruction code entered (OpCode).  Every MPU has its own unique

CROM with a set of OpCodes (Operating Codes) called Instruction Set.  Back inthe days, the 8080 has 78 different opcodes,

today a Pentium has about 700.  Some (well most) of these have additional paramters called Operands following them.  These

are fetched as the opcode is executed.ExecuteAfter decoding the instruction, the execute unit directs the synchronzing

signals whichcontrol the ALU, memory, and I/O circuits.  This sequencing and timing is kepy in sync by the Program Counter,

which keeps track of every step in the program and control breaks as mentioned earlier.Microprocessor

Instructions---------------------------Every MPU is designed to respond to a fixed set of instructions.  As mentioned

above,the old 8080 has 78 of them.  However, opcodes actually consist of two parts.  One partindicates the address mode,

the other the actual code.  Usually, only 2 bits are usedfor the address mode part.  A 8-bit computer can thus theoreticly

have 64 opcodes, butmanufactures usually push this limit a bit and include a few variations.Some opcode examples are:Binary

    Hex   Mnemonic  Describtion01110010b  72h   JC        Jump short if carry flag set00001100b  0Ch   OR AL     Perform

logical OR on contents of register ALBinary is the raw instruction opcode being used in the Decoding process, Hex is

thesame number converted to hexidecimal, mnemonic is a more human readable form of thatinstruction.  Mnemonix are what

assembly programmers code in.Modes of Addressing-------------------As stated before, a opcode usually contains two bits

telling the MPU what addressingmode to use.  I will cover the three basic (and outdated) 16-bit address modes, Inherent,

immediate and Direct.Inherent ModeThis mode invlovles the MPU chip itself as data is being stored on one or more of

theonchip registers during the execution of the instruction.  The opcode itself holdsall the information required to

execute the instruction.  Each register is identified in the opcode.  For example, say we want to add registers A and B,

where A = 000 and B = 111, the opcode for that might be 01000111  The 01 indicates Inherent Mode addressing, the 000 the

source register, and 111 the destination register.  As you can see, this opcode contains all the information the decoder

needs in order to execute this instruction.Steps to execution:1.  a) Fetch instruction    b) Decode instruction2.  Execute

instructionImmediate ModeThis mode involves the opcode PLUS the operand.  The operand can contain (at the timethis was

writen) 8, 16, 32, or 64 bit information.  This information can either bean address where data to be used is located, or

the data itself.  The decoder is toldhow many more bytes to read in by the opcode.  An example of this is a jump

instruction.First comes the opcode telling the MPU to perform a jump, the next few bytes containthe address to jump

to.Steps to execution:1.  a) Fetch instruction    b) Decode instruction2.  a) Obtain operand    b) Execute

instructionDirect ModeThis mode is used when transfering data from the MPU to memory or vice versa.  Instructions based on

this mode come in three bytes, one for the opcode, two for the (16-bit) address.  For example, the following statement

moves the value DEADh into the AX register:10111000 10101101 1101111010111000 is the opcode for move AX.  Since AX is a 16

bit register, the decoder will assume that the next 16 bits are are the value.Steps to execution:1.  a) Fetch instruction  

 b) Decode instruction2.  a) Obtain address    b) Decode address3.  a) Obtain operand    b) Execute instruction4.  Machine

Cycles==================Timing is a very important thing in MPUs.  Many circuits share the same data bus, andmust be

precisly timed.  I briefly mentioned this earlier, and now I'm covering it a bitmore in-depth.MPU instructions are executed

by the control section and timed by a series of machinecycles.  The cycles are subdevided into 5 parts called Clock

Periods.  A instruction from memory is given 5 clock periods in which it must complete the instruction.  If itfinishes in

less than 5 clock periods, the remaining periods are idled.  The followingk-rad ASCII shows a instruction fetch cycle:|---

Machine Cycle---|+---+---+---+---+---+| 1 | 2 | 3 | 4 | 5 |+---+---+---+---+---+|-----------| |   |      |       |   |

Instruction  |  Idle    Fetch     |              |         Increment PC          and decodeOn a modern computer one machine

cycle occurs ever 1193180/65536 of a second, or about18.2/sec.5.  Interfacing===============Without interfacing, a MPU is

about as usefull as condom made of ice.  Even the simplesttask requires some sort of way to input data, and some way to get

the output.  In fact,interfacing is so fundamental to the MPU that a interfacing apparatus is usually alreadypart of the

MPU design.Digital-------When the MPU recieves data, and performs some function, the result is placed on a data bus.  These

bits can then be read by any imaginable device.  All that is necessary is adecoder than can read those bits.31337 ASCII

Alert!+------------+    +------------+    +------------+|            |    |            |    |            ||    MPU     |   

| Interfacing|    |   Display  ||            |----|   Chip(s)  |----|            ||            |    |            |    |    

       |+------------+    +------------+    +------------+6. Other========I cannot be held responsible for anything that

happens to you as a result of using this information.You may freely distribute this text as long as you don't change

anything.  If there'ssomething you think should be changed, contact me first.Send feedback to fu@ckz.orgAnd very important!

 If you noticed a mistake (speling, grammer, and especially technical!), please contact me asap.  As I said before, most of

this information is fairly outdated and useless, if you know of a specific change that has happened toanything discussed

here, please let me know.Please always get the newest version of this and other tutorials at http://awc.rejects.net as they

usually contained updated information, and addons.Greetings to:cozgedal, Alf (the cat eating fury dude), Sad1stick, rpc,

moJoe, Lindex, and everyone Iforgot to mention.This space intentionally left blank.
  • Share this
  • Sumbit to Digg
  • Sumbit to StumbleUpon
  • Sumbit to Delicious
  • Sumbit to Technorati
  • Sumbit to Reddit
  • Sumbit to Mixx
  • Sumbit to Twitter
  • Sumbit to Furl
  • Sumbit to Design Float
  • Sumbit to Blinklist
  • Sumbit to Yahoo Buzz
  • Sumbit to Google Bookmarks

BASIC C Socket Programming In Unix For Newbies

<=================================================>



Written by: BracaMan

E-mail    : BracaMan@clix.pt

ICQ       : 41476410

URL      : http://www.BracaMan.net





For more tutorials: http://code.box.sk

            http://blacksun.box.sk





For comments, errors or just to say hello: <BracaMan@clix.pt>







CONTENTS

=======================================



1. Introduction

2. Different types of Internet Sockets

3. Structures

4. Conversions

5. IP Addresses

6. Important Functions



   6.1. socket()

   6.2. bind()

   6.3. connect()

   6.4. listen()

   6.5. accept()

   6.6. send()

   6.7. recv()

   6.8. sendto()

   6.9. recvfrom()

   6.10. close()

   6.11. shutdown()

   6.12. gethostname()



7. Some words about DNS



8. A Stream Server Example



9. A Stream Client Example



10. Last Words



11. Copyright







1. INTRODUCTION

=======================================



Are you trying to learn c socket programming? Or do you think that it's hard stuff?

Well, then you must read this basic tutorial to get basic ideas and concepts and to start

to work with sockets. Don't expect to be a "socket programming master" after reading this

tutorial. You'll only be that if you practice and read a lot.







2. DIFFERENT TYPES OF INTERNET SOCKETS

=======================================



In the first place I must explain what a socket is. In a very simple way, a socket is a way

to talk to other computer. To be more precise, it's a way to talk to other computers using

standard Unix file descriptors. In Unix, every I/O actions are done by writing or reading

to a file descriptor. A file descriptor is just an integer associated with an open file and it

can be a network connection, a terminal, or something else.



About the different types of internet sockets, there are many types but I'll just describe two

of them - Stream Sockets (SOCK_STREAM) and Datagram Sockets (SOCK_DGRAM).



"And what are the differences between this two types?" you may ask. Here's the answer:



        Stream Sockets - they're error free; if you send through the stream socket three

             items "A,B,C", they will arrive in the same order - "A,B,C" ;

             they use TCP ("Transmission Control Protocol") - this protocol

             assures the items' order.

     

      Datagram Sockets - they use UDP ("User Datagram Protocol"); they're connectionless

             because you don't need to have an open connection as in Stream

             Sockets - you build a packet with the destination information and

             send it out.



A lot more could be explained here about this two kind of sockets, but I think this is enough

to get the basic concept of socket. Understanding what a socket is and this two types of

internet sockets is a good start, but you need to learn how to "work" with them. You'll learn

it in the next sections.





3. STRUCTURES

=======================================



The purpose of this section is not to teach you structures but to tell you how are they

used in C socket programming. If you don't know what a structure is, my advice is to read

a C Tutorial and learn it. For the moment, let's just say that a structure is a data type

that is an aggregate, that is, it contains other data types, which are grouped together into

a single user-defined type.



Structures are used in socket programming to hold information about the address.





The first structure is struct sockaddr that holds socket information.







    struct sockaddr{

        unsigned short  sa_family;    /* address family */

        char            sa_data[14];  /* 14 bytes of protocol address */

    };







But, there's another structure (struct sockaddr_in) that help you to reference to the socket's

elements.







    struct sockaddr_in {

        short int         sin_family;  /* Address family */

        unsigned short int   sin_port;      /* Port */

        struct in_addr         sin_addr;      /* Internet Address */

        unsigned char         sin_zero[8]; /* Same size as struct sockaddr */

    };







Note: sin_zero is set to all zeros with memset() or bzero() (See examples bellow).







The next structure is not very used but it is defined as an union.



As you can see in both examples bellow (Stream Client and Server Client) , when I declare for

example "client" to be of type sockaddr_in then I do client.sin_addr = (...)



Here's the structure anyway:





    struct in_addr {

        unsigned long s_addr;

    };







Finally, I think it's better talk about struct hostent. In the Stream Client Example, you can

see that I use this structure. This structure is used to get remote host information.



Here it is:





    struct hostent

    {

      char *h_name;                 /* Official name of host.  */

      char **h_aliases;             /* Alias list.  */

      int h_addrtype;               /* Host address type.  */

      int h_length;                 /* Length of address.  */

      char **h_addr_list;           /* List of addresses from name server.  */

    #define h_addr  h_addr_list[0]  /* Address, for backward compatibility.  */

    };



This structure is defined in header file netdb.h.





In the beginning, this structures will confuse you a lot, but after you start to write some

lines, and after seeing the examples, it will be easier for you understanding them. To see

how you can use them check the examples (section 8 and 9).







4. CONVERSIONS

=======================================



There are two types of byte ordering: most significant byte and least significant byte.

This former is called "Network Byte Order" and some machines store their numbers internally

in Network Byte Order.



There are two types you can convert: short and long.

Imagine you want to convert a long from Host Byte Order to Network Byte Order. What would you

do? There's a function called htonl() that would convert it =) The following functions are

used to convert :



    htons() -> "Host to Network Short"

    htonl()    -> "Host to Network Long"

    ntohs()    -> "Network to Host Short"

    ntohl() -> "Network to Host Long"



You must be thinking why do you need this. Well, when you finish reading this document, it will

all seems easier =) All you need is to read and a lot of practice =)



An important thing, is that sin_addr and sin_port (from struct sockaddr_in) must be in Network

Byte Order (you'll see in the examples the functions described here to convert and you'll start

to understand it).



5. IP ADRESSES

=======================================



In C, there are some functions that will help you manipulating IP addresses. We'll talk about

inet_addr() and inet_ntoa() functions.





    inet_addr() converts an IP address into an unsigned long. An example:

   

    (...)



    dest.sin_addr.s_addr = inet_addr("195.65.36.12");



    (...)



    /*Remember that this is if you've a struct dest of type sockaddr_in*/







    inet_ntoa() converts string IP addresses to long. An example:



    (...)



    char *IP;



    ip=inet_ntoa(dest.sin_addr);



    printf("Address is: %s\n",ip);



    (...)



Remember that inet_addr() returns the address in Network Byte Order - so you don't need to

call htonl().





6. IMPORTANT FUNCTIONS

=======================================



In this section I'll put the function' syntax, the header files you must include to call it,

and little comments. Besides the functions mentioned in this document, there are more, but

I decided to put only these ones here. Maybe I'll put them in a future version of this

document =) To see examples of these functions, you can check the stream client and stream

server source code (Sections 8 and 9)





  6.1. socket()

  =============

   

    #include <sys/types.h>

    #include <sys/socket.h>



    int socket(int domain,int type,int protocol);





    Let's see the arguments:



        domain   -> you can set "AF_INET" (set AF_INET to use ARPA internet protocols)

                or "AF_UNIX" if you want to create sockets for inside comunication.

                Those two are the most used, but don't think that there are just

                  those. There are more I just don't mention them.

        type     -> here you put the kind of socket you want (Stream or Datagram)

                  If you want Stream Socket the type must be SOCK_STREAM

                  If you want Datagram Socket the type must be SOCK_DGRAM

        protocol -> you can just set protocol to 0





    socket() gives you a socket descriptor that you can use in later system calls or

    it gives you -1 on error (this is usefull for error checking routines).





  6.2. bind()

  ===========



    #include <sys/types.h>

    #include <sys/socket.h>



    int bind(int fd, struct sockaddr *my_addr,int addrlen);



   

    Let's see the arguments:



        fd  -> is the socket file descriptor returned by socket() call

        my_addr -> is a pointer to struct sockaddr

        addrlen -> set it to sizeof(struct sockaddr)



    bind() is used when you care about your local port (usually when you use listen() )

    and its function is to associate a socket with a port (on your machine). It returns

    -1 on error.



    You can put your IP address and your port automatically:



        server.sin_port = 0;                /* bind() will choose a random port*/

        server.sin_addr.s_addr = INADDR_ANY;  /* puts server's IP automatically */





    An important aspect about ports and bind() is that all ports bellow 1024 are reserved.

    You can set a  port above 1024 and bellow 65535 (unless the ones being used by other

    programs).





  6.3. connect()

  ==============



    #include <sys/types.h>

    #include <sys/socket.h>



    int connect(int fd, struct sockaddr *serv_addr, int addrlen);



    Let's see the arguments:



        fd    -> is the socket file descriptor returned by socket() call

        serv_addr -> is a pointer to struct sockaddr that contains destination IP

                 address and port

        addrlen   -> set it to sizeof(struct sockaddr)



    connect() is used to connect to an IP address on a defined port. It returns -1 on

    error.





  6.4. listen()

  =============



    #include <sys/types.h>

    #include <sys/socket.h>



    int listen(int fd,int backlog);



    Let's see the arguments:



        fd  -> is the socket file descriptor returned by socket() call

        backlog -> is the number of allowed connections



    listen() is used if you're waiting for incoming connections, this is, if you want

    someone to connect to your machine. Before calling listen(), you must call bind()

    or you'll be listening on a random port =) After calling listen() you must call

    accept() in order to accept incoming connection. Resuming, the sequence of system calls

    is:



        1. socket()

        2. bind()

        3. listen()

        4. accept() /* In the next section I'll explain how to use accept() */



    As all functions above described, listen() returns -1 on error.





  6.5. accept()

  =============



    #include <sys/socket.h>



    int accept(int fd, void *addr, int *addrlen);



    Let's see the arguments:



        fd  -> is the socket file descriptor returned by listen() call

        addr    -> is a pointer to struct sockaddr_in where you can determine which host

               is calling you from which port

        addrlen -> set it to sizeof(struct sockaddr_in) before its address is passed

               to accept()



   

    When someone is trying to connect to your computer, you must use accept() to get the

    connection. It's very simple to understand: you just get a connection if you accept =)

   



    Next, I'll give you a little example of accept() use because it's a little different

    from other functions.



    (...)



      sin_size=sizeof(struct sockaddr_in);

      if ((fd2 = accept(fd,(struct sockaddr *)&client,&sin_size))==-1){ /* calls accept() */

        printf("accept() error\n");

        exit(-1);

      }



    (...)



    From now on, fd2 will be used for add send() and recv() calls.





  6.6. send()

  ===========



   

    int send(int fd,const void *msg,int len,int flags);



    Let's see the arguments:



        fd -> is the socket descriptor where you want to send data to

        msg    -> is a pointer to the data you want to send

        len    -> is the length of the data you want to send (in bytes)

        flags  -> set it to 0





    This function is used to send data over stream sockets or CONNECTED datagram sockets.

    If you want to send data over UNCONNECTED datagram sockets you must use sendto().

   

    send() returns the number of bytes sent out and it will return -1 on error.





  6.7. recv()

  ===========





    int recv(int fd, void *buf, int len, unsigned int flags);



    Let's see the arguments:



        fd  -> is the socket descriptor to read from

        buf    -> is the buffer to read the information into

        len     -> is the maximum length of the buffer

        flags     -> set it to 0





    As I said above about send(), this function is used to send data over stream sockets or

    CONNECTED datagram sockets. If you want to send data over UNCONNECTED datagram sockets

    you must use recvfrom().



    recv() returns the number of bytes read into the buffer and it'll return -1 on error.





  6.8. sendto()

  =============



    int sendto(int fd,const void *msg, int len, unsigned int flags,

           const struct sockaddr *to, int tolen);



    Let's see the arguments:



        fd  -> the same as send()

        msg     -> the same as send()

        len    -> the same as send()

        flags    -> the same as send()

        to    -> is a pointer to struct sockaddr

        tolen    -> set it to sizeof(struct sockaddr)



    As you can see, sendto() is just like send(). It has only two more arguments : "to"

    and "tolen" =)



    sendto() is used for UNCONNECTED datagram sockets and it returns the number of bytes

    sent out and it will return -1 on error.





  6.9. recvfrom()

  ===============



    int recvfrom(int fd,void *buf, int len, unsigned int flags

             struct sockaddr *from, int *fromlen);



    Let's see the arguments:



        fd    -> the same as recv()

        buf    -> the same as recv()

        len    -> the same as recv()

        flags    -> the same as recv()

        from    -> is a pointer to struct sockaddr

        fromlen    -> is a pointer to a local int that should be initialised

               to sizeof(struct sockaddr)



    recvfrom() returns the number of bytes received and it'll return -1 on error.





  6.10. close()

  =============



    close(fd);



    close() is used to close the connection on your socket descriptor. If you call close(),

    it won't be no more writes or reads and if someone tries to read/write will receive an

    error.





  6.11. shutdown()

  ================



    int shutdown(int fd, int how);



    Let's see the arguments:



        fd    -> is the socket file descriptor you want to shutdown

        how    -> you put one of those numbers:

               

                    0 -> receives disallowed

                    1 -> sends disallowed

                    2 -> sends and receives disallowed



    When how is set to 2, it's the same thing as close().



    shutdown() returns 0 on success and -1 on error.





  6.12. gethostname()

  ===================



    #include <unistd.h>



    int gethostname(char *hostname, size_t size);



    Let's see the arguments:



        hostname  -> is a pointer to an array that contains hostname

        size       -> length of the hostname array (in bytes)



   

    gethostname() is used to get the name of the local machine.







7. SOME WORDS ABOUT DNS

=======================================



I created this section, because I think you should know what DNS is. DNS stands for "Domain

Name Service" and basically, it's used to get IP addresses. For example, I need to know the

IP address of queima.ptlink.net and through DNS I'll get 212.13.37.13 .



This is important, because functions we saw above (like bind() and connect()) work with IP

addresses.



To see you how you can get queima.ptlink.net IP address on c, I made a little example:





/* <---- SOURCE CODE STARTS HERE ----> */



#include <stdio.h>

#include <netdb.h>   /* This is the header file needed for gethostbyname() */

#include <sys/types.h>

#include <sys/socket.h>

#include <netinet/in.h>





int main(int argc, char *argv[])

{

  struct hostent *he;



  if (argc!=2){

     printf("Usage: %s <hostname>\n",argv[0]);

     exit(-1);

  }



  if ((he=gethostbyname(argv[1]))==NULL){

     printf("gethostbyname() error\n");

     exit(-1);

  }



  printf("Hostname : %s\n",he->h_name);  /* prints the hostname */

  printf("IP Address: %s\n",inet_ntoa(*((struct in_addr *)he->h_addr))); /* prints IP address */

}

/* <---- SOURCE CODE ENDS HERE ----> */







8. A STREAM SERVER EXAMPLE

=======================================



In this section, I'll show you a nice example of a stream server. The source code is all

commented so that you ain't no possible doubts =)



Let's start:



/* <---- SOURCE CODE STARTS HERE ----> */



#include <stdio.h>          /* These are the usual header files */

#include <sys/types.h>

#include <sys/socket.h>

#include <netinet/in.h>





#define PORT 3550   /* Port that will be opened */

#define BACKLOG 2   /* Number of allowed connections */



main()

{



  int fd, fd2; /* file descriptors */



  struct sockaddr_in server; /* server's address information */

  struct sockaddr_in client; /* client's address information */



  int sin_size;





  if ((fd=socket(AF_INET, SOCK_STREAM, 0)) == -1 ){  /* calls socket() */

    printf("socket() error\n");

    exit(-1);

  }



  server.sin_family = AF_INET;        

  server.sin_port = htons(PORT);   /* Remember htons() from "Conversions" section? =) */

  server.sin_addr.s_addr = INADDR_ANY;  /* INADDR_ANY puts your IP address automatically */  

  bzero(&(server.sin_zero),8); /* zero the rest of the structure */



 

  if(bind(fd,(struct sockaddr*)&server,sizeof(struct sockaddr))==-1){ /* calls bind() */

      printf("bind() error\n");

      exit(-1);

  }    



  if(listen(fd,BACKLOG) == -1){  /* calls listen() */

      printf("listen() error\n");

      exit(-1);

  }



while(1){

  sin_size=sizeof(struct sockaddr_in);

  if ((fd2 = accept(fd,(struct sockaddr *)&client,&sin_size))==-1){ /* calls accept() */

    printf("accept() error\n");

    exit(-1);

  }

 

  printf("You got a connection from %s\n",inet_ntoa(client.sin_addr) ); /* prints client's IP */

 

  send(fd2,"Welcome to my server.\n",22,0); /* send to the client welcome message */

 

  close(fd2); /*  close fd2 */

}

}



/* <---- SOURCE CODE ENDS HERE ----> */







9. A STREAM CLIENT EXAMPLE

=======================================



/* <---- SOURCE CODE STARTS HERE ----> */



#include <stdio.h>

#include <sys/types.h>

#include <sys/socket.h>

#include <netinet/in.h>

#include <netdb.h>        /* netbd.h is needed for struct hostent =) */



#define PORT 3550      /* Open Port on Remote Host */

#define MAXDATASIZE 100   /* Max number of bytes of data */



int main(int argc, char *argv[])

{

  int fd, numbytes;      /* files descriptors */

  char buf[MAXDATASIZE];  /* buf will store received text */

 

  struct hostent *he;         /* structure that will get information about remote host */

  struct sockaddr_in server;  /* server's address information */



  if (argc !=2) {          /* this is used because our program will need one argument (IP) */

    printf("Usage: %s <IP Address>\n",argv[0]);

    exit(-1);

  }



  if ((he=gethostbyname(argv[1]))==NULL){    /* calls gethostbyname() */

    printf("gethostbyname() error\n");

    exit(-1);

  }



  if ((fd=socket(AF_INET, SOCK_STREAM, 0))==-1){  /* calls socket() */

    printf("socket() error\n");

    exit(-1);

  }



  server.sin_family = AF_INET;

  server.sin_port = htons(PORT); /* htons() is needed again */

  server.sin_addr = *((struct in_addr *)he->h_addr);  /*he->h_addr passes "*he"'s info to "h_addr" */

  bzero(&(server.sin_zero),8);



  if(connect(fd, (struct sockaddr *)&server,sizeof(struct sockaddr))==-1){ /* calls connect() */

    printf("connect() error\n");

    exit(-1);

  }



  if ((numbytes=recv(fd,buf,MAXDATASIZE,0)) == -1){  /* calls recv() */

    printf("recv() error\n");

    exit(-1);

  }



      buf[numbytes]='\0';



      printf("Server Message: %s\n",buf); /* it prints server's welcome message =) */



      close(fd);   /* close fd =) */

}



/* <---- SOURCE CODE ENDS HERE ----> */







10. LAST WORDS

=======================================





As I'm just a simple human, it's almost certain that there are some errors on this document.

When I say errors I mean English errors (because my language is not the English) but also

technical errors. Please email me if you detect any error =)



But you must understand that this is the first version of this document, so , it's natural not

to be very complete (as matter of fact I think it is ) and it's also very natural to have

stupid errors. However, I can be sure that source code presented in this document works fine.





If you need help concerning this subject you can email me at <BracaMan@clix.pt>





SPECIAL THANKS TO: Ghost_Rider (my good old mate), Raven (for letting me write this tutorial)

           and all my friends =)







11. COPYRIGHT

=======================================



All copyrights are reserved. You can distribute this tutorial freely, as long you don't change

any name or URL. You can't change a line or two, or add another lines, and then claim that this

tutorial is yours. If you want to change something, please email me at <BracaMan@clix.pt>.
  • Share this
  • Sumbit to Digg
  • Sumbit to StumbleUpon
  • Sumbit to Delicious
  • Sumbit to Technorati
  • Sumbit to Reddit
  • Sumbit to Mixx
  • Sumbit to Twitter
  • Sumbit to Furl
  • Sumbit to Design Float
  • Sumbit to Blinklist
  • Sumbit to Yahoo Buzz
  • Sumbit to Google Bookmarks

The M.M.C. Guide to Hacking, Phreaking, Carding

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

                              The Mickey Mouse Club

                                  Presents.......

                  The M.M.C. Guide to Hacking, Phreaking, Carding

                                By: The Dark Lord


  Introduction:
  ~~~~~~~~~~~~~~
      This is a text file is made by The Mickey Mouse Club and we ask
 that it would be distibuted to others for their use.  This file is going to
 go into depth on how to hack, phreak, and card.  There will be information
 that should help everyone, hopefully!!




  Hacking:
 ~~~~~~~~~~
      Hacking is a long hard process, unless you get lucky.  There are many
 programs and aids out to make the job a lot easier, but the concept is
 the same no matter how you use it.  First, at least on most things that you
 hack, you need to get some type of account or vacancy, etc...  This is done
 by randomly entering numbers and or letters until you come up with the
 proper combination to find the account.  Knowing the size of the account
 number makes this job one-hundred times easier.  Thats why I suggest you
 find out from someone who allready has one or card one.  By carding the
 account, it will die quickly but at least it will give you the length
 of the account numbers (More on that topic will be expained in the carding
 section).  The accound numbers, do not always just contain numbers or have
 numbers at all in it.  If it has a mix, it makes it a hell of a lot harder
 to get.  You will just have to experiment to find out what charactors are
 contained in the account.  Some Examples of ones that do have mixes of
 numbers and letters would be Pc Persuit accounts.  The forms of them are
 usuall as such:

            Account: Pgp014764g
            Password: 23632k

     It looks from these that you are pretty much screw because of the way
 letters are mixed with numbers, thats what makes having a program so much
 easier.  In a lot of circumstances, getting the account is the hardest part
 that is why having a good background of the system is a major plus in your
 favor.
     Once you have got the account, it is time to get the password for this
 account.  Once again having the length and such makes this process not only
 easier, but faster.  just keep entering random passwords of the length or
 the thought length in until you get a stoke of luck and get it.  You MUST
 remember that 99.5 out of 100 times, this is a long process, and you have
 to have patience.  If you don't you might as well forget ever getting on
 to the system or have someone else do it for you.  Once you have gotten
 the password, look it over long and hard.  Write it down and keep it,
 examine it.  99% of the time there is a pattern to all the account
 passwords.  Things to look at is the password in reference to the account
 number.  check to see if things have been added to the end or beginning
 like 00 or 01 or 99 of 0010 thing like that.  If you see no relations,
 the only other way to really find out the pattern in to get another one.
 Look at both of them together, see if there the same or it account 400's
 password is 3456 and 402's password is 3458 (they go in order) then just
 those as a reference to other passwords, take away so much from accounts
 with a lower number and add the required amounts to accounts with a higher
 number, etc....  But bassicly, LOOK FOR A PATTERN!  Once you have got the
 password and the account, you have got yourself a passage way in.
     Although this is what you do to succeed, you have to take
 many precautions.  They do NOT like us messing with the system and they
 obviously want you to pay just like the others, so they will take necessary
 means to nail you.  They trace like you wouldn't belive.  They will trace
 right as you get on, if you happen to be unlucky, you will never know when
 they are doing it either, you must ALWAYS be aware of the dangers and take
 precautions!!!  Even on things that you wouldn't think that they would trace
 you but, be carfull.  Whether they trace depends on a couple of things, here
 are a few major ones:

     1. There bank balance
     2. There desire to catch you
     3. The amount of infestation in there system

    There are things that you can do to protect yourself, these are not all
    of them and none of them are sure fire ways, but hey, cutting down your
    chances of getting caught makes a world of difference, because remember,
    All the fun is taken away if you caught.  Some things to do to protect
    yourself is:

     1. Use a diverter
     2. Use false information about you
     3. Never stay On-line too long
     4. Call during late or early hours, were there is most likely no one
     monitoring the system
     5. Don't call frequently or during the same hours, regulate it

    Once again these are not all of them but these are some of the "More"
 helpfull things.  If you follow all the step, you can reduce the change of
 getting caught by about 40%.
    If you do get caught there is not a whole lot that you can do, but some
 tips are, first, don't reveal any information on what you have done. Deny
 all charges.  Sencond, plea bargin with knowladge of things, like hacked
 sytems etc..  But never admit that you did it.  Three, and most important,
 get a GOOD LAWYER!!!!!!!


 DIFFERENT TYPES OF SYSTEMS:

    Pc Persuit     Cp\m
    Trw
    Unix
    Vmb
    Vms

     These are just a few systems, if I made a complete list There would
 be pratically no end to it, there are millions.









 Phreaking:
~~~~~~~~~~~~

     Phreaking, Ahhhwwww, the wonderfull world of phreaking.  Well to start
 with Phreaking is "The use of Telecommunications to others besides people
 of the Phone Company".  Well thats my version of the definition at least.
     Using codes is wuit easy, there are different parts to it, the Dial-up,
 the code, and the number.  First you will have to dial in the dial-up and
 on most dial ups you will get a tone or a buzz or click or something to
 that effect.  Once you hear this, and you will know when you hear it you
 dial in the code.  Sometime you will get another tone or beep etc. and when
 you do that is when you dial in the number.  If you do not get another tone
 or whatever you just dial in the number right after you enter the code.
 You might have to have a test dial up to see how the tones go.
     In dialing the number once agian the nubers differ.  You must enter the
 area code and then the nuber.  Some require that you have a one before the
 area code but most that I have used do not.  You can tell if the code worked
 right after the number has been put in not just by the error recording that
 you get but if right off the bat the phone begins to ring, it doesn't work.
     A code can also be busy.  If it is busy it could mean that the code is
 dead or that too many people are using it at once.  You might experiance
 this often.
     There are numbers that make phreaking much safer, they are called
 diverters.  What the do is when the number that you have dial is being
 traced it diverts it to that number.  Unless this is virgin or nobody else
 uses it, you will find that with in a couple of days after it is out, it
 will be busy, that is the annoyance about diverters, and they are also hard
 to get.
     Hacking is also put into play in phreaking by using programs to get
 dial ups and the codes.  Getting these are done in the same way you hack
 anything else.   Just get a program like code thief or code hacker, or make
 one yourself, it is quite easy.
     There is a danger with useing the codes.  If you hack a code yourself,
 not just the code but the dial up amd no one else has it you can pretty well
 bet that it is safe.  A newly hacked dial-up/code is considered "Virgin".
 those Ma bell is not having the problem with people phreaking off of it
 so they don't bother doing anything with it.  But after a while, it will
 either Die (No Longer work) or they will start tracing off of it.  The
 whole pain about it is, is you will never positively no when they started
 doing traces or things like that.  The codes might be being traced but you
 are getting the luck of the draw.  On most codes they don't trace on every
 call, they just file it away and watch for like the 50th or 100th caller
 and then that person gets nailed.  You might think if they do trace every
 100 calls, that means you have a 1 in 100 chance of getting caught and those
 are really good odds.  Well the odd is 100 to 1 but the is a lot of people
 that live in areas that they can call with that code.  If you figure about
 10 million people could use it then about 100,000 of them are.  100,000,
 hummmmmmm, how odes your odds look now.  In a couple minute time spand
 99 peoplecould have used it, and lucky you might be the 100th caller.  A
 lot of times the take like every hundered calls and then when they get the
 100th caller, that don't just trace one, they trace 100, 101, 102, 103, 104
 200, 201, 202 etc.  So you chances of getting caught when the heat is on
 the code is pretty good.  There are a couple different types of codes and
 the two major ones are 1-800's and 950's.  800's can pretty much be dialed
 from anywhere in the states, but 950's stay in certain areas.  Some 950
 dial ups are:

    9501001
    9500266
    9500355
    9501388

     And there are others, but like take me for example, where I live you
 cannot use 9500266.  It will tell you that you cannot use that number from
 your dialing range or it just won't work.  You might get to the point where
 the dial-up works but not the code.  If this is the case it will say:
             "Invalid authorization Code"

     Some examples of 1-800's are as follows:

     1-800-255-2255
     1-800-759-2345
     1-800-959-8255

     There are many others but those are just a few, very few.  There are
 also 1-800's and others that will send you directly to the operator, you
 must tell her the code and the number you are dialing.  These are NEVER
 safe to use.  but in one case they are alot better.  I am out of town a lot
 so I have to use pay phones right?  Well, you are safe with anything with
 pay phones, so that is a good way to call people.  The real good thing
 them though, is since you must go throught th operator, the codes stay valid
 for up to 10 times as long as the others.  But thenm again another draw back
 is it is not a line that you want to give real names or numbers over.
 Because these are often tapped, since the operator know that you used the
 code, they will listen in quite often, and you will never even notice.
 Another problem experianced with them is if you are what MMC calls
                          "Petite Flowers",
 our home made word for, someone that sounds like a little kid, then they
 really give you a hastle about using the code.
     I have had a lot of people ask me if the person you are calling with the
 codes can get busted.  The answer is "No".  They cannot do anything to the
 person, just ask him who is calling him with the codes, and they rarely do
 that.  Just let the person you are talking to, if they don't already know,
 not to tell anyone that you are calling with the codes.  The phone
 companies do have to option of setting up a trace on that persons line and
 bust you when you do call him with a code.  I have never seen this done but
 do be aware that the phone companies are made up of intellegent adults and
 they are very smart and can and will nail you in many ways.
     I am a firm beliver that you should share a the information that you
 other phreakers and hackers as they should do the same with you.  I also
 see an execption, inexperianced people.  They can run it for everyone be not
 have the knowladge and screwing up.  I realize that they need someway to
 build themselves up to a good phreaker but be cautions in what you give to
 them.
     Codes die really often and you really have to keep up with the phone
 company.  Its kinda of a pain to keep up with it on your own as quickly as
 they work but thats why there is phreaking communities and groups such
 as Fhp and MMC, the gives the edge to the phreakers in the way that, you
 have help in keeping up with the phone companies, and in most cases if
 the groups or communities are working well together, you can eve stay
 one step ahead of good 'ole Ma bell and others.  You really need to find
 ways of getting codes either from getting acess to the phreaking sections
 on the pirate boards you call or throught friends, Vmb's Loops, Confrences,
 etc., just try to find a good connection to people that are into phreaking
 too.









 Carding:
~~~~~~~~~~



     Although everything talked about in the text file to this point is
 illegal, and you will get busted if you get caught, this is one one the
 one that you can get in some major shit over.  About the only thing I have
 talked about that this falls short of is hacking a government compter, and
 thats one of the Grand daddies of them all.  Well, although it is a major
 crime, it is really cool!!!!  This is the process in which you find the card
 number of someone and use it to purchase things.  In order to card, there
 are a few things that you must have or it will not work.  You will need to
 have........

     1. The Card Number
     2. The Experation date
     3. Card type (Master Card, Visa, etc...)

 Those are the main things tha you will need.  Having the name of the owner
 is very helpfull but it is not a must.  You can get by without it.
     You have to order everything you want by mail.  A couple of "Beginner"
 carder that I talked to didn't understand how you would do it, but thats
 when they had the misconception that you actually go to the store and
 purchase things.  That is a complete No, no.  You do everything from a
 phone ordering service.
       When you call make sure that you are a t a pay phone.  Don't do it
 your house or anywhere where it can come back to you.  When you order
 the merchandice, once again do send it to anywhere that it can come back to
 you like your home, work, etc.  Find a vacant house or building or anywhere
 else that you can send it to.  Also, don't send it to a P.O. box that you
 have, just as dangerous.  When you do order it and you think its around the
 time that you will be reciving it, check the mailbox frequently.  But do it
 during odd hours.  I mean, hows it going to look you taking a package from a
 vacant house?
       Most bills are sent at the end of the month or at the biginning, so
 try to time it to where the bill won't come to the person untill a couple of
 days after you have recived the package.  Ok heres how to figure it.  I
 have found out that the bills are sent out up around the 26-30th of the
 month, so they will actually recive the bill around the 31-4th.  Have it
 sent right after you think the bill has been sent.  Find what you want, but
 try to order it from the place that guarentees the fastest delivery.  When
 you order the item, make sure they have it in stock and don't have to get
 the item in first.  Order the highest class of delivery but not COD or
 next day service.  Thats cutting it too close.  It should take around 2-4
 weeks before you get it and if you timed it right, then it sound get there
 right before the person gets the bill.  You need to have it in your
 possesion before the bill gets to the person because if they complain, they
 can keep it from being sent, or watch who actually gets it even while its
 going throught the mail process.  Don't order more than a couple of things
 or overcharge the card, if the people at the Credit card office, see
 irregular charging on the card, they will follow up on it.
         To actually order the item you will call up the place that you will
 be ordering from, and when the operator answers let her know what you need
 to as far as what you are purchasing, etc.  When she ask how you will be
 paying just tell her "Charge" and the the type of card like Master Card,
 Visa, ect.  Then Tell them your name, if you don't know the name of the
 actuall owner of the card, Make up a false name that has NO relation to
 your name, not the same first, last middle what ever, nothing relating to
 your real name.  Then continue answering all the operators questions,
 address (Not your own remember!) state, area code etc.  They will also ask
 for your phone number.  Make one up, not your own.  If something happens
 to go wrong as far as delivery or if they are checking if you are who you
 say, then your screwed, unless of course, hehehe, the number is ALWAYS
 busy.  Find the busiest number there is and leave them that.  When they
 ask for the card number and experation, just tell them and do what all
 else you need.  Wish them a good day, and hope you get it.
         Ok heres how you check if the card is good, and how much money
 can be charged on the card.......

     1. Dail 1-800-554-2265

     2. it will ask for the type of the card.  you must put in 10 for Master
 Card and 20 for Visa, I am not sure about the others.

     3. Next it will ask for the Identification.  You will need to enter
 1067

     4. After all that you will have to enter the Mecrchant number, which
 you will either need to put in 24 or 52.  One of them should work.

     5. You will then have to enter (When Prompted) the card number itself.

     6. Next, the experation date of the card.

     7. Last but not least the amount you want to try to get on the card.
 The procedure for this is enter dollars, astricks, then cents.
     (Example:)
         100*30 = One hundred dollars and thirty cents.

 One thing I do need to mention, after you type in everything you must press
 pound (#).  Like when it asks you for the type of card, if you had a Master
 Card you would put:  10#.  when it asked for identification you would enter
 1067#.  If it says invalid, that either means that the card is no good or
 you can't charge that amount on the card.  Try it again, but try a lower
 amount.  If you get down to $1 and it still doesn't work, hehehe, you can
 probably guess that the card is no good.
     You might not be ordering just merchandice you might be ordering
 accounts and things like that and if you are, fine, but you have to
 remember, the accounts do not stay good for very long, the owner of the
 card gets the bill, complains and its no longer any good.  And when you
 card and account, Nine out of ten times, they won't kill the account, they
 will trace in and that is when you butts really in a sling.  So carding
 accounts and things, isn't the safest way to go, of course. nothing we
 have talked about it, right?





 Conclusion:
~~~~~~~~~~~~~~

     Well thats about it for now, there should be a BIG newsletter by
 The Mickey Mouse Club comming out soon that you have to be sure NOT to miss.
 I sincerely hope that you have gotten alot out of this file and I would like
 to ask for suggestions and ideas to make MMC a better orginazation.  At this
 time myself and Cardiac Arresst have a VMB at:

                1-800-444-7207 [Ext] 4001.

     All ideas and suggestions, please bring there.  Also, since your making
 the trip anyways, bring along some phreaking codes and all and any types
 of accounts.  I would be greatly appreciated by:

    The Mickey Mouse Club.
    09/89


-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-




  <=þ=> <=þ=> <=þ lääChäë ŸçíM: ’lÅäçï’Åiûä ï’Åiíï [áälGiUM] þ=> <=þ=> <=þ=> 
  • Share this
  • Sumbit to Digg
  • Sumbit to StumbleUpon
  • Sumbit to Delicious
  • Sumbit to Technorati
  • Sumbit to Reddit
  • Sumbit to Mixx
  • Sumbit to Twitter
  • Sumbit to Furl
  • Sumbit to Design Float
  • Sumbit to Blinklist
  • Sumbit to Yahoo Buzz
  • Sumbit to Google Bookmarks

BBS Crashing Techniques

[:=:][:=:][:=:][:=:][:=:][:=:][:=:][:=:][:=:][:=:][:=:][:=:][:=:][:=:][:=:]
[:=:]                                                                 [:=:]
[:=:]   New Wave  presents...                                         [:=:]
[:=:]                                                                 [:=:]
[:=:]                                                                 [:=:]
[:=:]                     BBS CRASHING TECHNIQUES                     [:=:]
[:=:]                    -------------------------                    [:=:]
[:=:]                                                                 [:=:]
[:=:]                                     by Mr. Memorex   1/27/87    [:=:]
[:=:]                                                                 [:=:]
[:=:][:=:][:=:][:=:][:=:][:=:][:=:][:=:][:=:][:=:][:=:][:=:][:=:][:=:][:=:]

             - File Formatted for 80 columns like it or not -

 To start off with, I'd just like to say this file is a collectithe
 latest BBS crashes. Many people have grudges and reasons to 'crash' a bbs,
 well this file is served as an aid to them and also to sysops who want to
 prevent their own bbs' from being attacked. And that's enuff talk for now,
 let's get on with the good stuff (everything is in cookbook format for speedy
 reading).


[-=:  Apple Net :=-]


1. Post a message (can be bbs,feedback,newuser etc.)
2. Press space bar util you get to the very last line (40th col.)
3. type ctrl-D
4. (after the word wrap to next line) Type any dos command (Preferrably FP)
5. get into editor ('/E')
6. list the program
7. You should be in basic or executing whatever dos command you entered


Requirements:

- Must have wordwrap activated
- 40 columns mode should be activated
- Their must be a (L)ist command in the editor


[-=: Telecat 2.x & 3.0 :=-]


 2.x
-----


1. Go to the board section
2. Newscan the last board accessable
3. After the first message, type 'B' at the prompt (To jump to next board)


Results:

- If it was the last board on the bbs, chances arethat will break into Basic
- If not, then it will go on to the next board (which is handy and surpassess
  the security level crap)

 3.0
-----


1. Post Message
2. Type a line of text
3. type ctrl-V


Results:

- This should either hang the system or break into basic
- It is trying to center the line but it fucks up

[-=: GBBS Pro :=-]

Method 1:

1. Go the the editor
2. Hold down tab key
3. or press space and type ctrl-C

Method 2:

1. Upload to a full volume

Method 3:

1. read the userlist
2. hang up when it gets to the Sysop
3. call back and log on and you'll be a sysop

[-=: Proving Grounds :=-]

Method 1:

1. (On older versions) Enter decimal or negative numbers

Method 2:

1. Call board and enter the user number of a Remote sysop
2. Enter any bs for a pw
3. Do the same thing again (more garbage the 2nd time it asks)
4. Now enter your real number and pass
5. At the first input prompt type 'Remote'
6. This should give you the Remote Sysop menu and access

Notes:

- Using Sysop's user# will give you 10 extra minutes on system
- The second method works only on unmoded newer versions of Proving Grounds

Ok, well that about wraps it up. Remember, all these crashes work only on
unmoded boards (which are on the most part run by leeches and geeks).

If you have any questions or more tips for Vol.2 then leave me mail on
Halifax 20megs (301)445/5897  or  Eastern Alliance 10megs (201)327/5725
and where else you see me. Both are fine boards. Have Fun!

[-------------<THE BAND>--------------]
Mistywood BBS/AE/CF........818/335-5651
Mistywood // BBS...........602/220-9363
The Wizards Guild..........409/696-8226
Den o/Crude Tort...........617/832-9229
Sirius Cybernetics.........808/528-2436
[-------------------------------------]


DOWNLOADED FROM P-80 SYSTEMS.....
  • Share this
  • Sumbit to Digg
  • Sumbit to StumbleUpon
  • Sumbit to Delicious
  • Sumbit to Technorati
  • Sumbit to Reddit
  • Sumbit to Mixx
  • Sumbit to Twitter
  • Sumbit to Furl
  • Sumbit to Design Float
  • Sumbit to Blinklist
  • Sumbit to Yahoo Buzz
  • Sumbit to Google Bookmarks

A beginners guide to Hacking UNIX

**************************************
*       A beginners guide to:        *
*          H A C K I N G             *
*                                    *
*                U N I X             *
*                                    *
*          By Jester Sluggo          *
*         Written 10/08/85           *
**************************************

  In the following file, all references made to the name Unix, may also be
substituted to the Xenix operating system.

  Brief history:  Back in the early sixties, during the development of third
generation computers at MIT, a group of programmers studying the potential of
computers, discovered their ability of performing two or more tasks
simultaneously.  Bell Labs, taking notice of this discovery, provided funds for
their developmental scientists to investigate into this new frontier.  After
about 2 years of developmental research, they produced an operating system they
called "Unix".

  Sixties to Current:  During this time Bell Systems installed the Unix system
to provide their computer operators with the ability to multitask so that they
could become more productive, and efficient.  One of the systems they put on the
Unix system was called "Elmos".  Through Elmos many tasks (i.e.  billing,and
installation records) could be done by many people using the same mainframe.

  Note:  Cosmos is accessed through the Elmos system.

  Current:  Today, with the development of micro computers, such multitasking
can be achieved by a scaled down version of Unix (but just as powerful).
Microsoft,seeing this development, opted to develop their own Unix like system
for the IBM line of PC/XT's.  Their result they called Xenix (pronounced
zee-nicks).  Both Unix and Xenix can be easily installed on IBM PC's and offer
the same functions (just 2 different vendors).

  Note:  Due to the many different versions of Unix (Berkley Unix, Bell System
III, and System V the most popular) many commands following may/may not work.  I
have written them in System V routines.  Unix/Xenix operating systems will be
considered identical systems below.

  How to tell if/if not you are on a Unix system:  Unix systems are quite common
systems across the country.  Their security appears as such:

Login;     (or login;)
password:

  When hacking on a Unix system it is best to use lowercase because the Unix
system commands are all done in lower- case.

  Login; is a 1-8 character field.  It is usually the name (i.e.  joe or fred)
of the user, or initials (i.e.  j.jones or f.wilson).  Hints for login names can
be found trashing the location of the dial-up (use your CN/A to find where the
computer is).

  Password:  is a 1-8 character password assigned by the sysop or chosen by the
user.

      Common default logins
   --------------------------

   login;       Password:

   root         root,system,etc..
   sys          sys,system
   daemon       daemon
   uucp         uucp
   tty          tty
   test         test
   unix         unix
   bin          bin
   adm          adm
   who          who
   learn        learn
   uuhost       uuhost
   nuucp        nuucp

  If you guess a login name and you are not asked for a password, and have
accessed to the system, then you have what is known as a non-gifted account.  If
you guess a correct login and pass- word, then you have a user account.  And,
if you guess the root password, then you have a "super-user" account.  All Unix
systems have the following installed to their system:  root, sys, bin, daemon,
uucp, adm

  Once you are in the system, you will get a prompt.  Common prompts are:


$

%

#


  But can be just about anything the sysop or user wants it to be.

  Things to do when you are in:  Some of the commands that you may want to try
follow below:

  who is on (shows who is currently logged on the system.)
  write name (name is the person you wish to chat with)
  To exit chat mode try ctrl-D.
  EOT=End of Transfer.
  ls -a (list all files in current directory.)
  du -a (checks amount of memory your files use;disk usage)
  cd\name (name is the name of the sub-directory you choose)
  cd\ (brings your home directory to current use)
  cat name (name is a filename either a program or documentation your username
has written)

  Most Unix programs are written in the C language or Pascal since Unix is a
programmers' environment.

  One of the first things done on the system is print up or capture (in a
buffer) the file containing all user names and accounts.  This can be done by
doing the following command:



cat /etc/passwd



  If you are successful you will a list of all accounts on the system.  It
should look like this:

root:hvnsdcf:0:0:root dir:/:
joe:majdnfd:1:1:Joe Cool:/bin:/bin/joe
hal::1:2:Hal Smith:/bin:/bin/hal

  The "root" line tells the following info :

login name=root
hvnsdcf   = encrypted password
0         = user group number
0         = user number
root dir  = name of user
/         = root directory

  In the Joe login, the last part "/bin/joe " tells us which directory is his
home directory (joe) is.

  In the "hal" example the login name is followed by 2 colons, that means that
there is no password needed to get in using his name.

  Conclusion:  I hope that this file will help other novice Unix hackers obtain
access to the Unix/Xenix systems that they may find.  There is still wide growth
in the future of Unix, so I hope users will not abuse any systems (Unix or any
others) that they may happen across on their journey across the electronic
highways of America.  There is much more to be learned about the Unix system
that I have not covered.  They may be found by buying a book on the Unix System
(how I learned) or in the future I may write a part II to this........
  • Share this
  • Sumbit to Digg
  • Sumbit to StumbleUpon
  • Sumbit to Delicious
  • Sumbit to Technorati
  • Sumbit to Reddit
  • Sumbit to Mixx
  • Sumbit to Twitter
  • Sumbit to Furl
  • Sumbit to Design Float
  • Sumbit to Blinklist
  • Sumbit to Yahoo Buzz
  • Sumbit to Google Bookmarks
 
Copyright 2009 ccproject. Powered by Blogger Blogger Templates create by Deluxe Templates. WP by Masterplan