Author Archive
If you tie in your web application to automatically PURGE content when you modify it, thus keeping the content “fresh” while using Varnish you may notice if you made the jump from 2.x to 3.x that your PURGE VCL is no longer working, I refer you to: https://www.varnish-software.com/blog/bans-and-purges-varnish-30
In short replace your usual
1 2 3 4 5 6 7 8 9 10 11
| sub vcl_hit {
if (req.request == "PURGE") {
set obj.ttl = 0s;
error 200 "Purged."; #uses error function to return simple confirmation
}
}
sub vcl_miss {
if (req.request == "PURGE") {
error 404 "Not in cache."; #request to purge none existant item
}
} |
with
1 2 3 4 5 6 7 8 9
| sub vcl_recv {
if (req.request == "PURGE") {
if (!client.ip ~ purge) {
error 405 "Not allowed.";
}
ban("req.url ~ "+req.url+" && req.http.host == "+req.http.host);
error 200 "Purged.";
}
... |
Substituting “~ purge” with your ACL name, the above implement wild card purging aswell, if you do not want this and only want PURGE for the exact passed URL replace
“req.url ~ “+req.url
with
“req.url == “+req.url
Tags: 2.x, 3.x, changes, PURGE, varnish
No Comments »
Posted by Buzz in Hosting, php
Ok, so following up on PHP & Caching with Varnish, let’s cut to the hard facts shall we?
Using the same tests as
ab -c 100 -n 500 -g ./saiweb-nocache-nogzip.bpl http://www.saiweb.co.uk/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking www.saiweb.co.uk (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Finished 500 requests
Server Software: Apache
Server Hostname: www.saiweb.co.uk
Server Port: 80
Document Path: /
Document Length: 92719 bytes
Concurrency Level: 100
Time taken for tests: 0.184 seconds
Complete requests: 500
Failed requests: 0
Write errors: 0
Total transferred: 47597095 bytes
HTML transferred: 47379409 bytes
Requests per second: 2716.92 [#/sec] (mean)
Time per request: 36.806 [ms] (mean)
Time per request: 0.368 [ms] (mean, across all concurrent requests)
Transfer rate: 252573.13 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 1 4 1.1 4 6
Processing: 9 31 7.0 32 47
Waiting: 2 7 5.7 4 26
Total: 15 35 6.8 36 53
Percentage of the requests served within a certain time (ms)
50% 36
66% 38
75% 39
80% 39
90% 41
95% 44
98% 48
99% 51
100% 53 (longest request)

2716.92 requests per second with a server load average of 0.1, and in this case varnish is serving cache from disk.
Caching using varnish (Or even nginx / mod_cache) means that PHP does not get executed at all, the cache system grabs the cache content and serves it.
This of course has the benefit of reducing the CPU and memory resources needed for the running of your application, but it does have some caveats.
- This only works for GET requests, and content not reliant on Cookies (Truely dynamic content will not cache)
- But on the “flipside” Varnish supports ESI, which when setup correctly you can target the dynamic sections of a pag for “passthrough” and have the rest cached
More details to come, as I have time to add them I have have a lot of posts to make on boxgrinder, KVM, libvirtd etc.
Tags: caching, php, varnish
No Comments »
Posted by Buzz in Mac
For those using netatalk for AFP shares in this case I am using CentOS, the EL5 compiles are missing the configure lines for the dhx2 extension, which is required by OSX Lion, if you are running x86_64 you can grab this file: netatalk-2.0.5-2.x86_64.rpm I have also emailed the Package maintainer @ EPEL with the changes I have made for this RPM so I would like to think that -2 will be available from EPEL soon.
Let me know if you have any issues with my RPM.
UPDATE: Official Rebuild in testing
Tags: 5, 5.6, 5.x, afp, atalk, CentOS, EL5, EPEL, lion, Mac, netatalk, osx
1 Comment »
So I’ve decided to start some name and shame posts for “naughty” ip’s that trip an ids, turn up in my log audits etc … and who are woefully ill prepared …
Dear 82.98.131.66,
This post is for you, I’m not sure what you hope to gain by failing repeatedly to gain access to this blog (god knows I hardly have time to update it …) but doing it from a host with all your ports open probably not the best idea in the world, so here’s some information on you.
And for anyone else reading this, I usually end up ignoring the standard user enumeration and brute force attacks (As the offender get blacklisted very quickly), in this case however it was a targeted attempt …
Your ISP’s whois
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
| inetnum: 82.98.128.0 - 82.98.143.255
netname: DINA-HOSTING1
descr: PROVIDER Local Registry
descr: Dinahosting S.L.
country: ES
admin-c: RB1624-RIPE
tech-c: EP2912-RIPE
status: ASSIGNED PA
mnt-by: DINAHOSTING-MNT
mnt-lower: DINAHOSTING-MNT
mnt-routes: DINAHOSTING-MNT
source: RIPE # Filtered
person: Ruben Bouso
address: Rua das Salvadas, 41
15705 - Santiago de Compostela
Spain
phone: +34900854000
fax-no: +34981577449
e-mail: HIDDEN EMAIL
nic-hdl: RB1624-RIPE
mnt-by: DINAHOSTING-MNT
source: RIPE # Filtered
person: Eladio Perez
address: Rua das Salvadas, 41
15705 - Santiago de Compostela
Spain
phone: +34 900854000
e-mail: HIDDEN EMAIL
nic-hdl: EP2912-RIPE
mnt-by: DINAHOSTING-MNT
source: RIPE # Filtered
% Information related to '82.98.128.0/18AS42612'
route: 82.98.128.0/18
descr: First Dinahosting S.L. prefix
origin: AS42612
mnt-by: DINAHOSTING-MNT
mnt-lower: DINAHOSTING-MNT
mnt-routes: DINAHOSTING-MNT
source: RIPE # Filtered |
Log of you attempting to get access to ftp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| Jun 12 20:02:45 132 kernel: IN=eth0 OUT= MAC=**:**:**:**:**:**:00:13:5f:94:18:00:08:00 SRC=82.98.131.66 DST=81.201.132.43 LEN=60 TOS=0x00 PREC=0x00 TTL=56 ID=15007 DF PROTO=TCP SPT=58291 DPT=21 WINDOW=5840 RES=0x00 SYN URGP=0
Jun 12 20:02:45 132 kernel: IN=eth0 OUT= MAC=**:**:**:**:**:**:00:13:5f:94:18:00:08:00 SRC=82.98.131.66 DST=81.201.132.43 LEN=52 TOS=0x00 PREC=0x00 TTL=56 ID=15008 DF PROTO=TCP SPT=58291 DPT=21 WINDOW=92 RES=0x00 ACK URGP=0
Jun 12 20:02:45 132 kernel: IN=eth0 OUT= MAC=**:**:**:**:**:**:00:13:5f:94:18:00:08:00 SRC=82.98.131.66 DST=81.201.132.43 LEN=52 TOS=0x00 PREC=0x00 TTL=56 ID=15009 DF PROTO=TCP SPT=58291 DPT=21 WINDOW=92 RES=0x00 ACK URGP=0
Jun 12 20:02:45 132 kernel: IN=eth0 OUT= MAC=**:**:**:**:**:**:00:13:5f:94:18:00:08:00 SRC=82.98.131.66 DST=81.201.132.43 LEN=65 TOS=0x00 PREC=0x00 TTL=56 ID=15010 DF PROTO=TCP SPT=58291 DPT=21 WINDOW=92 RES=0x00 ACK PSH URGP=0
Jun 12 20:02:45 132 kernel: IN=eth0 OUT= MAC=**:**:**:**:**:**:00:13:5f:94:18:00:08:00 SRC=82.98.131.66 DST=81.201.132.43 LEN=65 TOS=0x00 PREC=0x00 TTL=56 ID=15011 DF PROTO=TCP SPT=58291 DPT=21 WINDOW=92 RES=0x00 ACK PSH URGP=0
Jun 12 20:02:48 132 kernel: IN=eth0 OUT= MAC=**:**:**:**:**:**:00:13:5f:94:18:00:08:00 SRC=82.98.131.66 DST=81.201.132.43 LEN=58 TOS=0x00 PREC=0x00 TTL=56 ID=15012 DF PROTO=TCP SPT=58291 DPT=21 WINDOW=92 RES=0x00 ACK PSH URGP=0
Jun 12 20:02:48 132 kernel: IN=eth0 OUT= MAC=**:**:**:**:**:**:00:13:5f:94:18:00:08:00 SRC=82.98.131.66 DST=81.201.132.43 LEN=52 TOS=0x00 PREC=0x00 TTL=56 ID=15013 DF PROTO=TCP SPT=58291 DPT=21 WINDOW=92 RES=0x00 ACK FIN URGP=0
Jun 12 20:02:48 132 kernel: IN=eth0 OUT= MAC=**:**:**:**:**:**:00:13:5f:94:18:00:08:00 SRC=82.98.131.66 DST=81.201.132.43 LEN=60 TOS=0x00 PREC=0x00 TTL=56 ID=48056 DF PROTO=TCP SPT=58293 DPT=21 WINDOW=5840 RES=0x00 SYN URGP=0
Jun 12 20:02:48 132 kernel: IN=eth0 OUT= MAC=**:**:**:**:**:**:00:13:5f:94:18:00:08:00 SRC=82.98.131.66 DST=81.201.132.43 LEN=52 TOS=0x00 PREC=0x00 TTL=56 ID=15014 DF PROTO=TCP SPT=58291 DPT=21 WINDOW=92 RES=0x00 ACK URGP=0
Jun 12 20:02:48 132 kernel: IN=eth0 OUT= MAC=**:**:**:**:**:**:00:13:5f:94:18:00:08:00 SRC=82.98.131.66 DST=81.201.132.43 LEN=52 TOS=0x00 PREC=0x00 TTL=56 ID=48057 DF PROTO=TCP SPT=58293 DPT=21 WINDOW=92 RES=0x00 ACK URGP=0
Jun 12 20:02:48 132 kernel: IN=eth0 OUT= MAC=**:**:**:**:**:**:00:13:5f:94:18:00:08:00 SRC=82.98.131.66 DST=81.201.132.43 LEN=52 TOS=0x00 PREC=0x00 TTL=56 ID=48058 DF PROTO=TCP SPT=58293 DPT=21 WINDOW=92 RES=0x00 ACK URGP=0
Jun 12 20:02:48 132 kernel: IN=eth0 OUT= MAC=**:**:**:**:**:**:00:13:5f:94:18:00:08:00 SRC=82.98.131.66 DST=81.201.132.43 LEN=65 TOS=0x00 PREC=0x00 TTL=56 ID=48059 DF PROTO=TCP SPT=58293 DPT=21 WINDOW=92 RES=0x00 ACK PSH URGP=0
Jun 12 20:02:48 132 kernel: IN=eth0 OUT= MAC=**:**:**:**:**:**:00:13:5f:94:18:00:08:00 SRC=82.98.131.66 DST=81.201.132.43 LEN=69 TOS=0x00 PREC=0x00 TTL=56 ID=48060 DF PROTO=TCP SPT=58293 DPT=21 WINDOW=92 RES=0x00 ACK PSH URGP=0
Jun 12 20:02:51 132 kernel: IN=eth0 OUT= MAC=**:**:**:**:**:**:00:13:5f:94:18:00:08:00 SRC=82.98.131.66 DST=81.201.132.43 LEN=58 TOS=0x00 PREC=0x00 TTL=56 ID=48061 DF PROTO=TCP SPT=58293 DPT=21 WINDOW=92 RES=0x00 ACK PSH URGP=0
Jun 12 20:02:51 132 kernel: IN=eth0 OUT= MAC=**:**:**:**:**:**:00:13:5f:94:18:00:08:00 SRC=82.98.131.66 DST=81.201.132.43 LEN=52 TOS=0x00 PREC=0x00 TTL=56 ID=48062 DF PROTO=TCP SPT=58293 DPT=21 WINDOW=92 RES=0x00 ACK FIN URGP=0
Jun 12 20:02:51 132 kernel: IN=eth0 OUT= MAC=**:**:**:**:**:**:00:13:5f:94:18:00:08:00 SRC=82.98.131.66 DST=81.201.132.43 LEN=60 TOS=0x00 PREC=0x00 TTL=56 ID=18719 DF PROTO=TCP SPT=58295 DPT=21 WINDOW=5840 RES=0x00 SYN URGP=0
Jun 12 20:02:51 132 kernel: IN=eth0 OUT= MAC=**:**:**:**:**:**:00:13:5f:94:18:00:08:00 SRC=82.98.131.66 DST=81.201.132.43 LEN=52 TOS=0x00 PREC=0x00 TTL=56 ID=48063 DF PROTO=TCP SPT=58293 DPT=21 WINDOW=92 RES=0x00 ACK URGP=0
Jun 12 20:02:51 132 kernel: IN=eth0 OUT= MAC=**:**:**:**:**:**:00:13:5f:94:18:00:08:00 SRC=82.98.131.66 DST=81.201.132.43 LEN=52 TOS=0x00 PREC=0x00 TTL=56 ID=18720 DF PROTO=TCP SPT=58295 DPT=21 WINDOW=92 RES=0x00 ACK URGP=0
Jun 12 20:02:51 132 kernel: IN=eth0 OUT= MAC=**:**:**:**:**:**:00:13:5f:94:18:00:08:00 SRC=82.98.131.66 DST=81.201.132.43 LEN=52 TOS=0x00 PREC=0x00 TTL=56 ID=18721 DF PROTO=TCP SPT=58295 DPT=21 WINDOW=92 RES=0x00 ACK URGP=0
Jun 12 20:02:51 132 kernel: IN=eth0 OUT= MAC=**:**:**:**:**:**:00:13:5f:94:18:00:08:00 SRC=82.98.131.66 DST=81.201.132.43 LEN=69 TOS=0x00 PREC=0x00 TTL=56 ID=18722 DF PROTO=TCP SPT=58295 DPT=21 WINDOW=92 RES=0x00 ACK PSH URGP=0
Jun 12 20:02:51 132 kernel: IN=eth0 OUT= MAC=**:**:**:**:**:**:00:13:5f:94:18:00:08:00 SRC=82.98.131.66 DST=81.201.132.43 LEN=65 TOS=0x00 PREC=0x00 TTL=56 ID=18723 DF PROTO=TCP SPT=58295 DPT=21 WINDOW=92 RES=0x00 ACK PSH URGP=0
Jun 12 20:02:52 132 fail2ban.actions: WARNING [vsftpd-iptables] Ban 82.98.131.66
Jun 12 20:32:53 132 fail2ban.actions: WARNING [vsftpd-iptables] Unban 82.98.131.66
...
Jun 12 20:02:46 132 vsftpd: pam_unix(vsftpd:auth): authentication failure; logname= uid=0 euid=0 tty=ftp ruser=saiweb rhost=hl45.dinaserver.com user=saiweb
Jun 12 20:02:48 132 vsftpd: pam_unix(vsftpd:auth): authentication failure; logname= uid=0 euid=0 tty=ftp ruser=saiweb rhost=hl45.dinaserver.com user=saiweb
Jun 12 20:02:51 132 vsftpd: pam_unix(vsftpd:auth): authentication failure; logname= uid=0 euid=0 tty=ftp ruser=saiwebcouk rhost=hl45.dinaserver.com
... |
Can anyone say firewall?
1 2 3 4 5 6 7 8 9 10
| 21/tcp open ftp
22/tcp open ssh
25/tcp open smtp
53/tcp open domain
80/tcp open http
110/tcp open pop3
143/tcp open imap
443/tcp open https
587/tcp open submission
3306/tcp open mysql |
You need to read this NOW!
1 2 3 4
| Server: Apache/2.2.0 (Fedora) PHP/5.2.9 with Suhosin-Patch
Content-Length: 226
Connection: close
Content-Type: text/html; charset=iso-8859-1 |
Debian? seriously?
1
| SSH-2.0-OpenSSH_5.1p1 Debian-5 |
mySQL seems recent at least
1
| 5.1.32-log?yV!>VvoI?^~"(D\$::QjC^C |
For the moment I am assuming a compromised box quiet why you wanted to come after this blog is beyond me.
- 12/06/2011 – This blog written and evidence sent to ISP
- 12/07/2011 – The Scheduled publication for this post
1 Comment »
Posted by Buzz in hacking, php
In theroy this: http://www.exploit-db.com/exploits/17423/ could be used to facilitate phishing,
To patch this update to 1.9.28, and apply this patch: https://raw.github.com/Oneiroi/PenTesting/master/patches/wptouch-edb17423.patch
UPDATE 07072011 .9.30 does not suffer from this exploit.
No Comments »
Posted by Buzz in hacking, php
In theory this: http://www.exploit-db.com/exploits/17423/ could be used to facilitate phishing,
To patch this update to 1.9.28, and apply this patch: https://raw.github.com/Oneiroi/PenTesting/master/patches/wptouch-edb17423.patch
1 2 3
| cd /path/to/blog/wp-content/plugins/wptouch/
wget https://raw.github.com/Oneiroi/PenTesting/master/patches/wptouch-edb17423.patch
patch < wptouch-edb17423.patch |
update This: http://wordpress.org/news/2011/06/passwords-reset/ causes a 1.9.29 version to be rolled out.
1.9.29 is still vulnerable to this, the patch instructions above still work for 1.9.29
Tags: 17423, edb, patch, phishing, wptouch
No Comments »
Posted by Buzz in Hosting, Linux
Pre-req reading: Part 1
In this part we will cover setting up a backend. A backend is your application server, whether this be apache / nginx / iis (IIS – Is Inherently Stupid) you are telling varnish where it should sends it’s requests to.
Very basic configuration
1 2 3 4
| .backend app1 {
.host = "127.0.0.1";
.port = "8080;"
} |
For a quick start that’s it really you tell varnish a backend and the port to connect to it on … just make sure you use it in vcl_recv, but you’re not here for simple and quick start are you? lets add the following.
- timeout settings
- probe settings
Timeout settings
Your timeout settings deinf how long varnish should wait for a response from your backend
1 2 3 4 5 6 7
| .backend app1 {
.host = "127.0.0.1";
.port = "8080;"
.connect_timeout = 0.05s;
.first_byte_timeout = 2s;
.between_bytes_timeout = 2s;
} |
- connect_timeout wait 50ms for a tcp connection to take place
- first_byte_timeout wait 2s for the first byte of data to be sent from the backend
- between_bytes_timeout wait 2s if there is a pause mid data stream
Timeouts are a basic way of determining if a backend is down / miss behaving if you have multiple backends if timeouts occur then the backend is marked as sick and the other backends will be used.
probe settings – Trust me I’m a doctor
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| .backend app1 {
.host = "127.0.0.1";
.port = "8080;"
.connect_timeout = 0.05s;
.first_byte_timeout = 2s;
.between_bytes_timeout = 2s;
.probe = {
.url = "/status.html";
.timeout = 0.05s;
.window = 5;
.threshold = 3; #60% of last checks must of been OK for this backend to be healthy
.interval = 2s; #how often to run the checks
}
} |
- url the URL to to query this must return a 200 OK response, you could use a php script to return a 500 on say a mySQL outage
- timeout how long to wait for a 200 OK response from the URL
- window keep the result of the last 5 probes in memory
- threshold how many of the window total must be OK for the backend to be “healthy”
- interval how often to run the probe
And that about wraps up this post.
Tags: cache, high, performance., varnish
No Comments »
Posted by Buzz in security
Bad TMNT reference I know but with a reboot coming what do you expect realy?
Right so you have hidden your versions via The Hooded Apache so what now?
Well no matter what you do if your url’s contain .php / .asp / .cfm (Frankly if you are using coldfusion you deserve what you get … just saying …)
You are disclosing what your webapp is using as it’s server side language, now to be clear this hiding is only going to be effective if you are using a bespoke webapp, and not say Joomla / WordPress as they are easily identifiable via other means (for another post) …
mod_rewrite
Learn this, I mean seriously not only can it help cloak your server side language but you can do so using SEO urls.
BUT be careful if you think you’re being cleaver by having mod_rewrite change the extension alone …
1 2
| RewriteEngine On
RewriteRule (.*)\.inc$ $1.php [L] |
it will be easy to enumerate the back end language this way … the first 404 that an attacker gets when enumerating your file names will reveal this rule i.e.
“The file /asfasdgasdg.php was not found on this server” … yeh …
Change the extension entirely
Security through obscurity? you bet your ass, just add your new extension onto your AddType declaration, because you are already avoiding the dual extension vulnerability right?
how about .wtf
1
| AddType application/x-httpd-php .php .phtml .wtf |
Now just name your files .wtf instead of .php
So your using subversion good for you! you can use subversion as part of PCI 11.5 (iirc) to enforce file integrity assuming of course you have your subversion deploy setup securely just one tiny problem …
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| curl -s http://domain.com/.svn/entries
10
dir
1234
http://domain.com/PROJECT/tags/1.0
http://domain.com
2011-06-15T11:47:29.153442Z
1234
joe.blogs
has-props
9733698e-0000-0000-abab-ab0000000aba
^L
config.php
file
ddde986004c962d5827ca851403f96d5
2011-05-25T08:13:14.961921Z
1234
joe.blogs |
Seemingly innocent right? oh how wrong you are …
- http://domain.com we know the version control server location, we can attack that later
- http:// is not an encrypted protocol, easy to sniff for if you get access to the server / company lan
- joe.blogs we have a known username we can attempt to access using dictionary / brute force / social engineering
- http:// the server could be vulnerable to CVE-2011-1921
- we know that config.php exists we can target that later for other crednetials
So assuming a worst case scenario,
- Webapp is compromised and we managed to deploy a remote shell
- Sniffing for http:// hiding silently in the background we find a site update / commit, and snag joe.blogs user credentials
- Exploiting CVE-2011-1921 we enumerate all projects on the svn server (If we even have to … joe.blogs could have access to everything anyway …)
- Inject backdoors into all projects committing changes as joe.blogs
- Wait for co de to be deployed to production …
- And now you have backdoors into multiple projects
You can prevent this by …
1 2 3 4
| <Directory ~ "\.svn">
Order allow,deny
Deny from all
</Directory> |
Or using mod_security
1
| SecRule REQUEST_URI "\.svn" phase:1,deny |
Ensure you use an ENCRYPTED protocol for your version control https:// / ssh+svn:// for example with subversion.
Tags: apps, cloak, hacking, hide, security, web
1 Comment »
Go ahead and run
1
| curl -I http://www.saiweb.co.uk |
You will get
1 2 3 4 5 6 7 8
| HTTP/1.1 200 OK
Date: Mon, 25 Apr 2011 19:33:29 GMT
Server: Apache
Vary: Accept-Encoding,Cookie
Cache-Control: max-age=3, must-revalidate
WP-Super-Cache: Served supercache file from PHP
Connection: close
Content-Type: text/html; charset=UTF-8 |
As an attacker looking to hit a web app, one of the first things you’re going to want to look into is what version of web server is running, in this case you can see this blog in fact runs apache … but there is not much else to go on here is there.
That’s intentional, and by manual configuration changes I have put in place, this is not the case of a default LAMP install, take for instance, this snippet from another website,
1 2
| Server: Apache/2.2.16 (Debian)
X-Powered-By: PHP/5.2.14 |
This already has given me a wealth of information to go on and begin prepping an attack, I now know the site is running php version 5.2.14 Apache version 2.2.16 and that the underlying OS is Debian.
See the dilemma? your default roll outs are just declaring their running versions to anyone willing to listen, so lets make it a little more stealthy.
First and foremost if you are using php, edit your php.ini and set the following:
Now head into your httpd.conf and set the following
and
With these 3 simple steps all the headers will now return is Server: Apache this is the first step to shielding your app, I’ll be covering further steps as time allows.
Tags: Apache, hacking, Linux, security
2 Comments »
Posted by Buzz in hacking
With work returning to “normal” levels I began digging through my backlog of seclist updates, errata updates and security related podcasts,
One particular attack method has me concerned as a typical Paranoid Systems Admin, namely the one covered by Darren @ Hak5.org,
Where combining jasager and airdrop-ng can allow you to easily set yourself up as a m.i.t.m transparently, so I began thinking how would you defend against such an attack, with most if not all wifi clients switching to jasager transparently without the user ever knowing, now remember this is all theory at this point it could be completely wrong, please leave feedback in the comments.
before I beging let’s make a couple of assumptions.
- You are the admin for your network
- You are in control of all AP’s on your network
If you can not confirm 1 & 2 then you can land yourself in a whole heap of trouble, so think before you do please …
That said onto a possible defense scenario, making airdrop-ng work as a “shield”.
The main premise of airdrop is to send DeAuth packets forcing a wifi client to reconnect, Darren’s jasager + airdrop podcast (“Airport wifi challenge”) used this in conjunction with jasager to force clients to reconnect but to jasager instead, essentially denying access to the real AP’s and masquerading as them using jasager.
With me so far?
- Client is connected to REAL Access Point
- airdrop-ng sends DeAuth for all BSSIDs except jasager’s
- Client Attempts to reconnect, jasager masquerades as the REAL AP
- Client is now pwned.
To re purpose airdrop-ng as a “shield”, we change step 2 above .
- Client is connected to REAL Access Point
- airdrop-ng sends DeAuth for all BSSIDs except the REAL access point
Now this does cause a problem for any genuine “pop up” wifi, such as the share functionality on mac osx, and mobile hotspots (wifi 3g), but it is one possible method of defense.
If you have some theories related to detecting and defeating WiFi m.i.t.m attacks please let me know, I’d love to hear them,
I’ll work on getting a screencast for this up as soon as possible.
- this will not protect against BSSID / MAC spoofing,
- this will only prevent against a rougue AP BSSID masquerading as your valid AP.
- this will only work within range of your wifi device generating the DeAuth packets.
- improper configuration could cause D.o.S of nearby REAL Ap’s and generaly piss people off.
Update 04/10/2011 Seems that this project wifijammer can do exactly what I outlined above. via: Hackaday
Tags: defense, jasager, mitm
No Comments »
|