ÜÜÜ ÜÜÜ Ü ÜÜÜÜÜÜ ÜÜÜÜ ÜÜÜÜ ÜÜÜ ÜÜÜÜÜÜ ÜÜÜÜÜÜ ÛÛ ÛÛ Û ÛÜ Û Û ÛÛ Û ÛÛ Û ÛÛ ÛÛ ÛÛ Û ÛÛ Û ÛÛ ÜÛÛÜÛÛÜ Û ÛÜÛ ÛÛ ÛÛ Û ÛÛ ÛÛ ÛÛ ÛÛ ÛÛÜÜ ÛÛ ÛÛ Û ÛÛ ÛÛ ÛÛ Û ÛÛ ÛÛ ÛÛ ÛÛ ÛÛ ÛÛ ÛÛ Û Û ÛÛ ÛÛÛÛ ÛÛÛÛ ÛÛÛ ÛÛ ÛÛÛÛÛÛ -[The Antidote]- --------------------------------- Contents- Introduction News Government Servers - LoRD OaK Submittings Our Image - Jaynus 100% bikkel - LoRD OaK Antionline - opt1mus Rivalry - LoRD OaK Linux for Dipshits - sekurity-net.com --------------------------------- /*Introduction*/ --------------- Sorry for the delay folks, but like i said before, Duece got into a car accedent! He is OK so you don't need to worry. Antidote is getting pretty big, last issue we had only 20 subscribers and right now we have about 55 people. We are glad to see that more and more people are subscribing. The only thing we ask from you is that you tell people about this magazine and what you think of it. Out goal is to get over 90 subscribers by the next issue. Incase you didn't know, we are always taking artical submitions. Wich means that you can write us a artical on anything that is computer/internet/hacking/phreaking related. We will review it and see weather or not we will post it. There is a GOOD chance that we will. We have only turned down one artical. Your artical can be current news, or a submitting. A submitting isn't news, it is just basically and misc. section for all of the things that don't fit under the News section. You can send your articals to: lordoak@thepoison.org or duece@thepoison.org either one will be fine. We will then review it and maybe post it! When you write us an artical, please be sure to specify your handle or alias and e-mail address. If you don't want us to post them, please be sure and tell us that and we will respect your provacy on that. Please keep in mind that we had a lot of articals planned for this issue. But since I pretty much had to do this whole one myself, I had some trouble collecting some of the stuff. --------------------------------- /*News- Government Servers*/ --------------------------- Are government server lacking security? Well, considering this month, many NASA and government subnets have been taken down. Some for the fun of it and some to show that they are not safe. Groups such as gH, HcV, KpZ and Pentaguard have done the government hackings. Most of the hacks have been done to the US government and some to China, Philippine & Sweden. These hacks have caused rivalry between HcV and gH. gH says that HcV has no talent cause they hacked some government servers. It doesn't make much sense but I am sure there is more to it then that. Here is a list of SOME of the government hacked webpages: http://wwwjtuav.redstone.army.mil http://sisyphus.larc.nasa.gov http://cfo.gsa.gov http://www-ese.fnal.gov http://naisteam.msfc.nasa.gov http://ohrm.niddk.nih.gov http://bulltrout.nwifc.wa.gov http://wwwjtuav.redstone.army.mil http://www.fmc.gov/default.htm http://ri-acala4.ria.army.mil http://afas.afpc.randolph.af.mil/index.htm http://pcjcm1.ece.nps.navy.mil http://doim-il.ngb.army.mil/default.asp http://www.odcsrm.hqusareur.army.mil http://www.237arf.1ad.army.mil http://www.discom.1id.army.mil/default.html http://www.dlis.dla.mil/default.htm http://dcaucusweb.house.gov http://nces.ed.gov http://www.bls.gov http://wenjin.nlc.gov.cn http://www.ky.gov.se http://www.sb.gov.se http://www.pension.gov.se LoRD OaK lordoak@thepoison.org --------------------------------- /*Submittings- Our Image*/ ------------------------- I know lots of you have noticed the same as me. The hacking world is alot diffrent. Just a mere 5 years ago, it was just a semi-small class of computer "nerds" that like to Test security on a machine, and report anything found and how to fix it. But, now it has become much more complexe. Hackers, Crackers, of all types and specialties. From telnet to www hacking. I can remmember those days. IRCs ruled. 2600 and phrack where the only zines of considerable size. Now, hacking has become a hobby to some, a career to others. Imagine, less then 40% of all underground fanatics(hackers, crackers, the like) can program. More so, they don't know what hacking is. Most of the self aclaimed "l33t" are the ones that do the damage to our title. "Redemption of the HcV r00ted gay.faithweb.com Redemption Stated '0h0h0h0 ReDeMpTiOn h4xx0r3d 4 g4y f4gg0t! f33r HcV 4nd th31r 3r33tn3ss.". What is this? They call it hacking. I call it a someone trying to burn steam off when they were abused as a child by there gay father. When the public look at this, they think we all are malicious people like that. They steriotype us. And because the media loves to talk about the bad stuff in life, that is all that gets published. "Hacker takes out child pornography site in Italy". What will the public think of that when ya go to court? They will overall think your actully a nice guy. Most people say ethics are good because they keep you from getting cought. It is alot deeper then this my friends. Your ethics are ingraved into you hacks. Into your mind. Now, the "l33t" blow this off completly. "I l33t. I haxx0r3d Da F3dz pagez! I aM da b3st hax0r in hiztoRYz!". I don't think the writer realizes, but this sounds really stupid. We all know if ya hack the feds, your dead. But, of course, the ego kick! Admit it people, that is why we hack. The feeling of being where were not suppose to be. That is why. Yes, it is also because we wan't to know everything, but this is the true reason behind it all. Can you still remmember why you started hacking? Around 50% of the "l33t" I asked either said they didn't remmember, or because they love to destroy things. The rest said the search for knowledge. Are there any hacks going now'a'days that get you information? Not many. Just posts like Redemptions. All this www hacking, and re-formating hard drives is just plan stupid. I don't really get it. Whats with it? You don't accomplish anything except getting your name on a page that makes everyone fear and hate you. ahh, there it is. Again, alot of "l33t" also like to have people fear them online. But, phycologicly, they do this because they had no control as a child. If anyone argues otherwise, read a book adn see what it says. =) All I wan't to say is that people online should get more reason to hacking. Give us a better public Image. Ask anyone now what a hacker is, the reaply will be, "Someone who gets into your computer and deletes and steals files". I saw on CNN a few weeks ago, something about the Excel hole. They say, hackers will try to get into you computer to get credit cards and destroy it. uhhh huhh. There we go again. We be malicious sons of bitchs. That is what they all think. So do us a favor, and hack for a reason, for a goal. Personally, I hack to take out Child Pornography. And I like to "talk" with all the "l33t" that destroy boxes to give them another track. But, the choice is yours. I am just giving my opinion(a good one I think =) Jaynus (www.jaynus.com) --------------------------------- /*Submittings- 100% Bikkel*/ --------------------------- As most of you probably already have known, 100% bikkel is comming to an end. Demoniz, from hacknews.bikkel.com states that he can't keep up with the news and he feels he isn't doing a good job. On his page, he states that he goes by the quote "If you can't do it right, then don't do it". Well, even though his message board did kinda get out of comtrol with the flamming, his site was a good site for news. I have not been with bikkel for as long as some people have, only about 3 months. Some people have been comming there for a long time now. I know I went to that site EVERDAY for that period of time. Many groups are stating that they everyone that was with bikkel can come to their site for posting messages and submitting news etc.... I don't think that any page will be as good as bikkel. But i do think there will be one site that will be close. That site is www.net-security.org, I just started going there and it looks like a very good site and is always updated. So, my best wishis to demoniz in the future and to net-security.org. LoRD OaK lordoak@thepoison.org --------------------------------- /*Submittings- Antionline*/ -------------------------- Antionline use to be one of the best and most popular hacking sites in the hacking world. Ever since they got taken down I have noticed that a lot of people have lost respect for them. I understand where you all are comming from. I feel that if Antidonline was hacked, then they should admit it, and if they weren't then they have nothing to admit. But, This whole thing doesn't make any sense to me. They had to change servers so they put up "hello2"? Why didn't they just say they were changing servers if that was the truth. But also, I know a bunch of groups that are claiming to have done that hack, well that doesn't make sense to me either. Cause if a group or an individual is good enough to hack Antionline, then they would put there name up for the recognition. So either way, it doesn't make sense. Them being hacked, and them putting up 'hello2'. Another reason that I don't understand is that they say their server was going to be up in like 2 weeks after this happened, but yet it has been like 2 months and not one single word from them. I feel that you all have a good excuse to hate them, but it is not the right thing. The other day I went to Antionline to see for updates, there was the "hello2" message again. If they knew that the first hello2 cause a lot of commotion, then why would they do it again? Also, then it goes back to my theory of the hacker that would put their name or their groups name up. None if it makes sense to me or to anyone else (or so i think). opt1mus opt1mus_pr1me@yahoo.com (http://retribution.dynip.com) --------------------------------- /*Submittings- Rivalry*/ ----------------------- This hacking world now has nothing to do with knowlage, but destroying and "flaming". I have seen MANY hacked sites lately and i have seen nothing but "fuck yous to xxxx" and "xxxx sucks". Its all about flaming. I see reasons on some of the hacks and they are stupid. Like "xxxx hacked this after i did!" or "i hate xxxx cause he is a lamer!". Well guys, don't ya think that is kinda immature? Deal with it. Who cares that someone hacked something after you did? Who cares if someone is a lamer? We were all lamers at one point in our hacking lives or another. I consider ALL hackers, even lamers a race or a nationality. We all feel the same about seeking knowlage, and hate as one another. But to make fun of our own race is pathetic. Why do you think hackers have a bad reputation? Because they hack shit and post "1 4m 31337 4nd i h473 xxxx". Most of the time hackers don't even post the reason of hating someone. And when they do, its pathetic. Thats one of the main reasons hackers have a bad reputation, cause they destroy, make fun of others, and hack their servers for no reason that is given. All I am saying is that "Enough is enough" we all need to do a little growing up in one way or another. LoRD OaK lordoak@thepoison.org --------------------------------- /*Submittings- Linux for Dipshits*/ ---------------------------------- Well I had fun. Only took me about 24 hours, and a pack of cigarettes! In closing: Have fun, but be careful. I am not held responsible for any = misuse of any information displayed here, and if you accidentally mess = up your stuff, im not responsible either. > >part 1 - linuxdipshit.txt >part 2 - dipshitexpressions.txt >part 3 - dipshitOS.txt >part 4 - dipshitadmin.txt > >and part 5 - Networking coming soon > ________________ ---------- \ = / / \________ | | | \ / | | | | | \_/ = |----- | |------- | | | | = | =20 \_______________ |________ | | | | = |----- =20 \ \ |------| ____|_____ | = |=20 | | / \_______/ \___________/ = |_____ =20 | | / | | | \ = / \ ________________/ |/ | | | |\ = | -------- |\ |------| | | \ = | | | \ | \ | | = \ | | | \ | \ | | = \ | | \ | | = \| | ____________________________________ \ = | | Text: Linux For Dipshit's | | Lesson: Working with Other O/S's |=20 | By: Redemption |=20 | webmaster@sekurity-net.com | | http://www.sekurity-net.com | ------------------------------------ Although some of us Linux fanatics think it should be the only operating = system out there,=20 we have to live with the fact that it's not, yet. In the order to blend = in with the rest of the computer world, you must be able to deal with at least MS-DOS files = and media, and=20 perferably other non-Linux media. Thats what this part is about. In this text we will be talking about: -Working with MS-DOS files and media -WOrking with Macintosh media -Working with UNIX files and medial -Converting data using Linux utilites Well its newyears eve, and i just got back from my girlfriends (the love = of my life) house (party!) and im a tad bit drunk, so if this text seems..."fucked" = forgive me. Working with MS-DOS Media ------------------------- You can work with MS-DOS files in one or two ways: bt useing what are = called Mtools, or by=20 mounting the disk and just using regular Linux commands. -Mtools Basics Mtools are a series of commands specifically written to act like the = standard MS-DOS file=20 manipulation commands. They are called Mtools because they are designed = to work with MS-DOS files. The actual command names are just the MS-DOS command names with = an "m" in front of them. *Mtools support "VFAT" (long style) filenames. If the specified = filename does not fit into the standard 8.3 firmat of MS-DOS. Mtools create a "VFAT" name and an = appropriate shirt name. The original name is called the promart name; any derived name is called = the secondary name. *You refer to the MS-DOS file systems by device names. By default, "A" = is the first floppy disk, "B" is the second, "J" is a Jaz drive (if available), and "Z" is a Zip = drive (if available). *Mtools wildcards work the way they work in Linux. That is, the "*" = character matches all the=20 files as it would with Linux, unlike MS-DOS, for which you have to use = *.*=20 *Precede filenames with a drive letter and colon (for example, you can = use A:) to tell Mtools that the files are on an MS-DOS device. Otherwise, Mtools assumes that = they are on the Linux=20 file system. *Mtools supports most high-capacity disk format schemes. *You use the "/ect/mtools.conf" and "$HOME/.mtoolsrc" configuration = files to configure Mtools. All the mtools programs use the following command line options. Check = out the mtools.1 man=20 page for complete configuration information. _________________________________________________________________________= ______________________ Option | Function -------------------------------------------------------------------------= ---------------------- -a | Renames the primary name if there is a conflict -------------------------------------------------------------------------= ---------------------- -A | Renames the secondary name if there is a conflict -------------------------------------------------------------------------= ---------------------- -m | Asks the user what to do with the promary name on conflict -------------------------------------------------------------------------= ---------------------- -M | Asks the user what to do with the secondary name on = conflict -------------------------------------------------------------------------= ---------------------- -o | Overwrites the primary name if there is a conflict -------------------------------------------------------------------------= ---------------------- -O | Overwrites the secondary name if there is a conflict -------------------------------------------------------------------------= ---------------------- -s | Skips the primary name if there is a conflict -------------------------------------------------------------------------= ---------------------- -S | Skips the secondary name if there is a conflict -------------------------------------------------------------------------= ---------------------- --Well kiddies, im waisted, i cant go on, ill pick up again tomorrow.-- --Back again, with a hell of a headach-- -mcd, Changing the current directory You use "mcd" to change the current directory on the MS-DOS device. The = current information is saved in "$HOME/.mcwd"=20 mcd [dos_dir] _________________________________________________________________________= ________________________ Argument | Function -------------------------------------------------------------------------= ------------------------ dos_dir | Name of an MS-DOS directory or device (or both) to make = current. -------------------------------------------------------------------------= ------------------------ -mcopy, Copying files between DOS disks The "mcopy" command copies files to and from DOS disks. It also handels = any necessary=20 filename conversions in the process (because of the limitations on = filename length in MS-DOS) mcopy [-m] [-n] [-Q] [-t] source target mcopy [-m] [-n] [-t] dos_source _________________________________________________________________________= ________________________ Option or Argument | Function -------------------------------------------------------------------------= ------------------------ -m | Preserves file modification time. -------------------------------------------------------------------------= ------------------------ -n | Overwrites files without asking for confirmation. -------------------------------------------------------------------------= ------------------------ -Q | Quits if any file copy fails -------------------------------------------------------------------------= ------------------------ -t | Text transfer. Converts Return/Newline sequence = to Newline only -------------------------------------------------------------------------= ------------------------ source | A file or files to copy from. -------------------------------------------------------------------------= ------------------------ target | Destination file for single file copies or = destination directory=20 -------------------------------------------------------------------------= ------------------------ dos_source | A file on an MS-DOS disk. mcopy copies the file = to a file of the same name -------------------------------------------------------------------------= ------------------------ -mdel, Deleting MS-DOS files The equivalent to the "del" command on MS-DOS, "mdel" deletes one or = more files from an MS-DOS disk. mdel [-v] dos_files _________________________________________________________________________= ________________________ Option or Argument | Function -------------------------------------------------------------------------= ------------------------ -v | Verbose mode. -------------------------------------------------------------------------= ------------------------ dos_files | Nmaes of files to delte -------------------------------------------------------------------------= ------------------------ -mdir, Displaying an MS-DOS directory "mdir" is the equivalent of the MS-DOS command "dir". The "-w" option = is equivalent to the "/w" switch of the "dir" command. mdir [-w] dos_dir mdir [-a] [-f] [-w] dos_files _________________________________________________________________________= ________________________ Option or Argument | Function -------------------------------------------------------------------------= ------------------------ -a | Includes hidden files in the list. -------------------------------------------------------------------------= ------------------------ -f | Fast output -- Dosnt include freesepace count -------------------------------------------------------------------------= ------------------------ -w | Wide output -- Lists filenaes with no size or = date infomation -------------------------------------------------------------------------= ------------------------ dos_dir | Name of the directory whose contencts are to be = listed -------------------------------------------------------------------------= ------------------------ dos_file | MS-DOS filenames (possibly using wildcard = notation) -------------------------------------------------------------------------= ------------------------ -minfo, Printing MS-DOS file -System parameters- "minfo" displays the content of the fields of the boot sector of an = MS-DOS file system. minfo [-v] drive _________________________________________________________________________= _______________________ Option or Argument | Function -------------------------------------------------------------------------= ------------------------ -v | Includes a hex dump of the boot sector -------------------------------------------------------------------------= ------------------------ drive | Drive designator (A:, B:, ...) of the device to = access. -------------------------------------------------------------------------= ------------------------ -mmd, Making a new directory The "mmd" command makes one or more directories on the MS-DOS disk. mmd dos_dirs _________________________________________________________________________= ________________________ Argument | Function -------------------------------------------------------------------------= ------------------------ dos_dirs | Directory names or drive letters followed by: and directory = names create. -------------------------------------------------------------------------= ------------------------ -mtype, Displaying file contents The command "mtype" displays the contents of a file on the screen. It = also has options to do=20 some minor translations during the display process. mtype [-s] [-t] dos_files _________________________________________________________________________= ________________________ Option or Argument | Function -------------------------------------------------------------------------= ------------------------ -s | Strips the high bit from the data. -------------------------------------------------------------------------= ------------------------ -t | Translates Return/Newline to Newline -------------------------------------------------------------------------= ------------------------ dos_files | Names of files to display -------------------------------------------------------------------------= ------------------------ mcopy does not allow you to appens files as its MS-DOS equicalent does. = To append filesm use "mtype" and redirect its output to a file. For example, to append = "two.nd" onto the end of "fir.st" from the firlst floppy and put the result in "both.files", = type: mtype A:fir.st A:two.nd > both.files --Cigarette Break-- -xcopy, Copying one directory to another "xcopy" reproduces the file hierarchy under one directory in another = location by copying all the=20 files and subdirectories. xcopy source_dir target_dir -More Mtools Commands The following commands are also included in the Mtools utilities. _________________________________________________________________________= ________________________ Command | Function -------------------------------------------------------------------------= ------------------------ mattrib | Sets/clears attribute bits. -------------------------------------------------------------------------= ------------------------ mbadblocks | Scans for bad blocks. -------------------------------------------------------------------------= ------------------------ mdeltree | Deletes a directory tree. -------------------------------------------------------------------------= ------------------------ mformat | Formats an MS-DOS disk -------------------------------------------------------------------------= ------------------------ minfo | Displays the content of the fields of the boot sector of = an MS-DOS file system=20 -------------------------------------------------------------------------= ------------------------ mkmanifest | Creates a Linux shell script to unmangle the MS-DSO = conversion to 8.3 filenames -------------------------------------------------------------------------= ------------------------ mlabel | Adds a volume label. -------------------------------------------------------------------------= ------------------------ mmount | Mounts MS-DOS file system -------------------------------------------------------------------------= ------------------------ mmove | Renames an MS-DOS file or directory -------------------------------------------------------------------------= ------------------------ mpartition | Creates an MS-DOS partition -------------------------------------------------------------------------= ------------------------ mrd | Removes an MS-DOS subdirectory -------------------------------------------------------------------------= ------------------------ mren | Renames an MS-DOS file or directory -------------------------------------------------------------------------= ------------------------ mtoolstest | Tests Mtools configuration -------------------------------------------------------------------------= ------------------------ Mounting MS-DOS Media and Partitions ------------------------------------ Rather than use Mtools, you can use the support for MS-DOS file systems = that is built into Linux. You mount the NS-DOS file system just like any other file systm, and = then you treat it like part of the Linux file hierarchy. -Mounting Hard disk partitions If you have an MS-DOS file system on your Linux computer, you can keep = it mounted. Just follow these steps: 1. Log on as root. 2. Create a mount point directory useing "mkdir" 3. Edit "/etc/fdtab" and add a mount line for the appropriate device and = mount point. 4. Save the updated version of "/etc/fstab" 5. Type: " mount -a " to force a reread of "/etc/fstab" _________________________________________________________________________= _______________________ Field | Function -------------------------------------------------------------------------= ------------------------ Device | The device name of the partition -------------------------------------------------------------------------= ------------------------ Mount point | Name of the directory where the file system is to be = mounted -------------------------------------------------------------------------= ------------------------ Filesystem type | Type of file system to mount. Use "msdos" for an = MS-DOS partition -------------------------------------------------------------------------= ------------------------ Options | How is should be mounted. Using default is safe. -------------------------------------------------------------------------= ------------------------ Dump frequency | Use "0" if you dont want this partition to be = included in standard dumps -------------------------------------------------------------------------= ------------------------ Fsck order | Use "0" -------------------------------------------------------------------------= ------------------------ For example, if your second partition on your first hard drive = (/dev/hda2) Has an MS-DOS file=20 system on it and you want it to be automatically mounted in the = directory "/dosC" whenever you boot up Linux, add this line to "/etc/fstab": /dev/hda2 /dosc msdos default 0 0 You can back up MS-DOS file systems by mounting then under Linux and = then by using Linux backup utilities such as "tar" or "cpio" to back them up.=20 -Mounting and unmounting removable media The following command mounts an MS-DOS floppy in a directory called = "/mnt/dos".=20 Make sure that the directory "/mnt/dos" exists before attempting the = mount. mount -t msdos /mnt/dos /dev/fd0 To unmount it, make sure that you are no longer in any directory on the = disk. The command is as follows: unmount /mnt/dos If you add an entry to "/etc/fstab" for your floppy device and allow = user mount, then any user=20 can mount and unmout MS-DOS disks, For example, the command should look = like the following: /dosA /dev/fd0 msdos user, noauto 0 0 Users can then mount a floppy by typing: mount /dosA DOS users a two-character sequence consisting of a Return followed by a = Newline to separate=20 lines in a text file. Unix and Linuxuse only a Newline character. The = "tr" command can be=20 used to delete the Return characters. For exampl, to copy the file = "textfile.dos" to "textfile.linux" deleting the Return characters in the process (whose = value is octal 15) use the command "tr -d '\015' textfile.linux Working with Mac Media ---------------------- You can use a set of toold similar to Mtools to work with Mac HFS = volumes (the standard Macintosh system). You must first mount the HFS volume using "hmount"; then, you = can use all the other utilities to work with the data. -hcd, Changing the HFS working directory "hcd" changes the current working directory on the Mac disk. hcd [hfs_path] _________________________________________________________________________= ________________________ Argument | Fuction -------------------------------------------------------------------------= ------------------------ hfs_path | Directory on HFS volume you want to make the current = working directory. -------------------------------------------------------------------------= ------------------------ -hcopy, Copying files to or from an HFS volume "hcopy" copies files between Mac disks and Linux file systems. You can = instruct "hcopy" how to treat the two parts of the Mac file when it performs the copy. hcopy [-a|-b|-m|-t] sources target _________________________________________________________________________= ________________________ Option or Argument | Function -------------------------------------------------------------------------= ------------------------ -a | Automatic, "mcopy" guesses the right translation=20 -------------------------------------------------------------------------= ------------------------ -b | BinHex, an alternative format to -m for binary = data -------------------------------------------------------------------------= ------------------------ -m | MacBinary II, copyies both forks of the Mac file -------------------------------------------------------------------------= ------------------------ -r | Raw data, copies only the data fork with no = trnaslation -------------------------------------------------------------------------= ------------------------ -t | Text, copies only the data fork of the Mac file, = performs endofline trans. -------------------------------------------------------------------------= ------------------------ source | Files to copy -------------------------------------------------------------------------= ------------------------ target | Destination file or directory -------------------------------------------------------------------------= ------------------------ -hdel, Deleteing files from an HFS volume Use the "hdel" command to delete one or more files from the current Mac = volume hdel hfs_paths _________________________________________________________________________= ________________________ Argument | Function -------------------------------------------------------------------------= ------------------------ hfs_paths | The name of the file or files to delete. -------------------------------------------------------------------------= ------------------------ -hdir, Listing the files in an HFS directory "hdir" displays a listing of the files in the current directory or a = specified directory. hdir [hfs_path] _________________________________________________________________________= ________________________ Argument | Function -------------------------------------------------------------------------= ------------------------ hfs_path | Pathname of the firectory to list.=20 -------------------------------------------------------------------------= ------------------------ -hmkdir, Creating a new directory Use the command "hmkdir" to create new directories on the current Mac = disk. hmkdir hfs_paths _________________________________________________________________________= ________________________ Argument | Function -------------------------------------------------------------------------= ------------------------ hfs_paths | Pathname of the directories to create -------------------------------------------------------------------------= ------------------------ -hmount, Mounting an HFS volume You must use "hmount" to mount a Mac HFS volune before you can use any = of the other commands that access the volume hmount source_path [part] _________________________________________________________________________= ________________________ Argument | Function -------------------------------------------------------------------------= ------------------------ source_path | Linux pathname to a black device ot regular file = containing an HFS volume image -------------------------------------------------------------------------= ------------------------ part | Use partition number part as the partition to mount -------------------------------------------------------------------------= ------------------------ -humount, Unmounting an HFS volue You generally do not need to use the "humount" command. It only updates = "&HOME/.hcwd" hunmount [volume] _________________________________________________________________________= ________________________ Argument | Function -------------------------------------------------------------------------= ------------------------ volume | The volume name or path to the HFS volume to unmount. -------------------------------------------------------------------------= ------------------------ Other hfsutils commands ----------------------- The following HFS utility programs are also available: _________________________________________________________________________= ________________________ Command | Function -------------------------------------------------------------------------= ------------------------ hattrib | Changes file or directory atributes. -------------------------------------------------------------------------= ------------------------ hformat | Creates a new HFS file system -------------------------------------------------------------------------= ------------------------ hfs | Shell for manipulating HFS volumes -------------------------------------------------------------------------= ------------------------ hls | Lists the files in an HFS directory -------------------------------------------------------------------------= ------------------------ hpwd | Prints working directory name of current HFS volume -------------------------------------------------------------------------= ------------------------ hrename | Renames an HFS file of directory -------------------------------------------------------------------------= ------------------------ hrmdir | Revmoves an empty HFS directory -------------------------------------------------------------------------= ------------------------ hvol | Displays or changes the current HFS volume -------------------------------------------------------------------------= ------------------------ xhfs | Graphical interface to HFS commands -------------------------------------------------------------------------= ------------------------ Macs use a Return character to separate files in a text file. Unix and = Linux use a Newline=20 character. The "tr" command can be used to convert Returns to newlines. = For example, to copy the file "textfile.mac" to "textfile.linux", converting the Return = characters (octal 15) to=20 Newline caracters (octal 12) in the process, use the command: "tr '\015' '\012' textfile.linux Working with Unix files and Media --------------------------------- You should have no problm working with Unix files and media. The POSIX = standard that Linux compiles with is based on Unix. With careful use of options on = utilities such as "tar" and=20 "cpio", you should be able to transfer files between Unix and Linux = systems without a hitch. In closing: Have fun, but be careful. I am not held responsible for any = misuse of any=20 information displayed here, and if you accidentally mess up your stuff, = im not responsible=20 either. Greets to:=20 http://www.sekurity-net.com http://www.legion2000.org http://www.hcvorg.com http://www.kracked.com Flames to: http://www.hackcity.com http://www.cyberarmy.com http://www.2600.com (Burn Kevin!) Thanks, -Redemption (1/1/99) ------=_NextPart_000_001F_01BE4D5B.5B3DEBE0 Content-Type: application/octet-stream; name="dipshitadmin.txt" Content-Transfer-Encoding: quoted-printable Content-Description: dipshitadmin (Text Document) Content-Disposition: attachment; filename="dipshitadmin.txt" ________________ ---------- \ = / / \________ | | | \ / | | | | | \_/ = |----- | |------- | | | | = | =20 \_______________ |________ | | | | = |----- =20 \ \ |------| ____|_____ | = |=20 | | / \_______/ \___________/ = |_____ =20 | | / | | | \ = / \ ________________/ |/ | | | |\ = | -------- |\ |------| | | \ = | | | \ | \ | | = \ | | | \ | \ | | = \ | | \ | | = \| | ____________________________________ \ = | | Text: Linux For Dipshit's | | Lesson: Systems Administration |=20 | By: Redemption |=20 | webmaster@sekurity-net.com | | http://www.sekurity-net.com | ------------------------------------ Linux distbutions offer a combination of high-level utilities to help = you with systems=20 administration. All in all, administering a Linux system is not that = much different from administering a Unix system. So if you know how to administer Unix, you = may already be familiar with much of the information in this part of the "Linux For = Dipshit's" Series. If your Linux disrtibution has a GUI for systems administration, use it. = If, however, something goes wrong, you may have to get down and dirty to fix it. In this text we will be talking about: -Adding users and groups -Finding Systems Files -Managing User Control Files Adding Users ------------ You have a number of methods available to add a user. You can add a = user by doing and of the following: *Using the GUI supplied with your Linux Distribution *Using the "adduser" command *Making the necessare changes manually The GUI and "adduser" command "hold your hand" while you add users. To = add a user manually, you must be logged on as root and do all of the following things: 1. Edit /etc/passwd and add an entry for the new user. 2. If you are useing shadowed passwd, edit /etc/shadow and add and entry = for the new user. 3. If the new user will have his or her own group, edit /etc/group and = add a new group entry 4. Create the user's home directory useing the "mkdir" command. For = example, you can enter=20 "mkdir /home/newfriend" 5. Change the ownership of the home directory to the new user. For = example you can enter=20 "chown newguy.users" 6. Copy and system default configuration files to the new user's home = directory, making sure=20 the ownership and permissions are correct 7. Set the new user's passwd. For example you can enter "password = newguy" and follow the prompts Besides seeming like a lot of work, there are potential problems with = the sequence. For example, someone else may be updating the passwd file while you are = manually editing it. You are always better off to use the GUI or admin scripts to add = users. Checking File Systems --------------------- The "fsck" script runs the appropriate file system check program for = each file system in /etc/mtab when the system is booted. A list of the programs that check = the different file systems types follows: _________________________________________________________________________= ________________________ File System Type | Program -------------------------------------------------------------------------= ------------------------ e2fsck (fsck.ext2) | Second extended file system (Linux Default) -------------------------------------------------------------------------= ------------------------ fsck.minix | Minix File system -------------------------------------------------------------------------= ------------------------ xfsck (fsck.xiafs) | Xia file system -------------------------------------------------------------------------= ------------------------ The programs do a complete check if either of the following conditions = exist: *The system was not properly shut down *The file system has been mounted more times that the interval between = checks as saved in the=20 file system. Follow these steps to manually check a file system: 1. Log on as root 2. If prossible, unmount the file system you are about to check 3. To check and repair the file system, type "fsck" and the file system = name and then press enter. The file system name can be either the mount point (/home) or the = device name for the partition where the file system resides (/dev/hda3). If you would rather have the = program automatically perform the check without asking you to decide on the correct action, = type "fsck -a" instead. Deleting Users -------------- Deleting users is pretty much the opposite of adding users. To delete a = user, you must do the=20 following: 1. Delete or change the owner of any files that belong to the user. 2. Delete the user from /etc/passwd 3. If you are using shadowed passwd, delte the user from /etc/shadow 4. Delete the user from /etc/group. You may have to edit mulitple group = entries 5. Uf the users home directory is empty, delete it. Users may have files in directories other than their home directory. = You can use "find" to locate those files. For example, to save a list of all files that = belong to the user=20 "redemption" to the file /tmp/redemption.files, enter:=20 "find / -owner redemption -print >/tmp/redemption.files" If you are = really courageous, you could use the -exec option of find to automatically remove them. --Cigarette Break-- Finding System Files -------------------- You must use numerouse files to maintain and administer the system. You = can use the following shopping list to check off the files as you locate them: _________________________________________________________________________= ________________________ File | Function -------------------------------------------------------------------------= ------------------------ /etc/HOSTNAME | The name of your computer -------------------------------------------------------------------------= ------------------------ /etc/at.deny | A list of users who are not allowed to use the "at" = command -------------------------------------------------------------------------= ------------------------ /etc/bashrc | Startup commands for the Bash shell -------------------------------------------------------------------------= ------------------------ /etc/crontab | A systemwide "crontab" file -------------------------------------------------------------------------= ------------------------ /etc/exports | File system exports via NFS -------------------------------------------------------------------------= ------------------------ /etc/gettydefs | Serial line setup modes -------------------------------------------------------------------------= ------------------------ /etc/group | Shows which users have access to which groups -------------------------------------------------------------------------= ------------------------ /etc/hosts | Local file that offers a mapping from hostnames to = IP addresses -------------------------------------------------------------------------= ------------------------ /etc/inittab | Run level control file -------------------------------------------------------------------------= ------------------------ /etc/issue | Text file that is displayed before the login prompt -------------------------------------------------------------------------= ------------------------ /etc/issue.net | Text file that is displayed befire the long prompt = for Internet connections -------------------------------------------------------------------------= ------------------------ /etc/ld.so.conf | Locations for the dynamic loader to look for the = run-time libraries -------------------------------------------------------------------------= ------------------------ /etc/motd | Text file that is displayed after you successfully = log in -------------------------------------------------------------------------= ------------------------ /etc/mtab | Mount table for file systems -------------------------------------------------------------------------= ------------------------ /etc/passwd | Password file -------------------------------------------------------------------------= ------------------------ /etc/shadow | Shadow passwd file. Used only if shadow passwd are = enabled -------------------------------------------------------------------------= ------------------------ /etc/syslog.conf | File to configure what system messages are logged = and where they are logged -------------------------------------------------------------------------= ------------------------ /var/lock | Directory for lock files -------------------------------------------------------------------------= ------------------------ /var/log | Directory where all log files are kept -------------------------------------------------------------------------= ------------------------ /var/spool/lpd/ | Directory for the print spooler -------------------------------------------------------------------------= ------------------------ /var/spool/mail/ | Directory for incoming mail files -------------------------------------------------------------------------= ------------------------ /var/spool/mqueue| Mail transfer agent queue directory -------------------------------------------------------------------------= ------------------------ If you just want to know about recent important events on the system, = you can type "dmsg" rather than look though the files in the "/var/log". The command "dmsg" = displays recent system messages. Managing User Control Files --------------------------- You identify users by creating entries for then in the password file. = Each user also has an=20 entry in the group and possibly in the shadow password file. -The group file The /etc/group file sows which users have access to which groups. Each = group has a line in the file. Each entry consists of four separated by colons. _________________________________________________________________________= ________________________ Feild | Meaning ----- = -------------------------------------------------------------------------= ------------------- 1 | Group name. -------------------------------------------------------------------------= ------------------------ 2 | Group passwd. -------------------------------------------------------------------------= ------------------------ 3 | Group ID -------------------------------------------------------------------------= ------------------------ 4 | A comma-separated list of group members -------------------------------------------------------------------------= ------------------------ The following program shows a few lines from a /etc/group file. You can = see that=20 "fyl, viki, george, john, and marsha" are all members of the users = group, whereas only=20 "fyl and viki" are members of "fyl" group. User "grorge" has his own = group. root::0:root bin::1:root,bin,daemon users::100:fyl,viki,george,john,marsh fyl::500:fyl,viki geroge::501:george -The password file The /etc/passwd file contains the password login information about all = the users on the system. This is a text file with one line for each user. Each line contains = seven fields separated by a colon. _________________________________________________________________________= ________________________ Field | Meaning -------------------------------------------------------------------------= ------------------------ 1 | Login name -------------------------------------------------------------------------= ------------------------ 2 | Encrypted passwd. If this field is empty, the user does not = have a passwd -------------------------------------------------------------------------= ------------------------ 3 | User ID. The root login always has an ID of 0 -------------------------------------------------------------------------= ------------------------ 4 | Group ID -------------------------------------------------------------------------= ------------------------ 5 | User name and other contact information -------------------------------------------------------------------------= ------------------------ 6 | Pathname of the users home directory -------------------------------------------------------------------------= ------------------------ 7 | Pathname of the users shell -------------------------------------------------------------------------= ------------------------ Coming up are a few lines from a /etc/passwd file. Note that "george" = dosnt have a passwd, and "root" and "fyl" are the onle other accounts that have valid passwds. root:JVMFXsFct0MQs:0:0:root:/root:/bin/bash bin:*:1:1:bin:/bin daemon:*:2:2:daemon:/sbin fyl:Xpw.kT1c121ZY:1000:500:Phil Hughes:/home/fyl"/bin/bash george::1001:501:George L. Tyrebyter:/home/george:/bin/bash -Shadow passwds Some versions of Linux (and Unix) support shadow passwds that enhance = security. The /etc/passwd file, which contains login information about all the users in the = system, must be readable by everyone. When you use a shadow passwd, the passwd is moved from = /etc/password to /etc/shadow and an "x" is placed in the passwd field of /etc/password. Permissions = on /etc/shadow are set to prevent anyone except root from reading it. In closing: Have fun, but be careful. I am not held responsible for any = misuse of any=20 information displayed here, and if you accidentally mess up your stuff, = im not responsible=20 either. -=3DNext Text: Networking=3D- Greets to:=20 http://www.sekurity-net.com http://www.legion2000.org http://www.hcvorg.com http://www.kracked.com Flames to: http://www.hackcity.com http://www.cyberarmy.com http://www.2600.com (Burn Kevin!) Thanks, -Redemption (1/6/98) ------=_NextPart_000_001F_01BE4D5B.5B3DEBE0 Content-Type: application/octet-stream; name="DipshitExpressions.txt" Content-Transfer-Encoding: quoted-printable Content-Description: DipshitExpressions (Text Document) Content-Disposition: attachment; filename="DipshitExpressions.txt" ________________ ---------- \ = / / \________ | | | \ / | | | | | \_/ = |----- | |------- | | | | = | =20 \_______________ |________ | | | | = |----- =20 \ \ |------| ____|_____ | = |=20 | | / \_______/ \___________/ = |_____ =20 | | / | | | \ = / \ ________________/ |/ | | | |\ = | -------- |\ |------| | | \ = | | | \ | \ | | = \ | | | \ | \ | | = \ | | \ | | = \| | ____________________________________ \ = | | Text: Linux For Dipshit's | | Lesson: Using Regular Expressions|=20 | By: Redemption |=20 | webmaster@sekurity-net.com | | http://www.sekurity-net.com | ------------------------------------ Regular expressions provide a way to quickly and concisely specify the = criteria for matching=20 or selecting a string or characters.=20 You can use regular expressions for pattern matching in awk, ed, egreo, = fgrep, grep, sed,=20 and vi for starters. You can also call regular expression matching = tools from C programs. After you understand the basics in this part, you are well on your way = to becoming a regular expression guru. In this text we will be talking about: -Understaning siple regular expressions -Combining regular expressions -Looing at some examples Here we go again... Examining Simple Regular Expressions ------------------------------------ The regular expression matching mechanism attempts to find the logest = match for the specified regular expression. It matches one string, that being itself. You can add the expressions in the table that follows to expand upon = what is matched.=20 Simple expressions can also be combined to create more complex = expressions such as the=20 ones in the next section. _________________________________________________________________________= _______________________ Expression | Meaning -------------------------------------------------------------------------= ----------------------- C | Any character except the special characters / ( ) * . | + = ? [ ^ $ \ matches itself -------------------------------------------------------------------------= ----------------------- \c | Matches special character "c" -------------------------------------------------------------------------= ----------------------- \nnn | Matches char with ASCII value "nnn" octal (base 8) -------------------------------------------------------------------------= ----------------------- . | Matches any single character except a Newline -------------------------------------------------------------------------= ----------------------- [list] | Matches and character in "list" where "list" is one or = more single chars or ranges =20 |specified with "-" -------------------------------------------------------------------------= ----------------------- [^list] | Matches and char not in "list" -------------------------------------------------------------------------= ----------------------- ^ | Anchors pattern match to start of string -------------------------------------------------------------------------= ----------------------- $ | Anchors pattern match to end of string -------------------------------------------------------------------------= ----------------------- --Cigarette Break-- Combining Simple Regular Expressions ------------------------------------ When useing a regular expression, the goal is to build one that matches = what you are searching for or substituting. To buiild a more complicated regular expression, = you can combine simple regular expressions, For example, the regular expression = " [0-9] " matches a=20 single digit. If you need to match a series of digits, adding a "=3D" = to the simple expression turns it into a match for one or more digits. _________________________________________________________________________= _______________________ Combination | Meaning -------------------------------------------------------------------------= ----------------------- (re1) (re2) | Matches regular expression "re1" concatenated with = regular expression "re2" -------------------------------------------------------------------------= ----------------------- re* re | Matches 0 or more occurrences of the regular expression -------------------------------------------------------------------------= ----------------------- re+ re | Matches 1 or more occurrences of the regular expression -------------------------------------------------------------------------= ----------------------- re? | Matches 0 or 1 occurrences of the regular expression = "re" -------------------------------------------------------------------------= ----------------------- re1\re2 | Matches regular expression "re1" or regular expression = "re2" -------------------------------------------------------------------------= ----------------------- (re) | Matches the regular expression "re" -------------------------------------------------------------------------= ----------------------- ( ) | Ensures precedence of the expression. -optional -------------------------------------------------------------------------= ----------------------- Samples of Basic Regular Expressions ------------------------------------ Armed with the information in the previous two tables, I present you = with some sample regular expressions so that you can put the theory into preactice. The = following table lists regular expressions and what they match: _________________________________________________________________________= _______________________ Regular Expression | Matches -------------------------------------------------------------------------= ----------------------- d?g | Any three-letter string that starts with "d" and = ends with "g" -------------------------------------------------------------------------= ----------------------- ^From | Ans string that begins with "From" -------------------------------------------------------------------------= ----------------------- ^$ | An empty line -------------------------------------------------------------------------= ----------------------- ^X*YZ | Any line that begins with 0 or more of the = character X followed by "YZ" -------------------------------------------------------------------------= ----------------------- ^....m | Any string that has an "m" asteh fifth = character. -------------------------------------------------------------------------= ----------------------- [a-z]+ | Any string of one or more lowercase letters -------------------------------------------------------------------------= ----------------------- [^aA] | Any string that does not begin with "a" or "A" -------------------------------------------------------------------------= ----------------------- In closing: Have fun, but be careful. I am not held responsible for any = misuse of any=20 information displayed here, and if you accidentally mess up your stuff, = im not responsible=20 either. Greets to:=20 http://www.sekurity-net.com http://www.legion2000.org http://www.hcvorg.com http://www.kracked.com Flames to: http://www.hackcity.com http://www.cyberarmy.com http://www.2600.com (Burn Kevin!) Thanks, -Redemption (12/31/98) ------=_NextPart_000_001F_01BE4D5B.5B3DEBE0 Content-Type: application/octet-stream; name="linuxdipshit.txt" Content-Transfer-Encoding: quoted-printable Content-Description: linuxdipshit (Text Document) Content-Disposition: attachment; filename="linuxdipshit.txt" ________________ ---------- \ = / / \________ | | | \ / | | | | | \_/ = |----- | |------- | | | | = | =20 \_______________ |________ | | | | = |----- =20 \ \ |------| ____|_____ | = |=20 | | / \_______/ \___________/ = |_____ =20 | | / | | | \ = / \ ________________/ |/ | | | |\ = | -------- |\ |------| | | \ = | | | \ | \ | | = \ | | | \ | \ | | = \ | | \ | | = \| | ____________________________________ \ = | | Text: Linux For Dipshit's | | Lesson: Understanding The Shell |=20 | By: Redemption |=20 | webmaster@sekurity-net.com | | http://www.sekurity-net.com | ------------------------------------ The shell is a command interpreter, it acts as your interface to the = operating system by accepting yout input and performing the tasks you = request. Before i get into the hard-core shit of shells, let me mention that = graphikal user interfaces are avaliable for Linux. That means that for = those or you who perfer the point-and-click interface or a couse, there = is hope. In this text we are going to talk about: -Picking the shell thats best for you -Getting programs to read and write files -Connecting the output of one program to the input of another -Using puotation marks to contrl the interpretation or your input -Customizing your environment -Getting familiar with shell conventions -Examining special characters and what they do Here we go..... Available Shells ---------------- Multipule shells are included with Linux distributions. They include = Bash, ksh, tcsh, and zsh. The most populat shell by far is bash, a = product of the GNU Project of the Free software Foundation. Bash stands = "Bourne Again SHell" (named after stephen bourne, who wrote the first = programmable shell for Unix) In this text, I use the bash shell as the standard. As a user, you may = want to concider ksh as an alternative, particularly if you work with = Unix platforms. The ksh shell is a public-domain impletmentation of the = POSIX-compliant Korn shell, which was written by David Korn at AT&T. = The ksh shell is commonly available on most Unix platforms. Basic Directory Commands ------------------------ Use the followin commands to perform basic managment tasks: - cd : To change your current directory - mkdir : To create a directory - rmdir : To remove an empty directory - pwd: To find out which direcory you're in Type pwd (for "print working directory") and the name of the current = directory"> and the name of the current directory appeats on-screen. To = verify the name of your home directory, type pwd after logging in. --Cigarette Break-- Character Quoting ----------------- Some characters have a special meaning to the shell (that is, ths shell = treats the chatacters as directions to perform some action). If you = need to enter these characters as a part of a filename, and you dont = want the shell to interpret their special meaning, then you need to = quote these characters. -Quoting an individual character To quote any single character, preceed it with a backslash (\). For = example, to list the names of all files that contain an (*), type this: = ls -a *\** In the previous line of code, the shell interprets the first and third = asterisk but not the second one. Therefore, it matches any set of = characters that contains an asterisk. You can doubble and single quotation marks (" and ') to quote whole = strings. Their meaning is somewhat different. -Single quotation marks quote almost everything. -Doubble quotation marks allow the shell to interpret works that start = with a ($), which are commonly known as "shell variable references" -You can use a sigle quotation mark to turn off the special meaning of a = double uotation mark, and vice versa. For example, in the following commaind, the double quotation marks = prevent the shell from interpreting the special meaning of the single = quotation mark in "it's" but they allow "$money" to be treated as a = reference to a shell variable. The double quptation marksalso prevent = the shell from interpreting the whitespace so that "it's my $moeny" is = treated as a single argument rather than three separte ones. grep "it's my money" junkfile" Using the back-quote character ------------------------------ The single back-quote character (') is useful for telling the shell to = excute a command within the back quotation marks, insert the output of = the execution into the orginal commain line in place of the command in = back quotation marks, and then excute the newly built commaind line. = You can use this trick to display a message that contains the current = date. echo Damn, today is 'date' we will hack r00t to 3 servers soon The "date" command displays a timestamp to standard output. By = embedding the "date" command within quotation marks in the "echo" = command, the shell substitutes the result of execution of "date" into = the command line before excuting the "echo" command.=20 (The following code shows the input lines in quotations) "date" Fri Jul 10 09:30:8 PDT 1998=20 "echo Damn, today is 'date' we will hack r00t to 3 servers soon" today is Fri Jul 10 09:30:8 PDT 1998 we will hack r00t to 3 servers soon Command History --------------- The bash shell maintains a command history, a list of up to 500 of the = most recently entered commands. If you type the command history, the = shell displays your history list. The "history" command is useful when you want to reexecute a command = without having to retype it. (The number of commands saved can be = changed by setting the "HISTSIZE" shell variable). You can then use the = commands described in the following sections to go back though the list = and edit reexecute a command. -Setting command history mode How you edit recent commands depends on whether you shell is set to vi = mode or Emacs mode. *For vi mode, type set -o vi and press Enter *For Emacs mode, type set -o emaces and press Enter -Using Emacs mode If you are in Emacs mode, you can press Ctrl+P to access the previous = command, press Crtl+N to access the next command, or use the arrow keys. = When you finish editing, press Enter to execute the command.=20 -Using vi mode If you are in vi mode, press Esc and then use standard vi commands (k to = move up, j to move down, and so on) to access and edit the history list. = When you are ready to execute the edited command, press Enter. --Cigarette Break-- Customizing the Environment --------------------------- Linux, in the Unix tradition, has always allowed you to customize your = work environment, and this section shows you some of the ways to do = that. Creation shell aliases ---------------------- While you can use shell and environment variables to remember whats in = the character string, a shell alias is specifically designed to allow = you to make up names for commands. alias [name[=3Dcommand]] _________________________________________________________________________= ______________________ Argument | Function -------------------------------------------------------------------------= ---------------------- name | The name of the alias, if not specified "alias" lists all = your current aliases =20 -------------------------------------------------------------------------= ---------------------- command |Command string assigned to the alias. if "command" contains = any spaces or special = |characters, it must be quoted -------------------------------------------------------------------------= ---------------------- Suppose that you wnat to occasionally print files on a printer named = "soy" (rather than on your defauly printer) Normally, you type " lpr -p = soy file " (excluding the quotations) to print to the other printer, but = you want an easier way. The following command establishesan alias called = "lpsoy" that would do this for you. alias lpsoy=3D'lpr -P soy' After the alias is created, you can direct you printer output to print = "soy" by using the alias. For example to print the file "lentil.loaf", = type "lpsoy lentil.loaf" You can use the "unalias" command to delete a shell alias. For example, = to delete you alias "lpsoy" type "unalias lpsoy" -Displaying environment variables Any ecvironment variable is also available as a shell variable, so you = can display as environment variable just as you would a shell variable, = by useing the "$" prefix as an argument to a command (such as echo) that = displays the value of its arguments. echo $var _________________________________________________________________________= ____ Option or Argument | Function -------------------------------------------------------------------------= ---- var | Name of the environment (or shell) variable to = display -------------------------------------------------------------------------= ---- Figuring out which variables are local to your current shell and which = are from the environment can be confusing. Type "export" with no = variable names to see a list of variables that are exported. Suppose that you have written some shell scripts that e-mail recipes to = your 133t haxx0rz. The scripts need to know where you keep your list of = e-mail addresses. The shell scripts also need to know the name of the = directory where the recipes are located. The easiest way to pass this = infomation would be to set some evironment variables. Whenever the shell = starts the scripts, the scrpts can just read in the values. export 133t_ADDRESSES=3D~/Addr/haxx0rs export RECIPES=3D~/Recipes/133t -Setting environment variables Environment variables are saved in such a way that they are avaliable to = any shell that is a child of the current shell. Thus, environment = variables are the right place to save things suck as you search path and = the name of your printer. export var=3Dvalue (or) var=3Dvalue export var The order of the commands doesnt matter in the preceding exaply. The = "export" statement performs the binding. If the shell variable is = already set, its current value is ezported to the environment. If the = value is changed at a later time, the environment variable follows the = value of the shell variavle. _________________________________________________________________________= ______________________ Option or Argument | Function -------------------------------------------------------------------------= ---------------------- var | Name of the variable to set. -------------------------------------------------------------------------= ---------------------- value | A string value to be assigned. You must quote = (value) if it contains = |spaces or other characters that have special meaning to = the shell -------------------------------------------------------------------------= ---------------------- If you want to invoke one command with a different value for either a = shell or environment variable, but not change its value the command = line. For you cant specify the variable value on the command line. For = example, to run a script called 133t_haxxor with the "PRINTER" variable = set to fastone, just type "Printer=3Dfastone 133t haxxor". -Setting shell edit modes With the bash and kron shells, you have your choice whether to use = vi-style or Emacs-style command line editing. My advice is that if you = use the vi or Emacs text editor, set your shell mode to the editing mode = that matches your editor (which will help you get more comfortable with = your editor) If you dont currently use either, try each mode and pick = the one that you are most comfortable with. To set the shell mode to vi, use the following command: set -o vi To set the shell mode to Emacs, use this command: set -o emacs You can place either of these commands in your ".profile" file so that = the mode will be automatically set at login time. One significant difference between the useing the editing commands in vi = and thos in Emacs is that in vi mode you need to press "esc" to activate = the editing command (you have to switch back and forth between insert = and command mode in vi command line mode_. In Emacs, you just need to = type the key combinations, as shown in the following table. _________________________________________________________________________= _______ (Emacs) | (vi) | (Function) -------------------------------------------------------------------------= ------- Ctrl+P | K | Moves back one command in your history list -------------------------------------------------------------------------= ------- Ctrl+N | J | Moves forward one line in your history list -------------------------------------------------------------------------= ------- Ctrl+B | H | Moves back one character in the displayed command = line -------------------------------------------------------------------------= ------- Ctrl+F | L | Moves forward one character in the displayed = command line -------------------------------------------------------------------------= ------- Esc+B | b | Moves back one word -------------------------------------------------------------------------= ------- Esc+F | * | Moves forward one word -------------------------------------------------------------------------= ------- Crtl+A | 0 | Moves to beginning of line -------------------------------------------------------------------------= ------- Ctrl+E | $ | Moves to the end of line -------------------------------------------------------------------------= ------- | i | Enter insert mode -------------------------------------------------------------------------= ------- | Esc | Exit insert mode -------------------------------------------------------------------------= ------- | a | Appends to line -------------------------------------------------------------------------= ------- Esc+Del | X | Deletes backward one character -------------------------------------------------------------------------= ------- Ctrl+D | x | Deletes forward one character -------------------------------------------------------------------------= ------- Esc+D | dw | Delete forward one character -------------------------------------------------------------------------= ------- Esc+K | D | Deltes forward to end of line -------------------------------------------------------------------------= ------- Esc+. | Esc+_ | Inserts last word of previous command -------------------------------------------------------------------------= ------- After you've mastered these command, check out the man pages (enter man = bash or man ksh) for additional editing commands. --Ok kiddies, time to go to bed, i'll pick back up in the morning-- --Ok lil boys and girls, im ready to go once again-- -Standard environment variables Environment variables are ued to set your working environment. You = change their values to change their default environment. You may also = want to add new variables that your own programs use. _________________________________________________________________________= ______________________ Variable | Function -------------------------------------------------------------------------= ---------------------- DISPLAY | Display location (for the X windows system) -------------------------------------------------------------------------= ---------------------- HOME | Path to your home directory -------------------------------------------------------------------------= ---------------------- HOSTNAME | Name of this computer system -------------------------------------------------------------------------= ---------------------- LOGNAME | Your login name -------------------------------------------------------------------------= ---------------------- MAIL | Path to your e-mail file -------------------------------------------------------------------------= ---------------------- PATH | Command search path, colon separate list. ex: = =20 | /bin:/usr/bin:/usr/local/bin/~/bin -------------------------------------------------------------------------= ---------------------- SHELL | Path to default shell -------------------------------------------------------------------------= ---------------------- TERM | Terminal type -------------------------------------------------------------------------= ---------------------- Say that you want to create a new environment variable called 133t and = set it to be equal to the directory path where you keep all your good = files. Then you can referencethis directory and time you want to copy = or access a file in that directory. THe following commands she the variables and then list the file "super" = from that directory useing the "less" command. Placing the "export" = command i your ".profile" file makes "133t" available every time you log = on. export 133t=3D/home/tofu/Good-files less $133t:feer.txt To add a new directory to your current search path, enter: = Path=3D$Path:newdir The command adds a new directory named newdir to the nect of the path = (last directory to be searched) Directory Naming Conventions ---------------------------- A popualr practice is to name directories with a leading capital letter=20 (for example, "Correspondence" or "secret"). This wat, all directories = displayed together in a file list (ls) and are easily identifies. If you are unsure which enties in a list are directories, type: ls -F = and press enter. A/ is displayed at the end of any directory. Directory Referencing --------------------- A reliable way to access a file in your home directory (or one of its = branches) is ti use a title (~). It acts as an abbreviation for ths = path to your home directory. For example, if your current directory is = not your dome directory but you want to get a list of the files in your = home directory, you can type: ls ~ and an alternative to: ls = /home/133t. You can also follow the tilde with a user name (such as ~red) to access = information in the directory of a user name "red". For example, to = change your current directory to a directory name 133t that is in the = home of a user whos login name is red, type: cd ~red/133t. Files Associated with a Program ------------------------------- Whenever you start any program, three files are associated with the = program. In Linux speak, these files are referred to as: *stdin - For standard input *stdout - For standard output *stderr - For standard error -Redirecting the files The files associated with a program are all initially associated with = both your keyboard and display, but you can also connect the files to = other files and programs. THe following table lists characters you can = use to redirect the files. _________________________________________________________________________= _______________________ Redirection Character | What it does -------------------------------------------------------------------------= ----------------------- > | Redirects the output of the command to a file = or device. -------------------------------------------------------------------------= ----------------------- >> | Acts like >, but if the file alteady exists, = appends the new data to = | the end of and = existing file. If the file does not exist, it is = = | created -------------------------------------------------------------------------= ----------------------- 2> | Redirects the error output (also called = "stderr) of the command to a = | file or device. = (error output is a second output fule available to = = | every program. The Program itself decides which output to write = to: = | stout and which to: stderr.) -------------------------------------------------------------------------= ----------------------- < | Redirects the input of the command from a = file or device -------------------------------------------------------------------------= ----------------------- | | Joins two imple commands so that they work = together in a more useful = | = way. -------------------------------------------------------------------------= ----------------------- -Connecting commands Many commands can read from standard inut and write to standard output. = Linux calls commands that can do this "filters". The name comes from = the fact that they are filtering whatever comes in to prodeuce whatever = is supposed to come out. Filters allow commands to connect to other commands though pipes or to = become part of a pipeline. When using the pipe character (|) with two = commandsm the pope connects the output of the left-hand command to the = input of the right-hand command. For example: ls -la | less =20 pipes the output of the file list command (ls) into the input of the = "less" command, which alloes you ro scrill back and forth though the = file listing. System resources present the only limitation on how many commands can be = connected together in this way. For example, the "grep" command is a = filter. It can read standard out putm apply some selection criteria to = the input, and then send the selected information to standard output. = The filliwung pipeline can run the program "monthly", filter its output = though "grep" (in this case, looking for lines with the word "super" in = them), and display the seleted lines on the screen. monthly | grep super -Redirecting command output =20 The > operator is used to reditect the output of a command to a file or = device. For example, to cause the output of the program "monthly" to be = redirected to a new file called "monthly.output", you would enter the = command: monthly > monthky.output If "monthly.output" does not exist, >> acts just like > and creates a = new file name.=20 The filename " /dev/tty " is a special name that always points at your = screen. If you write a shell script in which you want the output of one = command to come back to the screen no matter where "stdout" and "stderr" = are redirected, redirect that command's output to " /dev/tty ". -Redirecting command input To indicate that the input for a command is to come from a file rather = than your keyboard, you use the < operator. For example, to run a = program named 133t and have it read from the file "input.data", use: 133t < input.data You can combine input redirection with other redirection. To run = monthly with its input comming from "input.data", its output sent to = "133t.output" and its error output comming bck to the screen (pretty = typical situation), use: 133t 133t.errors -Redirecting error messages If you wnat to redirect the error message from a program to a file use = the 2> operator. for example, if you want the error messages from = program 133t to be sent to 133t.errors, use: 133t 2> 133t.errors You can redirect both "stderr" and "stdout" to different places. For = example, to append the standard output of 133t to "133t.output" and send = the error messages to "133t.errors" use: 133t >> 133t.output 2> 133t.errors If you want to run a command and redirect both "stdout" and "sterr", you = need to use the command " 2>&1 ", which means, essentially, "redirect = output stream 2 to the same place as output stream 1." For example the = "stdout" and the "stderr" of 133t to 133t.both, you would use: =20 133t >133t.both 2>&1=20 --Cigarette Break-- File Naming Conventions ----------------------- Linux does not impose any structure on the name of a file, other than = prohibiting the use of a slash character (/) in a filename, and = requiring the length of the filename to be fewer that 256 characters. = Although this state of anarchy may sound desirable to some, you should = follow certian file-naming conventions to keep yourself out of trouble. = When in doubt, keep filenames simple. In Linux, filenames are case-sensitive. The file "redemption" is = different from "Redemption", "REDEMPTION", or "ReDeMpTiOn". These three = files name all life happily together in the same directory. Some special characters, which are technically legal to use in a = filename, may get you into trouble decause of their other meanings. The = following table offers "better safe than sorry" choices for filename = characters. _________________________________________________________________________= _____________________ Lowercase letters | Always safe to use -------------------------------------------------------------------------= --------------------- Uppercase letters | Always safe to use, but many people reserv then = for directory names -------------------------------------------------------------------------= --------------------- Numbers | Always safe to use -------------------------------------------------------------------------= --------------------- Underscores (_) | Always safe to use. (They make good word = separators) -------------------------------------------------------------------------= --------------------- Hyphens | Dont use as a first chatacter -------------------------------------------------------------------------= --------------------- Commas | Always safe to use -------------------------------------------------------------------------= --------------------- Periods | Always safe to use -------------------------------------------------------------------------= --------------------- Linux/Unix uses whitespace as an argument separator. Dont use spaces in = filenames Pathnames --------- A files pathname consists of the files full name, starting at the root = of the file tree. Therefore, if your home directory is /home/tofu, and = you have a subdirectory called Secret, and pathname of "love.letters" = would be /home/t0f0/Secret/love.letters. This fule is totalle distinct = from a file with a similat name in a different directory, such as = /home/red/Secret/love.letters or /home tofo/Correspondence/love.letters Shell Command Elements ---------------------- When you want to instruct the shell to perform a task, you need to pass = it a whole set ot information. The basic elements or a shell command = are the following: *The name of the command to run *Any command-line that you want to use *Any arguments require by the command *Instructions on how to handel the input and output data streams *Whether the command should run in its own shell, that is, "&" For instance, heres an example of a shell command: diff -i first secont > result *"diff", is the name of the command that you are asking th shell to run *"-i" is and option, it must be generally appear between the command = name and the arguments *"first" is the first argument *"second" is the second argument *">" is a redirection operator *"result" is the name of the file where the command output is = redirected. *Each of these items is commonly called a "word", The words of the = shell command are separated by "whitespace, which is defined as one or = more space ot tab characters. The most basic command consists of only a command name. For example, to = display the current date, type: date and press Enter. Most shells interpret the redirection operator first, and then parse the = other command parameters. For that reason, a line consisting only the = output redirection and file name (for example >Iron_133t) creats an = empty file called "Iron_133t. Some commands need arguments to operate. For example, if you wabt to = edit a text file with vi, you need to tellthe editor the name of the = file. Thus, VI myfile starts up the editor and tells it to open a file = named myfile. The third type of information that is passwd to a command is a = command-line option. Options modify the operation of a command. For = examply, "ls" lists the files in your current directory, but it does not = display file with names begging with a dot. (These are know as hidden = files) The -a option (ls -a) instructs ls to include in the optput = thoes that have filenames starting with a dot. --Cigarette Break-- Shell Variables --------------- Shell variables are local place for your shell to store infomation. For = example, the shel variable "HOME" is set to the pathname of you login = directory. In Bash and ksh, you can set shell variables is that = environment variables by the use of the "export" statement. The difference between shell variables and environment variables is that = the environment variables are available to the shells that you start up = later. Shell variables are available to the shell that you start up = later, Shell variables are available to the shell that you start up = later. Shell variables, on the other hand, are used only in the shell = in which they were created. Shell variables are identified by placing a = $ (dollar sign) in front of the variable name. The following sequence sets the shell variable "Iron" to the value = "133t". The second line exports the shell variable to an environment = variable. The third line then displays the environment variable useing = the "echo" command. Iron=3D133t export Iron echo Iron is $l33t *If your login shell is Bash, zsh, or ksh, then the environment varibles = in ~/.profile are used every time you log in. *The .bashrc file contains environment variables that are used as the = defaul settings for the Bash shell. *The equivalent files for csh and tcsh are .login and .cshrc. The following table shows the standard shell variables: _________________________________________________________________________= _____________________ Shell variable | What it means -------------------------------------------------------------------------= --------------------- $? | Return status of last command=20 -------------------------------------------------------------------------= --------------------- HOME | Pathname of your home dircetory -------------------------------------------------------------------------= --------------------- MAIL | Name of the fule to check for incomming mail -------------------------------------------------------------------------= --------------------- OLDPWD | Pathname of current directory before previous "cd" = command -------------------------------------------------------------------------= --------------------- PWD | Your current directory -------------------------------------------------------------------------= --------------------- SHELL | Path name of your shell -------------------------------------------------------------------------= --------------------- Many common shell variables are available. Type "set" to see your = current variables and theit assigned values. Special Characters ------------------ Many chatacters have specual meanings to the shell. The characters and = their meanings vary from shell to shell and system to system. Use the = documentation on your shell and the "stty" command to verify these = chatacters. The following list offers codeexamples showing the proper = way to use the "stty" command. The table that follows the list provies = likely default meanings for some keyboard entries and characters. *To display all your current terminal settings, type "stty -a" *To change a "stty" mode that is either true or false, type "stty" = followed by the name of the mode to turn it on. To turn a mode off, = precede the name with a "-". For example, to turn off the "opost" mode, = type "stty -opost". *To change the value of a setting, type "stty name value". For = example, to change the erase command to Control+H, you would type "stty = erase" then press Crtl+H. _________________________________________________________________________= _____________________ Special Entry | What it does -------------------------------------------------------------------------= --------------------- Enter | Tells the shell that your command isread to be = processed. -------------------------------------------------------------------------= --------------------- Spacebar or tab | Separates words in commands. -------------------------------------------------------------------------= --------------------- Backspace or Delete | Either key deletes the most recently type = character.=20 -------------------------------------------------------------------------= --------------------- ; | Allows you to enter multiple commands on the same = line. -------------------------------------------------------------------------= --------------------- & | Starts the command in the line preceding the & in = the background. -------------------------------------------------------------------------= --------------------- | | Connects the standard output of the command on = the left to the right. -------------------------------------------------------------------------= --------------------- ! | Denotes a history reference (in Bash and tcsh = only). -------------------------------------------------------------------------= --------------------- # | Comment. The remainder of the line is ignored by = the shell. -------------------------------------------------------------------------= --------------------- \ | Takes away the special meaning of a special = character that follows it. -------------------------------------------------------------------------= --------------------- ' | Disables the special meaning of characters = enclosed in singe quotation. -------------------------------------------------------------------------= --------------------- " | Disables the special meaning of chatacters = enclosed in doubble quote's. -------------------------------------------------------------------------= --------------------- ` | Executes what's in the quoted string -------------------------------------------------------------------------= --------------------- $ | Introduces a reference to a shell variable. -------------------------------------------------------------------------= --------------------- * | Matches any number of characters -------------------------------------------------------------------------= --------------------- ? | Matches a single chatacter -------------------------------------------------------------------------= --------------------- [ ] | Matches any single chatacter contained within the = brackets -------------------------------------------------------------------------= --------------------- Ctrl+C | Sents an interrupt signal to a running program -------------------------------------------------------------------------= --------------------- Ctrl+D | Sends an eng of file to the program currently = reading from the keyboard -------------------------------------------------------------------------= --------------------- Ctrl+U | Cancels the line that you are entering and allows = you to start over -------------------------------------------------------------------------= --------------------- Ctrl+Z | Pauses the current program -------------------------------------------------------------------------= --------------------- --Cigarette Break-- Startup Files ------------- Most startup or configuration files are located at your home directory = directory and have names that start with a dot (.). Bash has teo main = coniguration files: _________________________________________________________ Startup File | When Bash Reads It --------------------------------------------------------- .bash_profile | At login time --------------------------------------------------------- .bashrc | Each time a new shell is started --------------------------------------------------------- You can force Bash or ksh to read a file and interpret it by useing the = . (dot) command. For example, you may have some shell variables that = you want to set when you are working on a special project. Use your = editor to put the commans in a file, name the file ".special", and then = enter the following command: . .special The shell then interprets the file ans sets the variables. The following table shows setup files for both the Bash and Korn shells. _________________________________________________________________________= _____________________ Bash | Korn | = Function =20 -------------------------------------------------------------------------= --------------------- /ect/profile | /etc/profile | = Executed at login time -------------------------------------------------------------------------= --------------------- $HOME/.profile | $HOME/.profile | = Executed at login time -------------------------------------------------------------------------= --------------------- $HOME/.bashrc | | = Executed at shell startup -------------------------------------------------------------------------= --------------------- $HOME/.bash_logout | | = Executed at logout -------------------------------------------------------------------------= --------------------- webmaster@sekurity-net.com http://www.sekurity-net.com --------------------------------- Copyright 1998 All Rights Reserved. No information in or on this issue can be copied without the consent or the origional writer. Antidote has nothing to do with any of these articals so please contact the orgional owners and not us. ÛÜÛÛÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛÛÜÛ Û -|The Antidote|- Û ÛÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ