Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to Block/Ban Traffic From Specific Referrer Post 302102763 by BOFH on Friday 12th of January 2007 02:38:57 PM
Old 01-12-2007
Quote:
Originally Posted by osoamor
it's apache
That's fine. Apache on what? Smilie

Some OS's (like Linux or BSD) have firewalls as part of the default installation. You can set up a quickie firewall rule to block the IP address.

OpenBSD firewall example from my web server:

Code:
# cat /etc/pf.conf
# External interface and address
ext_if="vr0"
ext_ad="xx.xx.xx.xx/32"

# in general, block all incoming connections
block in on $ext_if

# block all net idiots
block in quick on $ext_if inet proto tcp from [badipaddr] port = 80

# let all outbound traffic go
pass out quick on $ext_if inet from ($ext_if) to any flags S/SA keep state

# let everyone else access the web server
pass in quick on $ext_if inet proto tcp from any to ($ext_if) port = 80 flags S/SA modulate state

I believe you can use your /etc/hosts.deny file to block access to your web server. As you can see, I use my firewall for that so I'd have to do a little search before I could present an example for you. Try googling on hosts.deny.

Oh and of course, don't use my pf.conf file without knowing what every rule does. I've clipped out a bunch of rules so I can show you a little example.

Carl
 

10 More Discussions You Might Find Interesting

1. IP Networking

block telnet to specific port

Hello All I am running redhat linux 7.2 and would like to know how i can block telnetting to a specified port . say for example i would like to block telnet acesses to port 80. regards Xiamin (5 Replies)
Discussion started by: xiamin
5 Replies

2. Shell Programming and Scripting

Extracting specific block

Hi Everyone , have a great day i have a file which has almost 20,000 blocks each starting with this particular line " rTCCreditControlRecord " , how can i bring out the 7172 block out of that file Thanks in Anticipation (7 Replies)
Discussion started by: Dastard
7 Replies

3. Shell Programming and Scripting

Block incoming traffic FTP from internet using iptables

Hi everybody. I have the next scenary: eth0: WAN eth1: DMZ eth2: LAN I need to block all incoming trafic from the internet through my network LAN using iptables. I have squid but i need to do this using ipatbles. I have been listening about iptables -A FORDAWARD but I am stuck right... (0 Replies)
Discussion started by: edeamat
0 Replies

4. Web Development

PHP Help - Delete cookies and redirect back to referrer

I was wondering if any one would be willing to help me with this. I'd like to create a 503 error page using a PHP script that will do the following: - delete all cookies that contains 'something' in the host and 'JSESSIONID' as the cookie name. There are either 1 or 2 cookies that each... (0 Replies)
Discussion started by: Adrnalnrsh
0 Replies

5. IP Networking

block windows file sharing traffic between networks

I have a LAN for users 192.0.3.0 I have a WAN for servers 192.0.0.0 I have a iptables capable router with a static route from 192.0.3.0 to 192.0.0.0 my problem is SMB file sharing traffic is leaking on to our 192.0.0.0 and causing congestion. I only have one printer IP address that needs... (13 Replies)
Discussion started by: herot
13 Replies

6. IP Networking

How does a router directs the internet traffic to a specific host in the private network?

how does a router directs the internet traffic to a specific host in the private network? Example: My PC has ip 192.168.134.100 Router has ip 192.168.134.200 My company's ip 202.52.150.33 When i try to access internet, say google, it traverses from... (1 Reply)
Discussion started by: Arun_Linux
1 Replies

7. UNIX for Advanced & Expert Users

Linux bridged firewall - monitor traffic & block IP

Hi All, I successfully configured a DEBIAN Lenny bridged firewall using ebtables. The bridged interface is br0. The ethernet interface are eth0 & eth1 respectively. All the traffic are transparently passing my firewall but i need to find & block temporarily the bandwidth abusers. Can... (1 Reply)
Discussion started by: coolatt
1 Replies

8. SCO

OSR 5.0.7 need to block a specific IP

There are huge number of messages in syslog suggesting one of the client's IP is trying to telnet/ssh/pop/imap into the OSR5.0.7 system, it happens every minute or so, see a snippet below Oct 9 13:11:20 myhost popper: (null) at 192.168.1.123 (192.168.1.123): -ERR POP EOF or I/O Error: 25... (3 Replies)
Discussion started by: migurus
3 Replies

9. Proxy Server

IPtable rules for DNS/http/https traffic for specific hosts only, not working.

Hi there, I have a VPS and am working on a little side project for myself and friend which is a DNS proxy. Everything was great till recently. My VPS IP has been detected by some botnet or something, and I believe SMURF attacks are occuring. The VPS provider keeps shutting down my VPS... (3 Replies)
Discussion started by: phi0x
3 Replies

10. UNIX for Dummies Questions & Answers

Add a block of code at the end of a specific block

I need to search for a block with the starting pattern say "tabId": "table_1", and ending pattern say "]" and then add a few lines before "]" "block1":"block_111" "tabId": "table_1", "title":"My title" ..... .... }] how do I achieve it using awk and sed. Thanks, Lakshmi (3 Replies)
Discussion started by: Lakshmikumari
3 Replies
atom_application_navigation(5)					File Formats Manual				    atom_application_navigation(5)

NAME
atom_application_navigation, GetFirstObj, GetLastObj, GetNextObj, GetPrevObj, GetFirstObjProc, GetLastObjProc, GetNextProc, GetPrevProc, GetFirstBlock, GetLastBlock, GetNextBlock, GetPrevBlock, GetFirstInst, GetLastInst, GetNextInst, GetPrevInst, GetProcObj, GetBlockProc, GetInstBlock, GetInstBranchTarget - Allows an Atom tool's instrumentation routine to find locations in an application program SYNOPSIS
#include <cmplrs/atom.inst.h> Obj *GetFirstObj( void ); Obj *GetLastObj( void ); Obj *GetNextObj( Obj * ); Obj *GetPrevObj( Obj * ); Proc *GetFirstObjProc( Obj * ); Proc *GetLastObjProc( Obj * ); Proc *GetNextProc( Proc * ); Proc *GetPrevProc( Proc * ); Block *GetFirstBlock( Proc * ); Block *GetLastBlock( Proc * ); Block *GetNextBlock( Block * ); Block *GetPrevBlock( Block * ); Inst *GetFirstInst( Block * ); Inst *GetLastInst( Block * ); Inst *GetNextInst( Inst * ); Inst *GetPrevInst( Inst * ); Inst *GetInstBranchTarget( Inst * ); Obj *GetProcObj( Proc * ); Proc *GetBlockProc( Block * ); Block *GetInstBlock( Inst * ); DESCRIPTION
Atom's application navigation routines allow an instrumentation routine to locate areas of an application that are interesting to monitor or analyze. You can use these routines only from an Atom tool's instrumentation file. See atom(1) for a description of Atom. Atom allows you view an application with the following granularity: The entire application, including all shared libraries. Either the main executable or a shared library. An object comprises a list of procedures and has it own set of attributes (for example, each object has its own name). A procedure. A basic block. An instruction. Note Do not confuse the term object with an object module produced by a compiler. The two terms are completely different. To traverse the list of objects in an application program, use the following routines: Use the GetFirstObj or GetLastObj routine to obtain a pointer to the first or last object in the program. Nonshared programs, have only one object. For call-shared programs, the first object corresponds to the main program and the remaining objects are its shared libraries. Use the GetNextObj routine to obtain a pointer to the object that follows the specified Obj. If the specified Obj is the last object in the program, GetNextObj returns a NULL pointer. Use the GetPrevObj routine to obtain a pointer to the object that precedes the specified Obj. If the specified Obj is the first object in the pro- gram, GetPrevObj returns a NULL pointer. Note Because the Instrument routine is called for each object in the program, the object traversal routines in the Instrument do not need to be used routine. To traverse the list of procedures in an object, use the following routines: Use the GetFirstObjProc or GetLastObjProc routine to obtain a pointer to the first or last procedure in the specified Obj. Use the GetNextProc routine to obtain a pointer to the procedure that follows the specified Proc. If the specified Proc is the last procedure in the object, GetNextProc returns a NULL pointer. Use the GetPrevProc routine to obtain a pointer to the procedure that precedes the specified Proc. If the specified Proc is the first procedure in the object, GetPrevProc returns a NULL pointer. To traverse the list of basic blocks in a procedure, use the following routines: Use the GetFirstBlock or GetLastBlock routine to obtain a pointer to the first or last basic block in the specified Proc. Use the GetNextBlock routine to obtain a pointer to the basic block that follows the specified Block. If the specified Block is the last basic block in the procedure, GetNextBlock returns a NULL pointer. Use the GetPrevBlock routine to obtain a pointer to the basic block that precedes the specified Block. If the specified Block is the first basic block in the procedure, GetPrevBlock returns a NULL pointer. To traverse the instructions in a basic block, use the following routines: Use the GetFirstInst or GetLastInst routine to obtain a pointer to the first or last instruction in the specified Block. Use the GetNextInst routine to obtain a pointer to the instruction that follows the specified Inst. If the specified Inst is the last instruction in the basic block, GetNextInst returns a NULL pointer. Use the Get- PrevInst routine to obtain a pointer to the instruction that precedes the specified Inst. If the specified Inst is the first instruction in the basic block, GetPrevInst returns a NULL pointer. Use the GetInstBranchTarget routine to obtain a pointer to the instruction that is the target of Inst. An error is raised if Inst is not a branch instruction. To navigate between the parts of an application, use the following routines: Use the GetProcObj routine to obtain a pointer to the object that contains the specified Proc. Use the GetBlockProc routine to obtain a pointer to the procedure that contains the specified Block. Use the GetInstBlock routine to obtain a pointer to the basic block that contains the specified Inst. RETURN VALUES
These routines return pointers to Obj, Proc, Block, and Inst structures, or NULL pointers, as described in the preceding section. FILES
Header file containing external definitions of Atom routines SEE ALSO
Commands: atom(1) AtomTools: hiprof(5), pixie(5), third(5) Functions: atom_application_instrumentation(5), atom_application_query(5), atom_application_resolvers(5), atom_description_file(5), atom_object_management(5), atom_instrumentation_routines(5), AnalHeapBase(5), Xlate(5), Thread(5) Programmer's Guide atom_application_navigation(5)
All times are GMT -4. The time now is 10:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy