1. Batch generation of random character file name cases
Use the For loop to bulk create 10 HTML files in the/sixijie directory, where each file needs to contain 10 random lowercase characters plus a fixed string sxj, with the following name examples:
[Email protected] ~]# ls/sixijie4gh7wbjzlz_sxj.html g1xnfa7itn_sxj.html jlfs4jzxht_sxj.html qn6lixyyae_sxj.html SNts qalfjw_sxj.html lG4JkU3dYv_sxj.htmlf36PdmohfI_sxj.html jboriq2wzz_sxj.html sdvwwl7wx0_sxj.html tx7bi+8myp_sxj.html
2. Batch renaming special cases
Change the SXJ string in the result file name in the first question to Sixijie (preferably with a For loop), and change the extension HTML all to uppercase.
3. Batch Create special requirement user case
Create 10 System Account test01-test10 and set a password
4. Scan Live host case in Network
Write a shell script to determine what IP is currently online in the 10.0.0.0/24 network.
5. Solve the Dos attack production case
Write a shell script to solve a Dos attack production case
The topic originates from the network
1.sh#!/bin/bash# Batch generation of random character file name case# Author Sixijiemkdir/sixijie &>/dev/nullfor ((i=1;i<=10;i++));d o pre=$ (OpenSSL rand | base64 | sed ' s/\\/1/g ' | sed ' s/\//2/g ' | head-c) Touc H/sixijie/${pre}_sxj.htmldone
2.sh#!/bin/bash# Batch Rename Special case# Author sixijiecd/sixijiefor i in ' Ls/sixijie '; Do pre=$ (echo $i | awk-f ' _ ' {printf $} ') MV $i ${pre}_sixijie. Htmldone
3.sh#!/bin/bash# Batch Create special requirements User case# Author sixijiepassword=$ (cat/dev/urandom | sed ' s/[^a-za-z0 -9]//g ' | Strings-n 5 | Head-n 1) for i in {1..10}; Do useradd test$i echo $password | passwd test$i--stdindone
4.sh#!/bin/bash# Scanning network Memory Live host case# Author sixijiefor i in {1..10}; Do ping-c 1-w 1 10.0.0. $i &>/dev/null res=$ (echo $?) If [$res-eq 0]; Then echo "10.0.0. $i oneline" Else echo "10.0.0. $i dead" Fidone
5.sh#!/bin/bash# Solve The production case of DOS attack# Author sixijiefor i in $ (NETSTAT-ANP | grep-i ': "| grep-i ' Established ' | awk ' {print $} ' | Cut-d:-f1 | Sort | uniq-c | awk ' {if ($1>30) {print $}} ') do iptables-a input-p tcp-s $i-j dropdone
This article is from the "Homecoming" blog, make sure to keep this source http://sixijie123.blog.51cto.com/11880770/1880332
Shell Combat (1)