Quantcast
Channel: check – PenTesting | Hacking | Coding
Browsing all 11 articles
Browse latest View live

Check if file or directory exists in Java

Check if file exists: File f = new File("/path/to/filename"); if(f.exists()){ .. } Check if directory exists: File f = new File("/path/to/folder/"); if(f.exists() && f.isDirectory()){ .. }

View Article



Check if file exists in C

Don’t forget to define true and false constants. #define TRUE 1 #define FALSE 0 int file_exists(const char *filename) { FILE *file = fopen(filename, "r"); if (file) { fclose(file); return TRUE; }...

View Article

Check file extension in C

Don’t forget to define true and false constants. #define TRUE 1 #define FALSE 0 int is_exe_extension(const char *filename) { char *ext = strrchr(filename, '.'); if (!ext) return FALSE; else {...

View Article

SMTP Users enumeration

* Open your BackTrack machine * GoTo Applications->BackTrack->Information Gathering->Network Analysis->SMTP Analysis * Choose smtp-user-enum * Execute: ./smtp-user-enum.pl -v -M RCPT -u...

View Article

Check if computer is alive with C#

To check if a computer in the network is alive we are going to ping it through C# and Ping class. Ping ping = new Ping(); PingReply pingReply; pingReply = ping.Send(ip, timeout); if (pingReply.Status...

View Article


Check whether the system is 32 bit or 64 bit

Check if the system is 64 bit. public Boolean Is64Bit_1() { return System.Environment.GetEnvironmentVariable("ProgramW6432") != ""; } Check if specified process is 64 bit....

View Article

Check for null passwords in Sql Server

One of the many ways to secure SQL Server is to review all passwords. You must also check for null passwords and if you locate any, change them. To list all users with null passwords, execute the...

View Article

Check if file is in use in C#

There is no build-in function in c# to check if a file is in use. You can just try to open file for reading and catch the exception. This is not a 100% safe way because the file could become locked by...

View Article


How to avoid repeating code to check if a user is logged in

First of all create your own Controller that all other controllers will inherit from. Name it Mycontroller, for example: defined('SYSPATH') or die('No direct script access.');   class...

View Article


How to check the machine type in C#

public enum ChassisTypes { Other = 1, Unknown, Desktop, LowProfileDesktop, PizzaBox, MiniTower, Tower, Portable, Laptop, Notebook, Handheld, DockingStation, AllInOne, SubNotebook, SpaceSaving,...

View Article

Image may be NSFW.
Clik here to view.

Unit testing framework for C

Check is a unit testing framework for C. It features a simple interface for defining unit tests, putting little in the way of the developer. Tests are run in a separate address space, so Check can...

View Article
Browsing all 11 articles
Browse latest View live




Latest Images