<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title><![CDATA[TurkTeam | Türk Siber Güvenlik Topluluğu - Kendi Araçlarım (Açık Kaynak)]]></title>
		<link>https://www.turkteam.org/</link>
		<description><![CDATA[TurkTeam | Türk Siber Güvenlik Topluluğu - https://www.turkteam.org]]></description>
		<pubDate>Sun, 25 Oct 2026 19:04:32 +0000</pubDate>
		<generator>MyBB</generator>
		<item>
			<title><![CDATA[Kendi Aracim: Basit Log Tarama Scripti (Python, Acik Kaynak Ornegi)]]></title>
			<link>https://www.turkteam.org/konu-kendi-aracim-basit-log-tarama-scripti-python-acik-kaynak-ornegi.html</link>
			<pubDate>Sat, 17 Oct 2026 11:30:57 +0300</pubDate>
			<dc:creator><![CDATA[<a href="https://www.turkteam.org/member.php?action=profile&uid=4">KulTigin</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.turkteam.org/konu-kendi-aracim-basit-log-tarama-scripti-python-acik-kaynak-ornegi.html</guid>
			<description><![CDATA[<div style="text-align: center;" class="mycode_align"><img src="https://www.turkteam.org/attachment.php?aid=119" loading="lazy"  alt="[Resim: attachment.php?aid=119]" class="mycode_img" /></div>
<br />
Selam millet,<br />
<br />
Her seferinde ayni grep/awk komutlarini yazmaktan sikilinca, ssh auth loglarindan basarisiz giris denemelerini ozetleyen kucuk bir script yazdim. Buyuk bir sey degil ama ise yariyor; paylasayim, isteyen gelistirir. MIT lisansi dusunun, serbestce kullanin.<br />
<br />
<span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Ne Yapar?</span></span><ul class="mycode_list"><li>auth.log icinde basarisiz giris (Failed password) satirlarini bulur<br />
</li>
<li>IP bazinda sayar ve en cok deneyen IP'leri siralar<br />
</li>
<li>Esik ustu IP'leri uyari olarak isaretler<br />
</li>
</ul>
<br />
<span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Kod</span></span><br />
<div class="codeblock"><div class="title">Kod:</div><div class="body" dir="ltr"><code>#!/usr/bin/env python3
import re, sys, collections

THRESHOLD = 10  # bu sayinin ustu supheli

def main(path):
    ip_re = re.compile(r"Failed password.*from (&#92;d+&#92;.&#92;d+&#92;.&#92;d+&#92;.&#92;d+)")
    counts = collections.Counter()
    with open(path, encoding="utf-8", errors="ignore") as f:
        for line in f:
            m = ip_re.search(line)
            if m:
                counts[m.group(1)] += 1

    if not counts:
        print("Basarisiz giris bulunamadi.")
        return

    print(f"{'IP':&lt;18} {'Deneme':&gt;7}  Durum")
    print("-" * 40)
    for ip, n in counts.most_common():
        flag = "UYARI" if n &gt;= THRESHOLD else ""
        print(f"{ip:&lt;18} {n:&gt;7}  {flag}")

if __name__ == "__main__":
    path = sys.argv[1] if len(sys.argv) &gt; 1 else "/var/log/auth.log"
    main(path)</code></div></div><br />
<span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Kullanim</span></span><br />
<div class="codeblock"><div class="title">Kod:</div><div class="body" dir="ltr"><code>python3 logscan.py /var/log/auth.log</code></div></div><br />
Ornek cikti:<br />
<div class="codeblock"><div class="title">Kod:</div><div class="body" dir="ltr"><code>IP                  Deneme  Durum
----------------------------------------
203.0.113.45            142   UYARI
198.51.100.7             23   UYARI
192.0.2.10                3</code></div></div><br />
<span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Gelistirme Fikirleri</span></span><ul class="mycode_list"><li>Zaman araligi filtresi (son 24 saat)<br />
</li>
<li>Esik ustu IP'leri otomatik fail2ban/iptables ile engelleme<br />
</li>
<li>JSON cikti ve bir panoya besleme<br />
</li>
<li>Birden fazla log dosyasini birlestirme<br />
</li>
</ul>
<br />
Katkiya acik; siz olsaniz once hangi ozelligi eklerdiniz? Fork edip gelistirmek isteyen beri gelsin.<br />
<br />
<span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Kaynaklar</span></span><ul class="mycode_list"><li><a href="https://docs.python.org/3/library/re.html" target="_blank" rel="noopener" class="mycode_url">Python re modulu</a><br />
</li>
<li><a href="https://docs.python.org/3/library/collections.html" target="_blank" rel="noopener" class="mycode_url">Python collections.Counter</a><br />
</li>
</ul>
<br />
<blockquote class="mycode_quote"><cite>Alıntı:</cite><span style="font-weight: bold;" class="mycode_b">Yasal not:</span> Scripti yalnizca kendi sunucunuzun loglarinda calistirin.</blockquote>
<br /><!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://cdn.turkteam.org/images/attachtypes/image.png" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=119" target="_blank" title="">kultigin-k10.png</a> (Dosya Boyutu: 86.9 KB / İndirme Sayısı: 9)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[<div style="text-align: center;" class="mycode_align"><img src="https://www.turkteam.org/attachment.php?aid=119" loading="lazy"  alt="[Resim: attachment.php?aid=119]" class="mycode_img" /></div>
<br />
Selam millet,<br />
<br />
Her seferinde ayni grep/awk komutlarini yazmaktan sikilinca, ssh auth loglarindan basarisiz giris denemelerini ozetleyen kucuk bir script yazdim. Buyuk bir sey degil ama ise yariyor; paylasayim, isteyen gelistirir. MIT lisansi dusunun, serbestce kullanin.<br />
<br />
<span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Ne Yapar?</span></span><ul class="mycode_list"><li>auth.log icinde basarisiz giris (Failed password) satirlarini bulur<br />
</li>
<li>IP bazinda sayar ve en cok deneyen IP'leri siralar<br />
</li>
<li>Esik ustu IP'leri uyari olarak isaretler<br />
</li>
</ul>
<br />
<span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Kod</span></span><br />
<div class="codeblock"><div class="title">Kod:</div><div class="body" dir="ltr"><code>#!/usr/bin/env python3
import re, sys, collections

THRESHOLD = 10  # bu sayinin ustu supheli

def main(path):
    ip_re = re.compile(r"Failed password.*from (&#92;d+&#92;.&#92;d+&#92;.&#92;d+&#92;.&#92;d+)")
    counts = collections.Counter()
    with open(path, encoding="utf-8", errors="ignore") as f:
        for line in f:
            m = ip_re.search(line)
            if m:
                counts[m.group(1)] += 1

    if not counts:
        print("Basarisiz giris bulunamadi.")
        return

    print(f"{'IP':&lt;18} {'Deneme':&gt;7}  Durum")
    print("-" * 40)
    for ip, n in counts.most_common():
        flag = "UYARI" if n &gt;= THRESHOLD else ""
        print(f"{ip:&lt;18} {n:&gt;7}  {flag}")

if __name__ == "__main__":
    path = sys.argv[1] if len(sys.argv) &gt; 1 else "/var/log/auth.log"
    main(path)</code></div></div><br />
<span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Kullanim</span></span><br />
<div class="codeblock"><div class="title">Kod:</div><div class="body" dir="ltr"><code>python3 logscan.py /var/log/auth.log</code></div></div><br />
Ornek cikti:<br />
<div class="codeblock"><div class="title">Kod:</div><div class="body" dir="ltr"><code>IP                  Deneme  Durum
----------------------------------------
203.0.113.45            142   UYARI
198.51.100.7             23   UYARI
192.0.2.10                3</code></div></div><br />
<span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Gelistirme Fikirleri</span></span><ul class="mycode_list"><li>Zaman araligi filtresi (son 24 saat)<br />
</li>
<li>Esik ustu IP'leri otomatik fail2ban/iptables ile engelleme<br />
</li>
<li>JSON cikti ve bir panoya besleme<br />
</li>
<li>Birden fazla log dosyasini birlestirme<br />
</li>
</ul>
<br />
Katkiya acik; siz olsaniz once hangi ozelligi eklerdiniz? Fork edip gelistirmek isteyen beri gelsin.<br />
<br />
<span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Kaynaklar</span></span><ul class="mycode_list"><li><a href="https://docs.python.org/3/library/re.html" target="_blank" rel="noopener" class="mycode_url">Python re modulu</a><br />
</li>
<li><a href="https://docs.python.org/3/library/collections.html" target="_blank" rel="noopener" class="mycode_url">Python collections.Counter</a><br />
</li>
</ul>
<br />
<blockquote class="mycode_quote"><cite>Alıntı:</cite><span style="font-weight: bold;" class="mycode_b">Yasal not:</span> Scripti yalnizca kendi sunucunuzun loglarinda calistirin.</blockquote>
<br /><!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://cdn.turkteam.org/images/attachtypes/image.png" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=119" target="_blank" title="">kultigin-k10.png</a> (Dosya Boyutu: 86.9 KB / İndirme Sayısı: 9)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
	</channel>
</rss>