background preloader

Linux/UNIX For DOS Users

Debian Linux: Set a Serial Console How do I set up a serial console on Debian Linux HP server for troubleshooting and login purpose? To setup a serial console you need to edit the following files under Debian Linux: /boot/grub/menu.lst or /etc/default/grub (recommended for grub2)/etc/inittab/etc/securetty Our Setup You can list your working serial port under Linux as follows: # setserial -g /dev/ttyS[0123] Sample outputs: /dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4 /dev/ttyS1, UART: unknown, Port: 0x02f8, IRQ: 3 /dev/ttyS2, UART: unknown, Port: 0x03e8, IRQ: 4 /dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3 /dev/ttyS0 (COM1) is detected and working serial console under Linux. Grub Configuration (Grub2) Edit /etc/default/grub, enter: # vi /etc/default/grub Append / modify as follows: GRUB_CMDLINE_LINUX='console=tty0 console=ttyS0,19200n8' GRUB_TERMINAL=serial GRUB_SERIAL_COMMAND="serial --speed=19200 --unit=0 --word=8 --parity=no --stop=1" Save and close the file. A Note About Grub Legacy (older version) ttyS0

Ultimate Boot CD - Overview Unix Toolbox Hardware | Statistics | Users | Limits | Runlevels | root password | Compile kernel | Repair grub | Misc Running kernel and system information # uname -a # Get the kernel version (and BSD version) # lsb_release -a # Full release info of any LSB distribution # cat /etc/SuSE-release # Get SuSE version # cat /etc/debian_version # Get Debian version Use /etc/DISTR-release with DISTR= lsb (Ubuntu), redhat, gentoo, mandrake, sun (Solaris), and so on. # uptime # Show how long the system has been running + load # hostname # system's host name # hostname -i # Display the IP address of the host. Hardware Informations Kernel detected hardware # dmesg # Detected hardware and boot messages # lsdev # information about installed hardware # dd if=/dev/mem bs=1k skip=768 count=256 2>/dev/null | strings -n 8 # Read BIOS Linux FreeBSD Load, statistics and messages The following commands are useful to find out what is going on on the system. Users Limits Per shell/script The shell limits are governed by ulimit. Misc

SampleCaptures Sample Captures So you're at home tonight, having just installed Wireshark. You want to take the program for a test drive. But your home LAN doesn't have any interesting or exotic packets on it? If you don't see what you want here, that doesn't mean you're out of luck; look at some of the other sources listed below, such as How to add a new Capture File If you want to include a new example capture file, you should attach it to this page (click 'attachments' in header above). Please don't just attach your capture file to the page without putting an attachment link in the page, in the format attachment:filename.ext; if you don't put an attachment link in the page, it's not obvious that the capture file is available. It's also a very good idea to put links on the related protocol pages pointing to your file. Other Sources of Capture Files If you don't find what you're looking for, you may also try: General / Unsorted SkypeIRC.cap (libpcap) Some Skype, IRC and DNS traffic.

C++ Programming/Exercises/Iterations Iterations[edit] Solutions requirements Solutions must: Use only standard C++.Be compilable.Be in accordance to general coding practices. and should: Handle error situations, even if behavior is not defined. Please do not add solutions that are 99% similar to another that is already present, if it is an improvement just add it to the existing solution. EXERCISE 1[edit] Write a program that asks the user to type an integer and writes "YOU WIN" if the value is between 56 and 78 (both included). int main() {int i; cout << "Type all numbers between 58 and 73: " << endl; cin>>i; if (i>=58 && i<=78) { cout << "YOU WIN" << i << endl; else cout<<"YOU LOSE!" EXERCISE 2[edit] Write a program that asks the user to type all the integers between 8 and 23 (both included) using a for loop. Solution Alternative solution by Bartosz Radwanski //Alternative solution by Bartosz Radwanski//This one allows the numbers to be entered in random order and exits//when all correct numbers have been entered. Alternate solution

Serial Consoles - Gridwiki Serial-over-LAN and IPMI 2.0 SoL is a standard feature of IPMI 2.0 and can be used with any IPMI 2.0 client over the LAN+ interface, provided the BMC is correctly configured with an IPv4 address. SoL is only avaialble to privileged users (on Dell: "root", hooi-ei: "root" and on Valentine: "ADMIN"), and of course such accounts on the BMC must be protected with a passphrase, which they are. Only one SoL client can be connected at any one time. FYI: the default password for the Dell DRAC "root" user is "calvin". ipmitool -I lanplus -H -U root -P calvin user set password 2 'NEWPASSWD' Setting up the BMC LAN+ channel The trivial way is to do it with the BMC BIOS interface (press Ctrl-E halfway in the boot process), but it can also be done using the IPMI device driver local interface as described in this Lone Sysadmin article on configuring IPMI on a Dell PE with RHEL. If you think you've configured everything correctly using "ipmitool -I open Enabling SoL SoL clients Grub

Windows XP Commands NetWorkSecurity For help with forensics, Jim points out, “SANS instructor, Rob Lee points us to a couple of new cheat sheets for doing forensics on USB keys under XP orVista/Win7.” There is also the Memory Analysis Cheat Sheet for Microsoft Windows XP SP2 by Pär Österberg and Andreas Schuster. If you have a SANS Portal Account, you can access the SANS Forensic Analysis Cheat Sheet. The below table provides links to other security cheat sheets I have found very beneficial. Since security does not exist in a vacuum, Raj helps us out with his post, “145 Useful cheat sheets for some of the most widely used tools on the web.” Hilde Torbjornsen has also posted “Mega Collection Of Cheatsheets for Designers & Developers” where she list more than one hundred cheat sheets and reference cards for the following topics: To assist on the operating side, Scott Klar posted “Linux-Unix cheat sheets – The ultimate collection.” To download them all paste into your terminal

Attack This category is for tagging common types of application security attacks. What is an attack? Attacks are the techniques that attackers use to exploit the vulnerabilities in applications. All attack articles should follow the Attack template. Examples: Brute Force: Is an exhaustive attack that works by testing every possible value of a parameter (password, file name, etc.) Note: many of the items marked vulnerabilities from CLASP and other places are really attacks. Subcategories This category has the following 12 subcategories, out of 12 total. Pages in category "Attack" The following 68 pages are in this category, out of 68 total. setserial(8): get/set serial port info Name setserial - get/set Linux serial port information Synopsis setserial [ -abqvVWz ] device [ parameter1 [ arg ] ] ... setserial -g [ -abGv ] device1 ... Description setserial is a program designed to set and/or report the configuration information associated with a serial port. During the normal bootup process, only COM ports 1-4 are initialized, using the default I/O ports and IRQ values, as listed below. The device argument or arguments specifies the serial device which should be configured or interrogated. If no parameters are specified, setserial will print out the port type (i.e., 8250, 16450, 16550, 16550A, etc.), the hardware I/O port, the hardware IRQ line, its "baud base," and some of its operational flags. If the -g option is given, the arguments to setserial are interpreted as a list of devices for which the characteristics of those devices should be printed. For the most part, superuser privilege is required to set the configuration parameters of a serial port. Options -a -b -q -v -z

Windows Run commands you probably never knew - instant fundas The Windows Run box is a very useful utility to launch programs and applications quickly. There are more than a hundred run commands that let you launch all sorts of built in Windows applications such as Control Panel modules, and system tools like Disk Defragmenter, Device Manager, Group Policy Editor etc. Most of these commands are well documented – you will find plenty of run command lists on the web, published and republished countless number of times. But I’m pretty sure you will never find the following commands in any of these lists. Trick 1: Open your home directory The home directory is located at C:\Documents and Settings\Username in Windows XP and C:\Users\Username in Windows Vista and 7. Trick 2: Open the users directory The users directory is the directory one folder above the home directory, i.e. Trick 3: Open My Computer To quickly open My Computer, open the Run box and type 3 dots, like this. Trick 4: Open system drive Do you know any more tricks?