Saturday, August 31, 2013
Friday, August 30, 2013
Thursday, August 29, 2013
Tuesday, August 27, 2013
Saturday, August 24, 2013
Friday, August 23, 2013
Thursday, August 22, 2013
Wednesday, August 21, 2013
The Evolution of a Programmer
A programmer's code gets complicated with maturity while a hacker's code gets even more simplified ;)
---------------------------------------------------- Programmers ----------------------------------------------------
---------------------------------------------------- Programmers ----------------------------------------------------
High
School/Jr.High
10 PRINT "HELLO WORLD"
20 END
First year in
College
program Hello(input, output)
begin
writeln('Hello World')
end.
Senior year in
College
(defun hello
(print
(cons 'Hello (list 'World))))
New professional
#include <stdio.h>
void main(void)
{
char *message[] = {"Hello ", "World"};
int i;
for(i = 0; i < 2; ++i)
printf("%s", message[i]);
printf("\n");
}
Seasoned
professional
#include <iostream.h>
#include <string.h>
class string
{
private:
int size;
char *ptr;
string() : size(0), ptr(new char[1]) { ptr[0] = 0; }
string(const string &s) : size(s.size)
{
ptr = new char[size + 1];
strcpy(ptr, s.ptr);
}
~string()
{
delete [] ptr;
}
friend ostream &operator <<(ostream &, const string &);
string &operator=(const char *);
};
ostream &operator<<(ostream &stream, const string &s)
{
return(stream << s.ptr);
}
string &string::operator=(const char *chrs)
{
if (this != &chrs)
{
delete [] ptr;
size = strlen(chrs);
ptr = new char[size + 1];
strcpy(ptr, chrs);
}
return(*this);
}
int main()
{
string str;
str = "Hello World";
cout << str << endl;
return(0);
}
Master
Programmer
[
uuid(2573F8F4-CFEE-101A-9A9F- 00AA00342820)
]
library LHello
{
// bring in the master library
importlib("actimp.tlb");
importlib("actexp.tlb");
// bring in my interfaces
#include "pshlo.idl"
[
uuid(2573F8F5-CFEE-101A-9A9F- 00AA00342820)
]
cotype THello
{
interface IHello;
interface IPersistFile;
};
};
[
exe,
uuid(2573F890-CFEE-101A-9A9F- 00AA00342820)
]
module CHelloLib
{
// some code related header files
importheader(<windows.h>);
importheader(<ole2.h>);
importheader(<except.hxx>);
importheader("pshlo.h");
importheader("shlo.hxx");
importheader("mycls.hxx");
// needed typelibs
importlib("actimp.tlb");
importlib("actexp.tlb");
importlib("thlo.tlb");
[
uuid(2573F891-CFEE-101A-9A9F- 00AA00342820),
aggregatable
]
coclass CHello
{
cotype THello;
};
};
#include "ipfix.hxx"
extern HANDLE hEvent;
class CHello : public CHelloBase
{
public:
IPFIX(CLSID_CHello);
CHello(IUnknown *pUnk);
~CHello();
HRESULT __stdcall PrintSz(LPWSTR pwszString);
private:
static int cObjRef;
};
#include <windows.h>
#include <ole2.h>
#include <stdio.h>
#include <stdlib.h>
#include "thlo.h"
#include "pshlo.h"
#include "shlo.hxx"
#include "mycls.hxx"
int CHello::cObjRef = 0;
CHello::CHello(IUnknown *pUnk) : CHelloBase(pUnk)
{
cObjRef++;
return;
}
HRESULT __stdcall CHello::PrintSz(LPWSTR pwszString)
{
printf("%ws
",
pwszString);
return(ResultFromScode(S_OK));
}
CHello::~CHello(void)
{
// when the object count goes to zero, stop the server
cObjRef--;
if( cObjRef == 0 )
PulseEvent(hEvent);
return;
}
#include <windows.h>
#include <ole2.h>
#include "pshlo.h"
#include "shlo.hxx"
#include "mycls.hxx"
HANDLE hEvent;
int _cdecl main(
int argc,
char * argv[]
)
{
ULONG ulRef;
DWORD dwRegistration;
CHelloCF *pCF = new CHelloCF();
hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
// Initialize the OLE libraries
CoInitializeEx(NULL, COINIT_MULTITHREADED);
CoRegisterClassObject(CLSID_ CHello, pCF, CLSCTX_LOCAL_SERVER,
REGCLS_MULTIPLEUSE, &dwRegistration);
// wait on an event to stop
WaitForSingleObject(hEvent, INFINITE);
// revoke and release the class object
CoRevokeClassObject( dwRegistration);
ulRef = pCF->Release();
// Tell OLE we are going away.
CoUninitialize();
return(0);
}
extern CLSID CLSID_CHello;
extern UUID LIBID_CHelloLib;
CLSID CLSID_CHello = { /* 2573F891-CFEE-101A-9A9F- 00AA00342820 */
0x2573F891,
0xCFEE,
0x101A,
{ 0x9A, 0x9F, 0x00, 0xAA, 0x00, 0x34, 0x28, 0x20 }
};
UUID LIBID_CHelloLib = { /* 2573F890-CFEE-101A-9A9F- 00AA00342820 */
0x2573F890,
0xCFEE,
0x101A,
{ 0x9A, 0x9F, 0x00, 0xAA, 0x00, 0x34, 0x28, 0x20 }
};
#include <windows.h>
#include <ole2.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "pshlo.h"
#include "shlo.hxx"
#include "clsid.h"
int _cdecl main(
int argc,
char * argv[]
)
{
HRESULT hRslt;
IHello *pHello;
ULONG ulCnt;
IMoniker * pmk;
WCHAR wcsT[_MAX_PATH];
WCHAR
wcsPath[2 * _MAX_PATH];
// get object path
wcsPath[0] = '\0';
wcsT[0] = '\0';
if( argc > 1) {
mbstowcs(wcsPath, argv[1], strlen(argv[1]) + 1);
wcsupr(wcsPath);
}
else {
fprintf(stderr, "Object path must be specified\n");
return(1);
}
// get print string
if(argc > 2)
mbstowcs(wcsT, argv[2], strlen(argv[2]) + 1);
else
wcscpy(wcsT, L"Hello World");
printf("Linking to object %ws\n", wcsPath);
printf("Text String %ws\n", wcsT);
// Initialize the OLE libraries
hRslt = CoInitializeEx(NULL, COINIT_MULTITHREADED);
if(SUCCEEDED(hRslt)) {
hRslt = CreateFileMoniker(wcsPath, &pmk);
if(SUCCEEDED(hRslt))
hRslt = BindMoniker(pmk, 0, IID_IHello, (void **)&pHello);
if(SUCCEEDED(hRslt)) {
// print a string out
pHello->PrintSz(wcsT);
Sleep(2000);
ulCnt = pHello->Release();
}
else
printf("Failure to connect, status: %lx", hRslt);
// Tell OLE we are going away.
CoUninitialize();
}
return(0);
}
---------------------------------------------------- Hackers ----------------------------------------------------
Apprentice
Hacker
#!/usr/local/bin/perl
$msg="Hello, world.\n";
if ($#ARGV >= 0) {
while(defined($arg=shift(@ ARGV))) {
$outfilename = $arg;
open(FILE, ">" . $outfilename) || die "Can't write $arg:
$!\n";
print (FILE $msg);
close(FILE) || die "Can't close $arg: $!\n";
}
}
else {
print ($msg);
}
1;
Experienced
Hacker
#include <stdio.h>
#define S "Hello, World\n"
main(){exit(printf(S)
== strlen(S) ? 0 : 1);}
Seasoned Hacker
%
cc -o a.out ~/src/misc/hw/hw.c
%
a.out
Guru Hacker
%
echo "Hello, world."
---------------------------------------------------- Managers ----------------------------------------------------
New Manager
10 PRINT "HELLO WORLD"
20 END
Middle Manager
mail -s "Hello, world." bob@b12
Bob, could you please write me a program that prints "Hello, world."?
I
need it by tomorrow.
^D
Senior Manager
%
zmail jim
I
need a "Hello, world." program by this afternoon.
Chief Executive
%
letter
letter: Command not found.
%
mail
To: ^X ^F ^C
%
help mail
help: Command not found.
%
damn!
!: Event unrecognized
%
logoutAstronaut mobile holder
Tuesday, August 20, 2013
Monday, August 19, 2013
Sunday, August 18, 2013
Dubai Police
Police around the world has had a hard time catching fast cars in pursuit. Dubai police, being rich enough, has employed a rather expensive life hack to get this remedied. Checkout the Dubai police's fleet of sports cars which seems to be something right out of a Need for Speed game:
Aston Martin
Chevrolet Camaro
Mercedes Bentley
The rare, Lamborghini Aventador
Bugatti Veyron
Saturday, August 17, 2013
Truck overload: Bike rigged up
One of the featured posts of juggaar, Pakistani truck unloading juggaar, the best photograph of 2012 shows the Pakistani way of unloading an overloaded truck. The current posts improvises a notch ahead to rig up a motor bike to the already overloaded truck to save another trip:
Recycling a light bulb
Thursday, August 15, 2013
8 Natural Anti-Depressants
Shared via positivemed.
- Swiss Chard: This veggie is packed with magnesium, which is a vital part of the biochemical reactions that increase energy levels in the human body.
- Blue potatoes: This little used vegetable is packed with a powerful antioxidant called anthocyanins, which reduces brain inflammation (associated with depression).
- Mussels: This seafood has high amounts of Vitamin B12, selenium, protein, and iodine, which supports the thyroid gland that regulates the mood and weight.
- Dark chocolate: This delicious sweet treat improves the blood-flow to the brain, and provides an instant boost in concentration and mood.
- Greek yogurt: This creamy dairy product is packed with calcium, which release happiness inducing-neurotransmitters from your brain.
- Asparagus: This green veggie has high levels of tryptophan , which is used by the brain to make serotonin.
- Honey: This natural sweeter contains kaempferol and quercetin, which reduces brain inflammation, preventing depression.
- Coconut: this delicious tropical fruit contains medium-chain triglycerides, which are special fats that fuel better moods and promote general brain health.
Stand with the ideology of Pakistan!
You stand with the ideology of Pakistan? Affectee
of Academic course work & Pakistan studies books. You think of
using force to defend Pakistan? ISI agent. You start to loose hope in
the nation after watching violence on media? Traitor. You consider the Pukhtoon culture as the nation's heritage? Racist. If you question drone
attacks, there are those that will immediately label you a
Taliban-supporter. If you question Pakistan’s need to fight, kill and
capture terrorists, there are those that will immediately label you an
American stooge. If you spell Ramadan correctly, you’re an Arabist. If
you enjoy classical music, you’re a covert Hindu. You enjoy modern
music? Secular. You want to make fraaandships with India? RAW
agent. You want to honour the dedication with which the guardians of the
Two Holy Mosques care for Makkah and Madinah? Wahabbist fundo. You talk
of nuclear weapons? They'll label you as an elite citizen with no
interest in improving the lives of the poor.
These labels are great fun. Mostly, they’re the domain of folks that are too busy to discern between the layers of complexity that defines the average person in the 21st century instead of helping their nation practically in its most vulnerable era.
These labels are great fun. Mostly, they’re the domain of folks that are too busy to discern between the layers of complexity that defines the average person in the 21st century instead of helping their nation practically in its most vulnerable era.
Energy saving, laziness or mere cultural change?
Wednesday, August 14, 2013
Tuesday, August 13, 2013
ATM Skimming hits Pakistan
ATM machines and internet banking is finding it's trend as an accessibility facility; something we get to use often without even realizing the importance of sensitivity of data involved using an ATM. ATM skimming has resulted in loss of millions of dollars around the world. Skimmers capture data from the magnetic strip of ATM cards via various methods and then clone that information on a blank ATM card that has a similar magnetic strip. This allows hacker to use bank accounts of the victims via ATM machines.
Personal identification is intercepted using custom and self made devices or gadgets which the hackers attached to ATM machines with ease without getting noticed. These devices make up portable data collectors which are mounted on the regular card reading slot. When the card is swiped in the machine, it reads the data on it's magnetic strip as well as allowing the ATM to do the same. Fake keypads are also mounted over original keypads to collect the other, independent, part of the secure information... the PIN code. The thief hacker then retrieves the device he placed on the ATM to access its mini portable storage.
The magnetic strip of the ATM card stores the user’s full name, account number, bank details and other series of information that is required to allow the card to function properly. If all this information is cloned on a card with blank magnetic strip, that card essentially becomes the same card as the user holds. Skimming devices can be mounted on different positions depending on the technology hacker developed; including the lighting fixtures of an ATM, the brochure plastic case, the ATM card swipe slot itself, and the keypad.
Another commonly used method is the involves the use of spy cameras. After mounting the card skimmer in the card swipe slot, the pin code can also be collected via a spy camera well hidden when the hacker tampers with the machine pretending to make a transaction. An example is shown below where the con has placed a camera in wooden casing to attach it to the ATM machine in combination with the card skimmer to swindle the users.
Card skimming devices that are attached to the card swipe slot to record data from the magnetic strip on the ATM cards can be seen in the image below. Criminals may then use the personal financial information gained along with the PIN that is achieved through spy cameras or fake key logging pads and withdraw cash from accounts of victims. The fake keypad presses the keys of original keypad under it to make it seamless and also stores the keys pressed in its own attached memory device.
This type of intrusion has recently hit Pakistan when a couple of university students in Islamabad designed their own version of a skimmer and robbed people off millions of rupees before being caught by the Federal Investigation Agency (FIA). The investigative report says that a total of Rs. 12 million was robbed using a single skimming device which included 187 PSO cards and a second skimming device for 1192 ATM cards. These university students included, Nasir Abbas, Muhammad, Zaheer Ahmed, Mustaqeem and Amir Shahzad, Javed according to a source.
It is also reported that FIA announced Zaheer Ahmed to be owning two skimming devices which caused a loss of almost Rs. 12 million to the government and private sector. The skimmer made by Zaheer Ahmed was used to acquire data of credit cards through the magnetic strip behind a card which holds the card owner’s details which was then used to clone the cards for fraudulent reasons including making transactions online so that the hacker did not have to take the risk of physically visiting an ATM machine repeatedly with a clone card. The second skimmer was a device that is mounted to an ATM machine to grab ATM users' information once they swipe their cards in the slot along with a device to log the keystrokes entered to gather the personal identification numbers (PINs).
Although banks have started taking counter measures but the hackers are also getting better at designing skimmers day by day. Over last few months, new skimming devices have been introduced by criminals which allow skimmers to access other components of ATM machines and use them to wirelessly transmit sensitive information of the victim the moment it is entered, hence, lessening the risk of a second visit for the hacker.
Skimming is not easy to detect but ATM users can be aware of some signs to prevent being victims of such crimes. It is best to be alert and always watch for the signs of an ATM machine being tampered with before you swipe your card. This especially involves the appearance of the machine such as glue residue, cracks, exposed wires, etc. Also check the card device reader; banks have started to attach their own mounts to the reader designed in a way which makes it difficult for the skimmers to attach malicious devices - so check if the card slot looks normal or seem to have an attached device to it. Against spy cameras, your best chance is to cover the keypad when typing in your PIN so that a hidden camera would not be able to view the keypad (and, ofcourse, confirm that you are alone in the cabin while typing your PIN).
ATM skimming is a hard to track process and is very attractive for thieves. ATM skimming maybe on the rise but staying informed and educated can reduce the likelihood being swiped by criminals. Social engineering involved in the skimming devices to appear as part of ATM machines or its own upgrades might also be involved and staying alert, informed and learning on the go is what makes you avoid such scams. The intruder maybe intelligent, but there is no cure for human stupidity and your own intelligence is your only real line of defense against social engineering.
Sunday, August 11, 2013
Friday, August 9, 2013
Subscribe to:
Posts (Atom)