LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-03-2017, 02:18 PM   #1
Panicked
LQ Newbie
 
Registered: Jun 2017
Posts: 21

Rep: Reputation: Disabled
Exclamation Wargame: Hardening WebApps on Linux


Assume our WebApp (any platform) is running on Linux (any distro).

Problem: WebApp is logging an insane number requests that contain invalid but encrypted session data.

1. Each nefarious client request invokes a server-side decryption that consumes valuable CPU time - How can we throttle the decryptions so that our WebApp (or Linux utils) can successfully execute the tasks below?

2. The WebApp reads HTTPS headers and associates the bad session data with one (or more) client IP Address (hopefully not 0.0.0.0) - Can this information be trusted? What can a WebApp log that would enable various Linux utils to positively identify the bad agent?

3. The WebApp (or Linux utils) then instruct IPTABLES to DROP incoming packets from the suspect IP Address - Will this happen quickly enough?

4. When changed IPTABLES takes effect, what happens to the many nefarious packets that have already entered the TCP stack?

5. Most users connect via NAT, Proxy, or Tor such that blocking one IP Address could affect many users - What alternative identifier is available?

Last edited by Panicked; 07-03-2017 at 02:33 PM.
 
Old 07-03-2017, 04:03 PM   #2
Panicked
LQ Newbie
 
Registered: Jun 2017
Posts: 21

Original Poster
Rep: Reputation: Disabled
Question Please join the discussion.. :)

1. possibly use renice to temporarily lower WebApp priority when it is under attack?

2. http-headers are designed to be rewritten (i.e. that is exactly how proxy servers work) so are inherently untrusted; but the original tcp handshake does not lie. WebApp could flag the miscreant's traffic with a plain/text header (i.e. X-MISCREANT=TRUE); then separately all outbound tcp traffic can be piped through openssl | tcpdump | grep to expose the miscreant's true IP address - what about Q5?

3. To achieve fast atomic rule updates, replace IPTABLES with NFTABLES - but before that: Should another util continually analyse many rows of naïve WebApp logging (slow); Should the WebApp output a single message that initiates the rule update (one app performing many tasks?); or perhaps the third way outlined in 2?

4. ...?

5. Reusing 2, instead of capturing the IP address, capture the entire TCP payload and (includes Proxy forwarding headers) and match the identifying strings in future packets - not sure if NFTABLES is built for this kind of work?

Having isolated the miscreant's network traffic, is it better to block their packets from only your network, or nuke their machine for wider social good?

Last edited by Panicked; 07-04-2017 at 12:26 PM.
 
Old 07-06-2017, 01:49 AM   #3
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,149

Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
Don't give details, what would be the overview to nuke a machine?
 
Old 07-06-2017, 03:14 PM   #4
Panicked
LQ Newbie
 
Registered: Jun 2017
Posts: 21

Original Poster
Rep: Reputation: Disabled
The requesting entity implicitly trusts the server and invites it to deposit an unknown payload. The attacking client machine has made a request from the server, without controlling TCP/IP stack behaviour, and without knowing in advance what the server will send back...


Last edited by Panicked; 07-06-2017 at 03:23 PM.
 
Old 07-06-2017, 08:33 PM   #5
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,149

Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
Unhappy

Quote:
Originally Posted by Panicked View Post
The requesting entity implicitly trusts the server and invites it to deposit an unknown payload. The attacking client machine has made a request from the server, without controlling TCP/IP stack behaviour, and without knowing in advance what the server will send back...

Hmmm..wow..thank you for the idea.

I'll create one hahaha, is there an opensource one that does this kind of thing.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux hardening and mysql hardening sagar666 Linux - Server 3 06-18-2014 11:47 PM
LXer: Wargame: Red Dragon, Strategy Game Released For SteamOS Linux LXer Syndicated Linux News 0 05-20-2014 01:11 AM
LXer: Wargame: European Escalation released for Linux LXer Syndicated Linux News 0 02-28-2013 06:01 AM
LXer: Wargame European Escalation is coming to Linux LXer Syndicated Linux News 0 02-02-2013 09:20 PM
Devil Linux and webapps momilla Linux - Software 0 10-22-2004 03:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration