Kali Linux and Intel Wireless A 7260

My experience with this started when installing Kali Linux amd64 on a new laptop that had this wireless network adapter(Intel Centrino Advanced-N 7260). After install finished succesfully I noticed that there is no wireless network adapter:

$ sudo iwconfig
eth0 no wireless extensions.
lo no wireless extensions.

Nothing else here.
The I spotted this:
$ sudo cat /var/log/syslog | grep 7260
[ x.975154] iwlwifi 0000:04:00.0: firmware: agent aborted loading iwlwifi-7260-7.ucode (not found?)
[ x.975346] iwlwifi 0000:04:00.0: request for firmware file ‘iwlwifi-7260-7.ucode’ failed.

After a bit a googling I found this post: http://askubuntu.com/questions/322511/no-wireless-with-intel-centrino-advanced-n-7260

Of course the devil is in the details so the solution is a bit hidden. To cut it short that’s what worked for me; first you have to install Linux Kernel 3.11 RC4 http://linuxg.net/kernel-3-11-rc4-has-been-released-how-to-install-the-linux-kernel-3-11-rc4-on-ubuntu-debian-and-linux-mint/ :

$ sudo apt-get install firmware-nonfree
$ wget -c kernel.ubuntu.com/~kernel-ppa/mainline/v3.11-rc4-saucy/linux-headers-3.11.0-031100rc4_3.11.0-031100rc4.201308041735_all.deb
$ wget -c kernel.ubuntu.com/~kernel-ppa/mainline/v3.11-rc4-saucy/linux-headers-3.11.0-031100rc4-generic_3.11.0-031100rc4.201308041735_amd64.deb
$ wget -c kernel.ubuntu.com/~kernel-ppa/mainline/v3.11-rc4-saucy/linux-image-3.11.0-031100rc4-generic_3.11.0-031100rc4.201308041735_amd64.deb

(This is of course for the x64 arch)

$sudo dpkg -i *.deb
$ sudo modprobe -r iwldvm
$ sudo modprobe -r iwlwifi
$ sudo modprobe iwlwifi

After this:

$sudo iwconfig
eth0 no wireless extensions.

lo no wireless extensions.

wlan0 IEEE 802.11bgn ESSID:off/any
Mode:Managed Access Point: Not-Associated Tx-Power=0 dBm
Retry long limit:7 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:on

So that’s it. Hope that this will help someone out there.

The laptop in question was a Lenovo ThinkPad S440.

Technet Subscriptions Retirement

This morning I received an email that had a subject like this: “Technet Subscriptions Retirement”. I was a little bit shocked as I looked at it.

retirement

Then I looked at the anouncement on the technet homepage somewhat puzzled: http://technet.microsoft.com/subscriptions/default.aspx

What was that all about? As an IT Pro I was using this subscription for testing purposes (vm) and access to some resources like MS Dart, AGPM, etc and there were a bunch of other products that weren’t available as normal free/trial downloads.

And what now?! Am I going to reinstall every 150 days my vm just to use them? What?! Or buy full license only for testing? WTF!

So I’ve decided to talk to a costumer support. The guy pointed me out to this: https://msdn.microsoft.com/en-US/subscriptions/buy/buy.aspx

So the option to the previous benefits would be the product MSDN Operating Systems which costs 699$; that’s almost 3 times the cost for a Standard Technet Subscription.

msdn

Well, that seems like a move to get rid of a product that was at a very good price for any IT Pro. Who knows to what else.

I can’t say I’m happy, yet my subscription expires next year on 24 Feb so I have plenty of time to think about this.

As for me, I see the later development of products at MS is only to maximize profit with no regards to the user well beiing.

Why do I say that. I’ll tell the story about how you activate Office 2013 later.

The story is so stupid that it’s funny.

Hacker Manifesto or The Conscience of a Real Hacker

This post is only a quote of The Hacker Manifesto from SoldierX on 23 Sept 2003.

It happened again today. Another one sold out, sacrificing their dreams to the corporate security machine.

Damn Whitehats, no one believes in a cause anymore.

Another bug was released today to the security mailing lists.

Damn Whitehats, they know not what they do.

Another potential computer genius was relegated to an existence of nothing more than than a 9-5 cubicle-dwelling promotional tool.

Damn Whitehats, putting money before discovery.

Another family was ravaged by corporations and governments bent on instituting control over individuality, monitoring every action…

Another kid was sentenced today for searching for a way to understand the world. Convicted and imprisoned, not because of what he did, but because of what others thought he could do.

Damn Whitehats – Fear keeps them in business.

The public, believing anything it hears from “reputed experts”. Screaming for blood. Looking for something to blame for their lost hope. Their lost ability to seek out new knowledge. Fear consumes them. They cannot let go of their uncertainty and doubt because there is no meaning. They seek to destroy explorers, outlaws, curiosity seekers because they are told too. They are told these people that seek information are evil. Individuality is evil. Judgment should be made based upon a moral standard set in conformity rather than resistance. Lives are ruined in the name of corporate profit and information is hoarded as a commodity.

Damn Whitehats, you were once like us.

I was a Whitehat. I had an awakening. I saw the security industry for what is really is. I saw the corruption, the lies, the deceit, the extortion of protection money in the form of subscription services and snake-oil security consultants.

I wanted to know, I wanted to understand, I wanted to go further then the rest. I never want to be held down by contracts and agreements.

You say I should grow up. You say I should find better things to do with my time. You say I should put my talent to better use. You’re saying I should fall in line with the other zombies and forget everything I believe in and shun those with my drive, my curiosity, tell them it’s not worth it, deny them of the greatest journey they will ever experience in their lives.

I am not a Blackhat. The term is insulting, it implies I am the opposite of you. You think i seek to defeat security, when I seek something greater. I will write exploits, travel through networks, explore where you are afraid to go. I will not put myself in the spotlight and release destructive tools to the public to attract business. I will not feed the fear and hysteria created by the security industry to increase stock prices. I can, and will, code and hack and find out everything I can for the same reasons I did years ago.

I am a Hacker, don’t try to understand me, you lost all hope of that when you crossed the line. You fail to see the lies and utter simplicity behind the computer security industry. Once, you may have shared my ideals. You fail to see the fact that security is a maintenance job. You’ve given up hope for something better. You fail to see yourself as worthless, fueling an industry whose cumulative result is nothing. I don’t hate you, I don’t even really care about you – If you try to stop me, you will fail, because I do this out of love — you do it for money.

This is our world now.. the world of the electron and the switch, the beauty of the baud. We make use of a service already existing without paying for what could be dirt cheap if it wasn’t run by profiteering gluttons, and you call us criminals. We explore… and you call us criminals. We seek after knowledge… and you call us criminals. We exist without skin color, without nationality, without religious bias… and you call us criminals. You build atomic bombs, you wage wars, you murder, cheat and lie to us and try to make us believe it is for our own good, yet we’re the criminals.

Yes, I am a criminal. My crime is that of curiosity. My crime is that of judging people by what they say and think, not what they look like. My crime is that of outsmarting you, something that you will never forgive me for.

I am a hacker, and this is my manifesto. You can’t stop me, and you certainly can’t stop us all.

Windows 8 – A new experience or a nightmare?

Well, it was a nightmare until a certain point.

In the beginning there was Windows 8 Developer Preview. Since I’m in the computer business since at least Win 3.11 (of course I had a Spectrum Z80 compatible in my childhood and played with it too, in our case these were
named HC-85 and HC-91) when I heard about the new Developer Preview for Windows 8 I was pleasantly surprised and installed it. And of course since I’m mainly using MS OS’es at work I’m somewhat if not a fan at least very well
accustomed to this kind of OS. And since Windows 7, which by the way is a very stable and robust OS MS has washed the bad image that they had since Vista or so.

The thing with the Developer Preview was that it worked very well for a semi-beta program, maybe too well. I really had no problem with that OS and used it for several months. Everything was working. On default drivers.

And now the RTM. Installed it and the fun began.First of all, my video adapter seemed to mysteriously fail once per two days or so. By failing, I mean that the screen went blank and nothing could bring the interface back, yet the computer was responding to pings from outside etc The solution was always reset. Have I mentioned that I never had problems with the video card(BFG NVIDIA 8800GTS) on any other os? After 2 or three weeks I ran out of patience and said: “Ok, maybe the default drivers are the problem, let’s install a driver from NVIDIA”. Said and done. Of course after installing the driver it looked like everything was going fine and no errors occurred. Until the next day. The same blank screen. The signed driver from NVIDIA. Waited for another month or so until a new driver was released. Installed it. Same thing. Blank screen once two days. So, if you want to play games on Windows 8 forget it for now. Half the games I’ve tried had problems with the video part and stability problems (were crashing very often).
And after countless more small harassments that doesn’t worth mentioning(the kind like: you can’t do this unless you do that. “But they’re not in any way related, I don’t understand why it’s like that.” We know better.) I was: “Ok, you’re done here.” Removed it and installed Windows 7 and happy since.

That’s my home experience.

Well, at work it’s a totally  different story. Here it either works or it doesn’t. You can’t explain to an employee that something “almost” works. So the first laptop I bought after the RTM, had Windows 8 despite the bad experience I had at home.
Laptop was a Dell Inspiron with Windows 8. No paying attention to the version because I always buy the Pro version for work so I supposed that my sales contact would offer me only Pro versions of the OS. Got it, and wanted to join the domain…
Surprise! It was grayed out. So I try powershell:
PS C:\> Get-WindowsEdition -Online

And the message?

Get-WindowsEdition : The requested operation requires elevation.
At line:1 char:1
+ Get-WindowsEdition -Online
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-WindowsEdition], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.GetWindowsEditionCommand
   
This seems rather stupid, why would I need elevation just to see what OS is installed? It hurts my head to think of this. Finally after opening an elevated session of powershell I get Windows 8 Something. Not Pro. So I called my seller and asked about the license. He confirmed that it was a basic edition and he had mistaken so he offers me a OEM license with the price of an upgrade license so that everyone is happy.
I don’t have to wait until I get the license, I can install the OS and activate it later with the key I get from him. Started installing, no key requirement (I was surprised by that) and when I finally want to join the domain …
Same version of windows. No PRO. I looked at the computer and can’t believe my eyes. And no chance to add a key or something to activate as PRO for example. I thought I got something wrong, and started installing again. Happily, from an usb stick the installation takes 8-9 minutes so no hassle here. Again no serial number requirement and same edition of Windows 8. Not PRO.
At this moment I was certain that something was very wrong and called my seller. He begins to laugh and says that I probably didn’t format the previous installation and some residual info remained. Of course I always install clean especially when the computer is new, simply delete all the partitions, create a new one and start installing on it. Of course, what he said seemed stupid so I proposed to him to install the OS. Sent the laptop and waited. After a few hours he calls me and says to me still laughing: “Well, you were right that’s for sure, but we have a problem”. The problem was that the key was embedded in BIOS and at installation the OS automatically acquires the corresponding key and activates the version that is embedded in BIOS. “So now we can’t install the PRO version on this hardware”. And I go “What? I bought an computer with an OS and I can’t have another version even if I pay for it?” He says that “Yes. We were talking to Microsoft support and Dell support and requested a resolution for this. For example if you want to have two versions of Windows 8 that you pay for you should be able to install both of them. We’re waiting for the resolution”.
So now I was already in a world of pain. This has already going on for too long and who would understand that you can’t deliver an fully configured workstation in 4 hours or less?
Then the next business day he told me they solved it but no resolution came from MS of DELL on this issue. They simply mounted the HDD on a non-embedded serial number hardware, started installing, and afterwards moved back the drive to the laptop. This can’t get more stupid than this would you say don’t you? Just carry on 🙂

Finally I delivered the computer to the user with the necessary excuses for the waiting time and now I had an upgrade licence to Win 8 PRO.

My laptop has an Windows 7 Pro OEM license and I wanted to migrate to Windows 8.This time everything has gone very well until I wanted to install mRemoteNG … The message was that I don’t have NET Framework installed.
Yes but I have NET Framework 4. Anyways at Add/Remove Windows features you have the option to Add NET Framework 3.5 which includes
version 2 and 3. Check the button, click OK and it simply gives an error like 0x800F0906. “Well, this is new” . I search on the net and what I find out: “If your computer is WSUS client (mine is by GPO of course), you will need the install disk or the Sources\SXS folder from the install media to run: dism /online /enable-feature

/featurename:NetFx3 /All /Source:e:\sxs /LimitAccess

. Whaaaaat?!?!!
So I can’t just download NET Framework 3.5 and install it?!! I need the windows install disk or files from sxs folder?!!!Microsoft you’re crazy?
Ok, I download the image from technet and finally get the Framework 3.5 installed to install mRemoteNG. 2-3 Hours of course, instead of 5 minutes.
We’re getting productive.

Now what would I need? Well RSAT of course. Download the package and install it. It took 10 seconds to install it. How nice! No errors!
Well, but were are the msc’s from RSAT? Searched even in %systemroot%\system32 and nothing. Well, this looks really interesting.
After a quick search on the net I find out that I can install RSAT ONLY if I have the EN-US Language Interface Pack installed.
Well I had EN-UK if you can imagine. So you Microsoft are telling me that only the EN-US users are interested in remotely administering servers??!?!

I didn’t even have vietnamese or something else. I had EN-UK for god sakes!?!? The solution? Simply download from technet the images with LIP’s and install from them.Now I was already so angry that at first I’ve downloaded the x86 image so I had to download again the x64. Namely mu_windows_8_language_pack_x64_dvd_917544.iso . Finally I had only to dism /online /add-package /packagepath:D:\langpacks\en-us or you can use RUN – lpksetup to install the EN-US language pack and the start the RSAT setup which took now at most 1 minute. So 2-3 hours instead of 1 minute. Greaaaaat!!!!

Now I am expecting some more nice surprises like those. Hopefully I’ve installed almost every tool I need.

Hope you didn’t had my experience with Windows 8 and simply laughed at my adventures.

Thank you Microsoft, you never let me get bored!

PowerTab – Powershell Error

 

Since I installed PowerShell 3 CTP 2 I’ve got his error when starting:

powertab

or by text

You are now entering pwrshll: ********

PS D:\reiser\Powershell\Scripts> Import-Module PowerTab
Get-Content : Cannot find path ‘Function:\TabExpansion’ because it does not exist.
At D:\DOCUMENTE\Documents\WindowsPowerShell\Modules\PowerTab\PowerTab.psm1:17 char:20
+ $OldTabExpansion = Get-Content Function:TabExpansion
+                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Function:\TabExpansion:String) [Get-Content], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand

PowerTab version 0.99.6.0 PowerShell TabExpansion Library
Host: ConsoleHost
PowerTab Enabled: True

Now when I installed PowerShell 3 RTM I’ve finally got annoyed by this message (I load powertab from within the profile) so I’ve done some research.

Seems that in PowerShell 3 TabExpansion has been replaced with TabExpansion2 : https://github.com/psget/psget/issues/16

So the only thing you will have to do is to modify the script PowerTab.psm1 , at line 17 char 20, instead of TabExpansion you should have TabExpansion2 like below:

powertab1

The script should be located either in the PowerShell’s allusers(computer) profile here:

"$PSHOME\modules\Powertab\PowerTab.psm1" or "$((($env:psmodulepath).Split(";"))[1])\powertab\powertab.psm1”

(ussually C:\Windows\system32\WindowsPowerShell\v1.0\Modules\PowerTab\PowerTab.psm1)

or in your user profile:

"$((($env:psmodulepath).Split(";"))[0])\powertab\powertab.psm1” (ussually C:\Users\%username%\documents\WindowsPowerShell\Modules\PowerTab\PowerTab.psm1)

After that, no error occurs anymore as here:

powertab2

Enjoy!

Quinto Labs Content Security 2 Django Error

So if you follow exactly the tutorial on integrating with apache you won’t get into any trouble. But if you don’t, and the line:

$sudo ./qlproxy_django/bin/easy_install django==1.3.1 lacks the version number or you’ve got previously a newer django version, you’ll get into an error like this:

ImportError at /
Import by filename is not supported.Request Method: GET
Request URL: http://hostname/
Django Version: 1.4
Exception Type: ImportError
Exception Value: Import by filename is not supported.
Exception Location: /var/opt/quintolabs/qlproxy/www/qlproxy_django/lib/python2.6/site-packages/Django-1.4-py2.6.egg/django/utils/importlib.py in import_module, line 35
Python Executable: /usr/bin/python
Python Version: 2.6.6
Python Path: [‘/usr/local/lib/python2.6/dist-packages/virtualenv-1.7.2-py2.6.egg’,
‘/var/opt/quintolabs/qlproxy/www/qlproxy_django/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg’,
‘/var/opt/quintolabs/qlproxy/www/qlproxy_django/lib/python2.6/site-packages/pip-1.1-py2.6.egg’,
‘/var/opt/quintolabs/qlproxy/www/qlproxy_django/lib/python2.6/site-packages/Django-1.4-py2.6.egg’,
‘/usr/lib/python2.6’,
‘/usr/lib/python2.6/plat-linux2’,
‘/usr/lib/python2.6/lib-tk’,
‘/usr/lib/python2.6/lib-old’,
‘/usr/lib/python2.6/lib-dynload’,
‘/usr/local/lib/python2.6/dist-packages’,
‘/usr/lib/python2.6/dist-packages’,
‘/usr/lib/pymodules/python2.6’,
‘/var/opt/quintolabs/qlproxy/www/qlproxy/’,
‘/var/opt/quintolabs/qlproxy/www/qlproxy_django/lib/python2.6/site-packages’]

The error appear because you have a newer Django version than 1.3.1.

This error and a lot more information would appear only if you have DEBUG = True in your Django settings file.

Recovering from this is pretty simple:

 

#apt-get install httpd mod_wsgi python-setuptools
#easy_install virtualenv
#cd /var/opt/quintolabs/qlproxy/www
#virtualenv –no-site-packages qlproxy_django
#./qlproxy_django/bin/easy_install *django==1.3.1*

Got from here:

http://groups.google.com/group/quintolabs-content-security-for-squid-proxy/browse_frm/month/2012-04

Squidview + Squid 3

I post this as a reminder, the solution to this problem found on this post: http://adminnetworks.blogspot.com/2011/05/instalar-squidview-en-debian.html

So what is all this about? When I first installed Squid v3 on a system and tried to run Squidview (of course everyone knows tail –f /var/log/squid3/access.log) but got this error: “The squid log file cannot be read.

It was clear enough that it looks for the log file in a place that doesn’t exist so I guessed that’s the location of the old 2.x Squid, /var/log/squid/access.log . But to my surprise squidview doesn’t have any config file, the location is hardcoded.

So the solution is to create a softlink like this:

ln -s /var/log/squid3/ /var/log/squid

Now squidview starts as it should. That simple!

Delete Files Older Than …

I have a bunch of drives on which I backup our servers (I rotate them) and I was running out of space on them because of the old backup files. So I decided to delete every file that was created more than a 1 month(31 days) ago, as it’s specified in the backup procedure.

Here is the powershell one liner:

Dir ‘d:\testxxx’ | Where-Object { $_ -is [System.IO.FileInfo] } | Where-Object {$_.CreationTime -lt (Get-Date).AddDays(-31)} | Remove-Item –Force

and you can add the –Recurse switch to find all files in the subfolders of the path like this:

Dir ‘d:\testxxx’  -Recurse | Where-Object { $_ -is [System.IO.FileInfo] } | Where-Object {$_.CreationTime -lt (Get-Date).AddDays(-31)} | Remove-Item –Force

You’ll want to replace d:\testxxx with the name of your folder or drive. You set how old would be the remaining files by changing the number or method in the (Get-Date).AddDays(-31) section .

For example if you want that the files that you keep would be of at most two months old you would need to change the powershell command like this:

Dir ‘d:\testxxx’ | Where-Object { $_ -is [System.IO.FileInfo] } | Where-Object {$_.CreationTime -lt (Get-Date).AddMonths(-2)} | Remove-Item –Force

Of course you have o bunch of methods available:

AddDays
AddHours
AddMilliseconds
AddMinutes
AddMonths
AddSeconds
AddTicks
AddYears

And if you need to keep the older files you simply change the Where-Object {$_.CreationTime -lt (Get-Date).AddMonths(-2)

like this:

Where-Object {$_.CreationTime -gt (Get-Date).AddMonths(-2)

But be very carefull with this command and test it first on a test folder and only after you’re certain of the result use it because it will delete a lot of files in no time.

For testing you’ll need to set the creation time of some files at your convenience so  that’s how you’ll do it.

For a single file:

$a=Get-ChildItem d:\testxxx\file1.txt

$a.CreationTime=(Get-Date).AddMonths(-3)

For multiple files with name pattern filexxx.txt

foreach($x in Get-ChildItem d:\testxxx\file*.txt)

{

$x.CreationTime=(Get-Date).AddMonths(-3)

}