批量创建用户名脚本:

 #########################################################################
# File Name: create-user.sh
# Author: kingle
# Mail: kingle122@vip.qq.com
# Created Time: Mon 06 Aug 2018 04:17:12 PM CST
#########################################################################
#!/bin/bash
user="kingle"
passfile="./passwd.txt"
for i in `seq -w `
do
useradd $user$i
"`echo "$RANDOM"|md5sum|cut -c5-15`" = pass
echo "$pass"|passwd --stdin $user$num
echo -e "user:$user$num\tpasswd:$pass" >>$passfile
done
echo --------------------------ok--------------------
cat $passfile

批量删除用户:

#########################################################################
# File Name: deluser.sh
# Author: kingle
# Mail: kingle122@vip.qq.com
# Created Time: Mon 06 Aug 2018 04:17:12 PM CST
######################################################################### #!/bin/sh
for user in kingle{..}
do
userdel -r $user
echo "delete $user is ok"
done

扫描内网存活主机

 #########################################################################
# File Name: scan_ip.sh
# Author: kingle
# Mail: kingle122@vip.qq.com
# Created Time: Mon 06 Aug 2018 04:17:12 PM CST
#########################################################################
#!/bin/bash
Ip_file=./scan_ip.txt
>$Ip_file
for i in 10.0..{..}
do
ping -c -W $i &>/dev/null && \
if [ $? -eq ];then
echo "chunzhu: $i" &>>$Ip_file fi &
done
echo "hahhahah:"

nmap扫描:

 #########################################################################
# File Name: namp.sh
# Author: kingle
# Mail: kingle122@vip.qq.com
# Created Time: Mon 06 Aug 2018 04:17:12 PM CST
#########################################################################
#!/bin/bash
CMD="nmap -sP"
IP="10.0.0.0/24"
CMD2="nmap -sS"
$CMD $IP|awk '/Nmap scan report for/ {print $NF}'

测试网站通否:

 #########################################################################
# File Name: test——url.sh
# Author: kingle
# Mail: kingle122@vip.qq.com
# Created Time: Mon 06 Aug 2018 04:17:12 PM CST
#########################################################################
#!/bin/bash
. /etc/init.d/functions
check_count=
url_list=(
http://10.0.0.200
http://10.0.0.201
http://10.0.0.202
http://www.baidu.com
)
function wait(){
echo -n 'waitting 3 misth--------';
for ((i=;i<;i++))
do
echo -n ".";sleep
done
echo
}
function check_url(){
wait
for ((i=; i<`echo ${#url_liset[*]}`; i++))
do
wget -o /dev/null -T --tries= --spider ${url_list[$i]} >/dev/null
if [ $? -eq ]
then
action "${url_list[$i]}" /bin/true
else
action "${url_list[$i]}" /bin/false
fi
done
((check_count++)) }
main(){
while true
do
check_url
echo "-------check count:${check_count}"
sleep
done
}
main

IPddos:

 #########################################################################
# File Name: namp.sh
# Author: kingle
# Mail: kingle122@vip.qq.com
# Created Time: Mon 06 Aug 2018 04:17:12 PM CST
#########################################################################
#!/bin/bash
file=$
JudgeExt(){
if expr "$1" : ".*\.log" &>/dev/null
then
:
else
echo $"usage:$0 *.log"
exit
fi
}
IpCount(){
grep "ESTABLISHED" $|awk -F "[ :]+" '{ ++S[$(NF-3)]}END {for(key in S)print S[key],key}'|sort -rn -k1|head - >/tmp/tmp.log
}
ipt (){
local ip=$
if [ `iptables -L -n|grep "$ip"|wc -l` -lt ]
then
iptables -I INPUT -s $ip -j DROP
echo "$line is dropped" >>/tmp/droplist_$(date +%F).log
fi
}
main(){
JudgeExt $file
while true
do
IpCount $file
while read line
do
ip=`echo $line |awk `{print $}``
count=`echo $line|awk '{print $1}'`
if [ $count -gt ]
then
ipt $ip
fi
done</tmp/tmp.log
sleep
done
}
main

shell的常用脚本一的更多相关文章

  1. shell常用脚本

    shell常用脚本 author:headsen chen  2017-10-17 15:36:17 个人原创,转载请注明,否则依法追究法律责任 1,vim  name.grep.sh 2,cat   ...

  2. 常用脚本语言Perl,Python,Ruby,Javascript一 Perl,Python,Ruby,Javascript

    常用脚本语言Perl,Python,Ruby,Javascript一 Perl,Python,Ruby,Javascript Javascript现阶段还不适合用来做独立开发,它的天下还是在web应用 ...

  3. shell中常用的特殊符号

    在shell中常用的特殊符号罗列如下: # ; ;; . , / \ 'string'| ! $ ${} $? $$ $* "string"* ** ? : ^ $# $@ `co ...

  4. Bash Shell启动配置脚本的顺序

    1.Bash检查环境变量文件的方式,取决于系统运行Shell的方式,通常系统运行Shell有3种方式: )通过系统用户登陆后默认运行的Shell )非登陆交互式运行Shell )执行脚本运行非交互式S ...

  5. Shell编程-01-Shell脚本初步入门

    目录 什么是Shell 什么是Shell脚本 Shell脚本语言的种类 常用操作系统默认Shell Shell 脚本的建立和执行 脚本规范 什么是Shell     简单来说Shell其实就是一个命令 ...

  6. linux Shell中常用的条件判断

    linux Shell中常用的条件判断 -b file            若文件存在且是一个块特殊文件,则为真 -c file            若文件存在且是一个字符特殊文件,则为真 -d ...

  7. 生产力工具:shell 与 Bash 脚本

    生产力工具:shell 与 Bash 脚本 作者:吴甜甜 个人博客网站: wutiantian.github.io 注意:本文只是我个人总结的学习笔记,不适合0基础人士观看. 参考内容: 王顶老师 l ...

  8. oracle 常用脚本以及语句

    oracle 常用脚本以及语句 一.oracle 安装10G 单机初始化环境: #!/bin/bash #关闭selinuxsed -i 's\SELINUX=enforcing\SELINUX=di ...

  9. -Shell 教程 Bash 脚本 基础语法 MD

    目录 目录 Shell 简介 Shell 脚本 Shell 环境 第一个shell脚本 Shell 变量 定义变量 使用变量 只读变量 删除变量 Shell 字符串 单引号 双引号 字符串基本操作 S ...

随机推荐

  1. Java IO输入输出流 字符数组流 ByteArrayOutputStream/ByteArrayInputStream

    private static void StringWriterAndReader() throws Exception { //字符串流(字符串的内存流) //字符串输入流 StringWriter ...

  2. css3的那些高级选择器一

    css大家都不陌生了,从1996年12月css1正式推出,经历了1998年5月css2,再到2004年2月css2.1,最后一直到2010年推出的css3.css的推出给web带来巨大 的改变,使我们 ...

  3. jeecms如何迭代list集合

    [@cms_channel_list][#list tag_list as a ]${a.name} [/#list][/@cms_channel_list]使用[XXX_list] 参数为 tag_ ...

  4. ApplicationContex是干啥的

    ApplicationContext就是一个百宝箱 ApplicationContext是Spring的核心,Context我们通常解释为上下文环境,我想用“容器”来表述它更容易理解一些,Applic ...

  5. React学习笔记3

    React的生命周期   生命周期分为三个阶段   1.mounted(初始化的时候) 当我们看见页面元素从JSX变成了DOM节点时,React组件已经被载入(mounted)到页面中了   2.up ...

  6. 以太坊系列之二: 单调时间monotime-以太坊源码学习

    在程序中需要测量时间时最好使用monotime.Now()而不是time.Now(),相比之下前者更准确. 来个示例: func main() { var start, elapsed time.Du ...

  7. 苹果开发者账号提示“Unable to verify mobile phone number”的解决方案

    在注册苹果开发者账号时,会提示:"Unable to verify mobile phone number.".顾名思义,没有有效的手机号码. 解决方案: 进入到Your Appl ...

  8. [SinGuLaRiTy] 2017 百度之星程序设计大赛 复赛

    [SinGuLaRiTy-1038] Copyright (c) SinGuLaRiTy 2017. All Rights Reserved. Arithmetic of Bomb Problem D ...

  9. python-webdriver库之Keys

    在使用webdriver时,有些时候我们需要做一些键盘上特殊键的操作,例如backspace,ctrl,shift等,这个时候就需要用到webdriver.common.keys.Keys方法来进行 ...

  10. [agc008f] Black Radius 树形dp

    Description ​ 给你一棵有NN个节点的树,节点编号为11到NN,所有边的长度都为11 ​ "全"对某些节点情有独钟,这些他喜欢的节点的信息会以一个长度为NN的字符串ss ...