Wednesday, February 3, 2010

Debian APT issue, how to resolve it ...

Today when I had some work on my Debian Box, I've been encountered to an almost unknown issue .
There's an issue in APT package manager which is typically origins from /etc/fstab configuration file, it's almost sikt for such a big project like debian !
well, whenever you want to use your source lists, whether cdrom or http sources, there's an issue that would be nasty to you.
the prompt is always show you to add /cdrom .
well, in this point I've seen the /etc/fstab configuration file which has the following content:

# /etc/fstab: static file system information.
#
#
proc /proc proc defaults 0 0
/dev/mapper/dhcppc0-root / ext3 errors=remount-ro 0 1
/dev/sda1 /boot ext2 defaults 0 2
/dev/mapper/dhcppc0-home /home ext3 defaults 0 2
/dev/mapper/dhcppc0-tmp /tmp ext3 defaults 0 2
/dev/mapper/dhcppc0-usr /usr ext3 defaults 0 2
/dev/mapper/dhcppc0-var /var ext3 defaults 0 2
/dev/mapper/dhcppc0-swap_1 none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto 0 0


from this point of view I realized that the cdrom mount point would be at /dev/scd0, then I issued the umount /dev/scd0 ... with no success .
after that time I issued the mount command :


well, with this command I found the mounting point in the last, for the most effective part I've been used these commands :

umount /dev/hdb
mount /dev/hdb /media/cdrom

with these two commands APT will realize that the mount point is the /cdrom/ and do not prompt you at the time , this is because debian will mount the cdrom at /media/[LABLE OF THE CD] .
I don't know how this problem is solved permanently but I think it should be an update for debian.

goodluck

- Genius

Friday, January 22, 2010

2 important privilege vulnerabilities !

While surfing through new vulnerabilities I saw two important privilege escalation vulnerabilities, fist in the windows (even 7) user mode to ring0 escalation vulnerability, while other security advisory is about Panda security privilege escalation vulnerability .
well, I'll refer them to the security reason.

Microsoft Windows 7 and prior user mode to ring 0 escalation

"Microsoft Windows NT #GP Trap Handler Allows Users to Switch Kernel Stack
-------------------------------------------------------------------------

CVE-2010-0232

In order to support BIOS service routines in legacy 16bit applications,
the
Windows NT Kernel supports the concept of BIOS calls in the Virtual-8086
mode
monitor code. These are implemented in two stages, the kernel transitions
to
the second stage when the #GP trap handler (nt!KiTrap0D) detects that the
faulting cs:eip matches specific magic values.

Transitioning to the second stage involves restoring execution context and
call stack (which had been previously saved) from the faulting trap frame
once
authenticity has been verified.

This verification relies on the following incorrect assumptions:

- Setting up a VDM context requires SeTcbPrivilege.
- ring3 code cannot install arbitrary code segment selectors.
- ring3 code cannot forge a trap frame.

This is believed to affect every release of the Windows NT kernel, from
Windows NT 3.1 (1993) up to and including Windows 7 (2009).

Working out the details of the attack is left as an exercise for the
reader.

Just kidding, that was an homage to Derek Soeder :-)

- Assumption 0: Setting up a VDM context requires SeTcbPrivilege.

Creating a VDM context requires EPROCESS->Flags.VdmAllowed to be set in
order
to access the authenticated system service, NtVdmControl(). VdmAllowed can
only be set using NtSetInformationProcess(), which verifies the caller has
SeTcbPrivilege. If this is true, the caller is very privileged and can
certainly be trusted.

This restriction can be subverted by requesting the NTVDM subsystem, and
then
using CreateRemoteThread() to execute in the context of the subsystem
process,
which will already have this flag set.

- Assumption 1: ring3 code cannot install arbitrary code segment
selectors.

Cpl is usually equal to the two least significant bits of cs and ss, and
is
a simple way to calculate the privilege of a task. However, there is an
exception, Virtual-8086 mode.

Real mode uses a segmented addressing scheme in order to allow 16-bit
addresses to access the 20-bit address space. This is achieved by forming
physical addresses from a calculation like (cs << 4) + (eip &
0xffff). The
same calculation is used to map the segmented real address space onto the
protected linear address space in Virtual-8086 mode. Therefore, I must be
permitted to set cs to any value, and checks for disallowed or privileged
selectors can be bypassed (PsSetLdtEnties will reject any selector where
any
of the three lower bits are unset, as is the case with the required cs
pair).

- Assumption 2: ring3 code cannot forge a trap frame.

Returning to usermode with iret is a complicated operation, the pseudocode
for
the iret instruction alone spans several pages of Intel's Software
Developers
Manual. The operation occurs in two stages, a pre-commit stage and a
post-commit stage. Using the VdmContext installed using NtVdmControl(), an
invalid context can be created that causes iret to fail pre-commit, thus
forging a trap frame.

The final requirement involves predicting the address of the second-stage
BIOS
call handler. The address is static in Windows 2003, XP and earlier
operating
systems, however, Microsoft introduced kernel base randomisation in
Windows
Vista. Unfortunately, this potentially useful exploit mitigation is
trivial
to defeat locally as unprivileged users can simply query the loaded module
list
via NtQuerySystemInformation().

--------------------
Affected Software
------------------------

All 32bit x86 versions of Windows NT released since 27-Jul-1993 are
believed to
be affected, including but not limited to the following actively supported
versions:

- Windows 2000
- Windows XP
- Windows Server 2003
- Windows Vista
- Windows Server 2008
- Windows 7

--------------------
Consequences
-----------------------

Upon successful exploitation, the kernel stack is switched to an attacker
specified address.

An attacker would trigger the vulnerability by setting up a specially
formed VDM_TIB in their TEB, using a code sequence like this:

/* ... */
// Magic CS required for exploitation
Tib.VdmContext.SegCs = 0x0B;
// Pointer to fake kernel stack
Tib.VdmContext.Esi = &KernelStack;
// Magic IP required for exploitation
Tib.VdmContext.Eip = Ki386BiosCallReturnAddress;

NtCurrentTeb()->Reserved4[0] = &Tib;
/* ... */

Followed by

/* ... */
NtVdmControl(VdmStartExecution, NULL);
/* ... */

Which will reach the following code sequence via the #GP trap handler,
nt!KiTrap0D. Please note how the stack pointer is restored from the saved
(untrusted) trap frame at 43C3E6, undoubtedly resulting in the condition
described above.

/* ... */
.text:0043C3CE Ki386BiosCallReturnAddress proc near
.text:0043C3CE mov eax, large fs:KPCR.SelfPcr
.text:0043C3D4 mov edi, [ebp+KTRAP_FRAME.Esi]
.text:0043C3D7 mov edi, [edi]
.text:0043C3D9 mov esi, [eax+KPCR.NtTib.StackBase]
.text:0043C3DC mov ecx, 84h
.text:0043C3E1 mov [eax+KPCR.NtTib.StackBase], edi
.text:0043C3E4 rep movsd
.text:0043C3E6 mov esp, [ebp+KTRAP_FRAME.Esi]
.text:0043C3E9 add esp, 4
.text:0043C3EC mov ecx, [eax+KPCR.PrcbData.CurrentThread]
.text:0043C3F2 mov [ecx+KTHREAD.InitialStack], edi
.text:0043C3F5 mov eax, [eax+KPCR.TSS]
.text:0043C3F8 sub edi, 220h
.text:0043C3FE mov [eax+KTSS.Esp0], edi
.text:0043C401 pop edx
.text:0043C402 mov [ecx+KTHREAD.Teb], edx
.text:0043C405 pop edx
.text:0043C406 mov large fs:KPCR.NtTib.Self, edx
.text:0043C40D mov ebx, large fs:KPCR.GDT
.text:0043C414 mov [ebx+3Ah], dx
.text:0043C418 shr edx, 10h
.text:0043C41B mov byte ptr [ebx+3Ch], dl
.text:0043C41E mov [ebx+3Fh], dh
.text:0043C421 sti
.text:0043C422 pop edi
.text:0043C423 pop esi
.text:0043C424 pop ebx
.text:0043C425 pop ebp
.text:0043C426 retn 4
/* ... */

Possibly naive example code for triggering this condition is availble from
the
link below.

http://lock.cmpxchg8b.com/c0af0967d904cef2ad4db766a00bc6af/KiTrap0D.zip

The code has been tested on Windows XP, Windows Server 2003/2008, Windows
Vista
and Windows 7. Support for other affected operating systems is left as an
exercise for the interested reader.

-------------------
Mitigation
-----------------------

If you believe you may be affected, you should consider applying the
workaround
described below.

Temporarily disabling the MSDOS and WOWEXEC subsystems will prevent the
attack
from functioning, as without a process with VdmAllowed, it is not possible
to
access NtVdmControl() (without SeTcbPrivilege, of course).

The policy template "Windows ComponentsApplication
CompatibilityPrevent
access to 16-bit applications" may be used within the group policy
editor to
prevent unprivileged users from executing 16-bit applications. I'm
informed
this is an officially supported machine configuration.

Administrators unfamiliar with group policy may find the videos below
instructive. Further information is available from the Windows Server
Group Policy Home

http://technet.microsoft.com/en-us/windowsserver/grouppolicy/default.aspx.

To watch a demonstration of this policy being applied to a Windows Server
2003
domain controller, see the link below.

http://www.youtube.com/watch?v=XRVI4iQ2Nug

To watch a demonstration of this policy being applied to a Windows Server
2008
domain controller, see the link below.

http://www.youtube.com/watch?v=u8pfXW7crEQ

To watch a demonstration of this policy being applied to a shared but
unjoined Windows XP Professional machine, see the link below.

http://www.youtube.com/watch?v=u7Y6d-BVwxk

On Windows NT4, the following knowledgebase article explains how to disable
the
NTVDM and WOWEXEC subsystems.

http://support.microsoft.com/kb/220159

Applying these configuration changes will temporarily prevent users from
accessing legacy 16-bit MS-DOS and Windows 3.1 applications, however, few
users
require this functionality.

If you do not require this feature and depend on NT security, consider
permanently disabling it in order to reduce kernel attack surface.

-------------------
Solution
-----------------------

Microsoft was informed about this vulnerability on 12-Jun-2009, and they
confirmed receipt of my report on 22-Jun-2009.

Regrettably, no official patch is currently available. As an effective and
easy
to deploy workaround is available, I have concluded that it is in the best
interest of users to go ahead with the publication of this document without
an
official patch. It should be noted that very few users rely on NT security,
the
primary audience of this advisory is expected to be domain administrators
and
security professionals.

-------------------
Credit
-----------------------

This bug was discovered by Tavis Ormandy.

-------------------
Greetz
-----------------------

Greetz to Julien, Neel, Redpig, Lcamtuf, Spoonm, Skylined, asiraP,
LiquidK,
ScaryBeasts, spender and all my other elite colleagues.

Check out some photography while at ring0 @ http://flickr.com/meder.

-------------------
References
-----------------------

Derek Soeder has previously reported some legendary NT bugs, including
multiple
vdm bugs that, while unrelated to this issue, make fascinating reading.

- http://seclists.org/fulldisclosure/2004/Oct/404, Windows VDM #UD
LocalPrivilege Escalation
- http://seclists.org/fulldisclosure/2004/Apr/477, Windows VDM TIB Local
Privilege Escalation
- http://seclists.org/fulldisclosure/2007/Apr/357, Zero Page Race Condition
Privilege Escalation
"

Panda Security local privilege escalation vulnerability

"security Advisory NSOADV-2010-001 (Version 2)
______________________________________________
______________________________________________


Title: Panda Security Local Privilege Escalation
Severity: Medium
Advisory ID: NSOADV-2010-001
Found Date: 02.2008
Date Reported: 30.11.2009
Release Date: 09.01.2010
Update Date: 20.01.2010
Author: Nikolas Sotiriu (lofi)
Website: http://sotiriu.de
Mail: nso-research at sotiriu.de
URL: http://sotiriu.de/adv/NSOADV-2010-001.txt
Vendor: Panda Security (http://www.pandasecurity.com/)
Affected Products: (Self tested)
-Panda Security for Business 4.04.10
-Panda Security for Business with Exchange
4.04.10
-Panda Security for Enterprise 4.04.10
-Panda Internet Security 2010 (15.01.00)
-Panda Global Protection 2010 (3.01.00)
-Panda Antivirus Pro 2010 (9.01.00)
-Panda Antivirus for Netbooks (9.01.00)

(Provided by Panda)
-Panda Global Protection 2009
-Panda Internet Security 2009
-Panda Antivirus Pro 2009
-Panda Internet Security 2008
-Panda Antivirus + Firewall 2008
-Panda Platinum 2007 Internet Security
-Panda Platinum 2006 Internet Security

Affected Component: Corporate Products:
-Panda Security for Desktops 4.05.10
-Panda Security for File Servers 8.04.10

Remote Exploitable: No
Local Exploitable: Yes
Patch Status: Vendor released a patch (See Solution)
Discovered by: Nikolas Sotiriu
Disclosure Policy: http://sotiriu.de/policy.html
Thanks to: Thierry Zoller: For the permission to use his
Policy



Background:
===========

Panda Security for is the security solution for companies
that
need to protect their networks, mainly workstations and file servers.
Panda Security for Business is centrally managed thanks to the
AdminSecure Console, which allows monitoring the entire network,
protecting your critical assets against all types of threats and
optimizing productivity.

(Product description from Panda Website)

This vulnerability is similar to the following vulnerabilities in Panda
products, which where discovered earlier:

Sep 07 2006 3APA3A: http://www.securityfocus.com/bid/19891
Aug 02 2007 tarkus: http://www.securityfocus.com/bid/25186
Oct 31 2009 Protek: http://www.securityfocus.com/archive/1/507615
Nov 02 2009 Maxim: http://www.securityfocus.com/bid/36897

The earlier reported vulnerabilities only affected the Home user
products. But the business products had the same bug.

More interesting is, that Panda failed since 2006 each year by
releasing the new version with the same old bug.



Description:
============

1. 32Bit Version of Panda Security for Desktops/File Servers
+-----------------------------------------------------------

During installation of Panda Security for Desktops/File Servers the
permissions for installation folder

%ProgramFiles%Panda SoftwareAVTC

by default are set to Everyone:Full Control. Few services
(e.g. PAVSRV51.EXE) are started from this folder. Services are started
under LocalSystem account.

The 32bit Version of Panda Security for Desktops/File Servers
installs the TruePrevent package by default, which protects the files
in the installation directory from manipulation.

If the TruePrevent Service (Panda TPSrv) is not running the files are
completely unprotected.

A normal user is not able to stop the service, but normally he can boot
his workstation in SafeBoot mode, in which the TPSrv is not started and
all services files can be manipulated.

This can be exploited by:

a. Boot the PC in SafeBoot mode, by pressing F8 during the boot
process
b. Rename PAVSRV51.exe to PAVSRV51.old in Panda folder
c. Copy any application to PAVSRV51.exe
d. Reboot

Upon reboot trojaned application will be executed with LocalSystem
account.

Executable started as services:
+------------------------------
%ProgramFiles%PANDA SOFTWAREAVTCPSKMsSvc.exe (Desktop only)
%ProgramFiles%PANDA SOFTWAREAVTCPavSrv51.exe
%ProgramFiles%PANDA SOFTWAREAVTCPavFnSvr.exe
%ProgramFiles%PANDA SOFTWAREAVTCPSHost.exe
%ProgramFiles%PANDA SOFTWAREAVTCPsImSvc.exe
%ProgramFiles%PANDA SOFTWAREAVTCPsCtrlS.exe
%ProgramFiles%PANDA SOFTWAREAVTCTPSrv.exe


2. 64Bit Version of Panda Security for Desktops/File Servers
+-----------------------------------------------------------

During installation of Panda Security for Desktops/File Servers the
permissions for installation folder

%ProgramFiles%Panda SoftwareAVTC

by default are set to Everyone:Full Control. Few services
(e.g. PavSrvx86.EXE) are started from this folder. Services are started
under LocalSystem account.

In the 64bit Version of Panda Security for Desktops/File Servers is no
TruePrevent package available, which protects the files in the
installation directory from manipulation.

There is no protection of service files. It's possible for unprivileged
user to replace service executable with the file of his choice to get
full access with LocalSystem privileges.

This can be exploited by:

a. Rename PavSrvX86.exe to PavSrvX86.old in Panda folder
b. Copy any application to PavSrvX86.exe
c. Reboot

Upon reboot trojaned application will be executed with LocalSystem
account.

Executable started as services:
+------------------------------
C:Program Files (x86)PANDA SOFTWAREAVNTPavSrvX86.exe
C:Program Files (x86)PANDA SOFTWAREAVNTPsImSvc.exe
C:Program Files (x86)PANDA SOFTWAREAVNTPskSvc.exe
C:Program Files (x86)PANDA SOFTWAREAVNTPsCtrlS.exe


3. Panda Internet Security/Global Protection/Antivirus Pro 20XX
+-----------------------------------------------------------------------

During installation of the Panda Security 20XX Products the
permissions for installation folder

%ProgramFiles%panda securitypanda

by default are set to Everyone:Full Control. Few services
(e.g. PAVSRV51.EXE) are started from this folder. Services are started
under LocalSystem account.

This products installs the TruePrevent package by default, which
protects the files in the installation directory from manipulation.

If the TruePrevent Service (Panda TPSrv) is not running the files are
completely unprotected.

A normal user is not able to stop the service, but normally he can boot
his workstation in SafeBoot mode, in which the TPSrv is not started and
all services files can be manipulated.

This can be exploited by:

a. Boot the PC in SafeBoot mode, by pressing F8 during the boot
process
b. Rename PAVSRV51.exe to PAVSRV51.old in Panda folder
c. Copy any application to PAVSRV51.exe
d. Reboot

Upon reboot trojaned application will be executed with LocalSystem
account.

Executable started as services:
+------------------------------
%ProgramFiles%panda securitypanda firewallPSHOST.EXE
%ProgramFiles%Panda SecurityPanda PavFnSvr.exe
%ProgramFiles%Panda SecurityPanda PsImSvc.exe
%ProgramFiles%Panda SecurityPanda pavsrv51.exe
%ProgramFiles%Panda SecurityPanda PskSvc.exe
%ProgramFiles%Panda SecurityPanda PsCtrls.exe
%ProgramFiles%Panda SecurityPanda TPSrv.exe


4. Panda Antivirus for Netbooks
+------------------------------

During installation of the Panda Antivirus for Netbooks the
permissions for installation folder

%ProgramFiles%panda securityPanda Antivirus for Netbooks

by default are set to Everyone:Full Control. Few services
(e.g. PAVSRV51.EXE) are started from this folder. Services are started
under LocalSystem account.

This product installs the TruePrevent package by default, which protects
the files in the installation directory from manipulation.

If the TruePrevent Service (Panda TPSrv) is not running the files are
completely unprotected.

A normal user is not able to stop the service, but normally he can boot
his workstation in SafeBoot mode, in which the TPSrv is not started and
all services files can be manipulated.

This can be exploited by:

a. Boot the PC in SafeBoot mode, by pressing F8 during the boot
process
b. Rename PAVSRV51.exe to PAVSRV51.old in Panda folder
c. Copy any application to PAVSRV51.exe
d. Reboot

Upon reboot trojaned application will be executed with LocalSystem
account.

This product was not patched like the other 2010 products, so the
the following vulnerability already exists:

http://www.securityfocus.com/bid/36897

TruePrevent bypass: It can be bypassed using "Open" dialog in
"Quarantine" -> Add file" functionality.

Executable started as services:
+------------------------------
%ProgramFiles%Panda SecurityPanda Antivirus for NetbooksPavFnSvr.exe
%ProgramFiles%Panda SecurityPanda Antivirus for NetbooksPsImSvc.exe
%ProgramFiles%Panda SecurityPanda Antivirus for Netbookspavsrv51.exe
%ProgramFiles%Panda SecurityPanda Antivirus for NetbooksPskSvc.exe
%ProgramFiles%Panda SecurityPanda Antivirus for NetbooksPsCtrls.exe
%ProgramFiles%Panda SecurityPanda Antivirus for NetbooksTPSrv.exe



Proof of Concept :
==================

#include
#include

INT main( VOID )
{
CHAR szWinDir[ _MAX_PATH ];
CHAR szCmdLine[ _MAX_PATH ];

GetEnvironmentVariable( "WINDIR", szWinDir, _MAX_PATH );

printf( "Creating user "owner" with password
"PandaOWner123"...n" );

wsprintf( szCmdLine, "%s\system32\net.exe user owner PandaOWner123
/add", szWinDir );

system( szCmdLine );

printf( "Adding user "owner" to the local Administrators
group...n" );

wsprintf( szCmdLine, "%s\system32\net.exe localgroup Administrators
owner /add", szWinDir );

system( szCmdLine );

return 0;
}



Solution:
=========

Home User Products:
+------------------

Panda Advisory
http://www.pandasecurity.com/homeusers/support/card?id=80173&idIdioma=2


Panda Global Protection 2010 Hotfix
http://www.pandasecurity.com/resources/sop/PGP10/hfgp30906s22_r4.exe

Panda Internet Security 2010 Hotfix
http://www.pandasecurity.com/resources/sop/PIS10/hfp150906s25_r1.exe

Panda Antivirus Pro 2010 Hotfix
http://www.pandasecurity.com/resources/sop/PAVPro10/hft90906s21_r1.exe


Business Products:
+-----------------

Panda Advisory
http://www.pandasecurity.com/enterprise/support/card?id=40061&idIdioma=
2

32Bit Version of Panda Security for Desktops/File Servers Hotfix
http://www.pandasecurity.com/resources/sop/AS0404/CSS_x86_SecurityFix.exe

64Bit Version of Panda Security for Desktops/File Servers Hotfix
http://www.pandasecurity.com/resources/sop/AS0404/CSS_x64_SecurityFix.exe
"

Sunday, January 17, 2010

Unwelcome Attack from Maskan-Bank

Unfortunately, the (in)secure iranian government and criticial websites are still highly vulnerablle to malware attacks .
I'm not still sure about this one, 'cuze of the time I've been spended.
it's a link to the maskan-bank, you can click here to see what I mean .
you would like to do such a thing like calculation of something related to your payment.
well, it's really this one and when you go to the above link in fact you're talking to this link .
well, you maybe heared about the some dangerous attacks from various places which is known to the people which is affected before this report .
some website / pages and other web based places is vulnerable to known web application attacks such as Xss (Cross site scripting) and SQL Injection (the most known vulnerability) .
iFrame pages, is a well-known javaScript pages which can load a whole page in a little piece of page .
as you may expect, yes, it's exactly what I want to say, another malicious pages can be loaded into your vulnerable website pages, consider your website PHP pages maybe vulnerable to SQL Injection attacks, if there's an automated tool which scans for malicious pages and affect them then it's possible to infect other web pages .
so, Is there any kind of web based worms which can do such a thing?
the answer is yes, nowadays this attack is common and can affect any page even secure web pages !
well, when you go to the link and want do some calculations, then you will be redirected to a page which is malicious .
there's various kinds of malwares which can affect the Client browser, exploits / viruses are just a few of them and it seems this one is a web based virus .
well finally all the attacks are from this jScript page.



further analysis will be post here as soon as possible about this attack .

any feedback !?

__Genius__

Friday, January 15, 2010

Back-Track 4.0 final release

Now it's time to announce the final release of backTrack 4.0 linux, a distro for penetration testers and hackers .
The primary change of this release is the base of the os, olden releases of this distro was based on slax and now it's a debian based .
for more information and download you can follow this link .

Tuesday, December 15, 2009

PostgreSQL 8.4.2, 8.3.9, 8.2.15, 8.1.19, 8.0.23 and 7.4.27 have security fixes ....



There's some available security patches for the postGreSQL versions : 8.4.2, 8.3.9, 8.2.15, 8.1.19, 8.0.23 and 7.4.27 .
These updates are available through this link, check and update .

Wednesday, September 30, 2009

Saturday, September 19, 2009

Third book of Rootkits

If you are one of the guys who is interested in Rootkits ( Dark Guys ;) )(I have insanity about rootkits) like me , then you love and know eveything about them, remember the old days that the book rootkits : subverting the windows kernel was published by Greg huglond and James Butler, and the second book on rootkits was Professional rootkits from wrox press (great publisher) and now the third publication on Rootkit subject is the rootkit arsenal. I didn't see it and don't reading this till now, but tonight, I saw this great book that Open-RCE guys announced, and I've been prepared for downloading . here's the properties, check it out, and put your feedback here .




and the table of contents :

Part 1 Foundations
Chapter 1 Setting the Stage
Chapter 2 Into the Catacombs: IA-32
Chapter 3 Windows System Architecture
Chapter 4 Rootkit Basics
Part 2 System Modification
Chapter 5 Hooking Call Tables
Chapter 6 Patching System Routines
Chapter 7 Altering Kernel Objects
Chapter 8 Deploying Filter Drivers
Part 3 Anti-Forensics
Chapter 9 Defeating Live Response
Chapter 10 Defeating File System Analysis
Chapter 11 Defeating Network Analysis
Chapter 12 Countermeasure Summary
Part 4 End Material
Chapter 13 The Tao of Rootkits
Chapter 14 Closing Thoughts


then a good announcement is you can download this great book as ebook ;)
here's the download link .

Saturday, September 12, 2009

Reverse me #1

Hey there, here's I've been written a simple / simple / simple program, you must reverse it, it will show you a simple message box and say : Win32 Assembly is great !.
It has just one button , "Ok", you must reverse this program and patch it for showing another button "cancel" after the patch process you must upload the patched file here, and the file must have two button, first "Ok" and other "cancel" .
here's the link :
http://rapidshare.com/files/279257573/ReverseMe_1.exe.html
this is a simple reverse me for newbies, not pros ! so leave the newbies alone !
thnx .

Friday, August 21, 2009

Conficker Eye Chart

if you are interested in malware analysis it may be great for see and read this interesting post, if you remembered the old Storm worm and nowdays "Conficker" worms are known as the dangerous worms in all the times, unhappily the Conficker worm block the access to almost 100 websites dedicated to security and threat analysis and also official antivirus websites.
a malware analyser named "Joe Stewart" is here and now you can see his interesting tool which can recognize if a system infected to conficker worm or not .
it has been done just by simply visiting a web page that is placed here .
this tool is named "Conficker Eye Chart" . when you visit this web page you saw some images , in the header if you saw this image then possibly you may not infected with conficker .


if you saw the following image possibly you may be infected with the conficker C variant or greater .





if you saw the following image then possibly you may be infected with B variant :




if you saw something like that then must turn on image loading in your own Internet Browser .




let's check it out and put your comment here .


Friday, July 31, 2009

Build a .NET Application on the Oracle Database with Visual Studio 2005 or 2008

With the popularity of Microsoft's .NET Framework, many developers are hungry for information about the best means of integrating .NET applications with Oracle—not only in terms of basic connectivity, but also in relationship to effective and efficient application development using Visual Studio 2005 or 2008.

In this article, I'll explain the basic yet essential processes involved in building a .NET application that uses an Oracle database, including:

  • How to add project references to support Oracle class libraries in your .NET project
  • How to create Oracle Database connection strings
  • How to work with Connection, Command, and DataReader objects

You will have the opportunity to apply what you have learned in three practice labs, ranging in difficulty from the relatively simple to the more complex. The article's screenshots are taken from Visual Studio 2008, but the experience is very similar in Visual Studio 2005.

For information and labs about how to secure your application, see my article "Securing a .NET Application on the Oracle Database". (Also, see the OTN .NET Developer Center for technical articles covering a range of Oracle.NET application lifecycle issues.)

Note that the free Oracle Developer Tools for Visual Studio, available for download from OTN, provides a Visual Studio add-in that makes the development of .NET apps on Oracle much easier and more intuitive. That subject is beyond our scope here, however.

.NET Data Provider

In addition to basic Oracle client connectivity software, .NET applications require the use of what is known as a managed data provider (where "managed" refers to code managed by the .NET framework). The data provider is the layer between the .NET application code and the Oracle client connectivity software. In almost every case, the best performance is achieved by using a provider optimized for a specific database platform instead of the generic .NET OLE DB data provider.

Oracle, Microsoft, and third-party vendors all offer .NET data providers optimized for Oracle. Oracle and Microsoft make their Oracle data providers available for free. (Microsoft's provider for the .NET Framework 2.0 is included in the framework, but it still requires Oracle client software installation.) In this article, we will use of the Oracle Data Provider for .NET (ODP.NET), which is included with the Oracle Database or as a separate download.

ODP.NET provides standard ADO.NET data access, while exposing Oracle database-specific features, such as XML DB, data access performance optimizations, and Real Application Clusters connection pooling.

When ODP.NET and Oracle client software are installed, application development using Visual Studio can begin. It's a good idea to confirm client connectivity before starting development. If you can connect to Oracle using Oracle client software such as SQL*Plus on the same machine as Visual Studio, then you know that your Oracle client-side software is properly installed and configured.

If you are new to Oracle, see the section "Installing .NET Products" in the Oracle Database 2 Day Developer's Guide for background information regarding installing and configuring ODP.NET specifically, or to the Oracle Database Documentation Library for general information about Oracle Database.

Creating a Project in Visual Studio 2005 or 2008

Let's create an ODP.NET application that retrieves data from an Oracle database. Later, we'll see how to perform error handling with ODP.NET and handle an additional data retrieval scenario.

After starting Visual Studio, the first task is to create a project. You can either select File | New | Project as shown below or click the New Project button located directly under File.



A New Project dialog box appears. On the left side of the dialog box under Project Types, select the programming language of your choice. In our example, "Visual Basic" was chosen. On the right side under Visual Studio installed templates, choose a project template. To keep things simple, a "Windows Forms Application" is selected.



You'll want to specify meaningful names for the project name (we used OraWinApp) and the solution name (we used OraWinApp). A solution contains one or more projects. When a solution contains only one project, many people use the same name for both.

Adding a Reference

Because our project must connect to an Oracle database, it is necessary to add a reference to the ODP.NET DLL containing the data provider of our choice. Within the Solution Explorer, select the project name, right click and select Add Reference. Alternatively, you can go to the menu bar and select Project and then select Add Reference.



The Add Reference dialog box appears.


ODP.NET is found under the Oracle.DataAccess component name. Select Oracle.DataAccess from the list, then click OK to make the ODP.NET data provider known to your project.

Visual Basic/C# Statements

After adding references, it is standard practice to add Visual Basic Imports statements or C# using statements. Technically, these statements are not required but they do allow you to refer to database objects without using lengthy, fully qualified names.

By convention, these statements appear at or near the top of a code file, before the namespace or class declaration.

Imports Oracle.DataAccess.Client ' Visual Basic ODP.NET Oracle managed provider




using Oracle.DataAccess.Client; // C# ODP.NET Oracle managed provider
If you added the reference, Intellisense will help you complete the addition of an Imports or using statement as shown in Figure 5.


Connection Strings and Objects

An Oracle connection string is inseparable from Oracle names resolution. Suppose you had a database alias of OraDb defined in a tnsnames.ora file as follows:

OraDb=
(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=TCP)(HOST=ORASRVR)(PORT=1521))
)
(CONNECT_DATA=
(SERVER=DEDICATED)
(SERVICE_NAME=ORCL)
)
)
The OraDb alias defines the database address connection information for the client. To use the OraDb alias defined in the tnsnames.ora file shown above, you would use the following syntax:
Dim oradb As String = "Data Source=OraDb;User Id=scott;Password=tiger;" ' Visual Basic

string oradb = "Data Source=OraDb;User Id=scott;Password=tiger;"; // C#
You can modify the connection string to obviate the need for the tnsnames.ora file, however. Simply replace the name of the alias with how it would be defined in a tnsnames.ora file.
' Visual Basic
Dim oradb As String = "Data Source=(DESCRIPTION=" _
+ "(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=ORASRVR)(PORT=1521)))" _
+ "(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=ORCL)));" _
+ "User Id=scott;Password=tiger;"

// C#
string oradb = "Data Source=(DESCRIPTION="
+ "(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=ORASRVR)(PORT=1521)))"
+ "(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=ORCL)));"
+ "User Id=scott;Password=tiger;";
As you can see above, the username and password are embedded in the connection string in clear text. This is the simplest approach to creating a connection string. However, the clear text approach is undesirable from a security perspective. In particular, you must understand that compiled .NET application code is only marginally more secure than the clear text source code files. It is very easy to decompile .NET DLL and EXE files and view the original clear text contents. (Encryption is in fact the appropriate solution, but that subject would be a quite lengthy digression from our discussion here.)

Next, you must instantiate a connection object from the connection class. The connection string must be associated with the connection object.

Dim conn As New OracleConnection(oradb) ' Visual Basic

OracleConnection conn = new OracleConnection(oradb); // C#
Notice that the connection string is associated with the connection object by being passed through the object's constructor, which is overloaded. The constructor's other overload allows the following alternative syntax:
Dim conn As New OracleConnection() ' Visual Basic
conn.ConnectionString = oradb

OracleConnection conn = new OracleConnection(); // C#
conn.ConnectionString = oradb;
After associating a connection string with a connection object, use the Open method to make the actual connection.
conn.Open() ' Visual Basic

conn.Open(); // C#
We'll cover error handling later.

Command Object

The Command object is used to specify the SQL command text that is executed, either a SQL string or a stored procedure. Similar to the Connection object, it must be instantiated from its class and it has an overloaded constructor. In this sample, ODP.NET will perform a SQL query to return the department name (DNAME) from the departments table (DEPT) where the department number (DEPTNO) is 10.

Dim sql As String = "select dname from dept where deptno = 10" ' Visual Basic
Dim cmd As New OracleCommand(sql, conn)
cmd.CommandType = CommandType.Text

string sql = "select dname from dept where deptno = 10"; // C#
OracleCommand cmd = new OracleCommand(sql, conn);
cmd.CommandType = CommandType.Text;
Using different overloads, the syntax can be structured slightly differently. The Command object has methods for executing the command text, which will be seen in the next section. Different methods are appropriate for different types of SQL commands.

Retrieving a Scalar Value

Retrieving data from the database can be accomplished by instantiating an OracleDataReader object and using the ExecuteReader method, which returns an OracleDataReader object. Returned data is accessible by passing either the column name or zero-based column ordinal to the OracleDataReader.

Dim dr As OracleDataReader = cmd.ExecuteReader() ' Visual Basic
dr.Read()

Label1.Text = dr.Item("dname") ' retrieve by column name
Label1.Text = dr.Item(0) ' retrieve the first column in the select list
Label1.Text = dr.GetString(0) ' return a .NET data type
Label1.Text = dr.GetOracleString(0) ' return an Oracle data type
There are typed accessors for returning .NET native data types and others for returning native Oracle data types, all of which are available in C#, Visual Basic, or any other .NET language. Zero-based ordinals are passed to the accessors to specify which column to return.
OracleDataReader dr = cmd.ExecuteReader(); // C#
dr.Read();

label1.Text = dr["dname"].ToString(); // C# retrieve by column name
label1.Text = dr.GetString(0).ToString(); // return a .NET data type
label1.Text = dr.GetOracleString(0).ToString(); // return an Oracle data type
In this simplified example, the returned value of DNAME is a string and is used to set the value of the label control's text property, which is also a string. But if DEPTNO, which is not a string, had been retrieved instead, there would be a data type mismatch. The .NET runtime attempts to implicitly convert from one data type to another when the source and destination data types don't match. Sometimes the data types are incompatible and the implicit conversion fails, throwing an exception. But even when it works, it's still better to use explicit data type conversions instead of implicit data type conversion.

An explicit cast to integer is shown below:

Label1.Text = CStr(dr.Item("deptno")) ' Visual Basic integer to string cast

C# is not as forgiving as Visual Basic on implicit conversions. You'll find yourself doing explicit conversions:

label1.Text = dr.GetInt16("deptno").ToString(); // C#
You can explicitly cast scalar values as well as arrays.

Close and Dispose

Either the connection object's Close or the Dispose method should be called to close the connection to the database. The Dispose method calls the Close method.

conn.Close()   ' Visual Basic
conn.Dispose() ' Visual Basic

conn.Close(); // C#
conn.Dispose(); // C#
You don't have to explicitly call Close or Dispose if you use VB's Using keyword or C#'s using keyword.
using (OracleConnection conn = new OracleConnection(oradb)) // C#
{
conn.Open();

OracleCommand cmd = new OracleCommand();
cmd.Connection = conn;
cmd.CommandText = "select dname from dept where deptno = 10";
cmd.CommandType = CommandType.Text;

OracleDataReader dr = cmd.ExecuteReader();
dr.Read();

label1.Text = dr.GetString(0);
}
In addition, OracleCommand includes a Dispose method; OracleDataReader includes a Close and Dispose method. Closing and disposing .NET objects free up system resources, ensuring more efficient application performance, which is especially important under high load conditions. You can experiment with some of the concepts we've learned here in Lab 1 (Retrieving Data from the Database) and Lab 2 (Adding Interactivity).

Error Handling

When an error occurs, .NET applications should gracefully handle the error and inform the user with a meaningful message. Try-Catch-Finally structured error handling is a part of .NET languages; here is a relatively minimalist example of using the Try-Catch-Finally syntax:

' Visual Basic
Try
conn.Open()

Dim cmd As New OracleCommand
cmd.Connection = conn
cmd.CommandText = "select dname from dept where deptno = " + TextBox1.Text
cmd.CommandType = CommandType.Text

If dr.Read() Then
Label1.Text = dr.Item("dname") ' or use dr.Item(0)
End If
Catch ex As Exception ' catches any error
MessageBox.Show(ex.Message.ToString())
Finally
' In a real application, put cleanup code here.
End Try

// C#
try
{
conn.Open();

OracleCommand cmd = new OracleCommand();
cmd.Connection = conn;
cmd.CommandText = "select dname from dept where deptno = " + textBox1.Text;
cmd.CommandType = CommandType.Text;

if (dr.Read()) // C#
{
label1.Text = dr["dname"].ToString();
// or use dr.GetOracleString(0).ToString()
}
}
catch (Exception ex) // catches any error
{
MessageBox.Show(ex.Message.ToString());
}
finally
{
// In a real application, put cleanup code here.



}
Although this approach will gracefully capture any errors in attempting to get data from the database, it is not user friendly. For example, look at the following message displayed when the database is unavailable:


An ORA-12545 is quite meaningful for an Oracle DBA or developer, but not for an end user. A better solution is to add an additional Catch statement to trap for the most common database errors and provide user-friendly messages.
Catch ex As OracleException ' catches only Oracle errors
Select Case ex.Number
Case 1
MessageBox.Show("Error attempting to insert duplicate data.")
Case 12545
MessageBox.Show("The database is unavailable.")
Case Else
MessageBox.Show("Database error: " + ex.Message.ToString())
End Select
Catch ex As Exception ' catches any error
MessageBox.Show(ex.Message.ToString())

catch (OracleException ex) // catches only Oracle errors
{
switch (ex.Number)
{
case 1:
MessageBox.Show("Error attempting to insert duplicate data.");
break;
case 12545:
MessageBox.Show("The database is unavailable.");
break;
default:
MessageBox.Show("Database error: " + ex.Message.ToString());
break;
}
}
catch (Exception ex) // catches any error not previously caught
{
MessageBox.Show(ex.Message.ToString());



}
Notice the two Catch statements in the code sample above. If there aren't any Oracle errors to catch, the first statement branch is skipped, leaving any other non-Oracle error to be caught by the second statement. Catch statements must be ordered in the code from most specific to most general. After implementing the user-friendly exception handling code, the ORA-12545 error message appears as follows:


The Finally code block is always executed regardless of whether or not an error occurred. It is where cleanup code belongs. If you don't use Using or using, you should dispose your connection and other objects in the Finally code block.

Retrieving Multiple Values Using a DataReader

So far our examples have only showed how to retrieve a single value. An OracleDataReader can retrieve values for multiple columns and multiple rows. First consider a multiple column, single row query:

select deptno, dname, loc from dept where deptno = 10
To obtain the values of the columns, either zero-based ordinals or column names can be used. Ordinals are relative to the order in the query. Thus, the LOC column's value can be retrieved in Visual Basic by using either dr.Item(2) or dr.Item("loc").

Here is a code snippet that concatenates the DNAME and LOC columns from the previous query:

Label1.Text = "The " + dr.Item("dname") + " department is in " + dr.Item("loc") ' VB

label1.Text = "The " + dr["dname"].ToString() + " department is in " +
dr["loc"].ToString(); // C#
Now consider a query that returns multiple rows:
select deptno, dname, loc from dept
To process multiple rows returned from an OracleDataReader, some type of looping construct is needed. Furthermore, a control that can display multiple rows is desirable. An OracleDataReader is a forward-only, read-only cursor, so it can't be bound to an updateable or fully scrollable control such as a Windows Forms DataGrid control. An OracleDataReader is compatible with a ListBox control, as the following code snippet illustrates:
While dr.Read() ' Visual Basic
ListBox1.Items.Add("The " + dr.Item("dname") + " department is in " + dr.Item("loc"))
End While

while (dr.Read()) // C#
{
listBox1.Items.Add("The " + dr["dname"].ToString() + " department is in " +
dr["loc"].ToString());



}
Lab 3 (Retrieve Multiple Columns and Rows with an OracleDataReader) highlights some of these concepts.

Building and Running on x64

When running Visual Studio 2008 on an x64 operating system, the Active solution platform defaults to Any CPU. Change that to x86 before building your project.



Conclusion

This article has introduced you to the process of accessing Oracle databases using .NET programming languages. You should now have the capability to connect to the database and retrieve multiple columns and rows.


the next post is about the lab section of our post .

you can find the original source at Oracle's website .


Thursday, July 23, 2009

Arp Cache poisoning revealed

Anatomy of an ARP Poisoning Attack
by Corey Nachreiner, WatchGuard Network Security Analyst

Hackers lie. Skillful hackers lie well. And well-rounded hackers can lie both to people and to machines.

Lying to people, known as "social engineering," involves tactics (detailed at length by convicted hacker Kevin Mitnick) such as posing as a company's employee so the company's real employees will blab secrets freely. Lying to machines involves lots of different techniques, and a commonly used one -- ARP Cache Poisoning -- is the focus of this article. ARP poisoning enables local hackers to cause general networking mayhem. Because it's mostly "incurable," every administrator should be aware of how this attack works.
ARP Refresher

In Foundations: What Are NIC, MAC, and ARP?, we explained that Address Resolution Protocol (ARP) is how network devices associate MAC addresses with IP Addresses so that devices on the local network can find each other. ARP is basically a form of networking roll call.

ARP, a very simple protocol, consists of merely four basic message types:

1.

An ARP Request. Computer A asks the network, "Who has this IP address?"
2.

An ARP Reply. Computer B tells Computer A, "I have that IP. My MAC address is [whatever it is]."
3.

A Reverse ARP Request (RARP). Same concept as ARP Request, but Computer A asks, "Who has this MAC address?"
4.

A RARP Reply. Computer B tells Computer A, "I have that MAC. My IP address is [whatever it is]"

All network devices have an ARP table, a short-term memory of all the IP addresses and MAC addresses the device has already matched together. The ARP table ensures that the device doesn't have to repeat ARP Requests for devices it has already communicated with.

Here's an example of a normal ARP communication. Jessica, the receptionist, tells Word to print the latest company contact list. This is her first print job today. Her computer (IP address 192.168.0.16) wants to send the print job to the office's HP LaserJet printer (IP address 192.168.0.45). So Jessica's computer broadcasts an ARP Request to the entire local network asking, "Who has the IP address, 192.168.0.45?" as seen in Diagram 1.

All the devices on the network ignore this ARP Request, except for the HP LaserJet printer. The printer recognizes its own IP in the request and sends an ARP Reply: "Hey, my IP address is 192.168.0.45. Here is my MAC address: 00:90:7F:12:DE:7F," as in Diagram 2.

Now Jessica's computer knows the printer's MAC address. It sends the print job to the correct device, and it also associates the printer's MAC address of 00:90:7F:12:DE:7F with the printer's IP address of 192.168.0.45 in its ARP table.
Hey ARP, Did You Know Gullible Is Not in the Dictionary?

The founders of networking probably simplified the communication process for ARP so that it would function efficiently. Unfortunately, this simplicity also leads to major insecurity. Know why my short description of ARP doesn't mention any sort of authentication method? Because in ARP, there is none.

ARP is very trusting, as in, gullible. When a networked device sends an ARP request, it simply trusts that when the ARP reply comes in, it really does come from the correct device. ARP provides no way to verify that the responding device is really who it says it is. In fact, many operating systems implement ARP so trustingly that devices that have not made an ARP request still accept ARP replies from other devices.

OK, so think like a malicious hacker. You just learned that the ARP protocol has no way of verifying ARP replies. You've learned many devices accept ARP replies before even requesting them. Hmmm. Well, why don't I craft a perfectly valid, yet malicious, ARP reply containing any arbitrary IP and MAC address I choose? Since my victim's computer will blindly accept the ARP entry into its ARP table, I can force my victim's gullible computer into thinking any IP is related to any MAC address I want. Better yet, I can broadcast my faked ARP reply to my victim's entire network and fool all his computers. Muahahahahaa!

Back to reality. Now you probably understand why this common technique is called ARP Cache Poisoning (or just ARP Poisoning): the attacker lies to a device on your network, corrupting or "poisoning" its understanding of where other devices are. This frighteningly simple procedure enables the hacker to cause a variety of networking woes, described next.
All Your ARP Are Belong To Us!

The ability to associate any IP address with any MAC address provides hackers with many attack vectors, including Denial of Service, Man in the Middle, and MAC Flooding.
Denial of Service

A hacker can easily associate an operationally significant IP address to a false MAC address. For instance, a hacker can send an ARP reply associating your network router's IP address with a MAC address that doesn't exist. Your computers believe they know where your default gateway is, but in reality they're sending any packet whose destination is not on the local segment, into the Great Bit Bucket in the Sky. In one move, the hacker has cut off your network from the Internet.
Man in the Middle

A hacker can exploit ARP Cache Poisoning to intercept network traffic between two devices in your network. For instance, let's say the hacker wants to see all the traffic between your computer, 192.168.0.12, and your Internet router, 192.168.0.1. The hacker begins by sending a malicious ARP "reply" (for which there was no previous request) to your router, associating his computer's MAC address with 192.168.0.12 (see Diagram 3).

Now your router thinks the hacker's computer is your computer.

Next, the hacker sends a malicious ARP reply to your computer, associating his MAC Address with 192.168.0.1 (see Diagram 4).

Now your machine thinks the hacker's computer is your router.

Finally, the hacker turns on an operating system feature called IP forwarding. This feature enables the hacker's machine to forward any network traffic it receives from your computer to the router (shown in Diagram 5).

Now, whenever you try to go to the Internet, your computer sends the network traffic to the hacker's machine, which it then forwards to the real router. Since the hacker is still forwarding your traffic to the Internet router, you remain unaware that he is intercepting all your network traffic and perhaps also sniffing your clear text passwords or hijacking your secured Internet sessions.
MAC Flooding

MAC Flooding is an ARP Cache Poisoning technique aimed at network switches. (If you need a reminder about the difference between a hub and a switch, see this sidebar.) When certain switches are overloaded they often drop into a "hub" mode. In "hub" mode, the switch is too busy to enforce its port security features and just broadcasts all network traffic to every computer in your network. By flooding a switch's ARP table with a ton of spoofed ARP replies, a hacker can overload many vendor's switches and then packet sniff your network while the switch is in "hub" mode.
Scared? Good, Now Calm Down!

This is scary stuff. ARP Cache Poisoning is trivial to exploit yet it can result in very significant network compromise. However, before you jump to Defcon-7, notice the major mitigating factor: only local attackers can exploit ARP's insecurities. A hacker would need either physical access to your network, or control of a machine on your local network, in order to deliver an ARP Cache Poisoning attack. ARP's insecurities can't be exploited remotely.

That said, hackers have been known to gain local access to networks. Good network administrators should be aware of ARP Cache Poisoning techniques.

Since ARP Cache Poisoning results from a lack of security in a protocol that is required for TCP/IP networking to function, you can't fix it. But you can help prevent ARP attacks using the following techniques.
For Small Networks

If you manage a small network, you might try using static IP addresses and static ARP tables. Using CLI commands, such as "ipconfig /all" in Windows or "ifconfig" in 'NIX, you can learn the IP address and MAC address of every device in your network. Then using the "arp -s" command, you can add static ARP entries for all your known devices. "Static" means unchanging; this prevents hackers from adding spoofed ARP entries for devices in your network. You can even create a login script that would add these static entries to your PCs as they boot.

However, static ARP entries are hard to maintain; impossible in large networks. That's because every device you add to your network has to be manually added to your ARP script or entered into each machine's ARP table. But if you manage fewer than two dozen devices, this technique might work for you.
For Large Networks

If you manage a large network, research your network switch's "Port Security" features. One "Port Security" feature lets you force your switch to allow only one MAC address for each physical port on the switch. This feature prevents hackers from changing the MAC address of their machine or from trying to map more than one MAC address to their machine. It can often help prevent ARP-based Man-in-the-Middle attacks.
For All Networks

Your best defense is understanding ARP Poisoning and monitoring for it. I'd highly recommend deploying an ARP monitoring tool, such as ARPwatch, to alert you when unusual ARP communication occurs. This kind of vigilance is still the greatest weapon against all kinds of attack -- for, as Robert Louis Stevenson wrote, "The cruelest lies are often told in silence."

Tuesday, July 14, 2009

Which Programming language !?

A general question "which programming language I must choose !?"
this is a question that can say everyone questioned for become a programmer .
well, there are 2 factors that must be considered as well, first is interest and second is the purpose .
the most important part is first section, interest .
when you are interested in a programming language then you will try as you can for learning and working with it and if you don't interested in your programming language that you work on it, it's a bit crucial ...
the second factor is your purpose, all the works in the world have a purpose that is in the background of it .
simply ask this question of yourself, " what thing I want from a programming language !? ", when you ask it of yourself and answer it truthful then you got the purpose .
for example a person wants a Programming language for only database programming and writing automation softwares, then the best choice is Delphi .
another person wants to write System programs, the the best is C++, another one wants to write applications that can be shown in the web, ASP.net / PHP is one of these choice and etc ...
every programming language have Good parts and bad parts, and none of them is unqualified .
you can choose the language that you want with considering and investigating these 2 factors,
and in my opinion here is a Good selection list :
DataBase Programmming : Delphi with .net support .
Network Programming : C#.net
Web Programming : ASP.Net / PHP
simple applications like simple automation softwares : Visual basic with .Net support or VB.Net
Secure web applications : Java
System Programs : C++
Ring0 and Driver Programming : Pure C

there's Good resource about the list that I mentioned out there,
one of the best place you can find great books for free is Flazx and PdfChm .
try that now, nJoy ;)

feedback !?

Tuesday, June 30, 2009

C# Network Programming

I've been back to normal life without any university, this is a good book, download and enjoy.
here's the link location ...
feedback !?

Sunday, June 14, 2009

busy with universitie's Examinations

I must say excuse me cuze i'm busy with my universitie's Examinations .
I'll be back after my exams, I promise ...

have a nice day,

- Genius

Friday, June 12, 2009

Gns Lookup, a tool for Looking up a specific Name Server

Gns Lookup is stands for genius name server lookup, a tool for doing a zone transfer from your dns server,you may know many tools for this kind of action, but it's developed under .Net Framework and it's really fast and also just 10 KBs (!).
for getting respond, first when you want acting a Name Server Transfer, you will enter your domain name and then click Resolve button, i'll promise you will get your respond less than 4 seconds ;)



#developed under C#.Net 2008#

I developed it for Free and you can use it without givving any payment.
hope you like it.

Download

Thursday, June 11, 2009

Conficker worm binary !

hey, all of them surely heard about the robust worm named Conficker, here's an example of this worm, you can download it and run it under an Isolated environment and start analysing this.
if you have any good report and result on analysing feel free to submit by comment and I will post it with your copyright ;)

Download

Wednesday, June 10, 2009

when you got infected with a robust malware !

when you got infected with a robust malware which use ring0 kernel drivers something like that may be happned,


well done, I've been killed this shit and hunt it's device section :)
any feedback about the picture !?

Develop your Drivers under Visual Studio !

sounds like new things in driver development hom ?!
yes, that's it, you read right, once again a new change in the driver development world .

before, when you want develop a driver under your windows NT based box, you have many problems like Compiling, preparing for MAKEFILE and also SOURCES files, after all you must go to DDK checked/Free envirenment and enter in the your driver's project directory then issue the "Build" command and may see lots of errors some of them related to syntax, something related to directory naming and such things like that and it may be confuse you for times.
you may know, there was no specific IDE (integrated Development Environment) for developing windows drivers and every time and many times you launch notepad and start to writing your own driver, but now things changed, now there's a new IDE dedicated to Driver development under DDK architecture, you can use it for many driver development purposes . ok let's explore some of it's features,
first you can Download it free with source code include (an open source project) from here, it's very tiny and if you one of guys or even girls that have no access to DSL connection you can download it easily.

after downloading it, you must have Visual Studio 2008/2005 not old Visual Studio 6.0, when you launch the setup you will see some options that need to configure them out .
when you install and configure it out correctly you can launch your visual studio and then select your driver project which added to projects section,

then you can specify a name for your project




we suppose the driver's project name is HelloWorld . then we start to create the project,



you can see what's the easy means ! it was generate all the source code for a hello world application automatically, the source file can appear such thing.
if you remind, in DDK console complilation when we want to compile the source code we must do 2 thing, first write the MAKEFILE which points to MAKEFILE.def in the DDK directory, and then add a SOURCES file which include our source's files .
after this two long work, we must simply issue the BUILD command from checked/free environment .
now these steps just need two key Ctrl+F5 keys, when you press them, if your application has no error then you see a Dialog Box which say it's not possible to execute your .Sys file and it's right !
it's a good news which tell you, your driver was made !
after this simply step you'll follow the driver's path, give it to Huglond's InstDrv and then you can see the driver's output with DebugView ( a kernel level Debug Viewer ) .


if you are a driver developer you can understand how much this work is worthy .
thanks to it's developer basiz :)

Friday, June 5, 2009

good or bad idea ?!

hey, after almost long time, once again ...
I've been so busy with my Universities's Exams, works and my personal researchs in the area of security .
I'm apologizing ...
the last week, I've 9 student's for network materials, all of them were girls of computer's major ...
they want to learn some basic networking for their network exam on university .
and the importance part was about subnnetting and supernetting, a material of CCNA Certified .
unluckily, 'cuze of difficulty of this subject, I've some problem with this material which I think I can solve it as soon as possible.
the class was about 3 hours .
after that, now I'm working and studing Object Oriented Data Structures in C++ for my tommorrow's Exam .
in this term we had the subject of Data Structures using classes and objects for Implementing them, Now I'm studing how to delete a node from a linked list with OOP aspect which I think this is very easiest than implementing it using structures (I mean data types).
ohhhhhh, a good news ..., I've been in a Conference with the subject of information security, I've present it with good materials about network security and it's related materials.
I've teached Firewalls, how firewall systems work, how to design them, the rule of a standard firewall and other materials about firewalling which include in Implementing windows based and Unix based firewalls .
after that, I've present Attack vectors, Vectors for attacking systems, include social engineering, the art of deception, how to poisoning a switched network and intercept it's traffic, how to exploit windows and linux systems and others ...
be patience for uploading it's PPT, and then you can see and download and read it, it's in persian ! :)
and the final words are, I want to write a great paper for Data Structures, using oop aspect . it's a great idea, hom !?
I'll trying to make it understandable and pretty with Adobe Flash with Full of codes.
any feedback !?
if you want to become my partner in this project, let me know .