PROGRAM
dhcpd.conf
----------------------------------------------------------------------------------
#
# DHCP Server Configuration file.
# see /usr/share/doc/dhcp/dhcpd.conf.example
# see dhcpd.conf(5) man page
subnet 192.168.17.0 netmask 255.255.255.0
{ range 192.168.17.1 192.168.17.20;
option domain-name-servers ns1.internal.example.org;
option domain-name "internal.example.org";
option routers 192.168.17.254;
option broadcast-address 192.168.17.255;
default-lease-time 10;
max-lease-time 7200;
}
Installation Steps:
----------------------------------------------------------------------------------
[root@localhost dhcp]# yum install dhcp
Loaded plugins: langpacks, refresh-packagekit
adobe-linux-x86_64 | 951 B 00:00
google-chrome | 951 B 00:00
home_Kenzy_packages | 1.6 kB 00:00
updates/20/x86_64/metalink | 5.8 kB 00:00
updates | 4.9 kB 00:00
(1/2): home_Kenzy_packages/primary | 176 kB 00:02
(2/2): updates/20/x86_64/primary_db | 13 MB 00:27
(1/3): google-chrome/primary | 1.9 kB 00:00
updates/20/x86_64/pkgtags FAILED
http://www.ftp.ne.jp/Linux/distributions/fedora/updates/20/x86_64/repodata/fd28bdf3e20f4e98d0358f64bd8a9719d9028d2e96ff081b2f097c33f3ac24a7-pkgtags.sqlite.gz: [Errno 14] HTTP Error 404 - Not Found
Trying other mirror.
(2/3): updates/20/x86_64/updateinfo | 1.8 MB 00:02
(3/3): updates/20/x86_64/pkgtags | 1.3 MB 00:02
google-chrome 3/3
home_Kenzy_packages 914/914
Package 12:dhcp-4.2.7-2.fc20.x86_64 already installed and latest version
Nothing to do
[root@localhost dhcp]# systemctl start dhcpd.service
[root@localhost dhcp]# systemctl enable dhcpd.service
[root@localhost dhcp]# chkconfig dhcpd on
Note: Forwarding request to 'systemctl enable dhcpd.service'.
[root@localhost dhcp]# service dhcpd restart
Redirecting to /bin/systemctl restart dhcpd.service
[root@localhost dhcp]#
#DHCP configuration settings
#
# DHCP Server Configuration file.
# see /usr/share/doc/dhcp/dhcpd.conf.example
# see dhcpd.conf(5) man page
subnet 192.168.17.0 netmask 255.255.255.0
{ range 192.168.17.1 192.168.17.20;
option domain-name-servers ns1.internal.example.org;
option domain-name "internal.example.org";
option routers 192.168.17.254;
option broadcast-address 192.168.17.255;
default-lease-time 10;
max-lease-time 7200;
}
#No. of clients connected to DHCP Server
[root@localhost dhcp]# arp
Address HWtype HWaddress Flags Mask Iface
192.168.17.11 ether ec:88:92:b0:7d:eb C p1p1
192.168.17.12 (incomplete) p1p1
192.168.17.14 (incomplete) p1p1
192.168.17.8 ether c0:18:85:c1:ed:71 C p1p1
192.168.17.1 ether c8:1f:66:05:8a:08 C p1p1
192.168.17.13 (incomplete) p1p1
192.168.17.10 ether e4:d5:3d:89:0c:13 C p1p1
192.168.17.15 (incomplete) p1p1
[root@localhost dhcp]#
abc.py
----------------------------------------------------------------------------------
import os
os.system("arp")
os.system("scp /home/exam10/Documents/crafter-0.2.tar.gz root@192.168.17.1:/root/Workspace/3208")
os.system("scp /home/exam10/qwe.py root@192.168.17.1:/root/Workspace/3208")
os.system("ssh root@192.168.17.1 cd Workspace/3208 python qwe.py")
qwe.py
----------------------------------------------------------------------------------
import os
os.system("tar -xvf crafter-0.2.tar.gz")
os.system("cd crafter-0.2")
os.system("./configure")
os.system("./autogen.sh")
os.system("make")
os.system("make install")
os.system("ldconfig")
OUTPUT
[root@localhost exam10]# python abc.py
Address HWtype HWaddress Flags Mask Iface
192.168.17.14 (incomplete) p1p1
192.168.17.1 ether c8:1f:66:05:8a:08 C p1p1
192.168.17.9 ether 18:dc:56:f0:3c:ce C p1p1
192.168.17.17 ether d0:b3:3f:c2:20:e2 C p1p1
192.168.17.8 ether c0:18:85:c1:ed:71 C p1p1
192.168.17.16 ether c4:50:06:0c:38:99 C p1p1
192.168.17.3 ether b8:c6:8e:46:fe:01 C p1p1
192.168.17.11 (incomplete) p1p1
192.168.17.19 (incomplete) p1p1
192.168.17.2 (incomplete) p1p1
192.168.17.10 ether e4:d5:3d:89:0c:13 C p1p1
192.168.17.18 (incomplete) p1p1
192.168.17.5 ether 9c:65:b0:9e:43:23 C p1p1
192.168.17.13 ether 30:39:26:91:47:8d C p1p1
192.168.17.4 (incomplete) p1p1
192.168.17.12 (incomplete) p1p1
192.168.17.7 ether 14:1a:a3:9b:a3:26 C p1p1
192.168.17.15 (incomplete) p1p1
192.168.17.6 (incomplete) p1p1
root@192.168.17.1's password:
crafter-0.2.tar.gz 100% 377KB 377.3KB/s 00:00
root@192.168.17.1's password:
qwe.py 100% 196 0.2KB/s 00:00
root@192.168.17.1's password:
[root@localhost exam10]# ls
1.c~ 3304 a3.java~ Desktop Downloads http.cpp~ Public sniffer.cpp~ tp.sh xyz.py
3105 3344 abc.py dhcp.conf encog-examples-3.2.0 keval.cpp~ pypcap-1.1.tar.gz sniff.py~ tp.sh~ xyz.py~
3204 444 abc.py~ dhcp.conf~ http1.cpp~ Music qwe.py STL_3143 Videos
3244 a2.py~ Chinmay Documents http2.cpp~ Pictures qwe.py~ Templates workspace
[root@localhost exam10]# cd Workspace
bash: cd: Workspace: No such file or directory
[root@localhost exam10]# exit
exit
Cant see imgs clearly
ReplyDelete