SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Tools and Files

Reply
 
Thread Tools Display Modes
Old 26/08/2017, 09:56 AM   #11
blackgangs
Banned
 
Join Date: Mar 2014
Location: cairo,egypt
Posts: 85
Reputation: 7
Default Re: Nobody's Firewall - Protection against query/cookie flood.

Code:
~/NobodyFirewall# make
gcc -lpcap -lpthread nfwall.c -o nfwall
nfwall.c: In function ‘main’:
nfwall.c:96:10: warning: too many arguments for format [-Wformat-extra-args]
   printf("[!] Warning: Using default interface: \"%s\".\n\n", iface, argv[0]);
          ^
/tmp/ccjeHIRl.o: In function `main':
nfwall.c:(.text+0x4b): undefined reference to `pthread_create'
nfwall.c:(.text+0x1ca): undefined reference to `pcap_findalldevs'
nfwall.c:(.text+0x23c): undefined reference to `pcap_open_live'
nfwall.c:(.text+0x295): undefined reference to `pcap_setdirection'
nfwall.c:(.text+0x2b3): undefined reference to `pcap_loop'
collect2: error: ld returned 1 exit status
Makefile:2: recipe for target 'all' failed
make: *** [all] Error 1
another problem came..
blackgangs is offline   Reply With Quote
Old 26/08/2017, 02:32 PM   #12
SlowARG
Little Clucker
 
Join Date: Feb 2014
Posts: 42
Reputation: 14
Default Respuesta: Re: Nobody's Firewall - Protection against query/cookie flood.

Quote:
Originally Posted by denNorske View Post
Nice - I kinda of need this at the moment, but whenever I try to make it (and after installing all the dependencies prior to trying), i get this output while "make":

Code:
~/NobodyFirewall# make
gcc -lpcap -lpthread nfwall.c -o nfwall
nfwall.c: In function ‘main’:
nfwall.c:96:3: warning: too many arguments for format [-Wformat-extra-args]
   printf("[!] Warning: Using default interface: \"%s\".\n\n", iface, argv[0]);
   ^
nfwall.c: In function ‘ProcessSAMPPacket’:
nfwall.c:179:3: error: ‘for’ loop initial declarations are only allowed in C99 m                                                               ode
   for (int i = 0; i < STRUCT_NUMBER; i++)
   ^
nfwall.c:179:3: note: use option -std=c99 or -std=gnu99 to compile your code
nfwall.c: In function ‘ProcessCookiePacket’:
nfwall.c:205:3: error: ‘for’ loop initial declarations are only allowed in C99 m                                                               ode
   for (int i = 0; i < STRUCT_NUMBER; i++)
   ^
nfwall.c: In function ‘CheckIfExists’:
nfwall.c:236:2: error: ‘for’ loop initial declarations are only allowed in C99 m                                                               ode
  for (int i = 0; i < STRUCT_NUMBER; i++)
  ^
nfwall.c: In function ‘threadReload’:
nfwall.c:246:2: error: ‘for’ loop initial declarations are only allowed in C99 m                                                               ode
  for (int i = 0; i < STRUCT_NUMBER; i++)
  ^
make: *** [all] Error 1
Any idea if this is system or code related issue?
Try the new version i uploaded right now, you don't need to use c99 compiler.

Quote:
Originally Posted by blackgangs View Post
Code:
~/NobodyFirewall# make
gcc -lpcap -lpthread nfwall.c -o nfwall
nfwall.c: In function ‘main’:
nfwall.c:96:10: warning: too many arguments for format [-Wformat-extra-args]
   printf("[!] Warning: Using default interface: \"%s\".\n\n", iface, argv[0]);
          ^
/tmp/ccjeHIRl.o: In function `main':
nfwall.c:(.text+0x4b): undefined reference to `pthread_create'
nfwall.c:(.text+0x1ca): undefined reference to `pcap_findalldevs'
nfwall.c:(.text+0x23c): undefined reference to `pcap_open_live'
nfwall.c:(.text+0x295): undefined reference to `pcap_setdirection'
nfwall.c:(.text+0x2b3): undefined reference to `pcap_loop'
collect2: error: ld returned 1 exit status
Makefile:2: recipe for target 'all' failed
make: *** [all] Error 1
another problem came..
Try to use -pthread instead of -lpthread in Makefile. Anyway, i edited Makefile in the new version, you can try with it.

Quote:
Originally Posted by azzerking View Post
Cool Idea,

But one problem is the loopback address can be faked, and any experienced programmer with some hacking knowledge will know this.

Don't ignore any address, treat all as a possible threat.

I am an experienced Ethical Hacker / Software and Network Engineer and I myself have made the same mistake a couple of years ago, so maybe update the code to not ignore the loopback address.
Take a look to Martian packet and Bogon filtering.

Best Regards!
SlowARG is offline   Reply With Quote
Old 27/08/2017, 09:51 AM   #13
azzerking
Gangsta
 
azzerking's Avatar
 
Join Date: Dec 2009
Location: England, Leicestershire
Posts: 491
Reputation: 70
Default Re: Respuesta: Re: Nobody's Firewall - Protection against query/cookie flood.

Quote:
Originally Posted by SlowARG View Post
Try the new version i uploaded right now, you don't need to use c99 compiler.



Try to use -pthread instead of -lpthread in Makefile. Anyway, i edited Makefile in the new version, you can try with it.



Take a look to Martian packet and Bogon filtering.

Best Regards!
Whoops, I apologize I overlooked the part of code where you were using this system. I am aware of this type of filtering, something I had to learn a few years ago when I first starting working for IBM.

Good Work, though.
__________________


Web Skill: PHP, HTML, CSS, JS, RUBY, NODE.js.

Programing Skill: Objective C, C#, C++, D#, Python, Java, MySQL.

OS Skill: Windows (95 - 10), Ubuntu/Debian, Raspbian, Kali, Arch, Unix, Mac (E-MACs - Current)

Scripting Skill: LUA, Pawn, C38*
azzerking is offline   Reply With Quote
Old 27/08/2017, 04:51 PM   #14
SlowARG
Little Clucker
 
Join Date: Feb 2014
Posts: 42
Reputation: 14
Default Respuesta: Re: Respuesta: Re: Nobody's Firewall - Protection against query/cookie flood.

Quote:
Originally Posted by azzerking View Post
Whoops, I apologize I overlooked the part of code where you were using this system. I am aware of this type of filtering, something I had to learn a few years ago when I first starting working for IBM.

Good Work, though.
No problem, anyway thank you for the suggestion.

Regards.
SlowARG is offline   Reply With Quote
Old 27/08/2017, 08:57 PM   #15
RDM
Huge Clucker
 
Join Date: Apr 2014
Location: my github: https://github.com/Edresson
Posts: 244
Reputation: 36
Default Re: [C] Nobody's Firewall - Protection against query/cookie flood.

Quote:
Originally Posted by SlowARG View Post
Nobody's Firewall
Simple firewall that protect your server against query/cookie flood.
Current version: 0.1 BETA FIX #2.

••• Description •••
Nobody Firewall (aka nfwall) is a simple —but powerful— firewall for SA-MP that protect your server against query flood/cookie flood attacks.

••• Why? •••
I didn't program for some years ago and i've retired from SA-MP. Recently a friend asked me for help with pawn and... I don't know, simply i want'd to program in C again and i noticed that the actual anti 'server full' attacks haven't been updated for some months, so i decided to work in a new firewall that protect the servers against known query flood and the cookie flood for SA-MP 0.3.7.

••• Features •••
Open Source.
Programmed purely in C.
Use lipbcap.
Ban logs.
Debug mode.
Actually runs only on Linux (i will relese a multi-so version soon).

••• Dependences •••
libpcap. (https://github.com/the-tcpdump-group/libpcap)

••• Downloads •••
https://github.com/n0bodysec/NobodyFirewall
Licensed under GNU General Public License v3.

••• Special thanks •••
n3ptun0 (aka Stella) for his firewall for SA-MP 0.3e.
Silver Moon for his base code.


Y̶u̶p̶,̶ ̶a̶ ̶p̶o̶o̶r̶ ̶p̶o̶s̶t̶.̶

Greetings!
Nobody.
I think this is a bit unnecessary since it is possible to do the control you did using iptables with the recent module!

But anyway congratulations! Good job !
RDM is offline   Reply With Quote
Old 27/08/2017, 09:34 PM   #16
SlowARG
Little Clucker
 
Join Date: Feb 2014
Posts: 42
Reputation: 14
Default Respuesta: Re: [C] Nobody's Firewall - Protection against query/cookie flood.

Quote:
Originally Posted by RDM View Post
I think this is a bit unnecessary since it is possible to do the control you did using iptables with the recent module!

But anyway congratulations! Good job !
Yeah, you are right, but i prefer to control my network packets with C, it has a little advantages.

For example, it works for each port and not only for 7777 and regex isn't necessary.
Anyway, it's so good to show all possibilities to mitigate an attack.

Thank you!
Regards.
SlowARG is offline   Reply With Quote
Old 27/07/2018, 09:12 PM   #17
Chaprnks
Gangsta
 
Chaprnks's Avatar
 
Join Date: Sep 2007
Location: Soviet America
Posts: 742
Reputation: 64
Default Re: Nobody's Firewall - Protection against query/cookie flood.



is this all it should display when its working correctly?
__________________
Chaprnks is offline   Reply With Quote
Old 25/08/2018, 08:03 AM   #18
SlowARG
Little Clucker
 
Join Date: Feb 2014
Posts: 42
Reputation: 14
Default Re: Nobody's Firewall - Protection against query/cookie flood.

Quote:
Originally Posted by Chaprnks View Post


is this all it should display when its working correctly?
That's correct.

Regards.
SlowARG is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[HELP ]requests connection cookie / ip flood VenomMancer Server Support 10 12/06/2015 06:55 PM
Flood requests connection cookie. RDM Server Support 4 28/05/2015 04:29 PM
Flood requests connection cookie. RDM Bug Reports 3 28/05/2015 03:02 PM


All times are GMT. The time now is 07:34 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.