Git Product home page Git Product logo

rpcfirewall's People

Contributors

acedef avatar johnlatwc avatar sagiesec avatar shaharlupu avatar sro-nviso avatar teachjing avatar xorlent avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rpcfirewall's Issues

RPC calls not being logged

While experimenting, I came across an issue where several RPC calls that are triggered by remote usage of psexec are not logged.
I am using the following bare minimum configuration (the .txt at the end was added in order to upload this):
RpcFw.conf.txt

When running psexec, the only event that is logged is the map request on the endpoint mapper interface:
RPCFWP.evtx.txt

A packet capture clearly shows that more RPC calls were performed:
remote_psexec.pcap.txt

I have also tried using no configuration file, but the calls in question are still not logged.

Server 2008 R2 Zero Logon

Hello.

I have setup a lab environment with a Windows 2008 R2 server vulnerable to zero logon attack. I have another PC that runs Ping Castle to check for zero logon vulnerability. It finds the venerability successfully.

I installed to Windows 2008 the rpcfirewall and protect all the processes with action block.

I run again from the PC the ping castle software and still finds the DC vulnerable to this attack.

In Windows server 2008 the rpcfw events are not storing anything nor your software protects from this attack.

Can you verify please?

Blocking WMI over Named Pipes

Hello, I wonder if anyone has discovered a way of blocking WMI (interface IWbemServices, UUID 36cfd3bf-c08c-43bf-b8ff-3eb594f583ff) over ncacn_np, while keeping ncacn_ip_tcp functional. It would IMO block impacket-wmiexec, without affecting the required Windows functionality, but I was not able to make it work with protocol-based rules, nor with port-based rules.
What I find even more problematic is impacket-dcomexec, which uses DCOM over named pipes (ShellWindows, ShellBrowserWindow, or MMC20 objects). Again, I was not able to find a method to block this, without causing too many side-effects.

windows 7 enterprise

Hello,

I tried installing rpcfirewall on my machine, just to see.
But does not seem to be working.

Is rpcfirewall supposed to be working on win7 x64 sp1 Enterprise French ?

Best regards

Screenshot_3
Screenshot_4

[Feature Request] sAMAccountName filtering

Is it possible to add a filtering based on the IP and on the username ?
For example block all RPC call made by domain admin (prefix da_) if sourceip is not 10.10.10.1 (admin castle)

fw:uuid:* action:block audit:true not_saddr:10.10.10.1 username:da_john.doe
fw:uuid:* action:block audit:true not_saddr:10.10.10.1 username_pattern:da_*

Does NdrClientCall3 is being hook?

Hi,

I have an RPC server that uses NdrClientCall3.
Does NdrClientCall3 is being hooked?
I saw that you implemented it here:

long WINAPI myNdrStubCall3(void* pThis, void* pChannel, PRPC_MESSAGE pRpcMsg, unsigned long* pdwStubPhase)

But I don't see it in the DLL:

static long (WINAPI* realNdrStubCall2)(void* pThis, void* pChannel, PRPC_MESSAGE pRpcMsg, unsigned long* pdwStubPhase) = NdrStubCall2;
long WINAPI detouredNdrStubCall2(void* pThis, void* pChannel, PRPC_MESSAGE pRpcMsg, unsigned long* pdwStubPhase);
static void (WINAPI* realNdrServerCallAll)(PRPC_MESSAGE pRpcMsg) = NdrServerCallAll;
void WINAPI detouredNdrServerCallAll(PRPC_MESSAGE pRpcMsg);
static void (WINAPI* realNdrAsyncServerCall)(PRPC_MESSAGE pRpcMsg) = NdrAsyncServerCall;
void WINAPI detouredNdrAsyncServerCall(PRPC_MESSAGE pRpcMsg);
static void (WINAPI* realNdr64AsyncServerCallAll)(PRPC_MESSAGE pRpcMsg) = Ndr64AsyncServerCallAll;
void WINAPI detouredNdr64AsyncServerCallAll(PRPC_MESSAGE pRpcMsg);
static void (WINAPI* realNdr64AsyncServerCall64)(PRPC_MESSAGE pRpcMsg) = Ndr64AsyncServerCall64;
void WINAPI detouredNdr64AsyncServerCall64(PRPC_MESSAGE pRpcMsg);
static void (WINAPI* realNdrServerCallNdr64)(PRPC_MESSAGE pRpcMsg) = NdrServerCallNdr64;
void WINAPI detouredNdrServerCallNdr64(PRPC_MESSAGE pRpcMsg);

Error when loading rpcFireWall.dll: "binary is not signed correctly"

When I am trying to audit a process called vmcompute.exe:

rpcFwManager.exe /process vmcompute.exe

It fails with the following message:

* This break indicates this binary is not signed correctly: \Device\HarddiskVolume4\Windows\System32\rpcFireWall.dll
* and does not meet the system policy.
* The binary was attempted to be loaded in the process: \Device\HarddiskVolume4\Windows\System32\vmcompute.exe
* This is not a failure in CI, but a problem with the failing binary.
* Please contact the binary owner for getting the binary correctly signed.

Here is a print screen of what I tried to do:
image

Operation system: Windows Server 2019 1809 (OS Build 17763.2114).

Security Issue due to lsass handle

Hello,

I stumbled on this issue by accident.
rpcFwManager.exe has a full control handle on LSASS, which can be abused to dump LSASS via a DeDup handle attack.

Maybe one should change this level of granted access to the bare minimum needed instead ?

image

Memory leak because security descriptor memory is never freed

createSecurityAttributes allocates a buffer with LocalAlloc but this memory is never freed after the security descriptor is used in object creation, resulting in a leak.

BOOL createSecurityAttributes(SECURITY_ATTRIBUTES * psa)
{
	PSECURITY_DESCRIPTOR psd = (PSECURITY_DESCRIPTOR)LocalAlloc(LPTR, SECURITY_DESCRIPTOR_MIN_LENGTH);

	if (InitializeSecurityDescriptor(psd, SECURITY_DESCRIPTOR_REVISION) != 0)

...

HANDLE createGlobalEvent(BOOL manualReset,BOOL initialState, TCHAR* eventName)
{
	HANDLE gEvent = NULL;
	SECURITY_ATTRIBUTES sa = { 0 };
	
	//TODO: return value instead of passing as ref
!	if (createSecurityAttributes(&sa))    // <------ need to free the security descriptor
	{
...

HANDLE mapNamedMemory()
{
	HANDLE hMapFile = NULL;
	SECURITY_ATTRIBUTES sa = { 0 };

!	if (createSecurityAttributes(&sa))    // <------ need to free the security descriptor

See:

gEvent = CreateEvent(&sa, manualReset, initialState, eventName);

if (createSecurityAttributes(&sa))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.