Pages

Sunday, March 25, 2012

PYTHON APPLICATION ..PART 2

part 2 deals with the server part ie the system..we need a system installed with python and sendkey attribute (make sure both of them are of same version)of python to do it

http://dl.dropbox.com/u/30579529/Bluecon/python/python-2.5.4.msi

http://dl.dropbox.com/u/30579529/Bluecon/python/SendKeys-0.3.win32-py2.5.exe

http://dl.dropbox.com/u/30579529/Bluecon/python/PyBluez-0.15.win32-py2.5.exe

in server side we broadcast a service and wait for client to connect .

after connecting  the server receives the ascii values from the client and server uses the sendkey attribute to make virtual keyboard and mouse movements with respect to received ascii values

/***********code*****************/
from ctypes import *
from bluetooth import *
import string
from SendKeys import *
user32=windll.user32
from ctypes.wintypes import *
import time

LEFTDOWN   = 0x00000002
LEFTUP     = 0x00000004
#  MIDDLEDOWN = 0x00000020
#  MIDDLEUP   = 0x00000040
#  MOVE       = 0x00000001
#  ABSOLUTE   = 0x00008000
RIGHTDOWN  = 0x00000008
RIGHTUP    = 0x00000010

class POINT(Structure):
_fields_ = [("x", c_ulong),
("y", c_ulong)]

def getpos():
global pt
pt = POINT()
windll.user32.GetCursorPos(byref(pt))
return pt.x, pt.y

def move(x,y):
windll.user32.SetCursorPos(x,y)

def up():
x = getpos()[0]
y = getpos()[1]
move(x,y-10)
def down():
x = getpos()[0]
y = getpos()[1]
move(x,y+10)
def left():
x = getpos()[0]
y = getpos()[1]
move(x-10,y)
def rigth():
x = getpos()[0]
y = getpos()[1]
move(x+10,y)

def rightclick():
windll.user32.mouse_event(RIGHTDOWN,0,0,0,0)
windll.user32.mouse_event(RIGHTUP,0,0,0,0)

def leftclick():
windll.user32.mouse_event(LEFTDOWN,0,0,0,0)
windll.user32.mouse_event(LEFTUP,0,0,0,0)

def send(data):
if(data==97):
SendKeys('a')
elif(data==98):
SendKeys('b')
elif(data==99):
SendKeys('c')
elif(data==100):
SendKeys('d')
elif(data==101):
SendKeys('e')
elif(data==102):
SendKeys('f')
elif(data==103):
SendKeys('g')
elif(data==104):
SendKeys('h')
elif(data==105):
SendKeys('i')
elif(data==106):
SendKeys('j')
elif(data==107):
SendKeys('k')
elif(data==108):
SendKeys('l')
elif(data==109):
SendKeys('m')
elif(data==110):
SendKeys('n')
elif(data==111):
SendKeys('o')
elif(data==112):
SendKeys('p')
elif(data==113):
SendKeys('q')
elif(data==114):
SendKeys('r')
elif(data==115):
SendKeys('s')
elif(data==116):
SendKeys('t')
elif(data==117):
SendKeys('u')
elif(data==118):
SendKeys('v')
elif(data==119):
SendKeys('w')
elif(data==120):
SendKeys('x')
elif(data==121):
SendKeys('y')
elif(data==122):
SendKeys('z')
elif(data==65):
SendKeys('A')
elif(data==66):
SendKeys('B')
elif(data==67):
SendKeys('C')
elif(data==68):
SendKeys('D')
elif(data==69):
SendKeys('E')
elif(data==70):
SendKeys('F')
elif(data==71):
SendKeys('G')
elif(data==72):
SendKeys('H')
elif(data==73):
SendKeys('I')
elif(data==74):
SendKeys('J')
elif(data==75):
SendKeys('K')
elif(data==76):
SendKeys('L')
elif(data==77):
SendKeys('M')
elif(data==78):
SendKeys('N')
elif(data==79):
SendKeys('O')
elif(data==80):
SendKeys('P')
elif(data==81):
SendKeys('Q')
elif(data==82):
SendKeys('R')
elif(data==83):
SendKeys('S')
elif(data==84):
SendKeys('T')
elif(data==85):
SendKeys('U')
elif(data==86):
SendKeys('V')
elif(data==87):
SendKeys('W')
elif(data==88):
SendKeys('X')
elif(data==89):
SendKeys('Y')
elif(data==90):
SendKeys('Z')
elif(data==48):
SendKeys('0')
elif(data==49):
SendKeys('1')
elif(data==50):
SendKeys('2')
elif(data==51):
SendKeys('3')
elif(data==52):
SendKeys('4')
elif(data==53):
SendKeys('5')
elif(data==54):
SendKeys('6')
elif(data==55):
SendKeys('7')
elif(data==56):
SendKeys('8')
elif(data==57):
SendKeys('9')
elif(data==43):
SendKeys('+')
elif(data==45):
SendKeys('-')
elif(data==42):
SendKeys('*')
elif(data==47):
SendKeys('/')
elif(data==61):
SendKeys('=')
elif(data==35):
SendKeys('#')
elif(data==44):
SendKeys(',')
elif(data==46):
SendKeys('.')
elif(data==59):
SendKeys(';')
elif(data==58):
SendKeys(':')
elif(data==64):
SendKeys('@')
elif(data==63):
SendKeys('?')
elif(data==32):
SendKeys(' ')
elif(data==13):
SendKeys("{ENTER}")
leftclick()
elif(data==8):
SendKeys("{BACKSPACE}")
elif(data==40):
SendKeys('(')
elif(data==41):
SendKeys(')')
elif(data==38):
SendKeys('&')
elif(data==33):
SendKeys('!')
elif(data==63497):
up()
elif(data==63498):
down()
elif(data==63495):
left()
elif(data==63496):
rigth()
elif(data==63557):
leftclick()
elif(data==63586):
rightclick()

parseStr = lambda x: x.isalpha() and x or x.isdigit() and int(x) or x.isalnum() and x or len(set(string.punctuation).intersection(x)) == 1 and x.count('.') == 1 and float(x) or x
server_sock=BluetoothSocket( RFCOMM )
server_sock.bind(("",PORT_ANY))
server_sock.listen(1)

port = server_sock.getsockname()[1]

uuid = "94f39d29-7d6d-437d-973b-fba39e49d4ee"

advertise_service( server_sock, "BLUECONTROL",
service_id = uuid,
service_classes = [ uuid, SERIAL_PORT_CLASS ],
profiles = [ SERIAL_PORT_PROFILE ],
#                   protocols = [ OBEX_UUID ]
)

print "Waiting for connection on RFCOMM channel %d" % port

client_sock, client_info = server_sock.accept()
print "Accepted connection from ", client_info

try:
while True:
data = client_sock.recv(1024)
if len(data) == 0: break
da=parseStr(data)
send(da)
except IOError:
pass

print "disconnected"

client_sock.close()
server_sock.close()
print "all done"

--------------

here i use a function parseStr to get the integer value form the received string .

later u can use pytoexe attribute in python to convert the server into a python independent running program

Thursday, March 1, 2012

Manually Remove Viruses from Your Windows

Most viruses launch when you log into Windows — they typically call an executable from the registry. In fact, that call will tell you exactly where the virus resides.

Start in the registry.

  • Click Start. Click Run and type: regedit.exe

  • Registry Editor opens. Expand HKEY_CURRENT_USER

  • Then expand Software. Next expand Microsoft.

  • Now expand Windows.

  • Then expand CurrentVersion.

  • Click on the Run folder.


Here you’ll find some of the programs that launch on startup. A rule of thumb: a virus is a randomly generated string that makes no sense.

The real giveaway that this is a virus is the location of the application it’s calling. It’s in the Application Data folder. It launches every time you log in. So no matter how many times you reboot, it comes right back.

Write down where the virus resides. In this case, it’s in the All Users Application Data folder. Then simply right-click the registry key and delete it. Now you haven’t actually deleted the virus, you’ve only deleted the call that launches it, which is doing the minimum. A virus is just a program, after all, so if the virus doesn’t launch it does no harm. But delete the file system anyway.

Now it’s time to go to the Application Data Folder. There is more than one — follow the path exactly as you wrote it down.

if its a VIRUS try the step in SAFEMODE

 

Access Ext2 file system in windows

The software provides Windows NT4.0/2000/XP/2003/Vista/2008 with full access to Linux Ext2 volumes (read access and write access). This may be useful if you have installed both Windows and Linux as a dual boot environment on your computer

If you currently have Windows running and you realize that you need some files for your work which you have stored on an Ext2 volume of your Linux installation, you no longer have to shut down Windows and boot Linux!

Furthermore, Windows will now be able to handle floppy disks which have been formatted with an Ext2 file system.

how it works

It installs a pure kernel mode file system driver Ext2fs.sys, which actually extends the Windows operating system to include the Ext2 file system. Since it is executed on the same software layer at the Windows NT operating system core like all of the native file system drivers of Windows (for instance NTFS, FASTFAT, or CDFS for Joliet/ISO CD-ROMs), all applications can access directly to Ext2 volumes. Ext2 volumes get drive letters (for instance O:). Files, and directories of an Ext2 volume appear in file dialogs of all applications. There is no need to copy files from or to Ext2 volumes in order to work with them.

Download it here

http://dl.dropbox.com/u/30579529/Ext2IFS_1_11a.exe

Monday, February 27, 2012

Installing Pakages rpm ang tar

RPM

rpm -iUhv <pkgname>.rpm

rpm -F <pkgname>.rpm
rpm -e <pkgname>.rpm
rpm -l <pkgname>.rpm

i...install

U...update

h...Print  50  hash marks as the package archive is unpacked

v...print normally routine progress messages

F...Fresh install

e...erase install

l...listing details

 

tar -xvzf package_name.tar.gz

x= extract v=verbose z=(un)compress f=file

tar -jxvf package_name.tar.bz2

j=bzip2

 

 

CHANGING FILE PERMISSIONS

Changing the permissions can be done with names and numbers, I like the numbers

chmod 754  test.txt

Here is why:
4=read 2=write 1=execute.
The three numbers in the chmod above are for the

"user" ( the first number ),

"group" ( the second number ) and

"others" ( the third number )

So if I want to give the user all permissions: 4+2+1=7
and i give the group read an execute permissions: 4+1=5
and all others only read permission 4=4

chmod takes either the decimal representation of the permissions or a symbolic representation.

The symbolic representation is [ugoa][+-][rwx]. This is one of the letters

u  (user=file owner),

g  (group), o(others),

a   (all=u and g and o) followed by + or - to add or remove permissions and then the symbolic      representation of the permissions in the form of

r   (read)

w   (write)

x   (execute).

To make the file "file.txt" writable for all you type: "chmod a+w  file.txt"

See through Terminal

Guake is an application which will give us a see through terminal.with tis terminal u can work on terminal and see the background as well see movies/photos etc

yum install guake*

Sunday, February 26, 2012

BYPASS WINDOWS PASSWORD

Here we will see two type of password bypassing for windows

1.using ubuntu live cd and chntpw command

2. using offline nt password recovery cd or usb

  1. Use chntpw to delete a Windows password : With chntpw utility, you can erase the password of      any Windows account, freeing access.first load the ubuntu live cd and linstall chntpw .



  • Open a Terminal window by clicking on the Ubuntu menu, click Accessories, then Terminal.

  • Enter the command cd / media and confirm with Enter.

  • Enter the ls command and confirm with Enter. The list of hard disk drives is displayed. You should see the reference noted above.

  • Then enter the command cd followed by the reference hard drive containing Windows. In our case, the command is cd FAC4AC2BC4ABE7D9. Confirm with Enter.

  • Then type the command cd WINDOWS/system32/config to access the Windows system folder where are saved passwords. Press Enter.

  • Then enter the command sudo-i chntpw Sat and confirm by pressing Enter.

  • Press the button 1 and press Enter.

  • SAM is the file that contains the Windows registry. The list of users on your system is displayed. Enter the code located in the RID column beside the name of the user you want to reset the password to zero code preceded by 0x and press Enter. For RID 03E8, the command becomes 0x03e8 here.

  • Then press the 1 key to erase the password for the selected account and confirm by pressing Enter.

  • The password is then deleted as you said the message Password cleared. Press! And press Enter to exit from the menu.

  • Then press the q key, validate and confirm the registration of the change by pressing ahead. Confirm with Enter.

  • Then close the Terminal window and restart your computer by clicking the Stop button and then click Restart. Confirm the operation and remove the Ubuntu CD in your drive when you are asked. Press Enter.


2. Offlint nt password recovery(http://pogostick.net/~pnh/ntpasswd/)

first download the cd or usb zip files form below and follow the steps

http://pogostick.net/~pnh/ntpasswd/cd110511.zip

http://pogostick.net/~pnh/ntpasswd/usb110511.zip

cd...if u r using a cd then simply  download the iso and burn it in the cd and use it

usb...

  • Copy all the files that is inside the usbXXXXXX.zip or on the CD onto an usb drive, directly on the drive, not inside any directory/folder.

  • It is OK if there are other files on the USB drive from before, they will not be removed.

  • Install bootloader on the USB drive, from command prompt in windows (start the command line with "run as administrator" if possible)Replace X: with the drive letter the USB drive shows up as (DO NOT USE C:)

    • X:syslinux.exe -ma X:




  • If it seems like nothing happened, it is usually done.

  • However, a file named ldlinux.sys may appear on the USB drive, that is normal.

  • It should now in theory be bootable.


now use the cd or usb to reset the password use the walkthrough if needed http://pogostick.net/~pnh/ntpasswd/