0%

常用正则表达式

1
([0-9]{1,3}[\.]){3}[0-9]{1,3}
1
2
(\<([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\>\.){3}\<([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\>

可攻击

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
211.71.232.42
211.71.232.43
211.71.232.54
211.71.232.55
211.71.232.132
211.71.232.133
211.71.232.134
211.71.232.135
211.71.232.136
211.71.232.137
211.71.232.138
211.71.232.139
211.71.232.140
211.71.232.141
211.71.232.142
211.71.232.143
211.71.232.144
211.71.232.147
211.71.232.148
211.71.232.156
211.71.232.157
检测结果
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
[-] 211.71.232.42:445     - Host does NOT appear vulnerable.
[-] 211.71.232.54:445 - Host does NOT appear vulnerable.
[*] Scanned 3 of 21 hosts (14% complete)
[+] 211.71.232.132:445 - Host is likely VULNERABLE to MS17-010! - Windows 7 Ultimate 7601 Service Pack 1 x86 (32-bit)
[*] Scanned 5 of 21 hosts (23% complete)
[-] 211.71.232.133:445 - Host does NOT appear vulnerable.
[*] Scanned 7 of 21 hosts (33% complete)
[+] 211.71.232.135:445 - Host is likely VULNERABLE to MS17-010! - Windows Server 2003 3790 Service Pack 2 x86 (32-bit)
[*] Scanned 9 of 21 hosts (42% complete)
[-] 211.71.232.137:445 - Host does NOT appear vulnerable.
[-] 211.71.232.138:445 - Host does NOT appear vulnerable.
[*] Scanned 11 of 21 hosts (52% complete)
[+] 211.71.232.139:445 - Host is likely VULNERABLE to MS17-010! - Windows Server 2003 3790 Service Pack 2 x86 (32-bit)
[*] Scanned 13 of 21 hosts (61% complete)
[+] 211.71.232.141:445 - Host is likely VULNERABLE to MS17-010! - Windows Server 2008 R2 Enterprise 7601 Service Pack 1 x64 (64-bit)
[+] 211.71.232.142:445 - Host is likely VULNERABLE to MS17-010! - Windows Server 2008 R2 Enterprise 7601 Service Pack 1 x64 (64-bit)
[*] Scanned 15 of 21 hosts (71% complete)
[+] 211.71.232.143:445 - Host is likely VULNERABLE to MS17-010! - Windows Server 2008 R2 Enterprise 7601 Service Pack 1 x64 (64-bit)
[*] Scanned 17 of 21 hosts (80% complete)
[+] 211.71.232.147:445 - Host is likely VULNERABLE to MS17-010! - Windows 7 Ultimate 7601 Service Pack 1 x64 (64-bit)
[*] Scanned 19 of 21 hosts (90% complete)
[+] 211.71.232.156:445 - Host is likely VULNERABLE to MS17-010! - Windows Server 2008 R2 Enterprise 7601 Service Pack 1 x64 (64-bit)
[*] Scanned 21 of 21 hosts (100% complete)
[*] Auxiliary module execution completed

1
2
3
4
5
6
7
8
9
divint3@Divint3:~$ cat 123.txt | grep "MS17-010" | egrep -o  "(\<([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\>\.){3}\<([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\>" | uniq >> 123.txt

211.71.232.135
211.71.232.139
211.71.232.141
211.71.232.142
211.71.232.143
211.71.232.147
211.71.232.156
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/bash
for i in $(seq 5)
do
useradd user$i -m
echo "创建用户成功"
echo "user$i" | passwd --stdin &> /dev/null
echo "更新密码成功"

userdel -r user$i
echo "删除成功"

done
1
2
3
4
条件表达式
使用[ ]


1
2
3
4
5
6
7
useradd user1 -m &> /dev/null
if($? -ne 0 )
do
echo "user1" | passwd --stdin user1
done


1
2
! id user && useradd -m user || echo "user exists"

1
2
3
4
5
6
7
8
9
10
11
12
逻辑与
&&
逻辑或
||
或与运算
[逻辑式] 逻辑与 [ 逻辑式 ] 逻辑或 [式子]


1 && echo "user exisit" || useradd
id user1 && useradd user1 || echo "user1 exisit"


1
2
3
4
5
6
7
8
9
10
11
if 判断条件; then 
else



else


fi


1
2
3
#!/bin/bash
COUNT=`cat /etc/passwd | grep "/bin/bash" | wc -l`
echo "$COUNT"
1
2
3
4
#!/bin/bash

cat /etc/inittab | grep ^$ | wc -l
echo $?
1
2
3
#!/bin/bash
UID1=`cat /etc/passwd | grep $USER | cut -d: -f3`
echo $UID1
恰饭,恰饭