批量创建用户名脚本:

 #########################################################################
# 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. 编写javascript的基本技巧一

    自己从事前端编码也有两年有余啦,时间总是比想象中流逝的快.岁月啊,请给我把时间的 脚步停下吧.不过,这是不可能的,我在这里不是抒发时间流逝的感慨.而是想在这分享两 年来码农生活的一些javascrip ...

  2. (转)jquery仿天猫商城左侧导航菜单

    原文地址:http://www.cnblogs.com/WinKi/p/3398824.html 之前看到有博友写了一个仿天猫商城左侧导航菜单,可惜不提供免费下载,也没有代码.以前自己也写过类似的效果 ...

  3. MVC Action控制方式

    1.Controller 的OnActionExecuting中控制 protected override void OnActionExecuting(ActionExecutingContext ...

  4. windows phone 8 新增功能:从一个应用程序启动另一个程序(file association 和 Protocol association两种方式)

    一. 启动手机预装内置程序打开文件file association 这里以打开word文档为例子 string fileToLaunch = @"HelloKitty.docx"; ...

  5. docker 镜像 容器删除

    Docker 容器镜像删除   1.停止所有的container,这样才能够删除其中的images: docker stop $(docker ps -a -q) 如果想要删除所有container的 ...

  6. .Net Core 项目部署IIS简单步骤

    1.新建一个解决方案: 我习惯会把运行文件移至一级目录 然后清除CoreTest 文件夹里面的文件 2.在解决方案中新建一个项目 点击确认有,这里有几种选择类型,我一般选择空类型(这里需要注意一下,空 ...

  7. WPF的Image控件图片不能显示出来的问题探究

    在wpf项目中,用Image来显示资源图片,在界面是可以显示,但是在运行的时候却显示不出来. <Image Source=" HorizontalAlignment="Lef ...

  8. whisper简介

    以太坊系列之二十 以太坊中的基础应用whisper 以太坊系列之二十 以太坊中的基础应用whisper 1 whisper介绍 2 whisper rpc模块 3 whisper中的消息 4 消息的加 ...

  9. 个人常用Markdow语法代码备用

    1.分隔线 -------------------------------- 2.OC代码 ``` Objective-C ``` 3.字体加粗 ##加粗## 4.标题样式 <h1> &l ...

  10. uoj#344. 【清华集训2017】我的生命已如风中残烛(计算几何)

    题面 传送门 题解 orzxyx 首先我们发现,一个点如果被到达大于一次,那么这个点肯定在一个环上.所以在不考虑环的情况下每个点只会被到达一次,那么我们就可以直接暴力了 简单来说,我们对每个点\(i\ ...