Articles

Metasploit Framework Windows Tutorial
Remote Desktop Connection
Windows Processes That May Be Dangerous
How-To use NetCat a Tutorial
Common Linux Commands
Common Ports
Netcat Commands
HTTP Response Codes
War-Google Hack Terms
Wardriving
Avoiding Social Engineering and Phishing Attacks
Intrusion Detection on Linux
Linux Intrusion Detection
Penetration Testing Guide
Penetration Testing Tools
Social Engineering Fundamentals, Part I: Hacker Tactics
Social engineering (computer security)
The Psychology of Social Engineering

The Archives

General GSO
GovernmentSecurity.org News & Suggestions
In The News
Open Topic
General Security Information
Trash Can
Exploit & Vulnerability Mailing List Archives
Trial Member Forum
Product and Program Reviews GSO Tutorials
System Security
Windows Systems
Beginners Section
Linux & Unix Systems
File Downloads
Exploit Research & Discussion Trojan & Virus Errata
Networking Security / Firewall / IDS / VPN / Routers
System Hardening
E-Mail Security
Wifi Security
Trial Member Uploads
Upload discovered Trojans & Mal ware
GSO Programming Section
C , C++ , VC++
Visual Basic.NET
Perl /CGI
Java/Javascript
PHP/XML/ASP/HTML
Assembly + Other
The Cork Board
Network Security Consultant Directory
Network Security Jobs
The Archives
Encryption Information
General Network Security
Internet Anonymity
HTTP Protocol Security
Linux Security
MS IIS Information
Exploit Articles
Programming / Tool Design
GSO Software Projects
Public Downloads
Microsoft Security Questions and Papers

usch
hi
i want to code an application that lists all currently running processes. here is my code :
CODE

#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <Psapi.h>

int main(int argc, char *argv[])
{
   int x;
   int returned;
   char module[100];
   HANDLE hProcess;
   char name[200];
   HMODULE modules;
   DWORD moduleBytesReturned;
   DWORD prozesse[60],bytesReturned;
   EnumProcesses(prozesse,sizeof(prozesse),&bytesReturned);
   returned = bytesReturned/sizeof(DWORD);
   for(x=0;x<returned;x++)
   {
   
   
   if((hProcess=OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ,FALSE,prozesse[x]))==NULL)
   printf("OpenProcessError:%d bei PID:%d \n",GetLastError(),prozesse[x]);
   else
   if((EnumProcessModules(hProcess,&modules,sizeof(modules),&moduleBytesReturned))==0)
   printf("EnumProcessError:%d bei PID:%d \n",GetLastError(),prozesse[x]);
   else
   if((GetModuleBaseName(hProcess,modules,name,200))==0)
   printf("GetModuleError:%d bei PID:%d \n",GetLastError(),prozesse[x]);
   else
   
   printf("%s\n",name);
   }
   
                                                     
   
           
   
   system("PAUSE");
 
}


but when i run the program i get access denied errors at csrss.exe and at 2 instances of svchost.exe which are running as services.


what am i doing wrong ?
thanks for help

usch

SkitZZ
think you need to enable debug privileges

http://msdn.microsoft.com/library/default....eges_in_c__.asp

SkitZZ
nolimit
Debug privs would solve your problem, however, you can also just disregard the error and print what information you have at the time. You probably want to implement both of these, as a lower level user running it won't be able to get debug privs.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2005 Invision Power Services, Inc.