ねもぷらす

ふぁいんでぃんぐねもの日記。プログラミングとか育児とか

 便利なコマンド「uniq」

secure監視に Perl スクリプトを書いてましたが、必要ないぽ。

  • Failed password ログ監視コマンド

・作成されているユーザーへのアクセス

grep 'Failed password for ' /var/log/secure | grep -v 'invalid' | awk '{print $9 "\t" $11}' | sort | uniq

・作成されていないユーザーへのアクセス

grep 'Failed password for ' /var/log/secure | grep 'invalid user' | awk '{print $11 "\t" $13}' | sort | uniq


これで、「ユーザー名」「タブ」「IPアドレス」のログが出力されます。
「for in」を使えばカウントも取れるはずなんですが、そこまでいたっていないんでがんばらな


ちなみに、最近アクセスされたユーザー名・IPアドレスは以下の通り。中国・韓国多し。

No. ユーザー名 アクセスIP
1 89 202.130.138.72
2 4388 210.6.64.3
3 Aaliyah 202.130.138.72
4 Aaron 202.130.138.72
5 Aba 202.130.138.72
6 Abel 202.130.138.72
7 Access 202.130.138.72
8 DTM 202.130.138.72
9 Exit 202.130.138.72
10 Ionut 202.130.138.72
11 Jewel 202.130.138.72
12 ROOT 202.130.138.72
13 Where 202.130.138.72
14 Zmeu 202.130.138.72
15 aa 202.130.138.72
16 ac 202.130.138.72
17 account 202.130.138.72
18 acct 210.6.64.3
19 ace-html 202.130.138.72
20 adam 202.130.138.72
21 adam 210.6.64.3
22 adame 202.130.138.72
23 add 202.130.138.72
24 address 202.130.138.72
25 adine 202.130.138.72
26 adine 210.6.64.3
27 admin 202.130.138.72
28 admin 210.6.64.3
29 administrator 202.130.138.72
30 administrator 210.6.64.3
31 admins 202.130.138.72
32 adrian 202.130.138.72
33 ag1 202.130.138.72
34 ahmed 202.130.138.72
35 ahmed 210.6.64.3
36 aircode 202.130.138.72
37 airparts 210.6.64.3
38 airservice 210.6.64.3
39 alan 202.130.138.72
40 alan 210.6.64.3
41 alba 202.130.138.72
42 albert 202.130.138.72
43 albert 210.6.64.3
44 alberto 202.130.138.72
45 alberto 210.6.64.3
46 alex 202.130.138.72
47 alex 210.6.64.3
48 alfred 202.130.138.72
49 alfred 210.6.64.3
50 ali 202.130.138.72
51 ali 210.6.64.3
52 alice 202.130.138.72
53 alice 210.6.64.3
54 alin 202.130.138.72
55 alina 202.130.138.72
56 alinus 202.130.138.72
57 allan 202.130.138.72
58 allan 210.6.64.3
59 amanda 202.130.138.72
60 amanda 210.6.64.3
61 amazon 202.130.138.72
62 andi 202.130.138.72
63 andi 210.6.64.3
64 andrei 202.130.138.72
65 andres 202.130.138.72
66 andres 210.6.64.3
67 andrew 202.130.138.72
68 andrew 210.6.64.3
69 angel 202.130.138.72
70 angel 210.6.64.3
71 angela 210.6.64.3
72 angie 210.6.64.3
73 anita 210.6.64.3
74 anna 210.6.64.3
75 anthony 202.130.138.72
76 anton 210.6.64.3
77 archivar 202.130.138.72
78 arcos 202.130.138.72
79 arcotour 202.130.138.72
80 arles 202.130.138.72
81 aron 202.130.138.72
82 aron 210.6.64.3
83 aroon 202.130.138.72
84 arthur 210.6.64.3
85 arun 202.130.138.72
86 asepyme 202.130.138.72
87 at 202.130.138.72
88 austin 210.6.64.3
89 backup 202.130.138.72
90 bank 202.130.138.72
91 banking 202.130.138.72
92 bannamkui 202.130.138.72
93 barbara 202.130.138.72
94 barbara 210.6.64.3
95 barquin 202.130.138.72
96 bart 210.6.64.3
97 bash 202.130.138.72
98 ben 210.6.64.3
99 benahmed 202.130.138.72
100 beny 210.6.64.3
101 bernard 202.130.138.72
102 bert 210.6.64.3
103 bestrella 202.130.138.72
104 bill 210.6.64.3
105 bind 210.6.64.3
106 bnc 202.130.138.72
107 bob 210.6.64.3
108 bobby 210.6.64.3
109 bonnie 210.6.64.3
110 bot 202.130.138.72
111 bran 202.130.138.72
112 bret 210.6.64.3
113 brett 202.130.138.72
114 brian 210.6.64.3
115 bruce 210.6.64.3
116 cafe 202.130.138.72
117 cal 202.130.138.72
118 cap 202.130.138.72
119 carl 210.6.64.3
120 carol 210.6.64.3
121 cesar 210.6.64.3
122 cfhorng 210.6.64.3
123 cgi 202.130.138.72
124 ch 202.130.138.72
125 change 202.130.138.72
126 char 202.130.138.72
127 cheng 210.6.64.3
128 chris 210.6.64.3
129 cindy 202.130.138.72
130 clare 210.6.64.3
131 clark 210.6.64.3
132 clasic 210.6.64.3
133 classic 210.6.64.3
134 clinton 210.6.64.3
135 cmd 202.130.138.72
136 com 202.130.138.72
137 commando 202.130.138.72
138 contact 202.130.138.72
139 copy 202.130.138.72
140 core 210.6.64.3
141 corey 210.6.64.3
142 corinna 210.6.64.3
143 craig 210.6.64.3
144 crissy 210.6.64.3
145 cvs 202.130.138.72
146 cvsroot 210.6.64.3
147 cyborg 202.130.138.72
148 cyrus 202.130.138.72
149 dan 202.130.138.72
150 dangaard 202.130.138.72
151 daniel 202.130.138.72
152 daniel 210.6.64.3
153 danielle 210.6.64.3
154 danny 202.130.138.72
155 danny 210.6.64.3
156 darcos 202.130.138.72
157 darren 210.6.64.3
158 data 202.130.138.72
159 database 202.130.138.72
160 dave 210.6.64.3
161 daveb 210.6.64.3
162 david 202.130.138.72
163 david 210.6.64.3
164 db 202.130.138.72
165 db 210.6.64.3
166 dbmaker 202.130.138.72
167 delgado 202.130.138.72
168 demo 202.130.138.72
169 demouser 202.130.138.72
170 denied 202.130.138.72
171 dennis 202.130.138.72
172 dennis 210.6.64.3
173 denryoku 202.130.138.72
174 desktop 210.6.64.3
175 dexter 202.130.138.72
176 dexter 210.6.64.3
177 dick 210.6.64.3
178 disney 202.130.138.72
179 doblas 202.130.138.72
180 doug 210.6.64.3
181 dozono 202.130.138.72
182 dragon 202.130.138.72
183 dulap 202.130.138.72
184 earl 210.6.64.3
185 ebay 202.130.138.72
186 ed 202.130.138.72
187 ed 210.6.64.3
188 eddie 210.6.64.3
189 edgar 210.6.64.3
190 edit 202.130.138.72
191 eigyou 202.130.138.72
192 electra 202.130.138.72
193 ellen 210.6.64.3
194 elo 202.130.138.72
195 emil 210.6.64.3
196 enzo 210.6.64.3
197 epanchi 202.130.138.72
198 eric 202.130.138.72
199 exchange 202.130.138.72
200 exit 202.130.138.72
201 fax 202.130.138.72
202 felix 210.6.64.3
203 ferari 202.130.138.72
204 fflores 202.130.138.72
205 file 202.130.138.72
206 firewall 202.130.138.72
207 flopy 202.130.138.72
208 fluffy 202.130.138.72
209 fran 202.130.138.72
210 francis 210.6.64.3
211 fred 210.6.64.3
212 ftpin 202.130.138.72
213 ftpout 202.130.138.72
214 ftpusr01 202.130.138.72
215 gabriel 210.6.64.3
216 galladi 202.130.138.72
217 game 202.130.138.72
218 gary 210.6.64.3
219 geiser 202.130.138.72
220 george 202.130.138.72
221 get 202.130.138.72
222 gnome 202.130.138.72
223 goba 202.130.138.72
224 golf 202.130.138.72
225 greg 210.6.64.3
226 guest 202.130.138.72
227 guest 210.6.64.3
228 guest123 202.130.138.72
229 hacker 202.130.138.72
230 handy 202.130.138.72
231 hans 202.130.138.72
232 harry 210.6.64.3
233 haxor 202.130.138.72
234 heather 210.6.64.3
235 hectorh 202.130.138.72
236 helena 202.130.138.72
237 help 202.130.138.72
238 hierros 202.130.138.72
239 hjh 210.6.64.3
240 hk 202.130.138.72
241 hnosvega 202.130.138.72
242 horii 202.130.138.72
243 hotdog 202.130.138.72
244 hp 202.130.138.72
245 htt 202.130.138.72
246 http 202.130.138.72
247 httpd 202.130.138.72
248 huelvasport 202.130.138.72
249 huey 210.6.64.3
250 hunter 202.130.138.72
251 hy 202.130.138.72
252 ian 210.6.64.3
253 id 202.130.138.72
254 ident 202.130.138.72
255 ident 210.6.64.3
256 if 202.130.138.72
257 igor 210.6.64.3
258 info 202.130.138.72
259 info 210.6.64.3
260 ingres 202.130.138.72
261 internet 202.130.138.72
262 interotero 202.130.138.72
263 irc 202.130.138.72
264 ircd 202.130.138.72
265 ircop 202.130.138.72
266 iris 210.6.64.3
267 is 202.130.138.72
268 ismail 210.6.64.3
269 it 202.130.138.72
270 ivan 210.6.64.3
271 jack 202.130.138.72
272 jacob 202.130.138.72
273 jag 202.130.138.72
274 james 202.130.138.72
275 james 210.6.64.3
276 jamy 210.6.64.3
277 jboss 210.6.64.3
278 jeff 210.6.64.3
279 jesse 210.6.64.3
280 jg 202.130.138.72
281 jhon 202.130.138.72
282 jim 210.6.64.3
283 jimmy 210.6.64.3
284 jinta 202.130.138.72
285 john 202.130.138.72
286 john 210.6.64.3
287 jorgegil 202.130.138.72
288 jose 202.130.138.72
289 joshua 202.130.138.72
290 jsryu 202.130.138.72
291 juan 202.130.138.72
292 juan 210.6.64.3
293 junkbust 202.130.138.72
294 kamal 202.130.138.72
295 karl 210.6.64.3
296 karlcheng 210.6.64.3
297 kathi 202.130.138.72
298 kawano 202.130.138.72
299 kayten 202.130.138.72
300 kbjin 202.130.138.72
301 kde 202.130.138.72
302 keiko 210.6.64.3
303 keith 210.6.64.3
304 ken 210.6.64.3
305 kernel 202.130.138.72
306 khan 202.130.138.72
307 kk 210.6.64.3
308 kyoda 202.130.138.72
309 lamett 202.130.138.72
310 larry 202.130.138.72
311 larry 210.6.64.3
312 ldap 202.130.138.72
313 le 202.130.138.72
314 leave 202.130.138.72
315 left 202.130.138.72
316 lftp 202.130.138.72
317 library 202.130.138.72
318 lidelsur 202.130.138.72
319 linux 202.130.138.72
320 linux 210.6.64.3
321 lisa 210.6.64.3
322 lm 202.130.138.72
323 loal 202.130.138.72
324 log 202.130.138.72
325 logadmin 210.6.64.3
326 logs 202.130.138.72
327 lost 202.130.138.72
328 love 202.130.138.72
329 mac 210.6.64.3
330 mago 202.130.138.72
331 mailman 202.130.138.72
332 mal 202.130.138.72
333 marc 202.130.138.72
334 markt 210.6.64.3
335 martin 210.6.64.3
336 marvin 202.130.138.72
337 marvin 210.6.64.3
338 master 202.130.138.72
339 matt 210.6.64.3
340 max 202.130.138.72
341 mcedit 202.130.138.72
342 mclee 202.130.138.72
343 mclee77 202.130.138.72
344 media 210.6.64.3
345 messagebus 210.6.64.3
346 michael 202.130.138.72
347 michi 202.130.138.72
348 mikael 202.130.138.72
349 mike 202.130.138.72
350 mili 202.130.138.72
351 misc 202.130.138.72
352 mizoguti 202.130.138.72
353 modesto 202.130.138.72
354 monica 210.6.64.3
355 mrtg 202.130.138.72
356 mrtg1 202.130.138.72
357 mrtg2 202.130.138.72
358 mrtg3 202.130.138.72
359 msg 202.130.138.72
360 musiq 202.130.138.72
361 name 202.130.138.72
362 nancy 210.6.64.3
363 nathan 202.130.138.72
364 net 202.130.138.72
365 network 202.130.138.72
366 nexus 210.6.64.3
367 nice 202.130.138.72
368 nick 202.130.138.72
369 nickname 202.130.138.72
370 nicole 202.130.138.72
371 nicole 210.6.64.3
372 nina 202.130.138.72
373 nologin 202.130.138.72
374 not 202.130.138.72
375 nothing 202.130.138.72
376 notice 202.130.138.72
377 nuzahar 202.130.138.72
378 ocapate 202.130.138.72
379 oconnor 202.130.138.72
380 ogazon 202.130.138.72
381 ok 202.130.138.72
382 open 202.130.138.72
383 oper 202.130.138.72
384 optic 210.6.64.3
385 oracle 202.130.138.72
386 oralcle 202.130.138.72
387 org 202.130.138.72
388 orlu 202.130.138.72
389 pachon 202.130.138.72
390 paredes 202.130.138.72
391 parts 210.6.64.3
392 party 202.130.138.72
393 passwd 202.130.138.72
394 password 202.130.138.72
395 paul 202.130.138.72
396 paul 210.6.64.3
397 pe 202.130.138.72
398 pepe 202.130.138.72
399 pepe_new 202.130.138.72
400 pete 210.6.64.3
401 peter 210.6.64.3
402 pgsql 202.130.138.72
403 pgsql 210.6.64.3
404 phil 210.6.64.3
405 philip 210.6.64.3
406 pico 202.130.138.72
407 pl 202.130.138.72
408 play 202.130.138.72
409 player 202.130.138.72
410 postmaster 202.130.138.72
411 print 202.130.138.72
412 printer 202.130.138.72
413 printul 202.130.138.72
414 privero 202.130.138.72
415 psy 202.130.138.72
416 psybnc 202.130.138.72
417 pub 202.130.138.72
418 public 210.6.64.3
419 pvm 202.130.138.72
420 pvm 210.6.64.3
421 rachafi 202.130.138.72
422 radu 202.130.138.72
423 radvd 202.130.138.72
424 rajen 202.130.138.72
425 rajoma 202.130.138.72
426 ramamurthy 202.130.138.72
427 rcs 202.130.138.72
428 rebeca 210.6.64.3
429 reciclados 202.130.138.72
430 reseller01 202.130.138.72
431 reseller02 202.130.138.72
432 resin 202.130.138.72
433 resin 210.6.64.3
434 reunion 202.130.138.72
435 rex 202.130.138.72
436 richard 202.130.138.72
437 richard 210.6.64.3
438 ricky 202.130.138.72
439 right 202.130.138.72
440 rk 202.130.138.72
441 rmgadmin 202.130.138.72
442 robert 202.130.138.72
443 roland 210.6.64.3
444 rootkit 202.130.138.72
445 rossy 202.130.138.72
446 router 202.130.138.72
447 rumeno 202.130.138.72
448 rushprint 202.130.138.72
449 ryan 202.130.138.72
450 sabin 202.130.138.72
451 sagun 202.130.138.72
452 sales 202.130.138.72
453 samba 202.130.138.72
454 samba 210.6.64.3
455 samir 210.6.64.3
456 sammy 210.6.64.3
457 samuel 210.6.64.3
458 sandra 210.6.64.3
459 sanjiv 202.130.138.72
460 sara 202.130.138.72
461 sbin 202.130.138.72
462 school 202.130.138.72
463 sean 210.6.64.3
464 search 202.130.138.72
465 security 210.6.64.3
466 sef 202.130.138.72
467 send 202.130.138.72
468 service 210.6.64.3
469 sex 202.130.138.72
470 sgi 202.130.138.72
471 sh 202.130.138.72
472 sharon 202.130.138.72
473 shaun 210.6.64.3
474 shell 202.130.138.72
475 shell 210.6.64.3
476 shigeno 202.130.138.72
477 shop 202.130.138.72
478 shopping 202.130.138.72
479 sisap 202.130.138.72
480 sitasubedi 202.130.138.72
481 smakom 202.130.138.72
482 smc 202.130.138.72
483 smecher 202.130.138.72
484 sonia 210.6.64.3
485 sparky 210.6.64.3
486 spg 202.130.138.72
487 sql 202.130.138.72
488 squid 202.130.138.72
489 squid 210.6.64.3
490 ssh 202.130.138.72
491 ssi 202.130.138.72
492 stan 202.130.138.72
493 stan 210.6.64.3
494 station 202.130.138.72
495 status 202.130.138.72
496 stef 202.130.138.72
497 stef 210.6.64.3
498 stephen 202.130.138.72
499 steve 210.6.64.3
500 steven 202.130.138.72
501 steven 210.6.64.3
502 stewart 202.130.138.72
503 student 202.130.138.72
504 suarez 202.130.138.72
505 sue 210.6.64.3
506 suhian 202.130.138.72
507 sundog 202.130.138.72
508 sunny 202.130.138.72
509 sunsun 202.130.138.72
510 surtransa 202.130.138.72
511 susan 202.130.138.72
512 suva 202.130.138.72
513 sven 210.6.64.3
514 sys 202.130.138.72
515 sysadmin 202.130.138.72
516 sysop 202.130.138.72
517 t-ikeda 202.130.138.72
518 t-miyata 202.130.138.72
519 takayama 202.130.138.72
520 tar 202.130.138.72
521 tcp 202.130.138.72
522 technicom 202.130.138.72
523 telnet 202.130.138.72
524 temp 210.6.64.3
525 ternero 202.130.138.72
526 terry 210.6.64.3
527 test 202.130.138.72
528 test 210.6.64.3
529 test1 202.130.138.72
530 test123 202.130.138.72
531 test2reseller 202.130.138.72
532 tester 202.130.138.72
533 testreseller 202.130.138.72
534 testuser 202.130.138.72
535 text 202.130.138.72
536 tgz 202.130.138.72
537 theo 202.130.138.72
538 thomas 202.130.138.72
539 thor 210.6.64.3
540 tia 202.130.138.72
541 tim 210.6.64.3
542 tina 210.6.64.3
543 tkip 202.130.138.72
544 to 202.130.138.72
545 tom 210.6.64.3
546 tomcat 202.130.138.72
547 tomcat4 202.130.138.72
548 tony 210.6.64.3
549 trib 202.130.138.72
550 tunekiyo 202.130.138.72
551 uk 202.130.138.72
552 undernet 202.130.138.72
553 unix 202.130.138.72
554 unix 210.6.64.3
555 unseen 202.130.138.72
556 upload 202.130.138.72
557 us 202.130.138.72
558 usa 202.130.138.72
559 user 202.130.138.72
560 user 210.6.64.3
561 username 202.130.138.72
562 users 202.130.138.72
563 vanessa 202.130.138.72
564 vanessa 210.6.64.3
565 var 202.130.138.72
566 ventas 202.130.138.72
567 veyma 202.130.138.72
568 victor 202.130.138.72
569 virtuoso 202.130.138.72
570 visitor 210.6.64.3
571 vivian 202.130.138.72
572 vojeda 202.130.138.72
573 vox 202.130.138.72
574 wang 202.130.138.72
575 web 202.130.138.72
576 webadmin 202.130.138.72
577 webadmin 210.6.64.3
578 webadmin 221.254.238.126
579 webalizer 210.6.64.3
580 webb 202.130.138.72
581 webchat 202.130.138.72
582 webmaster 202.130.138.72
583 webmaster 210.6.64.3
584 webmaster 221.254.238.126
585 webpop 202.130.138.72
586 will 210.6.64.3
587 william 202.130.138.72
588 william 210.6.64.3
589 willie 210.6.64.3
590 win 210.6.64.3
591 wing 210.6.64.3
592 wnn 210.6.64.3
593 word 202.130.138.72
594 work 202.130.138.72
595 www 202.130.138.72
596 www-data 202.130.138.72
597 wwwrun 202.130.138.72
598 xvf 202.130.138.72
599 yahoo 202.130.138.72
600 yoshida 202.130.138.72
601 youmin 202.130.138.72
602 yunke 202.130.138.72
603 yusaf 202.130.138.72
604 za 202.130.138.72
605 zxvf 202.130.138.72

やりたいことがほとんど出来ていない日曜日。。