403Webshell
Server IP : 127.0.0.1  /  Your IP : 216.73.216.48
Web Server : Apache/2.4.58 (Win64) OpenSSL/3.1.3 PHP/8.2.12
System : Windows NT DESKTOP-3H4FHQJ 10.0 build 19045 (Windows 10) AMD64
User : win 10 ( 0)
PHP Version : 8.2.12
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : OFF |  Perl : OFF |  Python : OFF |  Sudo : OFF |  Pkexec : OFF
Directory :  D:/xamppkk/FileZillaFTP/source/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : D:/xamppkk/FileZillaFTP/source/AdminListenSocket.cpp
// AdminListenSocket.cpp: Implementierung der Klasse CAdminListenSocket.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "AdminListenSocket.h"
#include "AdminSocket.h"
#include "AdminInterface.h"
#include "Options.h"
#include "iputils.h"

//////////////////////////////////////////////////////////////////////
// Konstruktion/Destruktion
//////////////////////////////////////////////////////////////////////

CAdminListenSocket::CAdminListenSocket(CAdminInterface *pAdminInterface)
{
	ASSERT(pAdminInterface);
	m_pAdminInterface = pAdminInterface;
}

CAdminListenSocket::~CAdminListenSocket()
{
}

void CAdminListenSocket::OnAccept(int nErrorCode)
{
	CAdminSocket *pSocket = new CAdminSocket(m_pAdminInterface);

	SOCKADDR_IN sockAddr;
	memset(&sockAddr, 0, sizeof(sockAddr));
	int nSockAddrLen = sizeof(sockAddr);
	
	if (Accept(*pSocket))
	{
		//Validate IP address
		CStdString ip;
		UINT port = 0;

		bool allowed = false;
		if (pSocket->GetPeerName(ip, port))
		{
			if (!IsLocalhost(ip))
			{
				COptions options;

				// Get the list of IP filter rules.
				CStdString ips = options.GetOption(OPTION_ADMINIPADDRESSES);
				ips += _T(" ");

				int pos = ips.Find(' ');
				while (pos != -1)
				{
					CStdString filter = ips.Left(pos);
					ips = ips.Mid(pos + 1);
					pos = ips.Find(' ');

					if ((allowed = MatchesFilter(filter, ip)))
						break;
				}
			}
			else
				allowed = true;
		}

		if (!allowed)
		{
			delete pSocket;
			return;
		}

		pSocket->AsyncSelect();
		if (!m_pAdminInterface->Add(pSocket))
			delete pSocket;
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit