/l3/trainings/xg-ids/2005-12-19/fbsd2.linux.nt/user :1 :2 :3 :4 :5 :6 :7 :8 :9 :10 :11 :12 :13 :14 :15 :16 :17 :18 :19 :20 :21 :22 |
|
$ls -al /usr/local/bin/get-port-by-mac
-rwxr--r-- 1 root wheel 1155 Dec 21 11:38 /usr/local/bin/get-port-by-mac |
$sudo /usr/local/bin/get-port-by-mac 00:13:8f:2f:ac:5e
![]() syntax error at /usr/local/bin/get-port-by-mac line 6, near "my " Execution of /usr/local/bin/get-port-by-mac aborted due to compilation errors. |
$sudo vi /usr/local/bin/get-port-by-mac
5,6c5,6 < my $SNMP_switch="192.168.15.200 192.168.15.121"; 1 < my $SNMP_community="public"; 2 --- > my $SNMP_switch="192.168.15.200 192.168.15.121"; > my $SNMP_community="public"; 8c8 < my $snmpwalk="/usr/local/bin/snmpwalk"; 3 --- > my $snmpwalk="/usr/local/bin/snmpwalk"; |
$sudo /usr/local/bin/get-port-by-mac 00:13:8f:2f:ac:5e
Timeout: No Response from 192.168.15.200 Timeout: No Response from 192.168.15.121 |
$sudo vi /usr/local/bin/get-port-by-mac
|
$sudo /usr/local/bin/get-port-by-mac 00:13:8f:2f:ac:5e
34(switch 192.168.12.100) |
$sudo /usr/local/bin/get-port-by-mac 00:13:8f:2f:ac:5e
34(switch 192.168.12.100) |
$sudo /usr/local/bin/get-port-by-mac 00:13:8f:2f:ac:5e
Timeout: No Response from 192.168.12.100 |
$uname -a | grep rom
![]() |
$uname
FreeBSD |
$dmesg | grep rom
Trying to mount root from ufs:/dev/ad1s1a rl0: promiscuous mode disabled rl0: promiscuous mode enabled rl0: promiscuous mode disabled rl0: promiscuous mode enabled rl0: promiscuous mode disabled |
$dmesg | grep dvd
![]() |
$dmesg | grep DVD
acd0: DVDROM <Pioneer DVD-ROM ATAPIModel DVD-115 0122/E1.22> at ata1-master UDMA33 |
$snmpwalk -v2c -c public 192.168.12.100 .1.3.6.1.2.1.17.1.4.1.2
SNMPv2-SMI::mib-2.17.1.4.1.2.13 = INTEGER: 2 SNMPv2-SMI::mib-2.17.1.4.1.2.14 = INTEGER: 3 SNMPv2-SMI::mib-2.17.1.4.1.2.15 = INTEGER: 4 SNMPv2-SMI::mib-2.17.1.4.1.2.16 = INTEGER: 5 SNMPv2-SMI::mib-2.17.1.4.1.2.17 = INTEGER: 6 SNMPv2-SMI::mib-2.17.1.4.1.2.18 = INTEGER: 7 SNMPv2-SMI::mib-2.17.1.4.1.2.19 = INTEGER: 8 SNMPv2-SMI::mib-2.17.1.4.1.2.20 = INTEGER: 9 SNMPv2-SMI::mib-2.17.1.4.1.2.22 = INTEGER: 10 SNMPv2-SMI::mib-2.17.1.4.1.2.23 = INTEGER: 11 ... SNMPv2-SMI::mib-2.17.1.4.1.2.28 = INTEGER: 16 SNMPv2-SMI::mib-2.17.1.4.1.2.29 = INTEGER: 17 SNMPv2-SMI::mib-2.17.1.4.1.2.31 = INTEGER: 18 SNMPv2-SMI::mib-2.17.1.4.1.2.32 = INTEGER: 19 SNMPv2-SMI::mib-2.17.1.4.1.2.33 = INTEGER: 20 SNMPv2-SMI::mib-2.17.1.4.1.2.34 = INTEGER: 21 SNMPv2-SMI::mib-2.17.1.4.1.2.35 = INTEGER: 22 SNMPv2-SMI::mib-2.17.1.4.1.2.36 = INTEGER: 23 SNMPv2-SMI::mib-2.17.1.4.1.2.37 = INTEGER: 24 SNMPv2-SMI::mib-2.17.1.4.1.2.38 = INTEGER: 25 |
$sudo vi /usr/local/bin/get-port-by-mac
|
$sudo /usr/local/bin/get-port-by-mac 00:13:8f:2f:ac:5e
34(switch 192.168.12.100) |
$echo `!!`
![]() echo `sudo /usr/local/bin/get-port-by-mac 00:13:8f:2f:ac:5e` Password: |
$which get-port-by-mac
![]() |
$whereisport-by-mac
get-port-by-mac: /usr/local/bin/get-port-by-mac |
$vi `!!`
|
$sudo `!!`
![]() sudo `vi `whereis get-port-by-mac`` usage: touch [-acfhm] [-r file] [-t [[CC]YY]MMDDhhmm[.SS]] file ... ex/vi: Vi's standard input and output must be a terminal Password: |
$whereis get-port-by-mac
get-port-by-mac: /usr/local/bin/get-port-by-mac |
$whereis banner
banner: /usr/bin/banner /usr/share/man/man6/banner.6.gz /usr/src/usr.bin/banner |
$whereis cowsay
cowsay: /usr/ports/games/cowsay |
$cowsay test:)
![]() bash: syntax error near unexpected token `)' |
$cowsay test )
![]() bash: syntax error near unexpected token `)' |
$cowsay 'test :)'
![]() bash: cowsay: command not found |
$cd /usr/ports/games/cowsay
|
$sudo make install clean
Password: ===> Vulnerability check disabled, database not found => cowsay-3.03.tar.gz doesn't seem to exist in /usr/ports/distfiles/. => Attempting to fetch from ftp://ftp.nog.net/pub/tony/cowsay/. cowsay-3.03.tar.gz 100% of 14 kB 24 kBps ===> Extracting for cowsay-3.03_1 => Checksum OK for cowsay-3.03.tar.gz. ===> cowsay-3.03_1 depends on file: /usr/local/bin/perl5.8.7 - found ===> Patching for cowsay-3.03_1 ===> cowsay-3.03_1 depends on file: /usr/local/bin/perl5.8.7 - found ... x cows/vader-koala.cow x cows/www.cow x cows/vader.cow + set +x Okay, let us see if the install actually worked. Installation complete! Enjoy the cows! ===> Compressing manual pages for cowsay-3.03_1 ===> Registering installation for cowsay-3.03_1 ===> Cleaning for perl-5.8.7 ===> Cleaning for cowsay-3.03_1 |
$cowsay 'test :)'
_________ < test :) > --------- \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || || |
$banner 123
#### #### # #### ### #### ##### ############################################################################ ############################################################################## ################################################################################ ################################################################################## ################################################################################### ##################################################################################### ... ################ ################# ################################## ############################################ ################################ ########################################## ############################## ######################################## ########################### ###################################### ####################### ################################## ################# ############################## ########### ########################## #################### ########### |
$cowsay 'test :)'
_________ < test :) > --------- \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || || |
$man cowsay
|
$cowsay 'test :)'
_________ < test :) > --------- \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || || |
$for
![]() for fore_dnld fortune |
$fortune
Bus error -- please leave by the rear door. |
$fortune
The more you sweat in peace, the less you bleed in war. |
$cowsay `fortune `
_________________________________________ / The local minister noticed a little \ | girl standing outside of his door with | | a basket of kittens. "Hello, little | | girl, what do you have there?" "These | | are my Democratic kittens," she | | replied. Amused, the pastor said | | nothing. Two weeks later he saw the | | same little girl with (apparently) the | | same basket of kittens. "My, I see you | ... | Republican kittens," she answered. "Two | | weeks ago they were Democratic | | kittens," he replied, puzzled. "Two | \ weeks ago they had their eyes closed." / ----------------------------------------- \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || || |
$cowsay `fortune `
________________________________________ < I wish you were a Scotch on the rocks. > ---------------------------------------- \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || || |
$cowsay `fortune `
_______________________________________ / He: "If I made love to you, would you \ | yell?" She: "What do you want me to | \ yell?" -- Benny Hill / --------------------------------------- \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || || |
$cowsay `fortune `
________________________________________ / World War Three can be averted by \ | adherence to a strictly enforced dress | \ code! / ---------------------------------------- \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || || |
$cowsay `fortune `
________________________________________ / The other day I... uh, no, that wasn't \ \ me. -- Steven Wright / ---------------------------------------- \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || || |
$tcpdump
![]() tcpdump: no suitable device found |
$sudo mp
Password: tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on rl0, link-type EN10MB (Ethernet), capture size 96 bytes 14:15:04.708713 802.1d config 8000.00:03:e3:6c:37:80.8022 root 8000.00:03:e3:6c:37:80 pathcost 0 age 0 max 20 hello 2 fdelay 15 14:15:06.711781 802.1d config 8000.00:03:e3:6c:37:80.8022 root 8000.00:03:e3:6c:37:80 pathcost 0 age 0 max 20 hello 2 fdelay 15 14:15:08.713675 802.1d config 8000.00:03:e3:6c:37:80.8022 root 8000.00:03:e3:6c:37:80 pathcost 0 age 0 max 20 hello 2 fdelay 15 14:15:10.714231 802.1d config 8000.00:03:e3:6c:37:80.8022 root 8000.00:03:e3:6c:37:80 pathcost 0 age 0 max 20 hello 2 fdelay 15 14:15:12.716950 802.1d config 8000.00:03:e3:6c:37:80.8022 root 8000.00:03:e3:6c:37:80 pathcost 0 age 0 max 20 hello 2 fdelay 15 14:15:14.719693 802.1d config 8000.00:03:e3:6c:37:80.8022 root 8000.00:03:e3:6c:37:80 pathcost 0 age 0 max 20 hello 2 fdelay 15 14:15:15.038958 IP fbsd2.linux.nt.51690 > hotel.so.net.ua.pop3: S 3012783924:3012783924(0) win 65535 <mss 1460,nop,wscale 1,nop,nop,timestamp 16628388 0,sackOK,eol> ... 14:15:25.190334 IP fbsd2.linux.nt.51831 > linux.nt.domain: 47247+ PTR? 254.15.168.192.in-addr.arpa. (45) 14:15:25.190984 IP linux.nt.domain > fbsd2.linux.nt.51831: 47247* 1/1/1 (97) 14:15:26.364551 IP linux.nt.32819 > 192.168.15.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST 14:15:26.634481 IP linux.nt.32819 > 192.168.15.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST 14:15:26.736163 802.1d config 8000.00:03:e3:6c:37:80.8022 root 8000.00:03:e3:6c:37:80 pathcost 0 age 0 max 20 hello 2 fdelay 15 14:15:26.904430 IP linux.nt.32819 > 192.168.15.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST ^C 46 packets captured 48 packets received by filter 0 packets dropped by kernel |
$sudo ethereal
|
$sudo ethereal
Password: |
$cd
|
$pwd
/home/user |
$whereis etherial
etherial: |
$whereis etherial.log
etherial.log: |
$cd /var/log
|
$ls
Xorg.0.log cron lastlog mysql.pipe sendmail.st.1 Xorg.0.log.old debug.log logger.log ppp.log slip.log Xorg.8.log fbsd1 lpd-errs scrollkeeper.log swatch.log Xorg.8.log.old fbsd2 maillog security userlog auth.log httpd-access.log messages sendmail.st wtmp backup httpd-error.log messages.0.bz2 sendmail.st.0 xferlog |
$ls -al
total 456 drwxr-xr-x 5 root wheel 1024 Dec 21 09:39 . drwxr-xr-x 23 root wheel 512 Dec 21 11:38 .. -rw-r--r-- 1 root wheel 44795 Dec 21 11:21 Xorg.0.log -rw-r--r-- 1 root wheel 45036 Dec 21 09:36 Xorg.0.log.old -rw-r--r-- 1 root wheel 42535 Dec 19 17:10 Xorg.8.log -rw-r--r-- 1 root wheel 26277 Dec 19 17:10 Xorg.8.log.old -rw------- 1 root wheel 6846 Dec 21 13:53 auth.log drw------- 2 root wheel 512 Dec 19 17:33 backup -rw------- 1 root wheel 37059 Dec 21 14:25 cron ... -rw-r--r-- 1 root wheel 42957 Dec 18 21:50 scrollkeeper.log -rw------- 1 root wheel 60 Dec 18 19:53 security -rw-r----- 1 root wheel 728 Dec 21 11:40 sendmail.st -rw-r----- 1 root wheel 0 Dec 18 20:00 sendmail.st.0 -rw-r----- 1 root wheel 0 Nov 3 10:12 sendmail.st.1 -rw-r----- 1 root network 60 Dec 18 19:53 slip.log -rw-r--r-- 1 root wheel 200 Dec 19 15:34 swatch.log -rw------- 1 root wheel 677 Dec 19 16:45 userlog -rw-r--r-- 1 root wheel 5324 Dec 21 14:29 wtmp -rw------- 1 root wheel 60 Dec 18 19:53 xferlog |
$sudo which etherial
![]() Password: |
$sudo `which etherial`
![]() usage: sudo -K | -L | -V | -h | -k | -l | -v usage: sudo [-HPSb] [-c class|-] [-p prompt] [-u username|#uid] { -e file [...] | -i | -s | <command> } |
$sudo whereisrial
etherial: |
$sudo whereis etherel
ethereal: /usr/X11R6/bin/ethereal /usr/X11R6/man/man1/ethereal.1.gz /usr/ports/net/ethereal |
$sudo which etherel
/usr/X11R6/bin/ethereal |
$strings `which ethereal`
^DRQ ^DRQ AdRP A`RP AdRP 2Pj2 Bt+Bp B|+Bx x{Pj AdRP ... " hide="yes <field name="data" value=" %% Set the font to 10 point %% the page title %d (%s) putline /Dest /%s /DEST pdfmark <proto name="geninfo" pos="0" showname="General information" size="%u"> <field name="num" pos="0" show="%u" showname="Number" value="%x" size="%u"/> <field name="len" pos="0" show="%u" showname="Packet Length" value="%x" size="%u"/> <field name="caplen" pos="0" show="%u" showname="Captured Length" value="%x" size="%u"/> |
$q
![]() |
$strings `which ethereal` | grep log
g_log g_log_set_handler gtk_dialog_set_response_sensitive gtk_file_chooser_dialog_new gtk_dialog_get_type gtk_dialog_run gtk_color_selection_dialog_get_type gtk_color_selection_dialog_new simple_dialog_set_cb set_capture_if_dialog_for_capture_in_progress ... Open a dialog box to set various interface options. Hide the capture info dialog while capturing. Will only take effect, if the "Update list of packets in real time" option is also used. Open a dialog showing the current settings. Apply current setting, close dialog and redissect packets. Apply current setting, redissect packets and keep dialog open. Close the dialog, don't redissect packets. The packets in these files will be merged chronologically into a new temporary file. Close the dialog and keep the current display filter "File Open" dialog behavior: Close this dialog |
$strings `which ethereal` | grep .og
g_log g_log_set_handler gtk_dialog_set_response_sensitive gtk_file_chooser_dialog_new gtk_dialog_get_type gtk_dialog_run gtk_color_selection_dialog_get_type gtk_color_selection_dialog_new simple_dialog_set_cb set_capture_if_dialog_for_capture_in_progress ... Open a dialog box to set various interface options. Hide the capture info dialog while capturing. Will only take effect, if the "Update list of packets in real time" option is also used. Open a dialog showing the current settings. Apply current setting, close dialog and redissect packets. Apply current setting, redissect packets and keep dialog open. Close the dialog, don't redissect packets. The packets in these files will be merged chronologically into a new temporary file. Close the dialog and keep the current display filter "File Open" dialog behavior: Close this dialog |
$which ethereal
/usr/X11R6/bin/ethereal |
$strings `which ethereal` | grep .conf
create_persconffile_dir get_persconffile_path capture_start_confirmed Loading configuration files ... Personal configuration Global configuration tput_read_config() tseq_stevens_read_config() rtt_read_config() |
$ls -al /usr/local/etc/
![]() aide.conf cups/ gnokiirc openslp/ php.ini-dist swatch_1_rule aide.conf.sample esd.conf gnokiirc.sample orbit2rc php.ini-recommended syslog-ng/ apache/ esd.conf.default ksysguarddrc orbit2rc.default rc.d/ xdg/ bonobo-activation/ etter.conf lynx.cfg pam.d/ snmp/ xml2Conf.sh cdrecord etter.conf.sample lynx.cfg.default php/ sudoers xsltConf.sh cdrecord.sample fam.conf openldap/ php.conf sudoers.sample |
$ls -al /usr/local/etc/etter.conf
-r--r--r-- 1 root wheel 8326 Dec 20 15:26 /usr/local/etc/etter.conf |
$cat /local/etc/etter.conf
ldap = 389 # tcp 389 https = 443 # tcp 443 ssmtp = 465 # tcp 465 rlogin = 512,513 # tcp 512 513 rip = 520 # udp 520 nntps = 563 # tcp 563 ldaps = 636 # tcp 636 telnets = 992 # tcp 992 imaps = 993 # tcp 993 ircs = 994 # tcp 993 ... #redir_command_off = "pfctl -a sslsniff -Fn" # also, if you create a group called "pfusers" and have EC_GID be that group, # you can do something like: # chgrp pfusers /dev/pf # chmod g+rw /dev/pf # such that all users in "pfusers" can run pfctl commands; thus allowing non-root # execution of redir commands. ########## # EOF # ########## |
$lesssr/local/etc/etter.conf
# ----- cut here ------- # #!/bin/sh#######################050 # # if [ -a "/tmp/osx_ipfw_rules" ]; then901 5902 5903not... # # ipfw -q delete `head -n 1 /tmp/osx_ipfw_rules`3 # # rm -f /tmp/osx_ipfw_rules for your operating system in order to have # fiSL dissection availablecp 7777 8888n standard port # # ----- cut here -------cript is executed without enough privileges (because # they are dropped on startup). so you have to either: provide a setuid program # or set the ec_uid to 0, in order to be sure the cleanup script will be # #---------------rlyctors have multiple default ports, if you specify a new # ... # ----- cut here -------direct command for SSL mitm attack. # #!/bin/sh # tcp 636 # if [ -a "/tmp/osx_ipfw_rules" ]; then # ipfw -q add `head -n 1 osx_ipfw_rules` fwd 127.0.0.1,$1 tcp from any to any $2 in via $3 # elseault encoding to be used for the UTF-8 visualizationcal; 3 = remote # ipfw add fwd 127.0.0.1,$1 tcp from any to any $2 in via $3 | cut -d " " -f 1 >> /tmp/osx_ipfw_rules # fi 1080 # tcp 1080value # ----- cut here ------- remote_browser plugin remote_browser = "mozilla -remote openurl(http://%host%url)" checksum_check is 1) # redir_command_off: # tcp 3306 |
$sudo vi /usr/local/bin/watch-for-new-devices
|
$ls -al /usr/local/bin/watch-for-new-devices
-rw-r--r-- 1 root wheel 1658 Dec 21 14:37 /usr/local/bin/watch-for-new-devices |
$chmod 744al/bin/watch-for-new-devices
![]() chmod: /usr/local/bin/watch-for-new-devices: Operation not permitted |
$sudo 744 /usr/local/bin/watch-for-new-devices
|
$ls -al /usr/local/bin/watch-for-new-devices
-rwxr--r-- 1 root wheel 1658 Dec 21 14:37 /usr/local/bin/watch-for-new-devices |
$sudo vi /usr/local/etc/syslog-ng/syslog-ng.conf
|
$swatch
swatch: cannot read /home/user/.swatchrc swatch: using default configuration of: watchfor = /.*/ echo *** swatch version 3.1.1 (pid:13436) started at Wed Dec 21 14:41:25 EET 2005 tail: /var/log/messages: Permission denied |
$cat /var/log/messages
![]() cat: /var/log/messages: Permission denied |
$sudo tailessages
Dec 21 14:28:55 src@fbsd2 syslog-ng[536]: STATS: dropped 0 Dec 21 14:30:21 src@fbsd2 sudo: user : TTY=ttyp5 ; PWD=/var/log ; USER=root ; COMMAND=/usr/bin/which etherial Dec 21 14:30:45 src@fbsd2 sudo: user : TTY=ttyp5 ; PWD=/var/log ; USER=root ; COMMAND=/usr/bin/whereis etherial Dec 21 14:30:57 src@fbsd2 sudo: user : TTY=ttyp5 ; PWD=/var/log ; USER=root ; COMMAND=/usr/bin/whereis ethereal Dec 21 14:31:05 src@fbsd2 sudo: user : TTY=ttyp5 ; PWD=/var/log ; USER=root ; COMMAND=/usr/bin/which ethereal Dec 21 14:34:45 src@fbsd2 sudo: user : TTY=ttyp5 ; PWD=/var/log ; USER=root ; COMMAND=/usr/bin/vi /usr/local/bin/watch-for-new-devices Dec 21 14:38:19 src@fbsd2 sudo: user : TTY=ttyp5 ; PWD=/var/log ; USER=root ; COMMAND=/bin/chmod 744 /usr/local/bin/watch-for-new-devices Dec 21 14:38:55 src@fbsd2 syslog-ng[536]: STATS: dropped 0 Dec 21 14:38:57 src@fbsd2 sudo: user : TTY=ttyp5 ; PWD=/var/log ; USER=root ; COMMAND=/usr/bin/vi /usr/local/etc/syslog-ng/syslog-ng.conf Dec 21 14:42:02 src@fbsd2 sudo: user : TTY=ttyp5 ; PWD=/var/log ; USER=root ; COMMAND=/usr/bin/tail /var/log/messages |
$sudo vi /usr/local/etc/syslog-ng/syslog-ng.conf
40a41 > destination pr_arpwatch { file("/usr/local/bin/watch-for-new-devices"); }; 91a93 > filter f_arpwatc { match("arpwatch"); }; |
$sudo vi /usr/local/etc/syslog-ng/syslog-ng.conf
|
$perlr/local/etc/syslog-ng/syslog-ng.conf
![]() Bareword found where operator expected at /usr/local/etc/syslog-ng/syslog-ng.conf line 15, near ""/var/run/logpriv" perm" (Missing operator before perm?) syntax error at /usr/local/etc/syslog-ng/syslog-ng.conf line 15, near "unix" syntax error at /usr/local/etc/syslog-ng/syslog-ng.conf line 16, near "; }" Execution of /usr/local/etc/syslog-ng/syslog-ng.conf aborted due to compilation errors. |
$sudo vi /usr/local/etc/syslog-ng/syslog-ng.conf
|
$perlr/local/bin/watch-for-new-devices
|
$ps -waux | grep arp
user 13628 0.0 0.1 1504 1020 p5 S+ 2:55PM 0:00.00 grep arp |
$whereis arpwatch
arpwatch: /usr/local/sbin/arpwatch /usr/local/man/man8/arpwatch.8.gz /usr/ports/net-mgmt/arpwatch |
$whichpwatch
/usr/local/sbin/arpwatch |
$sudo vi /usr/local/etc/syslog-ng/syslog-ng.conf
|
$which arpwatch
/usr/local/sbin/arpwatch |
$strings `!!`
gmtime _getshort setuid __res_query _edata __bss_start _end t*f= Qj*hn tjf=5 ... /usr/sbin/sendmail execl: %s: %m Cannot dup2 %s to stdout: %m Cannot open %s: %m dup2: %m child fdopen(%s): %m mkstemp(%s) %m reaper: pid %d, exit status %d $FreeBSD: src/lib/csu/i386-elf/crtn.S,v 1.6 2005/05/19 07:31:06 dfr Exp $ 2.1a13 |
$strings `which arpwatch` | grep etc
![]() |
$strings `which arpwatch` | grep log
openlog closelog syslog |
$which arpwatch
/usr/local/sbin/arpwatch |
$/usr/local/etc/rc.d/syslog-ng.sh restart
Usage: syslog-ng.sh {start|stop} |
$/usr/local/etc/rc.d/syslog-ng.sh stop
No matching processes belonging to you were found |
$/usr/local/etc/rc.d/syslog-ng.sh start
io.c: bind_unix_socket(): bind failed /var/run/log (Address already in use) Error initializing configuration, exiting. |
ldap = 389 # tcp 389 https = 443 # tcp 443 ssmtp = 465 # tcp 465 rlogin = 512,513 # tcp 512 513 rip = 520 # udp 520 nntps = 563 # tcp 563 ldaps = 636 # tcp 636 telnets = 992 # tcp 992 imaps = 993 # tcp 993 ircs = 994 # tcp 993 pop3s = 995 # tcp 995 socks = 1080 # tcp 1080 msn = 1863 # tcp 1863 cvs = 2401 # tcp 2401 mysql = 3306 # tcp 3306 icq = 5190 # tcp 5190 ymsg = 5050 # tcp 5050 vnc = 5900,5901,5902,5903 # tcp 5900 5901 5902 5903 x11 = 6000,6001,6002,6003 # tcp 6000 6001 6002 6003 irc = 6666,6667,6668,6669 # tcp 6666 6667 6668 6669 napster = 7777,8888 # tcp 7777 8888 proxy = 8080 # tcp 8080 rcon = 27015,27960 # udp 27015 27960 ppp = 34827 # special case ;) this is the Net Layer code # # you can change the colors of the curses GUI. # here is a list of values: # 0 Black 4 Blue # 1 Red 5 Magenta # 2 Green 6 Cyan # 3 Yellow 7 White # [curses] color_bg = 0 color_fg = 7 color_join1 = 2 color_join2 = 4 color_border = 7 color_title = 3 color_focus = 6 color_menu_bg = 4 color_menu_fg = 6 color_window_bg = 4 color_window_fg = 7 color_selection_bg = 6 color_selection_fg = 6 color_error_bg = 1 color_error_fg = 3 color_error_border = 3 # # This section includes all the configurations that needs a string as a # parmeter such as the redirect command for SSL mitm attack. # [strings] # the default encoding to be used for the UTF-8 visualization utf8_encoding = "ISO-8859-1" # the command used by the remote_browser plugin remote_browser = "mozilla -remote openurl(http://%host%url)" ##################################### # redir_command_on/off ##################################### # you must provide a valid script for your operating system in order to have # the SSL dissection available # note that the cleanup script is executed without enough privileges (because # they are dropped on startup). so you have to either: provide a setuid program # or set the ec_uid to 0, in order to be sure the cleanup script will be # executed properly # NOTE: this script is executed with an execve(), so you can't use pipes or # output redirection as if you were in a shell. We suggest you to make a script if # you need those commands. #--------------- # Linux #--------------- # if you use ipchains: #redir_command_on = "ipchains -A input -i %iface -p tcp -s 0/0 -d 0/0 %port -j REDIRECT %rport" #redir_command_off = "ipchains -D input -i %iface -p tcp -s 0/0 -d 0/0 %port -j REDIRECT %rport" # if you use iptables: #redir_command_on = "iptables -t nat -A PREROUTING -i %iface -p tcp --dport %port -j REDIRECT --to-port %rport" #redir_command_off = "iptables -t nat -D PREROUTING -i %iface -p tcp --dport %port -j REDIRECT --to-port %rport" #--------------- # Mac Os X #--------------- # quick and dirty way: #redir_command_on = "ipfw add fwd 127.0.0.1,%rport tcp from any to any %port in via %iface" #redir_command_off = "ipfw -q flush" # a better solution is to use a script that keeps track of the rules interted # and then deletes them on exit: # redir_command_on: # ----- cut here ------- # #!/bin/sh # if [ -a "/tmp/osx_ipfw_rules" ]; then # ipfw -q add `head -n 1 osx_ipfw_rules` fwd 127.0.0.1,$1 tcp from any to any $2 in via $3 # else # ipfw add fwd 127.0.0.1,$1 tcp from any to any $2 in via $3 | cut -d " " -f 1 >> /tmp/osx_ipfw_rules # fi # ----- cut here ------- # redir_command_off: # ----- cut here ------- # #!/bin/sh # if [ -a "/tmp/osx_ipfw_rules" ]; then # ipfw -q delete `head -n 1 /tmp/osx_ipfw_rules` # rm -f /tmp/osx_ipfw_rules # fi # ----- cut here ------- #--------------- # Open BSD #--------------- # unfortunately the pfctl command does not accepts direct rules adding # you have to use a script wich executed the following command: # ----- cut here ------- # #!/bin/sh # rdr pass on $1 inet proto tcp from any to any port $2 -> localhost port $3 | pfctl -a sslsniff -f - # ----- cut here ------- # it's important to remember that you need "rdr-anchor sslsniff" in your # pf.conf in the TRANSLATION section. #redir_command_on = "the_script_described_above %iface %port %rport" #redir_command_off = "pfctl -a sslsniff -Fn" # also, if you create a group called "pfusers" and have EC_GID be that group, # you can do something like: # chgrp pfusers /dev/pf # chmod g+rw /dev/pf # such that all users in "pfusers" can run pfctl commands; thus allowing non-root # execution of redir commands. ########## # EOF # ##########
Время первой команды журнала | 11:43:53 2006-12-21 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 15:01:10 2006-12-21 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 95 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 16.84 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 1.05 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 1.35 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 1.17 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду w. В поле WHAT, соответствующем текущему терминалу, должна быть указана программа script.
Команды, при наборе которых были допущены синтаксические ошибки, выводятся перечёркнутым текстом:
$ l s-l bash: l: command not found |
Если код завершения команды равен нулю, команда была выполнена без ошибок. Команды, код завершения которых отличен от нуля, выделяются цветом.
$ test 5 -lt 4 |
Команды, ход выполнения которых был прерван пользователем, выделяются цветом.
$ find / -name abc find: /home/devi-orig/.gnome2: Keine Berechtigung find: /home/devi-orig/.gnome2_private: Keine Berechtigung find: /home/devi-orig/.nautilus/metafiles: Keine Berechtigung find: /home/devi-orig/.metacity: Keine Berechtigung find: /home/devi-orig/.inkscape: Keine Berechtigung ^C |
Команды, выполненные с привилегиями суперпользователя, выделяются слева красной чертой.
# id uid=0(root) gid=0(root) Gruppen=0(root) |
Изменения, внесённые в текстовый файл с помощью редактора, запоминаются и показываются в журнале в формате ed. Строки, начинающиеся символом "<", удалены, а строки, начинающиеся символом ">" -- добавлены.
$ vi ~/.bashrc
|
Для того чтобы изменить файл в соответствии с показанными в диффшоте изменениями, можно воспользоваться командой patch. Нужно скопировать изменения, запустить программу patch, указав в качестве её аргумента файл, к которому применяются изменения, и всавить скопированный текст:
$ patch ~/.bashrc |
Для того чтобы получить краткую справочную информацию о команде, нужно подвести к ней мышь. Во всплывающей подсказке появится краткое описание команды.
Если справочная информация о команде есть, команда выделяется голубым фоном, например: vi. Если справочная информация отсутствует, команда выделяется розовым фоном, например: notepad.exe. Справочная информация может отсутствовать в том случае, если (1) команда введена неверно; (2) если распознавание команды LiLaLo выполнено неверно; (3) если информация о команде неизвестна LiLaLo. Последнее возможно для редких команд.
Большие, в особенности многострочные, всплывающие подсказки лучше всего показываются браузерами KDE Konqueror, Apple Safari и Microsoft Internet Explorer. В браузерах Mozilla и Firefox они отображаются не полностью, а вместо перевода строки выводится специальный символ.
Время ввода команды, показанное в журнале, соответствует времени начала ввода командной строки, которое равно тому моменту, когда на терминале появилось приглашение интерпретатора
Имя терминала, на котором была введена команда, показано в специальном блоке. Этот блок показывается только в том случае, если терминал текущей команды отличается от терминала предыдущей.
Вывод не интересующих вас в настоящий момент элементов журнала, таких как время, имя терминала и других, можно отключить. Для этого нужно воспользоваться формой управления журналом вверху страницы.
Небольшие комментарии к командам можно вставлять прямо из командной строки. Комментарий вводится прямо в командную строку, после символов #^ или #v. Символы ^ и v показывают направление выбора команды, к которой относится комментарий: ^ - к предыдущей, v - к следующей. Например, если в командной строке было введено:
$ whoami
user
$ #^ Интересно, кто я?в журнале это будет выглядеть так:
$ whoami
user
Интересно, кто я? |
Если комментарий содержит несколько строк, его можно вставить в журнал следующим образом:
$ whoami
user
$ cat > /dev/null #^ Интересно, кто я?
Программа whoami выводит имя пользователя, под которым мы зарегистрировались в системе. - Она не может ответить на вопрос о нашем назначении в этом мире.В журнале это будет выглядеть так:
$ whoami user
|
Комментарии, не относящиеся непосредственно ни к какой из команд, добавляются точно таким же способом, только вместо симолов #^ или #v нужно использовать символы #=
1 2 3 4Группы команд, выполненных на разных терминалах, разделяются специальной линией. Под этой линией в правом углу показано имя терминала, на котором выполнялись команды. Для того чтобы посмотреть команды только одного сенса, нужно щёкнуть по этому названию.
LiLaLo (L3) расшифровывается как Live Lab Log.
Программа разработана для повышения эффективности обучения Unix/Linux-системам.
(c) Игорь Чубин, 2004-2008