May 11, 2001 Lab 6 # Lock an account passwd -l user ########################################################## # wexx paper on awk: # http://www.ecis.com/~wexx/UNIX/tutorials/awkintro.htm ########################################################## ################################################# # using passwd and shadow files from each class server # create user acounts for each user # in the class on our systems. ################################################# # cd to my download dir cd /usr/local/src/ # get the concatinted file from Gregs server ftp 10.4.1.230 lcd /usr/local/src/ ls -ltr get all.passwd get all.shadow quit # backup my old stuff cp /etc/shadow /etc/shadow.20010511.good cp /etc/passwd /etc/passwd.20010511.good # This is how I will make a list that does not include greg or I cat /etc/passwd |grep -v john |grep -v greg cat /etc/shadow |grep -v john |grep -v greg # Create a list of all the other users in the class people=`cat all.passwd |grep -v john |grep -v greg |awk -F: '{print $1}'` # For each name make an accout for them for person in $people do mkdir /home/$person; cp /etc/skell/* /home/$person; chown -R $person:staff /home/$person; chmod 700 /home/$person done ######################################## # crack install and get hooked ######################################## mkdir -p /usr/local/src # this is where we will store our custom programs. cd /usr/local/src # Get on gregs server, and download patches. ftp 10.4.1.230 ftp> anonymous Passwd: bla@bla.com ftp> bin # make transfer binary ftp> cd pub # ftp> mget c50a.tgz ftp> quit # Set the path, unzip, untar the package, and get in the package PATH=$PATH:/usr/local/bin gunzip -d c50a.tgz tar -xvpf c50a.tar cd c50a # Need to make some configuration settings vi Crack CC=gcc # -g =debug on, -O =optimization level, -W CFLAGS=" -g -O2 -Wall $C5FLAGS" LIBS=-lcrypt # Change the Makefile cd src/libdes vi Makefile # only CC and CFLAGS should be there. CC=gcc CFLAGS= -O4 -fomit-frame-pointer -funroll-loops $(OPTS) $(CFLAG) # for gmake, edit Crack, and change CRACK_PATH look at /usr/ccs/bin /usr/local/bin cd .. ./Crack -makeonly ./Crack -makedict # shadmrg.sv script and merge cd scripts vi shadmrg.sv ./shadmrg > merge.txt ./Crack merge.txt ./Reporter ###################3 # ssh stuff ################### #### cofind / -name tcpd.h cp tcpd.h /usr/local/src/ssh* cd /usr/local/src/ssh-1.2.27/ make clean solaris7_setup.anonymous.ftp.txt:/usr/local/bin/gzip -d tcp_wrappers_7.6.1.tar.gz solaris7_setup.anonymous.ftp.txt:tar -xvpf tcp_wrappers_7.6.1.tar solaris7_setup.anonymous.ftp.txt:cd tcp_wrappers_7.6.1 solaris7_setup.anonymous.ftp.txt-vi Makefile solaris7_setup.anonymous.ftp.txt-# uncomment REAL_DAEMON_DIR=/usr/sbin solaris7_setup.anonymous.ftp.txt-PATH=$PATH:/usr/css/bin:/usr/local/bin solaris7_setup.anonymous.ftp.txt-make sunos5 CC=/usr/local/bin/gcc cp /usr/local/bin/gzip -d tcp_wrappers_7.6.1/ibwrap.a /usr/local/src/ssh-1.2.27 ./configure --with-libwrap=./libwrap.a #################### # wu-ftp #################### #get it ./configure make make install default location is /usr/sbin, /usr/bin, /usr/man, and /etc # /etc/ftpaccess controls the server. # ftpconversions - allows user to add/delete file converisons. # works with .tar, .tar.gz, .tar.Z, etc # ftphosts - # ftpservers- makes virtual servers. # each server has a: # ftpaccess,ftpconverions, ftpusers, ftpgroups, ftphosts. # ftpwho = shows who is logged in # in.ftpd ftpdamon # ftshut - bring down ftpd # ftprestart - starts the server # ckconf - checks the config file # # var/adm/xfer - logs all activity # comment out ftpd in /etc/inetd.conf # start with /usr/sbin/in.ftpd -S # copy binarie (use ldd tar to find tar and others.) # get the wu-ftpd-2.6.1.tar tar -xvpf wu-ftpd-2.6.1.tar cd wu-ftpd-2.6.1 PATH=$PATH:/usr/ccs/bin ./configure make make install vi /etc/inetd.conf coment out ftp /usr/sbin/in.ftpd -s& netstat -a |grep ftp TCP Local Address Remote Address Swind Send-Q Rwind Recv-Q State -------------------------------------------------------------------------------------- *.ftp *.* 0 0 0 0 LISTEN # restrct access vi /etc/ftpaccess ############################## # /usr/sbin/in.ftpd -s ############################################# # reading doc files nrof -man /usr/local/src/wu-ftpd-2.6.1/doc/ftpd.8