At the moment, the module sends an email with:

Title: PHPIDS detected an attack with impact 52
Message: Check your logs to see a full detail of the report.

This gives me no reference as to when the attack occured and who did it (IP). Both of these are essential to finding the correct line in your syslog. For anyone who has even a mildly busy site and uses syslog, you'll know the pain of having to locate a needle in a hay-stack.

What the email needs is the time of the attack, the IP of the attack, and even the "details" of the attack.

Also, what is considered "full details"? When I eventually find the correct syslog entry all I see is:

::ffff:93.45.xxx.xxx example.com - [28/Jan/2010:14:11:17 -0500] "GET /?q=admin/reports/dblog&test=%3Cscript%3Ealert(%27hi%27)%3C/script%3E&test2=%3Cscript%3Ealert(%27hi2%27)%3C/script%3E HTTP/1.1" 301 37 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2) Gecko/20100115 Firefox/3.6 (.NET CLR 3.5.30729)"

Is that all?

I also checked my /tmp/ dir for more details but it only has one file (default_filter.cache), which also only has one record (from the very first attack).

I installed everything correctly as the status report gives me the green light.

Comments

andrewsuth’s picture

Version: 6.x-1.9 » 6.x-1.10
it-cru’s picture

Version: 6.x-1.10 » 6.x-2.x-dev
Assigned: Unassigned » it-cru
Status: Active » Needs work

Hello andrewsuth,

I will add attackers IP and Date/Time and perhaps an option to insert full report into message body in new dev branch.

Logging in 6.x-1.10:
You should find PHPIDS log entries under domain.tld/admin/reports/dblog by filtering for phpids. It's all integrated into drupal itself.

thx for request and greetz from Berlin

Gos77

andrewsuth’s picture

I don't log to the database, I prefer (for performance reasons) to only log to syslog.

The module should take this into account this case senario as well.

it-cru’s picture

I created an own issue for the log to syslog feature request.

#698882: Feature Request: Logging to syslog

it-cru’s picture

Status: Needs work » Needs review

I have added attackers IP and attack-time to mail body. Please take a look at new branch dev-snapshot (e.g. 6.x-2.x-dev) and give feedback if it is enough.

On ToDo list:
- Full PHPIDS attack report in mail

eMPee584’s picture

Title: Send time and remote IP of attack in email » Report attacker ip in mail subject and additional details in mail body
StatusFileSize
new26.18 KB

Salut..
i pimped my phpids copy a tiny bit and ported the changes to current rev. Works cool for me. What i do not understand is though: i've been collecting these nmap results for some time now - and two times more linux than windows hosts are among the comment spammers????? WTF?? Very strange.. There's even a few BSD, Solaris and Mac hosts where these spams come from ... ?

eMPee584’s picture

StatusFileSize
new13.6 KB

oops previous patch fubared .. 8)
uuhm and there're a lot of trailing whitespaces removed obfuscating the code changes a bit..sorry *g

eMPee584’s picture

StatusFileSize
new13.83 KB

D'oH!
put back an accidently removed piece of the new test mode check and made the getHandling() function log anonymous users again ^^

eMPee584’s picture

StatusFileSize
new13.83 KB

thing worth doing is worth doing right *hust*

it-cru’s picture

Hello eMPee584,

thx for your patch for review. I'll take a look next days.

Constants of course I'll put into new branch. But with nmap and co I see legally problems, because in some countries (germany too!) nmap scans and co aren't allowed or a legally grey zones. Main function of PHPIDS module should be to log and block attacks. Perhaps it could be later realized as a extra activatable submodule of PHPIDS module, but not included in phpids.module file.

I think the high linux OS spammers counter which you have reported comes from infected webservers. I have also sometimes reported infected webservers to their hosting providers.

Greetz from Berlin
Gos77

eMPee584’s picture

Jo Gos77,
please take a look at http://de.wikipedia.org/wiki/Portscanner#Rechtliche_Aspekte ... nmap is NOT an attack tool itself so it should be legal in most countries. The warning message could be expanded to:
Attention: These tools may cause timeouts, out of memory situations or simply be unavailable on shared hosting environments! Furthermore, It is your own responsibility to check wether port scanning via NMAP is considered legal in your country!
Disabling nmap scanning by default should be very much sufficient, creating a new module just to put those few lines in would really be.. schwachsinn lol
And: NMAP is NOT an attack tool, however it gives very valuable information about the 'attacking' host.
Also consider: only very few hosts actually will have the nmap tool available at all as it is not usually installed on shared hosting environments!

I think the high linux OS spammers counter which you have reported comes from infected webservers.
Please, have a look at this list of systems generated from phpids report emails:

    166 Linux 2.6.13 - 2.6.28
    118 Linux 2.6.9 - 2.6.28
     86 Microsoft Windows Server 2003 SP1 or SP2
     31 Linux 2.6.9 - 2.6.27
     31 Linux 2.6.19 - 2.6.31
     28 Microsoft Windows Server 2003 SP2, Microsoft Windows XP SP2 or Server 2003 SP2, Microsoft Windows XP SP2
     25 Microsoft Windows XP SP2 or Server 2003 SP2
     21 Linux 2.6.15 - 2.6.26
     21 Linux 2.6.13 - 2.6.28, Linux 2.6.18
     20 Microsoft Windows Server 2003 SP2
     17 Linux 2.6.18 (Centos 5.3), Linux 2.6.9 - 2.6.28
     16 Linux 2.6.18 (CentOS 5.1, x86)
     16 Linux 2.6.17 - 2.6.31
     16 Apple Mac OS X 10.5 - 10.6 (Leopard - Snow Leopard) (Darwin 9.0.0b5 - 10.0.0)
     15 Blue Coat SG810 web proxy (SGOS 5.3.1.9)
     14 Microsoft Windows Server 2003 SP2, Microsoft Windows XP SP2
     13 Microsoft Windows XP SP2 or SP3
     13 Microsoft Windows 2000 Server SP4 or XP Professional SP3
     13 Linux 2.6.9 - 2.6.30
     12 Microsoft Windows Server 2003 SP1
     12 Linux 2.6.18 - 2.6.27
     11 Microsoft Windows XP SP2 or SP3, Microsoft Windows XP SP3
     10 Microsoft Windows Server 2003 Enterprise Edition SP2, Microsoft Windows Server 2003 SP2
     10 IPCop firewall 1.4.10 - 1.4.21 (Linux 2.4.31 - 2.4.36)
      9 FreeBSD 7.0-RELEASE-p1 - 8.0-CURRENT, FreeBSD 7.2-RELEASE
      9 Avaya P580 switch running Cajun Switch Agent v5.4.2, Avaya P880 switch running Cajun Switch Agent v5.3.2, Fortinet FortiGate-100A firewall, Motorola SURFboard SB3100 cable modem (VxWorks 5.3)
      7 Microsoft Windows XP SP2 or SP3, or Windows Server 2003
      7 Microsoft Windows Server 2003 SP1 or SP2, Microsoft Windows Server 2003 SP2
      7 Microsoft Windows 2000 SP2 - SP4, Windows XP SP2 - SP3, or Windows Server 2003 SP0 - SP2
      7 Linux 2.6.8 - 2.6.27
      7 Linux 1.0.9, Ricoh Aficio 3045/3245C multifunction printer, Roku SoundBridge M1001 music player, Roku SoundBridge M500 music player, Savin 8025e multifunction printer
      7 FreeBSD 6.0-STABLE - 6.2-RELEASE, FreeBSD 6.1-RELEASE - 6.2
      7 Apple Mac OS X 10.5 - 10.6 (Leopard - Snow Leopard) (Darwin 9.0.0b5 - 10.0.0), Apple Mac OS X 10.5.2 - 10.5.6 (Leopard) (Darwin 9.2.0 - 9.6.0)
      6 Linux 2.6.9 - 2.6.18, Linux 2.6.9 - 2.6.27
      6 Linux 2.6.9 - 2.6.18
      5 OpenWrt (Linux 2.4.32), Linux 2.6.24 (Gentoo)
      5 Microsoft Windows Vista SP0 - SP2, Server 2008, or Windows 7 Ultimate (build 7000)
      5 Linux 2.6.15 - 2.6.27, Linux 2.6.27 (Ubuntu 8.10)
      5 Linux 2.6.15 - 2.6.27
      5 Linux 2.6.13 - 2.6.28, Linux 2.6.18, Linux 2.6.24 - 2.6.28
      5 Linux 2.6.13 - 2.6.27
      5 Linux 2.4.21 (embedded)
      5 Linux 2.4.18 - 2.4.35 (likely embedded)
      4 Microsoft Windows 2000 SP4
      4 Linux 2.6.5 - 2.6.12
      4 Linux 2.6.24 (Gentoo)
      4 Linux 2.6.19 - 2.6.24
      4 Linux 2.6.18 (CentOS 5, x86_64, SMP), Linux 2.6.9 - 2.6.18, Linux 2.6.9 - 2.6.27
      4 Linux 2.6.15 - 2.6.30
      4 Linux 2.6.15-27 (Ubuntu), Linux 2.6.9 - 2.6.30
      4 FreeBSD 5.4-RELEASE
      4 Chumby Internet radio, Linux 2.6.13 - 2.6.28
      4 Blue Coat SG200 proxy server (SGOS 4.2.2.8 - 4.2.6.1)
      3 Sun Solaris 9 or 10 (SPARC)
      3 Microsoft Windows Server 2008 Beta 3, Microsoft Windows Vista SP0 or SP1, Server 2008 SP1, or Windows 7
      3 Microsoft Windows Server 2003 SP2, Microsoft Windows XP SP2 or Server 2003 SP2
      3 Microsoft Windows Server 2003 SP0 or Windows XP SP2, Microsoft Windows Small Business Server 2003, Microsoft Windows XP SP3
      3 Microsoft Windows 2000 SP4 or Windows XP SP2 or SP3, Microsoft Windows XP SP2
      3 Microsoft Windows 2000 SP4, Microsoft Windows Server 2003 SP1, Microsoft Windows Server 2003 SP2, Microsoft Windows NT 4.0 SP0, Nokia N81 mobile phone (Symbian OS)
      3 Linux 2.6.9, Linux 2.6.9 - 2.6.28
      3 Linux 2.6.18 - 2.6.27, Linux 2.6.26
      3 Linux 2.6.18 (CentOS 5.2), Linux 2.6.9 - 2.6.28
      3 Linux 2.6.17 - 2.6.27
      3 Linux 2.6.14 - 2.6.18
      3 FreeBSD 7.0-RELEASE-p1 - 8.0-CURRENT
      3 FreeBSD 7.0-BETA4 - 7.0
      3 FreeBSD 6.2-RELEASE
      3 Cisco Content Engine CE590 running Application and Content Networking System Software 5.5.5, Cisco WAE-512 Wide Area Application Engine (ACNS 5.5.5.4)
      3 Blue Coat proxy server (SGOS 4.1 - 4.2)
      2 Smoothwall Express 3.0 (Linux 2.6.16)
      2 NetBSD 4.0
      2 Microsoft Windows Vista SP1
      2 Microsoft Windows Server 2003 SP0 or Windows XP SP2, Microsoft Windows XP SP3
      2 Microsoft Windows Server 2003 SP0 or Windows XP SP2, Microsoft Windows Small Business Server 2003, Microsoft Windows XP Home SP1 (French), Microsoft Windows XP SP3
      2 Microsoft Windows 2000 SP4 or Windows XP SP2 or SP3, Microsoft Windows 2003 Small Business Server, Microsoft Windows XP SP2
      2 Linux 2.6.5, Linux 2.6.5 - 2.6.12
      2 Linux 2.6.23, Linux 2.6.9 - 2.6.28
      2 Linux 2.6.20
      2 Linux 2.6.18 (CentOS 5, x86_64, SMP), Linux 2.6.9 - 2.6.18
      2 Linux 2.6.18 (CentOS 5), Linux 2.6.23, Linux 2.6.9 - 2.6.28, Linux 2.6.9-022stab078.19-enterprise (CentOS 4.2 x86)
      2 Linux 2.6.18 (CentOS 5), Linux 2.6.18 (Centos 5.3), Linux 2.6.23, Linux 2.6.9 - 2.6.28
      2 Linux 2.6.13 - 2.6.28, Linux 2.6.15 - 2.6.16, Linux 2.6.17 (Debian)
      2 FreeBSD 7.1-RELEASE - 8.0-BETA2
      2 FreeBSD 6.2-STABLE - 6.4-STABLE, FreeBSD 6.3-PRERELEASE
      2 D-Link DWL-624+ or DWL-2000AP, or TRENDnet TEW-432BRP WAP
      2 Cisco WAE-512 Wide Area Application Engine (ACNS 5.5.5.4)
      2 Cisco 831 switch or 1760 router (IOS 12.4)
      1 Symantec Security Gateway 5620 firewall
      1 Sun Solaris 10 (SPARC), Sun Solaris 9 (SPARC)
      1 Microsoft Windows XP SP3
      1 Microsoft Windows XP SP2 or Server 2003 SP2, Microsoft Windows XP SP2
      1 Microsoft Windows XP Professional SP2
      1 Microsoft Windows Vista SP0 or SP1, Server 2008 SP1, or Windows 7
      1 Microsoft Windows Vista SP0 or SP1, Server 2008, or Windows 7 Ultimate (build 7000)
      1 Microsoft Windows Server 2008 Beta 3
      1 Microsoft Windows Server 2003 Enterprise Edition SP2
      1 Microsoft Windows Mobile 6.0 - 6.1 or Zune audio player (firmware 2.2)
      1 Microsoft Windows 2003 Small Business Server
      1 Microsoft Windows 2000 Server SP3 or SP4, Microsoft Windows XP SP2 (Norwegian), Microsoft Windows XP SP2 or SP3, or Windows Server 2003
      1 Linux 2.6.9 - 2.6.24
      1 Linux 2.6.5 - 2.6.19
      1 Linux 2.6.27 (Ubuntu 8.10), Linux 2.6.28 (Gentoo)
      1 Linux 2.6.27 (Ubuntu 8.10)
      1 Linux 2.6.24 - 2.6.31
      1 Linux 2.6.22 - 2.6.23
      1 Linux 2.6.21 - 2.6.27, Linux 2.6.24, Linux 2.6.26, Linux 2.6.29, Linux 2.6.30
      1 Linux 2.6.20, Linux 2.6.9 - 2.6.27
      1 Linux 2.6.18, Linux 2.6.9 - 2.6.27
      1 Linux 2.6.18 (CentOS 5, x86_64, SMP)
      1 Linux 2.6.18 (CentOS 5), Linux 2.6.18 (CentOS 5.2), Linux 2.6.18 (Centos 5.3), Linux 2.6.23, Linux 2.6.9 - 2.6.28
      1 Linux 2.6.18 (Centos 5.3), Linux 2.6.9 - 2.6.28, Linux 2.6.9-022stab078.19-enterprise (CentOS 4.2 x86)
      1 Linux 2.6.18 (CentOS 5.2), Linux 2.6.18 (Centos 5.3), Linux 2.6.9 - 2.6.28
      1 Linux 2.6.18
      1 Linux 2.6.15 - 2.6.27, Linux 2.6.18-8.el5 (Red Hat Enterprise Linux 5), Linux 2.6.21 (Arch Linux 0.8, x86)
      1 Linux 2.6.15 - 2.6.26, Linux 2.6.24 (Debian)
      1 Linux 2.6.15 - 2.6.23 (embedded)
      1 Linux 2.6.13 - 2.6.28, Linux 2.6.24 - 2.6.28
      1 Linux 2.6.13 - 2.6.28, Linux 2.6.22 - 2.6.23, Linux 2.6.9 - 2.6.24, Linux 2.6.9 - 2.6.28
      1 Linux 2.4.21 - 2.4.31 (likely embedded)
      1 Linksys AM300 wireless ADSL modem, Microsoft Windows XP SP2, Microsoft Windows XP SP3
      1 Huawei SmartAX MT800u-T ADSL router, ZyXEL ES-4024A switch, or ZyXEL Prestige 650HW ADSL router, NexStor Nexsan ATABoy2x NAS device
      1 HP ProLiant BL p-Class C-Gbe2 switch, Netopia 3366-ENT ADSL router, Teltronics NET-PATH intrusion detection system
      1 HP Designjet Z3100ps printer, Linux 2.6.9, Linux 2.6.9 - 2.6.28
      1 HP 4200 PSA (Print Server Appliance) model J4117A, Linux 2.4.21 (embedded)
      1 FreeBSD 7.2-RELEASE
      1 FreeBSD 6.0-STABLE - 6.2-RELEASE, FreeBSD 6.1-RELEASE - 6.2, FreeBSD 6.2-STABLE - 6.4-STABLE, FreeBSD 6.3-PRERELEASE
      1 FreeBSD 4.10-RELEASE (x86)
      1 Fortinet FortiGate-100A firewall
      1 Crestron XPanel control system, HP ProCurve MSM422 WAP, Linux 2.4.21 - 2.4.25
      1 Cisco Content Engine CE590 running Application and Content Networking System Software 5.5.5
      1 Cisco Aironet 1240AG or 1250 WAP, 1811 or 2800 router, or VG 224 VoIP gateway (IOS 12.4)
      1 Cisco 2500 router (IOS 11.1), Linux 1.0.9, Ricoh Aficio 3045/3245C multifunction printer, Roku SoundBridge M1001 music player, Roku SoundBridge M500 music player, Savin 8025e multifunction printer, Yamaha NetVolante RT58i router
      1 CipherLab 5100 time and attendance terminal, D-Link DCS-3220 or DCS-5300G webcam, Efficient Networks SpeedStream 5100 ADSL router, Hioki MEMORY HiCORDER 8855 digital oscilloscope, HP 4000M ProCurve switch (J4121A), Motorola SURFboard SB5100i cable modem, Panasonic DB-3500 series printer, Panasonic KX-HCM270 Network Camera
      1 Chumby Internet radio
      1 Brocade SilkWorm switch, Linux 2.4.18 - 2.4.35 (likely embedded), MicroTik RouterOS 2.9.46
      1 Acorp W400G or W422G wireless ADSL modem (MontaVista embedded Linux 2.4.17), Actiontec GT701 DSL modem, AVM FRITZ!Box FON WLAN 7050, Linksys WAG200G, or Netgear DG834GT wireless broadband router, MontaVista embedded Linux 2.4.17

See the obscure ones at the end? Find it very hard to believe ANYONE actually pwn3d these. Mysteryyyyy... ;-)

eMPee584’s picture

nah this must be something different.. i highly suspect IP spoofing to be used by those spammers?

   2187 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
     67 Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)
     48 Mozilla/5.0
     23 Mozilla/4.0 (compatible- MSIE 6.0- Windows NT 5.1- SV1- .NET CLR 1.1.4322
     21 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
     19 Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0; .NET CLR 1.0.2914)
     18 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1)
     17 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
     16 Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/532.8 (KHTML, like Gecko) Chrome/4.0.281.0 Safari/532.8
     15 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; FunWebProducts; .NET CLR 1.1.4322; PeoplePal 6.2)
     14 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
     11 Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/532.8 (KHTML, like Gecko) Chrome/4.0.289.0 Safari/532.8
     11 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; KKman2.0)
     11 Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; T312461)
     10 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)
     10 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; ru) Opera 8.50
      9 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1
      9 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; ru) Opera 8.01
      9 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322; FDM)
      8 ZmEu (www.blackhat.ro)
      8 Opera/9.0 (Windows NT 5.1; U; en)
      8 Opera/9.00 (Windows NT 4.0; U; en)
      8 Mozilla/6.0 (compatible; MSIE 7.0a1; Windows NT 5.2; SV1)
      8 Mozilla/4.0 (compatible; MSIE 6.0; Windows XP)
      8 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Media Center PC
      8 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; FREE; .NET CLR 1.1.4322)
      7 Opera/9.00 (Windows NT 5.1; U; ru)
      7 Mozilla/4.0 (compatible; Powermarks/3.5; Windows 95/98/2000/NT)
      7 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; Win64; AMD64)
      7 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Deepnet Explorer 1.5.0; .NET CLR 1.0.3705)
      7 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; KTXN)
      6 Mozilla/5.0 (Windows NT 5.1; U; en) Opera 8.00
      6 Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)
      6 Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 6.0)
      6 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; TheFreeDictionary.com; .NET CLR 1.1.4322; .NET CLR 1.0.3705; .NET CLR 2.0.50727)
      6 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322) Babya Discoverer  8.0:
      6 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; FunWebProducts; MRA 4.6 (build 01425); .NET CLR 1.1.4322; .NET CLR 2.0.50727)
      6 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Q312461)
      6 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322; Alexa Toolbar; (R1 1.5))
      6 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)
      6 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705)
      6 Mozilla/4.0 (compatible; MSIE 6.0; MSIE 5.5; Windows NT 5.0) Opera 7.02 Bork-edition [en]
      6 Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)
      6 Mozilla/1.22 (compatible; MSIE 2.0; Windows 95)
      5 Opera/7.54 (Windows NT 5.1; U)  [pl]
      5 Mozilla/4.61 [en] (X11; U; ) - BrowseX (2.0.0 Windows)
      5 Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/4.0)
      5 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT) ::ELNSB50::000061100320025802a00111000000000507000900000000
      5 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; YPC 3.0.2; .NET CLR 1.1.4322; yplus 4.4.02b)
      5 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; MRA 4.6 (build 01425); MRSPUTNIK 1, 5, 0, 19 SW)
      5 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) Opera 7.54 [en]
      5 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; MRA 4.3 (build 01218); .NET CLR 1.1.4322)
      5 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Maxthon; .NET CLR 1.1.4322)
      5 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705; .NET CLR 1.1.4322)
      5 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; APC; .NET CLR 1.0.3705; .NET CLR 1.1.4322; .NET CLR 2.0.50215; InfoPath.1)
      5 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
      5 Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Win 9x 4.90)
      5 Mozilla/4.0 (compatible; MSIE 6.0; MSIE 5.5; Windows NT 4.0) Opera 7.0 [en]
      5 Mozilla/4.0 (compatible; MSIE 6.0; America Online Browser 1.1; rev1.2; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
      5 Mozilla/4.0 (compatible; MSIE 5.5; Windows 95; BCD2000)
      5 Mozilla/4.0 (compatible; MSIE 5.0; Windows 2000) Opera 6.0 [en]
      5 Mozilla/4.0 (compatible; MSIE 4.01; Digital AlphaServer 1000A 4/233; Windows NT; Powered By 64-Bit Alpha Processor)
      5 Mozilla/1.22 (compatible; MSIE 2.0d; Windows NT)
      5 Lynx/2.8.8dev.2 libwww-FM/2.14 SSL-MM/1.4.1
      4 Toata dragostea mea pentru diavola
      4 Opera/9.01 (Windows NT 5.1; U; en)
      4 Opera/9.00 (Windows NT 5.1; U; en)
      4 Opera/7.11 (Windows NT 5.1; U) [en]
      4 Mozilla/4.7 (compatible; OffByOne; Windows 2000) Webster Pro V3.4
      4 Mozilla/4.76 [en] (Windows NT 5.0; U)
      4 Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)
      4 Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 6.0 ; .NET CLR 2.0.50215; SL Commerce Client v1.0; Tablet PC 2.0
      4 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; Win64; x64; SV1; .NET CLR 2.0.50727)
      4 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
      4 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; MRA 4.6 (build 01425))
      4 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) Opera 9.0
      4 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Crazy Browser 1.0.5)
      4 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; T312461)
      4 Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Win 9x 4.90; Creative)
      4 Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)
      4 Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)
      4 Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)
      4 Mozilla/3.0 (compatible; WebCapture 2.0; Auto; Windows)
      4 Mozilla/2.0 (compatible; MSIE 3.02; Windows CE; 240x320)
      3 Opera/9.22 (Windows NT 5.1; U; en)
      3 Opera/8.01 (Windows NT 5.1)
      3 Opera/8.00 (Windows NT 5.1; U; en)
      3 Mozilla/5.0 (X11; U; Linux i686; ru; rv:1.9.0.5) Gecko/2009010316 Gentoo Firefox/3.0.5
      3 Mozilla/4.79 [en] (Windows NT 5.0; U)
      3 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; FunWebProducts)
      3 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Crazy Browser 2.0.0 Beta 1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)
      3 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) Netscape/8.0.4
      3 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; MyIE2; Deepnet Explorer)
      3 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) Opera 8.00
      3 Mozilla/4.0 (compatible; MSIE 5.0; Windows 95) Opera 6.01  [en]
      3 Mozilla/4.0 (compatible; MSIE 5.01; Windows 95; MSIECrawler)
      2 Opera/9.63 (Windows NT 5.1; U; MRA 5.4 (build 02647); en) Presto/2.1.1
      2 Opera/9.50 (Windows NT 5.1; U; en)
      2 Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4
      2 Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20041122 Firefox/0.5.6+
      2 Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_4_11; en) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.22
      2 Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0.04506; .NET CLR 1.1.4322)
      2 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; WOW64; SV1; .NET CLR 2.0.50727)
      2 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322)
      2 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;)
      2 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Avant Browser [avantbrowser.com]; Hotbar 4.4.5.0)
      2 Mozilla/4.0 (compatible; MSIE 6.0; Windows ME) Opera 7.11  [en]
      2 Mozilla/4.0 (compatible; MSIE 6.0; Update a; AOL 6.0; Windows 98)
      2 Mozilla/4.0 (compatible; MSIE 6.0; AOL 9.0; Windows NT 5.1)
      2 Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; .NET CLR 1.1.4322)
      2 Mozilla/4.0 (compatible; MSIE 5.0; Windows 3.1)
      1 SecretBrowser/5.0 (iPhone; U; Commodore64; en)
      1 Opera/9.60 (Windows NT 5.1; U; en) Presto/2.1.1
      1 Opera/7.60 (Windows NT 5.2; U)  [en] (IBM EVV/3.0/EAK01AG9/LE)
      1 Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.371.0 Safari/533.4
      1 Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/532.8 (KHTML, like Gecko) Chrome/4.0.297.0 Safari/532.8
      1 Mozilla/5.0 (Windows; U; Windows NT 5.2 x64; en-US; rv:1.9a1) Gecko/20060214 Firefox/1.6a1
      1 Mozilla/5.0 (Windows; U; Windows NT 5.2; de; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12
      1 Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20040913 Spacebug/0.10 (aka Firefox/0.10)
      1 Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7
      1 Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.9) Gecko/20100315 Firefox/3.5.9 GTB6
      1 Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 GTB6
      1 Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20060206 Songbird/0.1
      1 Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4
      1 Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1
      1 Mozilla/5.0 (Windows NT 5.1; U; en) Opera 8.01
      1 Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; InfoPath.2; FDM)
      1 Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; GTB5; .NET CLR 2.0.50727)
      1 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; XMPP Tiscali Communicator v.10.0.2; .NET CLR 2.0.50727)
      1 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.2; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)
      1 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.2)
      1 Mozilla/4.0 (compatible; MSIE 5.5; Windows 95)
      1 Mozilla/3.0 (x86 [en] Windows NT 5.1; Sun)
      1 Mozilla/0.91 Beta (Windows)
      1 Mozilla/0.6 Beta (Windows)
      1 Anonymous Proxy at example.com (Linux; Intel)
      1 anonymous
it-cru’s picture

What do you think about $_SERVER['HTTP_USER_AGENT'] to get informations about the attackers client? I think this is the right way for the PHPIDS module.

NMAP brings too many legal risks and potential performance problems. An NMAP OS fingerprint scan can bring a different system to crash and that would be considered as computer sabotage.

eMPee584’s picture

Status: Needs review » Active

What do you think about $_SERVER['HTTP_USER_AGENT'] to get informations about the attackers client? I think this is the right way for the PHPIDS module.

Not useful i believe:

[$_SERVER] => Array
(
    [CONTENT_LENGTH] => 1266
    [CONTENT_TYPE] => application/x-www-form-urlencoded
    [DOCUMENT_ROOT] => /var/www/drupal-hfopi
    [GATEWAY_INTERFACE] => CGI/1.1
    [HTTP_ACCEPT] => */*
    [HTTP_COOKIE] => SESSc11da2c384edcca84c83de0c1c43dcff=nomvlvfuvl3vpmr0fk2se8dm46
    [HTTP_HOST] => hfopi.org
    [HTTP_PRAGMA] => no-cache
    [HTTP_PROXY_CONNECTION] => Keep-Alive
    [HTTP_REFERER] => http://hfopi.org/pt-br/project-schedule
  > [HTTP_USER_AGENT] => Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322) Babya Discoverer  8.0:
    [PATH] => /usr/local/bin:/usr/bin:/bin
    [PHP_SELF] => /index.php
    [QUERY_STRING] => q=pt-br/comment/reply/7
    [REDIRECT_QUERY_STRING] => q=pt-br/comment/reply/7
    [REDIRECT_STATUS] => 200
    [REDIRECT_URL] => /pt-br/comment/reply/7
  > [REMOTE_ADDR] => 87.118.94.987
  > [REMOTE_HOST] => ns.km32529-02.foobar.de
    [REMOTE_PORT] => 2784
    [REQUEST_METHOD] => POST
    [REQUEST_TIME] => 1271356581
    [REQUEST_URI] => /pt-br/comment/reply/7
    [SCRIPT_FILENAME] => /var/www/drupal-hfopi/index.php
    [SCRIPT_NAME] => /index.php
    [SERVER_ADDR] => 195.42.115.245
    [SERVER_ADMIN] => webmaster@hfopi.org
    [SERVER_NAME] => hfopi.org
    [SERVER_PORT] => 80
    [SERVER_PROTOCOL] => HTTP/1.0
    [SERVER_SIGNATURE] => Apache/2.2.15 (Debian) Server at hfopi.org Port 80
    [SERVER_SOFTWARE] => Apache/2.2.15 (Debian)
)

REMOTE_ADDR and REMOTE_HOST point to the same machine. The combination of user agent (browser) string that is being submitted and the Operating system nmap sniffs on these machines does not make sense in many cases (MSIE on FreeBSD? yeah sure ;), which pretty much leaves return address forgery as only credible explanation.
...i just turned on

net.ipv4.conf.all.rp_filter = 2
net.ipv4.conf.default.rp_filter = 2
net.ipv4.conf.lo.rp_filter = 2
net.ipv4.conf.eth0.rp_filter = 2

which should heighten the barrier against IP address spoofing a tiny bit. Now if this stops the spook, we know for sure.

patrickd’s picture

Status: Active » Closed (duplicate)

Custom mail subject and bodies by tokens are planned features for 7.x-2.x.
Have a look at the proper tasks