Author Topic: [Solved] [Usefull] STunnel log displayed in HFS  (Read 17130 times)

0 Members and 1 Guest are viewing this topic.

Offline SilentPliz

  • Operator
  • Tireless poster
  • *****
  • Posts: 1181
  • ....... chut ! shh!
    • View Profile
[Solved] [Usefull] STunnel log displayed in HFS
« on: February 12, 2009, 12:45:53 AM »
       
I managed to displayed the Stunnel log in hfs with:

A file hfs.events:

[connected]
{.add to log|{.load|stunnel.log.}|ClBlue.}


But stunnel.log, can't be destroyed when Stunnel runs, the file grows bigger ...

The macro Delete is impossible ... I am looking if someone has an idea.

This kind of thing also does not work:

Just an example:

{.set|hfslog|{.load|hfslog.txt.}.}
{.set|stunnellog|{.load|stunnel.log.}.}
{.save|hfslog.txt|{.cut|{.length|{.^hfslog.}.}|{sub|{.length|{.^stunnellog.}.}|{.length|hfslog.}.}|{.^stunnellog.}.}.}
« Last Edit: February 13, 2009, 10:24:13 AM by SilentPliz »

Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12891
    • View Profile
Re: stunnel log
« Reply #1 on: February 12, 2009, 12:48:32 AM »
your purpose is to show only new lines of the file?

Offline SilentPliz

  • Operator
  • Tireless poster
  • *****
  • Posts: 1181
  • ....... chut ! shh!
    • View Profile
Re: stunnel log
« Reply #2 on: February 12, 2009, 12:50:17 AM »
Short answer.... yes  ;D

Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12891
    • View Profile
Re: stunnel log
« Reply #3 on: February 12, 2009, 01:14:23 AM »
what about this? (untested)

{.set|s|{.load|stunnel.log.}.}
{.set|past|{.load|stunnel.last.}.}
{.save|stunnel.last|{.length|{.^s.}.}.}
{.cut|-{.^past.}||{.^s.}.}
« Last Edit: February 12, 2009, 01:16:17 AM by rejetto »

Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12891
    • View Profile
Re: stunnel log
« Reply #4 on: February 12, 2009, 01:15:59 AM »
i will introduce a new way for {.length|{.^s.}.}
because it is common but absurdly slow for very long text.
from next build you'll be able to use {.var length|s.}

Offline SilentPliz

  • Operator
  • Tireless poster
  • *****
  • Posts: 1181
  • ....... chut ! shh!
    • View Profile
Re: stunnel log
« Reply #5 on: February 12, 2009, 01:36:59 AM »
Quote
what about this? (untested)

Helas No, not better.
I enclose the result after 1 connection.


Quote
i will introduce a new way for {.length|{.^s.}.}
because it is common but absurdly slow for very long text.
from next build you'll be able to use {.var length|s.}

Good !  :)
« Last Edit: February 11, 2010, 05:48:12 AM by SilentPliz »

Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12891
    • View Profile
Re: stunnel log
« Reply #6 on: February 12, 2009, 02:59:15 AM »
ok, try this

{.cut|{.load|stunnel.last.}||{.load|stunnel.log.}.}
{.save|stunnel.last|{.filesize|stunnel.log.}.}

Offline SilentPliz

  • Operator
  • Tireless poster
  • *****
  • Posts: 1181
  • ....... chut ! shh!
    • View Profile
Re: stunnel log
« Reply #7 on: February 12, 2009, 04:10:20 AM »
EUREKA !

This works perfectly !:

[connected]
{.add to log|{.cut|{.load|stunnel.last.}||{.load|stunnel.log.}.}
{.save|stunnel.last|{.filesize|stunnel.log.}.}|Clblue.}



GRAZIE MILLE !  :)
« Last Edit: February 12, 2009, 06:25:03 AM by SilentPliz »

Offline SilentPliz

  • Operator
  • Tireless poster
  • *****
  • Posts: 1181
  • ....... chut ! shh!
    • View Profile
Re: stunnel log
« Reply #8 on: February 12, 2009, 05:46:55 AM »
PS:  ;)

For those who would get the same thing. (v2.3 since build #239):

1)

- Paste the following section in a file hfs.events that you will put in the folder of hfs.exe:


Script edited 01-18-2010

[connected]
{.set|#log|{.load|stunnel.log|from={.^#stunnel.last.}.}.}
{.set|#stunnel.last|{.filesize|stunnel.log.}.}
{.if|{.^#log.}|{:
{.add to log|.
Stunnel log :
{.^#log.}|Clblue.}
:}.}

[+start]
{.set|#stunnel.last|{.filesize|stunnel.log.}.}
[/color]

2)

- In file stunnel.conf of the folder of stunnel.exe , specify the path of HFS where the file stunnel.log will be created.
(Debug = 6 gives a correct result)

; Some debugging stuff useful for troubleshooting
debug = 6
output = C:\path\of\hfs folder\stunnel.log


3)

- Enjoy HFS and Stunnel !  :)

----------------------------------------------------------------------------
Independently, you can add to the section [https] of stunnel.conf, the internal IP of your PC:

[https]
accept  = 0.0.0.0:443
connect = 127.0.0.1:44300

local =
192.168.1.6 *
TIMEOUTclose = 0

* IP example

Then you add in HFS:

Menu > Limits > Bans

\127.0.0.1;192.168.1.6

Then in Adress2name:

Name       IP Mask
Local        127.0.0.1
Stunnel
  192.168.1.6

This will differentiate in the log, the local connections (http), and the distant connections from Stunnel (https).
« Last Edit: January 18, 2010, 09:26:28 PM by SilentPliz »

Offline Dragon_Hunter

  • Occasional poster
  • *
  • Posts: 52
    • View Profile
Re: stunnel log
« Reply #9 on: February 12, 2009, 09:07:41 PM »
Hi

Can you help and explane about the stunnel log how to get it to work in the hfs.

Offline SilentPliz

  • Operator
  • Tireless poster
  • *****
  • Posts: 1181
  • ....... chut ! shh!
    • View Profile
Re: stunnel log
« Reply #10 on: February 12, 2009, 09:38:51 PM »
« Last Edit: February 12, 2009, 09:48:25 PM by SilentPliz »

Offline Dragon_Hunter

  • Occasional poster
  • *
  • Posts: 52
    • View Profile
Re: stunnel log
« Reply #11 on: February 12, 2009, 09:47:15 PM »
Oki thx i take a look at it... Do you have stunnel log on your computer?

Offline SilentPliz

  • Operator
  • Tireless poster
  • *****
  • Posts: 1181
  • ....... chut ! shh!
    • View Profile
Re: stunnel log
« Reply #12 on: February 12, 2009, 09:49:48 PM »
   
Yes ... since yesterday ... it's the subject of this topic.  ;)
« Last Edit: February 12, 2009, 09:51:33 PM by SilentPliz »

Offline Dragon_Hunter

  • Occasional poster
  • *
  • Posts: 52
    • View Profile
Re: stunnel log
« Reply #13 on: February 12, 2009, 10:06:46 PM »
where should openssl be in the computer?

Offline SilentPliz

  • Operator
  • Tireless poster
  • *****
  • Posts: 1181
  • ....... chut ! shh!
    • View Profile
Re: stunnel log
« Reply #14 on: February 12, 2009, 10:15:39 PM »
At the place where you have installed.  :D

It only serves to generate an SSL certificate.