Python IRC Proxy DDos script
import socket
import threading
# Proxy sunucusu ayarları
PROXY_HOST = '0.0.0.0'
PROXY_PORT = 6667
# IRC sunucusu ayarları
IRC_HOST = 'irc.example.com'
IRC_PORT = 6667
def handle_client(client_socket):
# IRC sunucusuna bağlan
irc_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
irc_socket.connect((IRC_HOST, IRC_PORT))
def forward(source, destination):
while True:
data = source.recv(4096)
if len(data) == 0:
break
destination.sendall(data)
# Thread'ler oluştur
client_to_irc = threading.Thread(target=forward, args=(client_socket, irc_socket))
irc_to_client = threading.Thread(target=forward, args=(irc_socket, client_socket))
client_to_irc.start()
irc_to_client.start()
client_to_irc.join()
irc_to_client.join()
client_socket.close()
irc_socket.close()
def main():
proxy_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
proxy_socket.bind((PROXY_HOST, PROXY_PORT))
proxy_socket.listen(5)
print(f'Proxy sunucusu {PROXY_HOST}:{PROXY_PORT} adresinde dinliyor...')
while True:
client_socket, addr = proxy_socket.accept()
print(f'Bağlantı kabul edildi: {addr}')
client_handler = threading.Thread(target=handle_client, args=(client_socket,))
client_handler.start()
if __name__ == "__main__":
main() |