blog.darkstar.work - a simple url encoder/decoder

 a simple url encoder/decoder
 http://blog.darkstar.work

Labels

Wirtschaft (150) Pressefreiheit (125) Österreich (120) IT (96) code (61) Staatsschulden (37) EZB (27) Pensionssystem (16)

2012-05-16

Google Groups shows NNTP-Posting-Host public for everyone

"Google Mail" shows original SMTP-Header only to account owner,
GoogleShowYouTheOrigSMTPMessage.png

but "Google Groups" shows NNTP-Posting-Host public for everyone (anonymous):

flex - fast lexical analyzer generator sample


Who remember flex: fast lexical analyzer generator? 

I have written a short mail logfile scanner sample long time ago under gnu linux with gcc and flex. MailScanner.yy  is a win32 port using gnuwin32 flex and getoptwin:


%option noyywrap

%{
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "getopt.h"
#include <string.h> 
#define MAXLEN 1024
#define OUT (void)printf


int i, j, idx, len, mode = 0;
char tmps[MAXLEN], reverse[MAXLEN];

%}
SEGA  [2][5][0-5]
SEGB  [2][0-4][0-9]
SEGC  [1][0-9]{2}
SEGD  [1-9][0-9]{0,1}
SEG   {SEGA}|{SEGB}|{SEGC}|{SEGD}
IP    {SEG}["."]{SEG}["."]{SEG}["."]{SEG}

HOSTDOMAINSEGMENT [0-9a-zA-Z_"\-"]+["."]
TOPLEVELDOMAIN [a-zA-Z]{2,7}
HOSTNAME {HOSTDOMAINSEGMENT}+{TOPLEVELDOMAIN}
USER [0-9A-Za-z_"\-""."]+

EMAIL1 {USER}"@"{HOSTNAME}
EMAIL2 {USER}"@"{IP}

URIPROTOCOL [a-zA-Z]{2,10}"://"
URISUFFIX [^ \t\n\r"@"","">""<""("")""{""}"]
URL1   {URIPROTOCOL}{HOSTNAME}{URISUFFIX}*
URL2   {URIPROTOCOL}{IP}{URISUFFIX}*

%%
<<EOF>> {
        exit(1);
    }

{EMAIL1} |
{EMAIL2} {
    
  if (strchr(yytext, '@') != (char *)NULL) 
  {
  switch((mode % 16))
    {
      case 0: 
        strcpy(tmps, yytext); 
        break;
case 1: 
        strcpy(tmps, strchr(yytext, (int)'@'));
        break;
case 2: 
        strcpy(tmps, &strchr(yytext, (int)'@')[1]);
        break;
  case 4:
        strcpy(tmps, &strchr(yytext, (int)'@')[1]);
len = strlen(tmps); 
for (j = 0, idx = 0; ((j < len) && (j < MAXLEN-1)); j++) 
{
if (tmps[j] == '.'
{
for (i = idx; i <= j; 
reverse[(len-j) + (i-idx)] = tmps[i++]);
 idx = j + 1;
}
}
for (i = idx; i <= j; i++)
{
          reverse[(len-j) + (i-idx)] = (i < len) ? tmps[i] : '.';
} 
reverse[len + 1] = '\0';
strcpy(tmps, reverse);
break;
case 8: 
        strcpy(tmps, &strrchr(yytext, (int)'.')[1]);
        break;
default:
        strcpy(tmps, yytext);
        break;
  }
  OUT("%s\n", tmps);
  }
}

{URL1} |
{URL2} {
  if (mode < 16) 
{
  switch((mode % 16)) 
  {
  case 0:
        strcpy(tmps, yytext);
        break;
  case 1:
        strcpy(tmps, strchr(yytext, (int)'/'));
        break;
  case 2:
        strcpy(tmps, &strrchr(yytext, (int)'/')[1]);      
        break;
  case 4:
        strcpy(tmps, &strrchr(yytext, (int)'/')[1]);
        len = strlen(tmps);
        for (j = 0, idx = 0; ((j < len) && (j < MAXLEN-1)); j++)
        {
          if (tmps[j] == '.'
          {
            for (i = idx; i <= j; reverse[(len-j) + (i-idx)] = tmps[i++]);
            idx = j + 1;
          }
        }
        for (i = idx; i <= j; i++)
{ 
          reverse[(len-j) + (i-idx)] = (i < len) ? tmps[i] : '.';
        }
        reverse[len + 1] = '\0';
        strcpy(tmps, reverse);
        break;
      case 8:
        strcpy(tmps, &strrchr(yytext, (int)'.')[1]);
        break;
      default:
        strcpy(tmps, yytext);
        break;
    }
    OUT("%s\n", tmps);
  }  

^[\n;] { ; }

[\r\n]+ { ; }

. { ; }

%%
void yyerror() { exit(1); }

void usage(const char *cmd) 
{
  OUT("Usage: %s [-f file] [-a ] [ -r ] [ -u ]\n", cmd);
  OUT("\tsimple email address and uri lexer reads from stdin \n");
  OUT("\t-a,--noat   \tprints FQDN email (chars left of \'@\')\n");
  OUT("\t-u,--nouser \tprints email without username \n");
  OUT("\t-t,--top    \tprints topleveldomain with option -a|-u\n");
  OUT("\t-n,--nouris \tprints only email address and not URIs\n");
  OUT("\t-r,--reverse\treverses FQDB/IP address segments\n");
  exit(0);
}

int _tmain(int argc, TCHAR** argv)
{
  static int verbose_flag;
  int c;

  while(1)
  {
  static struct option long_options[] =
    {
      {_T("help"), ARG_NONE, 0, _T('h')},
      {_T("noat"), ARG_NONE, 0, _T('a')},
      {_T("nouser"), ARG_NONE, 0, _T('u')},
      {_T("top"), ARG_NONE, 0, _T('t')},
      {_T("nouris"), ARG_NONE, 0, _T('n')},
      {_T("reverse"),     ARG_NONE, 0, _T('r')},
      { ARG_NULL,         ARG_NULL, ARG_NULL, ARG_NULL}
    }; 

    int option_index = 0;
    c = getopt_long(argc, argv, _T("hautnr:"), long_options, &option_index);
    if (c == -1) 
      break;
    switch (c) // Handle options
    {
      case 0: // If this option set a flag, do nothing else now.   
        if (long_options[option_index].flag != 0)
  break;
        _tprintf (_T("option %s"), long_options[option_index].name);
        if (optarg)
          _tprintf (_T(" with arg %s"), optarg);
        _tprintf (_T("\n"));
        break;
      case _T('u'): mode = 1;
        break
      case _T('a'): mode = 2;  
        break
      case _T('r'): mode = 4;  
        break;
      case _T('h'): usage(argv[0]);  
        break;
      case _T('t'): mode = 8;  
        break;
      case _T('n'): mode += 16;  
        break;  
      case '?': // getopt_long already printed an error message.  
        break
      defaultabort();
    }
  }
  (void) fflush(stdout);
  yyin = stdin;
  yylex();
  exit(0);
}


Files: [MailScanner.yy] [lex.yy.c]

VPN Security or secure instant linux


Howto increase VPN security, when you only need remote desktop or remote login sessions? 

When your OS at office is Win2008, 
VPN clients on bootable write protected memory sticks/ CDs/ DVDs with a special prepared linux OS can enhance security. (You can easy clone or customize a live cd and change the certificate / password all 2 months) 
You might even prepare a live cd for android or boot a special image from sdcard, but remember, that an image on sdcard isn't write protected.
USB Memory Stick with write protection 

Urheberrecht Führerschein

Eine berechtigte Frage und ein guter Vergleich von Igor Sekowski zum Urheberrecht: https://plus.google.com/u/0/112832268641330799683/posts/9rKTXnWkApY

Ich habe folgende Infos im Netz gefunden, die sich leider (oder wie beim Urheberrecht sehr häufig) widersprechen.
Dieser Artikel wurde bereits auf Google+ öfters erwähnt:
http://rechtsanwalt-schwenke.de/vorschaubilder-beim-teilen-von-inhalten-in-social-media-praxistipps-zur-minderung-des-abmahnrisikos/

Diese Infos habe ich so gefunden: 

und folgendes Kommentar geschrieben:
Da zumindest größtenteils Einigkeit darüber herrscht, dass wenn auf einer Webseite ein +1 oder like Button vorhanden ist, diese Webseite bei Google+ oder Facebook mit Vorschaubild geteilt werden kann, 
hätte ich als reiner Benutzer folgende ganz praktische Frage:

Ist es unproblematisch die Seite auch in jenen Sozialen Medien zu teilen, wo der entsprechende Button fehlt, sofern nur ein einziger social media share button auf der Webseite vorhanden ist?


Ein Beispiel: Jemand, egal jetzt ob unwissentlich oder absichtlich fügt nur den Facebook like Button auf seiner Webseite hinzu. Auf alle Fälle dürfte es  jetzt unproblematisch sein, wenn ich mit Vorschaubild bei Facebook diese Seite teile. Aber besteht für mich als Benutzer ein höheres Abmahnrisiko, wenn ich die Seite jetzt bei Google+ teile?

Darf der Inhaber der Seite darüber bestimmen in welchen Sozial Medien seine Seite mit Vorschaubild geteilt wird und wenn ja hätte das nicht einen extremen Wettbewerbsnachteil für neue Startups von bis dato unbekannten social media?


Hier eine Diskussion zu diesem Thema auf  Google+:
https://plus.google.com/u/0/107370420028985054014/posts/AZuWDxDif3P


http://seclists.org/ 
http://seclists.org/basics/
http://seclists.org/honeypots/ 
http://seclists.org/bugtraq/
http://seclists.org/isn/

cloud-email-security


cloud email security
Coud E-Mail Dienste werden immer populärer.
Google und Microsoft stellen Email- inkl. domain & diverser anderer Services für Unternehmen und Organisationen (Preisspektrum gratis bis günstig) per Cloud zur Verfügung. 


In meinem Umfeld setzen KMUs aus ideologischen Gründen eher auf MS, während Vereine und kleine private Organisationen eher Google zugeneigt sind.
Die Serversicherheit wird (jetzt nur) im Vergleich zu halbprofessionell eingerichteten und schlecht administrierten Mailservern eher zunehmen. 

Der Verbindungsaufbau Endgerät -> Server wird für jene, die SSL seit Jahren stur ignorieren zumindest besser. 
Benutzer Endgeräte bleiben aber weiterhin auch hier die größte Sicherheitsschwachstelle.

Zum Thema E-Mail Verschlüsselung fand ich folgende android apps im market: