/l3/users/bas/2011-03/linux5.unix.bas/root :1 :2 :3 :4 :5 :6 :7 :8 :9 :10 :11 :12 :13 |
|
#vncviewer 127.0.0.1:2
![]() VNC Viewer Free Edition 4.1.2 for X - built Jul 27 2010 10:24:13 Copyright (C) 2002-2005 RealVNC Ltd. See http://www.realvnc.com for information on VNC. Tue Apr 5 17:22:52 2011 main: unable to connect to host: Connection refused (111) |
#vncviewer 127.0.0.1:4
![]() VNC Viewer Free Edition 4.1.2 for X - built Jul 27 2010 10:24:13 Copyright (C) 2002-2005 RealVNC Ltd. See http://www.realvnc.com for information on VNC. Tue Apr 5 17:23:23 2011 CConn: connected to host 127.0.0.1 port 5904 CConnection: Server supports RFB protocol version 3.8 CConnection: Using RFB protocol version 3.8 TXImage: Using default colormap and visual, TrueColor, depth 24. CConn: Using pixel format depth 6 (8bpp) rgb222 CConn: Using ZRLE encoding Tue Apr 5 17:23:28 2011 CConn: Throughput 20156 kbit/s - changing to hextile encoding CConn: Throughput 20156 kbit/s - changing to full colour CConn: Using pixel format depth 24 (32bpp) little-endian rgb888 CConn: Using hextile encoding Tue Apr 5 17:29:06 2011 main: read: Connection reset by peer (104) |
#ps -Z
LABEL PID TTY TIME CMD - 7641 pts/8 00:00:00 bash - 7673 pts/8 00:00:00 ps |
#xm list
Name ID Mem(MiB) VCPUs State Time(s) Domain-0 0 3427 2 r----- 640.2 WinXP 6 519 1 -b---- 5.1 |
#vncviewer 127.0.0.1:5
VNC Viewer Free Edition 4.1.2 for X - built Jul 27 2010 10:24:13 Copyright (C) 2002-2005 RealVNC Ltd. See http://www.realvnc.com for information on VNC. Tue Apr 5 17:29:51 2011 CConn: connected to host 127.0.0.1 port 5905 CConnection: Server supports RFB protocol version 3.8 CConnection: Using RFB protocol version 3.8 TXImage: Using default colormap and visual, TrueColor, depth 24. CConn: Using pixel format depth 6 (8bpp) rgb222 CConn: Using ZRLE encoding CConn: Throughput 20000 kbit/s - changing to hextile encoding CConn: Throughput 20000 kbit/s - changing to full colour CConn: Using pixel format depth 24 (32bpp) little-endian rgb888 CConn: Using hextile encoding Tue Apr 5 17:32:04 2011 CConn: Throughput 20000 kbit/s - changing to raw encoding CConn: Using raw encoding Tue Apr 5 17:41:15 2011 main: End of stream |
#vncviewer 127.0.0.1:6
![]() VNC Viewer Free Edition 4.1.2 for X - built Jul 27 2010 10:24:13 Copyright (C) 2002-2005 RealVNC Ltd. See http://www.realvnc.com for information on VNC. Tue Apr 5 17:41:50 2011 CConn: connected to host 127.0.0.1 port 5906 CConnection: Server supports RFB protocol version 3.8 CConnection: Using RFB protocol version 3.8 TXImage: Using default colormap and visual, TrueColor, depth 24. CConn: Using pixel format depth 6 (8bpp) rgb222 CConn: Using ZRLE encoding CConn: Throughput 20000 kbit/s - changing to hextile encoding CConn: Throughput 20000 kbit/s - changing to full colour CConn: Using pixel format depth 24 (32bpp) little-endian rgb888 CConn: Using hextile encoding Tue Apr 5 17:43:36 2011 CConn: Throughput 20000 kbit/s - changing to raw encoding CConn: Using raw encoding |
#yum list rdesktop
Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * addons: mirror.neolabs.kz * base: mirror.neolabs.kz * extras: mirror.neolabs.kz * rpmforge: fr2.rpmfind.net * updates: mirror.neolabs.kz Available Packages rdesktop.x86_64 1.6.0-3 base |
#yum install rdesktop
Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * addons: mirror.neolabs.kz * base: mirror.neolabs.kz * extras: mirror.neolabs.kz * rpmforge: fr2.rpmfind.net * updates: mirror.neolabs.kz Setting up Install Process Resolving Dependencies --> Running transaction check ... rdesktop-1.6.0-3.x86_64.rpm | 163 kB 00:00 Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Installing : rdesktop 1/1 Installed: rdesktop.x86_64 0:1.6.0-3 Complete! |
#rdesktop 192.168.15.15
Autoselected keyboard map en-us WARNING: Remote desktop does not support colour depth 24; falling back to 16 |
#rdesktop -f 192.168.15.15
Autoselected keyboard map en-us WARNING: Remote desktop does not support colour depth 24; falling back to 16 |
#init 0
![]() bash: init: command not found |
#netstat -ln A
![]() usage: netstat [-veenNcCF] [<Af>] -r netstat {-V|--version|-h|--help} netstat [-vnNcaeol] [<Socket> ...] netstat { [-veenNac] -I[<Iface>] | [-veenNac] -i | [-cnNe] -M | -s } [delay] -r, --route display routing table -I, --interfaces=[<Iface>] display interface table for <Iface> -i, --interfaces display interface table -g, --groups display multicast group memberships -s, --statistics display networking statistics (like SNMP) -M, --masquerade display masqueraded connections -v, --verbose be verbose ... -C, --cache display routing cache instead of FIB -T, --notrim stop trimming long addresses -Z, --context display SELinux security context for sockets <Iface>: Name of interface to monitor/list. <Socket>={-t|--tcp} {-u|--udp} {-S|--sctp} {-w|--raw} {-x|--unix} --ax25 --ipx --netrom <AF>=Use '-A <af>' or '--<af>'; default: inet List of possible address families (which support routing): inet (DARPA Internet) inet6 (IPv6) ax25 (AMPR AX.25) netrom (AMPR NET/ROM) ipx (Novell IPX) ddp (Appletalk DDP) x25 (CCITT X.25) |
#netstat -ln A inet
Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 127.0.0.1:2208 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:941 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN tcp 0 0 192.168.122.1:53 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:2207 0.0.0.0:* LISTEN tcp 0 0 :::22 :::* LISTEN ... unix 2 [ ACC ] STREAM LISTENING 8945 /var/run/cups/cups.sock unix 2 [ ACC ] STREAM LISTENING 9417 /var/run/avahi-daemon/socket unix 2 [ ACC ] STREAM LISTENING 9529 /var/run/libvirt/libvirt-sock unix 2 [ ACC ] STREAM LISTENING 9531 /var/run/libvirt/libvirt-sock-ro unix 2 [ ACC ] STREAM LISTENING 6247 @ISCSID_UIP_ABSTRACT_NAMESPACE unix 2 [ ACC ] STREAM LISTENING 7211 @/var/run/hald/dbus-2ByqIosKDb unix 2 [ ACC ] STREAM LISTENING 7210 @/var/run/hald/dbus-yKgQvoI4gm unix 2 [ ACC ] STREAM LISTENING 11447 @/tmp/fam-user- unix 2 [ ACC ] STREAM LISTENING 9173 /dev/gpmctl unix 2 [ ACC ] STREAM LISTENING 10535 @/tmp/dbus-tFt5WX9jmZ |
#netstat -ln -A inet
Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 127.0.0.1:2208 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:941 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN tcp 0 0 192.168.122.1:53 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:2207 0.0.0.0:* LISTEN udp 0 0 0.0.0.0:935 0.0.0.0:* udp 0 0 0.0.0.0:938 0.0.0.0:* udp 0 0 192.168.122.1:53 0.0.0.0:* udp 0 0 0.0.0.0:67 0.0.0.0:* udp 0 0 0.0.0.0:49895 0.0.0.0:* udp 0 0 0.0.0.0:5353 0.0.0.0:* udp 0 0 0.0.0.0:111 0.0.0.0:* udp 0 0 0.0.0.0:631 0.0.0.0:* |
#list -l /etc/services
![]() bash: list: command not found |
#ls -l /etc/services
-rw-r--r-- 1 root root 362031 Feb 23 2006 /etc/services |
#grep ssh /etc/services
ssh 22/tcp # SSH Remote Login Protocol ssh 22/udp # SSH Remote Login Protocol x11-ssh-offset 6010/tcp # SSH X11 forwarding offset sshell 614/tcp # SSLshell sshell 614/udp # SSLshell sdo-ssh 3897/tcp # Simple Distributed Objects over SSH sdo-ssh 3897/udp # Simple Distributed Objects over SSH ssh-mgmt 17235/tcp # SSH Tectia Manager ssh-mgmt 17235/udp # SSH Tectia Manager |
#grep pop3 /etc/services
pop3 110/tcp pop-3 # POP version 3 pop3 110/udp pop-3 pop3s 995/tcp # POP-3 over SSL pop3s 995/udp # POP-3 over SSL |
#grep portmap /etc/services
sunrpc 111/tcp portmapper # RPC 4.0 portmapper TCP sunrpc 111/udp portmapper # RPC 4.0 portmapper UDP rpc2portmap 369/tcp rpc2portmap 369/udp # Coda portmapper mdc-portmapper 685/tcp # MDC Port Mapper mdc-portmapper 685/udp # MDC Port Mapper bmap 3421/tcp # Bull Apprise portmapper bmap 3421/udp # Bull Apprise portmapper sdp-portmapper 3935/tcp # SDP Port Mapper Protocol sdp-portmapper 3935/udp # SDP Port Mapper Protocol fsportmap 4349/tcp # File System Port Map fsportmap 4349/udp # File System Port Map |
#netstat -lnp -A inet | cut -c 1-50,70-120
Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Fo State PID/Program name tcp 0 0 127.0.0.1:2208 0. LISTEN 2689/hpiod tcp 0 0 0.0.0.0:941 0. LISTEN 2455/rpc.statd tcp 0 0 0.0.0.0:111 0. LISTEN 2420/portmap tcp 0 0 192.168.122.1:53 0. LISTEN 2952/dnsmasq tcp 0 0 127.0.0.1:631 0. LISTEN 2716/cupsd tcp 0 0 127.0.0.1:25 0. LISTEN 2747/sendmail: acce tcp 0 0 127.0.0.1:2207 0. LISTEN 2694/python udp 0 0 0.0.0.0:935 0. 2455/rpc.statd udp 0 0 0.0.0.0:938 0. 2455/rpc.statd udp 0 0 192.168.122.1:53 0. 2952/dnsmasq udp 0 0 0.0.0.0:67 0. 2952/dnsmasq udp 0 0 0.0.0.0:49895 0. 2895/avahi-daemon: udp 0 0 0.0.0.0:5353 0. 2895/avahi-daemon: udp 0 0 0.0.0.0:111 0. 2420/portmap udp 0 0 0.0.0.0:631 0. 2716/cupsd |
#netstat -lnp -A inet | cut -c 1-50,70-120 | grep 631
tcp 0 0 127.0.0.1:631 0. LISTEN 2716/cupsd udp 0 0 0.0.0.0:631 0. 2716/cupsd |
#n
![]() namei nisdomainname nameif nl nano nm nash nm-applet nautilus nmblookup nautilus-cd-burner nm-connection-editor nautilus-connect-server nm-online nautilus-file-management-properties nm-system-settings nautilus-sendto nm-tool nc nohup ... newgrp ntpq new-kernel-pkg ntpstat newusers ntptime nfsstat ntptrace ngettext ntp-wait nhfsgraph ntsysv nhfsnums numactl nhfsrun numademo nhfsstone numastat nice |
#nc 127.0.0.1 631
print text |
#nc 127.0.0.1 632
![]() |
#nc 192.169.15.5 631
![]() testprint q ^[q |
#nc 192.169.15.1 631
![]() xaxa q ^[:wq |
#nc 127.0.0.1 25
![]() 220 linux5.unix.bas ESMTP Sendmail 8.13.8/8.13.8; Wed, 6 Apr 2011 10:29:46 +0600 500 5.5.1 Command unrecognized: "" |
#nc 127.0.0.1 25
![]() 220 linux5.unix.bas ESMTP Sendmail 8.13.8/8.13.8; Wed, 6 Apr 2011 10:30:11 +0600 testmail 500 5.5.1 Command unrecognized: "testmail" 500 5.5.1 Command unrecognized: "" 500 5.5.1 Command unrecognized: "" "test" 500 5.5.1 Command unrecognized: ""test"" |
#nc 127.0.0.1 25
![]() 220 linux5.unix.bas ESMTP Sendmail 8.13.8/8.13.8; Wed, 6 Apr 2011 10:31:22 +0600 hello m 500 5.5.1 Command unrecognized: "hello m" |
#netstat -lnp -A inet | cut -c 1-50,70-120
Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Fo State PID/Program name tcp 0 0 127.0.0.1:2208 0. LISTEN 2689/hpiod tcp 0 0 0.0.0.0:941 0. LISTEN 2455/rpc.statd tcp 0 0 0.0.0.0:111 0. LISTEN 2420/portmap tcp 0 0 192.168.122.1:53 0. LISTEN 2952/dnsmasq tcp 0 0 127.0.0.1:631 0. LISTEN 2716/cupsd tcp 0 0 127.0.0.1:25 0. LISTEN 2747/sendmail: acce tcp 0 0 127.0.0.1:2207 0. LISTEN 2694/python udp 0 0 0.0.0.0:935 0. 2455/rpc.statd udp 0 0 0.0.0.0:938 0. 2455/rpc.statd udp 0 0 192.168.122.1:53 0. 2952/dnsmasq udp 0 0 0.0.0.0:67 0. 2952/dnsmasq udp 0 0 0.0.0.0:49895 0. 2895/avahi-daemon: udp 0 0 0.0.0.0:5353 0. 2895/avahi-daemon: udp 0 0 0.0.0.0:111 0. 2420/portmap udp 0 0 0.0.0.0:631 0. 2716/cupsd |
#yum install xinetd
Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * addons: mirror.space.kz * base: mirror.space.kz * extras: mirror.space.kz * rpmforge: fr2.rpmfind.net * updates: mirror.space.kz Setting up Install Process Resolving Dependencies --> Running transaction check ... xinetd-2.3.14-10.el5.x86_64.rpm | 125 kB 00:00 Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Installing : xinetd 1/1 Installed: xinetd.x86_64 2:2.3.14-10.el5 Complete! |
#ps aux | grep sshd
root 2707 0.0 0.0 62608 1180 ? Ss 09:55 0:00 /usr/sbin/sshd root 4117 0.0 0.0 61180 752 pts/5 S+ 10:40 0:00 grep sshd |
#ls /etc/xinetd.conf
/etc/xinetd.conf |
#cat /etc/xinetd.conf
# # This is the master xinetd configuration file. Settings in the # default section will be inherited by all service configurations # unless explicitly overridden in the service configuration. See # xinetd.conf in the man pages for a more detailed explanation of # these attributes. defaults { # The next two items are intended to be a quick access place to # temporarily enable or disable services. ... # passenv = groups = yes umask = 002 # Generally, banners are not used. This sets up their global defaults # # banner = # banner_fail = # banner_success = } includedir /etc/xinetd.d |
#stri
![]() strings strip |
#strings `which xinetd` | grep /etc/
/etc/inetd.conf service/protocol combination not in /etc/services: %s/%s /etc/xinetd.conf Protocol %s not in /etc/protocols inetd.conf - Protocol %s not in /etc/protocols |
#strings `which xinetd` | grep ^/etc/
/etc/inetd.conf /etc/xinetd.conf |
#cat /etc/xinetd.d/echo-stream | grep -v ^# | grep -xv ''
service echo { disable = yes id = echo-stream type = INTERNAL wait = no socket_type = stream } |
#chkconfig --list
NetworkManager 0:off 1:off 2:off 3:off 4:off 5:off 6:off acpid 0:off 1:off 2:on 3:on 4:on 5:on 6:off anacron 0:off 1:off 2:on 3:on 4:on 5:on 6:off atd 0:off 1:off 2:off 3:on 4:on 5:on 6:off auditd 0:off 1:off 2:on 3:on 4:on 5:on 6:off autofs 0:off 1:off 2:off 3:on 4:on 5:on 6:off avahi-daemon 0:off 1:off 2:off 3:on 4:on 5:on 6:off avahi-dnsconfd 0:off 1:off 2:off 3:off 4:off 5:off 6:off bluetooth 0:off 1:off 2:on 3:on 4:on 5:on 6:off capi 0:off 1:off 2:off 3:off 4:off 5:off 6:off ... eklogin: off ekrb5-telnet: off gssftp: off klogin: off krb5-telnet: off kshell: off rsync: off tcpmux-server: off time-dgram: off time-stream: off |
#chk
![]() chkconfig chkfontpath |
#chkconfig echo-stream on
|
#chkconfig --list
NetworkManager 0:off 1:off 2:off 3:off 4:off 5:off 6:off acpid 0:off 1:off 2:on 3:on 4:on 5:on 6:off anacron 0:off 1:off 2:on 3:on 4:on 5:on 6:off atd 0:off 1:off 2:off 3:on 4:on 5:on 6:off auditd 0:off 1:off 2:on 3:on 4:on 5:on 6:off autofs 0:off 1:off 2:off 3:on 4:on 5:on 6:off avahi-daemon 0:off 1:off 2:off 3:on 4:on 5:on 6:off avahi-dnsconfd 0:off 1:off 2:off 3:off 4:off 5:off 6:off bluetooth 0:off 1:off 2:on 3:on 4:on 5:on 6:off capi 0:off 1:off 2:off 3:off 4:off 5:off 6:off ... eklogin: off ekrb5-telnet: off gssftp: off klogin: off krb5-telnet: off kshell: off rsync: off tcpmux-server: off time-dgram: off time-stream: off |
#cat /etc/xinetd.d/echo-stream | grep -v ^# | grep -xv ''
service echo { disable = no id = echo-stream type = INTERNAL wait = no socket_type = stream } |
#/etc/init.d/xinetd start
Starting xinetd: [ OK ] |
#ps aux | grep xinetd
root 4252 0.0 0.0 21644 880 ? Ss 10:52 0:00 xinetd -stayalive -pidfile /var/run/xinetd.pid root 4262 0.0 0.0 61176 740 pts/5 S+ 10:52 0:00 grep xinetd |
#grep ^echo /etc/services
echo 7/tcp echo 7/udp echo 4/ddp # AppleTalk Echo Protocol echonet 3610/tcp # ECHONET echonet 3610/udp # ECHONET |
#netstat -lnp | grep :7
tcp 0 0 0.0.0.0:7 0.0.0.0:* LISTEN 4252/xinetd |
#nc 127.0.0.1 7
![]() qwerty qwerty q q |
#yum install nmap
Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * addons: mirror.space.kz * base: mirror.space.kz * extras: mirror.space.kz * rpmforge: fr2.rpmfind.net * updates: mirror.space.kz Setting up Install Process Resolving Dependencies --> Running transaction check ... nmap-4.11-1.1.x86_64.rpm | 680 kB 00:02 Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Installing : nmap 1/1 Installed: nmap.x86_64 2:4.11-1.1 Complete! |
#cat /etc/xinetd.d/finger
service echo { disable = no id = echo-stream type = INTERNAL wait = no socket_type = stream } |
#vim /etc/xinetd.d/finger
--- /tmp/l3-saved-3452.6278.18395 2011-04-05 10:47:05.000000000 +0600 +++ /etc/sysconfig/network-scripts/ifcfg-eth0:0 2011-04-05 10:47:16.000000000 +0600 @@ -1,5 +1,5 @@ # Atheros Communications Atheros AR8121/AR8113/AR8114 PCI-E Ethernet Controller -DEVICE=eth0::0: +DEVICE=eth0:0 BOOTPROTO=none ONBOOT=yes NETMASK=255.255.255.0 |
#/etc/init.d/xinetd restart
Stopping xinetd: [ OK ] Starting xinetd: [ OK ] |
#history
41 bc 42 dd if=/dev/zero of=disk1.img count=1200 bs=5120k 43 /usr/libexec/qemu-kvm -cdrom /dev/cdrom 44 history | grep dd 45 dd if=/dev/zero of=disk1.img count=1200 bs=5120k 46 qume 47 =l 48 qume -l 49 history | qume 50 yum repolist ... 1031 ps aux | grep xinetd 1032 grep ^echo /etc/services 1033 netstat -lnp | grep :7 1034 nc 127.0.0.1 7 1035 yum install nmap 1036 grep -v ^# /etc/xinetd.d/echo-stream | grep -xv '' > /etc/xinetd.d/finger 1037 cat /etc/xinetd.d/finger 1038 vim /etc/xinetd.d/finger 1039 /etc/init.d/xinetd restart 1040 history |
#netstat -lnp | grep 79
unix 2 [ ACC ] STREAM LISTENING 10799 3266/gnome-settings /tmp/orbit-user/linc-cc2-0-72010d166fff unix 2 [ ACC ] STREAM LISTENING 11786 3414/gnome-screensa /tmp/orbit-user/linc-d55-0-679f93c599d24 unix 2 [ ACC ] STREAM LISTENING 11946 3418/gnome-terminal /tmp/orbit-user/linc-d5a-0-60fda579e1c1b |