Журнал лабораторных работ

Содержание

Журнал

Вторник (03/29/16)

10:35:27
$sudo apt-get install isc-dhcp-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  isc-dhcp-server-ldap
The following NEW packages will be installed:
  isc-dhcp-server
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 381 kB of archives.
After this operation, 864 kB of additional disk space will be used.
...
(Reading database ... 135376 files and directories currently installed.)
Preparing to unpack .../isc-dhcp-server_4.3.1-6+deb8u2_amd64.deb ...
Unpacking isc-dhcp-server (4.3.1-6+deb8u2) ...
Processing triggers for systemd (215-17+deb8u3) ...
Processing triggers for man-db (2.7.0.2-5) ...
Setting up isc-dhcp-server (4.3.1-6+deb8u2) ...
Generating /etc/default/isc-dhcp-server...
Job for isc-dhcp-server.service failed. See 'systemctl status isc-dhcp-server.service' and 'journalctl -xn' for details.
invoke-rc.d: initscript isc-dhcp-server, action "start" failed.
Processing triggers for systemd (215-17+deb8u3) ...
/dev/pts/4
10:37:31
$su
Password:
10:37:34
#vim /root/.l3rc
--- /tmp/l3-saved-3030.22324.20161	2016-03-29 11:37:57.102782637 +0300
+++ .l3rc	2016-03-29 11:38:00.454782696 +0300
@@ -1 +1 @@
-l3cd=/users/andrey_f4/sl-voip-2016-03/asterick8.unix.sl/user
+l3cd=/users/andrey-f4/sl-voip-2016-03/asterick8.unix.sl/user
10:37:45
#pkill -1 l3-agent

10:37:48
#exit
exit
10:37:49
$vim .l3rc
10:38:00
$pkill -1 l3-agent

10:38:07
$ps aux | grep l3
user      2994 77.6  0.3  66668 27688 ?        Rs   11:37   0:30 l3-agent
user      3191  0.0  0.0  12728  2168 pts/5    S+   11:38   0:00 grep l3
10:38:10
$su
Password:
10:38:16
#l3-agent

10:38:18
#exit
exit
10:38:19
$pkill -1 l3-agent
pkill: killing pid 3254 failed: Operation not permitted
10:39:26
$dpkg -L isc-dhcp-server | gre
grep       gresource  greytiff
10:39:26
$dpkg -L isc-dhcp-server | gre
grep       gresource  greytiff
10:39:26
$dpkg -L isc-dhcp-server | grep /etc
/etc
/etc/init.d
/etc/init.d/isc-dhcp-server
/etc/dhcp
/etc/dhcp/dhcpd.conf
10:40:25
$vim /etc/dhcp/dhc
10:40:25
$vim /etc/dhcp/dhcpd.conf
10:44:44
$sudo vim /etc/dhcp/dhcpd.conf
10:44:56
$sudo vim /etc/dhcp/dhcpd.conf
10:45:01
$sudo vim /etc/dhcp/dhcpd.conf
10:45:25
$sudo vim /etc/dhcp/dhcpd.conf
10:45:43
$sudo vim /etc/dhcp/dhcpd.conf
10:45:50
$sudo vim /etc/dhcp/dhcpd.conf
10:45:53
$fg
# Hosts which require special configuration options can be listed in
# host statements.   If no address is specified, the address will be
# allocated dynamically (if possible), but the host-specific information
# will still come from the host declaration.
#host passacaglia {
#  hardware ethernet 0:0:c0:5d:bd:95;
#  filename "vmuni{.passacaglia";
#  server-name "toccata.fugue.com";
#}
                                                              69,2          54%
...
  range 192.168.80.200 192.168.80.250;
  option routers 192.168.80.1;
}
                                          {
# This declaration allows BOOTP clients to get dynamic addresses,
# which we don't really recommend.
}
#subnet 10.254.239.32 netmask 255.255.255.224 {
#  range dynamic-bootp 10.254.239.40 10.254.239.60;
"/etc/dhcp/dhcpd.conf" 107L, 3447C written
10:54:09
$sudo serv
servertool  service
10:54:09
$sudo service isc-dhcp-server
force-reload  restart       start         status        stop
10:54:09
$sudo service isc-dhcp-server sta
start   status
10:54:09
$sudo service isc-dhcp-server status
● isc-dhcp-server.service - LSB: DHCP server
   Loaded: loaded (/etc/init.d/isc-dhcp-server)
   Active: failed (Result: exit-code) since Tue 2016-03-29 11:39:24 MSK; 15min ago
Mar 29 11:39:22 asterick8 dhcpd[3692]: in your dhcpd.conf file for the netw...nt
Mar 29 11:39:22 asterick8 dhcpd[3692]: to which interface eth0 is attached. **
Mar 29 11:39:22 asterick8 dhcpd[3692]:
Mar 29 11:39:22 asterick8 dhcpd[3692]:
Mar 29 11:39:22 asterick8 dhcpd[3692]: Not configured to listen on any inte...s!
Mar 29 11:39:24 asterick8 isc-dhcp-server[3685]: Starting ISC DHCP server: d...!
Mar 29 11:39:24 asterick8 isc-dhcp-server[3685]: failed!
Mar 29 11:39:24 asterick8 systemd[1]: isc-dhcp-server.service: control proc...=1
Mar 29 11:39:24 asterick8 systemd[1]: Failed to start LSB: DHCP server.
Mar 29 11:39:24 asterick8 systemd[1]: Unit isc-dhcp-server.service entered ...e.
Hint: Some lines were ellipsized, use -l to show in full.
10:54:40
$sudo service isc-dhcp-server restart

10:55:51
$ps aux | grep dhcp
root      3973  0.0  0.1  28488  9496 ?        Ss   11:55   0:00 /usr/sbin/dhcpd -q -cf /etc/dhcp/dhcpd.conf -pf /var/run/dhcpd.pid
user      3996  0.0  0.0  12728  2116 pts/3    S+   11:56   0:00 grep dhcp
10:58:08
$cat /var/lib/dhcp/dhc
dhclient.leases  dhcpd.leases     dhcpd.leases~
10:58:08
$cat /var/lib/dhcp/dhcpd.leases
# The format of this file is documented in the dhcpd.leases(5) manual page.
# This lease file was written by isc-dhcp-4.3.1
server-duid "\000\001\000\001\036\214\377\225lbmz\304\255";
lease 192.168.80.200 {
  starts 2 2016/03/29 08:57:12;
  ends 2 2016/03/29 09:07:12;
  cltt 2 2016/03/29 08:57:12;
  binding state active;
  next binding state free;
  rewind binding state free;
  hardware ethernet 34:e6:d7:57:b1:95;
  uid "\0014\346\327W\261\225";
  client-hostname "BLR-CPCCQ32";
}
10:59:24
$cat /var/lib/dhcp/dhcpd.leases
# The format of this file is documented in the dhcpd.leases(5) manual page.
# This lease file was written by isc-dhcp-4.3.1
server-duid "\000\001\000\001\036\214\377\225lbmz\304\255";
lease 192.168.80.200 {
  starts 2 2016/03/29 08:57:12;
  ends 2 2016/03/29 09:07:12;
  cltt 2 2016/03/29 08:57:12;
  binding state active;
  next binding state free;
  rewind binding state free;
...
  starts 2 2016/03/29 09:02:12;
  ends 2 2016/03/29 09:12:12;
  cltt 2 2016/03/29 09:02:12;
  binding state active;
  next binding state free;
  rewind binding state free;
  hardware ethernet 34:e6:d7:57:b1:95;
  uid "\0014\346\327W\261\225";
  client-hostname "BLR-CPCCQ32";
}
11:02:32
$cat /var/lib/dhcp/dhcpd.leases
# The format of this file is documented in the dhcpd.leases(5) manual page.
# This lease file was written by isc-dhcp-4.3.1
server-duid "\000\001\000\001\036\214\377\225lbmz\304\255";
lease 192.168.80.200 {
  starts 2 2016/03/29 08:57:12;
  ends 2 2016/03/29 09:07:12;
  cltt 2 2016/03/29 08:57:12;
  binding state active;
  next binding state free;
  rewind binding state free;
...
  starts 2 2016/03/29 09:02:12;
  ends 2 2016/03/29 09:12:12;
  cltt 2 2016/03/29 09:02:12;
  binding state active;
  next binding state free;
  rewind binding state free;
  hardware ethernet 34:e6:d7:57:b1:95;
  uid "\0014\346\327W\261\225";
  client-hostname "BLR-CPCCQ32";
}
11:03:27
$sudo apt-get install nmap
Reading package lists... Done
Building dependency tree
Reading state information... Done
nmap is already the newest version.
nmap set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
/dev/pts/4
11:03:49
$su
Password:
11:04:12
#vim /etc/ssh/sshd_config
11:04:18
$nmap
Nmap 6.47 ( http://nmap.org )
Usage: nmap [Scan Type(s)] [Options] {target specification}
TARGET SPECIFICATION:
  Can pass hostnames, IP addresses, networks, etc.
  Ex: scanme.nmap.org, microsoft.com/24, 192.168.0.1; 10.0.0-255.1-254
  -iL <inputfilename>: Input from list of hosts/networks
  -iR <num hosts>: Choose random targets
  --exclude <host1[,host2][,host3],...>: Exclude hosts/networks
  --excludefile <exclude_file>: Exclude list from file
HOST DISCOVERY:
...
  --send-eth/--send-ip: Send using raw ethernet frames or IP packets
  --privileged: Assume that the user is fully privileged
  --unprivileged: Assume the user lacks raw socket privileges
  -V: Print version number
  -h: Print this help summary page.
EXAMPLES:
  nmap -v -A scanme.nmap.org
  nmap -v -sn 192.168.0.0/16 10.0.0.0/8
  nmap -v -iR 10000 -Pn -p 80
SEE THE MAN PAGE (http://nmap.org/book/man.html) FOR MORE OPTIONS AND EXAMPLES
11:04:23
$nmap 192.168.80.0/24 -p 22
Starting Nmap 6.47 ( http://nmap.org ) at 2016-03-29 12:04 MSK
Nmap scan report for 192.168.80.1
Host is up (0.00037s latency).
PORT   STATE SERVICE
22/tcp open  ssh
Nmap scan report for asterick8.unix.sl (192.168.80.2)
Host is up (0.00019s latency).
PORT   STATE SERVICE
22/tcp open  ssh
Nmap scan report for 192.168.80.200
Host is up (0.0012s latency).
PORT   STATE    SERVICE
22/tcp filtered ssh
Nmap scan report for 192.168.80.201
Host is up (0.0032s latency).
PORT   STATE  SERVICE
22/tcp closed ssh
Nmap done: 256 IP addresses (4 hosts up) scanned in 2.67 seconds
11:04:50
$nmap 192.168.80.0/24 -p 22
Starting Nmap 6.47 ( http://nmap.org ) at 2016-03-29 12:05 MSK
Nmap scan report for 192.168.80.1
Host is up (0.00030s latency).
PORT   STATE SERVICE
22/tcp open  ssh
Nmap scan report for asterick8.unix.sl (192.168.80.2)
Host is up (0.00016s latency).
PORT   STATE SERVICE
22/tcp open  ssh
Nmap scan report for 192.168.80.200
Host is up (0.00049s latency).
PORT   STATE    SERVICE
22/tcp filtered ssh
Nmap scan report for 192.168.80.201
Host is up (0.0021s latency).
PORT   STATE  SERVICE
22/tcp closed ssh
Nmap done: 256 IP addresses (4 hosts up) scanned in 3.00 seconds
11:05:29
$nmap 192.168.80.0/24
Starting Nmap 6.47 ( http://nmap.org ) at 2016-03-29 12:06 MSK
Nmap scan report for 192.168.80.1
Host is up (0.00021s latency).
Not shown: 995 closed ports
PORT     STATE SERVICE
22/tcp   open  ssh
80/tcp   open  http
111/tcp  open  rpcbind
6000/tcp open  X11
9999/tcp open  abyss
...
80/tcp   open  http
443/tcp  open  https
1947/tcp open  sentinelsrm
4445/tcp open  upnotifyp
Nmap scan report for 192.168.80.201
Host is up (0.021s latency).
Not shown: 999 closed ports
PORT   STATE SERVICE
80/tcp open  http
Nmap done: 256 IP addresses (4 hosts up) scanned in 6.41 seconds
11:06:13
$man nm
11:06:13
$man nmap
11:07:53
$arp -an
bash: arp: command not found
11:07:59
$sudo arp -an
? (192.168.80.1) at 6c:62:6d:7a:c2:cc [ether] on eth0
? (192.168.80.200) at 34:e6:d7:57:b1:95 [ether] on eth0
? (192.168.80.201) at 00:0e:08:d0:0e:dd [ether] on eth0
11:08:03
$sudo time arp -an
sudo: time: command not found
11:08:19
$time arp -an
bash: arp: command not found
real    0m0.001s
user    0m0.000s
sys     0m0.000s
11:08:22
$time arp -an
bash: arp: command not found
real    0m0.003s
user    0m0.000s
sys     0m0.000s
11:08:29
$su
Password:
11:08:39
#time arp -an
? (192.168.80.1) at 6c:62:6d:7a:c2:cc [ether] on eth0
? (192.168.80.200) at 34:e6:d7:57:b1:95 [ether] on eth0
? (192.168.80.201) at 00:0e:08:d0:0e:dd [ether] on eth0
real    0m0.002s
user    0m0.000s
sys     0m0.000s
11:08:49
#time
real    0m0.000s
user    0m0.000s
sys     0m0.000s
11:10:27
#man time
11:10:57
#apt-get install asterisk
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  asterisk-config asterisk-core-sounds-en asterisk-core-sounds-en-gsm
  asterisk-modules asterisk-moh-opsound-gsm asterisk-voicemail freetds-common
  libcfg4 libcoroipcc4 libcpg4 libcurl3 libfreeradius-client2 libiksemel3
  libodbc1 libpj2 libpjlib-util2 libpjmedia-audiodev2 libpjmedia-codec2
  libpjmedia-videodev2 libpjmedia2 libpjnath2 libpjsip-simple2 libpjsip-ua2
  libpjsip2 libpjsua2 libpq5 libresample1 libsensors4 libsnmp-base libsnmp30
...
Adding user `asterisk' to group `audio' ...
Adding user asterisk to group audio
Done.
Setting up asterisk-voicemail (1:11.13.1~dfsg-2+b1) ...
Setting up libsox-fmt-alsa:amd64 (14.4.1-5) ...
Setting up libsox-fmt-base:amd64 (14.4.1-5) ...
Setting up sox (14.4.1-5) ...
Setting up asterisk-moh-opsound-gsm (2.03-1) ...
Processing triggers for libc-bin (2.19-18+deb8u3) ...
Processing triggers for systemd (215-17+deb8u3) ...
11:13:03
#ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0 110768  5084 ?        Ss   10:19   0:00 /sbin/init
root         2  0.0  0.0      0     0 ?        S    10:19   0:00 [kthreadd]
root         3  0.0  0.0      0     0 ?        S    10:19   0:00 [ksoftirqd/0]
root         5  0.0  0.0      0     0 ?        S<   10:19   0:00 [kworker/0:0H]
root         7  0.0  0.0      0     0 ?        S    10:19   0:02 [rcu_sched]
root         8  0.0  0.0      0     0 ?        S    10:19   0:00 [rcu_bh]
root         9  0.0  0.0      0     0 ?        S    10:19   0:00 [migration/0]
root        10  0.0  0.0      0     0 ?        S    10:19   0:00 [watchdog/0]
root        11  0.0  0.0      0     0 ?        S    10:19   0:00 [watchdog/1]
...
root      4163  0.0  0.0  22092  3996 pts/6    Ss+  12:04   0:00 bash
root      4204  0.0  0.0      0     0 ?        S    12:04   0:00 [kworker/1:1]
root      4339  0.0  0.0  56936  3460 pts/3    S+   12:08   0:00 su
root      4340  0.0  0.0  16268  2068 pts/3    S+   12:08   0:00 script -f -c ba
root      4371  0.0  0.0  16272   156 pts/3    S+   12:08   0:00 script -f -c ba
root      4372  0.0  0.0  22100  4032 pts/7    Ss   12:08   0:00 bash
root      4401  0.0  0.0      0     0 ?        S    12:09   0:00 [kworker/1:0]
asterisk  6084  1.3  0.5 1741936 43408 ?       Ssl  12:12   0:00 /usr/sbin/aster
asterisk  6085  0.0  0.0  14588  1492 ?        S    12:12   0:00 astcanary /var/
root      6160  0.0  0.0  19100  2452 pts/7    R+   12:13   0:00 ps aux
11:13:39
#ps aux | grep aster*
avahi      427  0.0  0.0  32232  2780 ?        Ss   10:19   0:00 avahi-daemon: running [asterick8.local]
asterisk  6084  1.1  0.5 1741936 43408 ?       Ssl  12:12   0:00 /usr/sbin/asterisk -p -U asterisk
asterisk  6085  0.0  0.0  14588  1492 ?        S    12:12   0:00 astcanary /var/run/asterisk/alt.asterisk.canary.tweet.tweet.tweet 6084
root      6169  0.0  0.0  12732  2244 pts/7    S+   12:13   0:00 grep aster*
11:13:49
#dpkg -L asterisk
/.
/var
/var/lib
/var/lib/asterisk
/var/lib/asterisk/moh
/var/lib/asterisk/sounds
/var/lib/asterisk/sounds/custom
/var/spool
/var/spool/asterisk
/var/spool/asterisk/dictate
...
/usr/sbin/astgenkey
/usr/sbin/smsq
/usr/sbin/aelparse
/usr/sbin/autosupport
/usr/sbin/astdb2sqlite3
/usr/sbin/astdb2bdb
/usr/share/asterisk/sounds/recordings
/usr/share/asterisk/sounds/custom
/usr/share/man/man8/rasterisk.8.gz
/usr/sbin/rasterisk
прошло 14 минут
11:27:50
#dpkg -L asterisk | grep /etc
/etc
/etc/logrotate.d
/etc/logrotate.d/asterisk
/etc/asterisk
/etc/init.d
/etc/init.d/asterisk
/etc/default
/etc/default/asterisk
/dev/pts/2
11:29:20
$cd /etc/asterisk/

11:29:29
$ls
acl.conf                 config_test.conf        ooh323.conf
adsi.conf                console.conf            osp.conf
agents.conf              dbsep.conf              oss.conf
alarmreceiver.conf       dnsmgr.conf             phone.conf
alsa.conf                dsp.conf                phoneprov.conf
amd.conf                 dundi.conf              queuerules.conf
app_mysql.conf           enum.conf               queues.conf
app_skel.conf            extconfig.conf          res_config_mysql.conf
asterisk.adsi            extensions.ael          res_config_sqlite3.conf
asterisk.conf            extensions.conf         res_config_sqlite.conf
...
cel_pgsql.conf           manager.conf            smdi.conf
cel_sqlite3_custom.conf  manager.d               telcordia-1.adsi
cel_tds.conf             meetme.conf             udptl.conf
chan_dahdi.conf          mgcp.conf               unistim.conf
chan_mobile.conf         minivm.conf             users.conf
cli_aliases.conf         misdn.conf              voicemail.conf
cli.conf                 modules.conf            vpb.conf
cli_permissions.conf     motif.conf              xmpp.conf
codecs.conf              musiconhold.conf
confbridge.conf          muted.conf
11:29:31
$dpkg -L mc
/.
/etc
/etc/mc
/etc/mc/mc.menu.sr
/etc/mc/mc.keymap
/etc/mc/mcedit.menu
/etc/mc/mc.emacs.keymap
/etc/mc/filehighlight.ini
/etc/mc/mc.menu
/etc/mc/edit.indent.rc
...
/usr/share/lintian
/usr/share/lintian/overrides
/usr/share/lintian/overrides/mc
/usr/bin/mcview
/usr/bin/mcdiff
/usr/bin/mcedit
/usr/share/mc/bin/mc-wrapper.csh
/usr/share/mc/bin/mc.csh
/usr/share/mc/bin/mc-wrapper.sh
/usr/share/mc/bin/mc.sh
11:30:49
$dpkg -L asterisk | less
прошло 17 минут
11:48:03
$sudo apt-get install asterisk-dahdi
[sudo] password for user:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  dahdi dahdi-linux fxload libopenr2-3 libpri1.4 libss7-1 libtonezone2.0
The following NEW packages will be installed:
  asterisk-dahdi dahdi dahdi-linux fxload libopenr2-3 libpri1.4 libss7-1
  libtonezone2.0
0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded.
...
Processing triggers for systemd (215-17+deb8u3) ...
Setting up fxload (0.0.20081013-1) ...
Setting up dahdi-linux (1:2.10.0.1~dfsg-1) ...
Setting up dahdi (1:2.10.0.1-1) ...
Setting up libopenr2-3 (1.3.3-1) ...
Setting up libpri1.4 (1.4.15-1) ...
Setting up libss7-1 (1.0.2-5) ...
Setting up libtonezone2.0:amd64 (1:2.10.0.1-1) ...
Setting up asterisk-dahdi (1:11.13.1~dfsg-2+b1) ...
Processing triggers for libc-bin (2.19-18+deb8u3) ...
11:48:35