While preparing to deploy an internal application I started to wonder if all of the workstations were properly configured – after a quick search I found a number of methods for detecting the .NET framework locally, but I didn’t find any clean options that worked remotely.
Thankfully I found a post with a few detection methods, one of which was using WMI from VBScript – which gave me the inspiration I needed:
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM Win32_Product WHERE Caption LIKE '%.NET Framework 4%'",,48)
For Each objItem in colItems
Wscript.Echo "Caption: " & objItem.Caption
Next
I pulled up LINQPad and whipped up a quick script to check for both the Client Profile and full (extended) version on a list of computers. Hopefully it’ll be of some use others.
void Main()
{
//read the list of computrers to hit from computers.txt
var path = Path.Combine(Environment.GetEnvironmentVariable("USERPROFILE"),
@"Desktop\computers.txt");
var computers = File.ReadAllLines(path);
//use a parallel searh as this process is quite slow
Parallel.ForEach (computers.Where(s => !string.IsNullOrWhiteSpace(s)), comp =>
{
try
{
bool extended = false;
bool client = false;
var search = new ManagementObjectSearcher(string.Format(@"\\{0}\root\cimv2", comp),
"SELECT * FROM Win32_Product WHERE " +
"Caption = 'Microsoft .NET Framework 4 Client Profile' " +
"OR Caption = 'Microsoft .NET Framework 4 Extended'");
foreach (ManagementObject res in search.Get())
{
if (res.Properties["Name"].Value.ToString() == "Microsoft .NET Framework 4 Client Profile")
client = true;
if (res.Properties["Name"].Value.ToString() == "Microsoft .NET Framework 4 Extended")
extended = true;
}
Console.WriteLine(string.Format("{0}: Client: {1}; Extended: {2}", comp, client, extended));
}
catch (Exception ex)
{
Console.WriteLine(string.Format("{0}: Failed ({1})", comp, ex.Message));
}
});
}
One thing to note, is that you do need Administrator permissions on the remote workstations.
ALERT: Julian Assange has requested political asylum and is under the protection of the Ecuadorian embassy in London http://t.co/bz4O9bjF — WikiLeaks (@wikileaks) June 19, 2012 The news that Julian Assange has asked Ecuador for political asylum is flooding twitter as his supporters do their best to attract attention to his cause, and rally everyone they can to contact Ecuador’s embassy in London to urge them to grant Assange’s request. While I’ve watched the Assange case since before the first allegations came out of Sweden – that’s not my interest here, my interest is in what Ecuador could do if they wanted to.
Like many in this field, I am always looking for ways to improve my workflow, improve my productivity, achieve more. Part of this is evaluating new tools that help me get work done, tools that become critical to my process. While looking at something that could be useful, I had a startling realization — but there are a couple of things I’d like to cover first.
Supporting What You Love I always try to pay for things that make my life better and support businesses that give me real value.
Or: Ethical Decision Making for Security Researchers.
There has been much discussion recently on the appropriateness of releasing offensive security tools to the world – while this storm has largely come and gone on Twitter, it’s something I still find myself thinking about. It boils down to a simple question, is it ethical to release tools that make it easy for attackers to leverage vulnerabilities that they wouldn’t otherwise be able to?
During a recent discussion about the DarkMatter CA on a Mozilla mailing list, it was found that their 64-bit serial numbers weren’t actually 64 bits, and it opened a can of worms. It turns out that the serial number was effectively 63 bits, which is a violation of the CA/B Forum Baseline Requirements that state it must contain 64 bits of output from a secure random number generator (CSPRNG). As a result of this finding, 2,000,000 certificates or more may need to be replaced by Google, Apple, GoDaddy and various others.
or, These aren’t the droids apps you are looking for…
The Chinese government has passed new anti-terror legislation, drafts of which have been criticized for months due to broad language, and the massive privacy concerns. This legislation is a critical move in the global Crypto War – effectively giving the Chinese what the FBI has been seeking for well over a decade: a CALEA-style law, that mandates providers be able to supply law enforcement with decrypted data.