Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index International Gentoo Users Forum italiano (Italian) Risorse italiane (documentazione e tools)
  • Search

[TIP] Sys/sID Email crypt [krymail]

Forum riservato alla documentazione in italiano.

Moderator: ago

Post Reply
  • Print view
Advanced search
8 posts • Page 1 of 1
Author
Message
koma
Advocate
Advocate
User avatar
Posts: 2702
Joined: Fri Jun 06, 2003 10:13 am
Location: Italy
Contact:
Contact koma
Website

[TIP] Sys/sID Email crypt [krymail]

  • Quote

Post by koma » Sun Dec 05, 2004 1:01 pm

Ciao!
Andando sul sito di _sys/sid http://gensid.altervista.org/ ho notato che la sua email era sostituita da un codice di C.
Incuriosito prima ho pensato fosse un errore del suo sito del php o in generale... ma ho notato che si trattava di una funzione con tanto di librerie in testa quindi non una porzione di programma ma un programma completo.
Creo quidi un user senza alcun provilegio se nn quello di usare gcc ed eliminare la sua home e lancio questo programmino... ci rimango malissimo quando leggo che è la sua email!
Mi sono innamorato così tanto di quella cosa che ho pregato sys di farmi un programma che emulasse quello che ha fatto (e l'ha fatto) ho deciso quindi di condividerlo con voi direi che è a dir poco perfetto sto codice :)
CODICE

Code: Select all

/* [ krymail.c ]
 ************************************************
 * Compile With: gcc -Wall krymail.c -o krymail *
 ************************************************
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Library General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

#include <stdio.h>

int main(int argc, char **argv) {   
   unsigned char i;
   char *mmail;
   
   if (argc <= 1) {
      printf("Usage: \r\n");
      printf("  %s [ mail ]\r\n", argv[0]);
      return(1);
   }
   mmail = argv[1];
   
   printf("#include <stdio.h>\r\n\r\n");
   printf("int main() {\r\n");
   printf("   unsigned char i;\r\n");
   printf("   unsigned char mail[] = {");
   
   for (i=0; mmail[i] != '\0'; i++) {
      (mmail[i] > 100) ? (mmail[i] += 3) : (mmail[i] -= 7);
      if (!(i % 7)) {
         printf("%d, ", mmail[i]);
      } else if (!(i % 3)) {
         printf("0x%X, ", mmail[i]);
      } else if (!(i % 2)) {
         printf("0%o, ", mmail[i]);
      } else {
         if (mmail[i] == '\'' || mmail[i] == '\"') {
            printf("'\\%c', ", mmail[i]);
         } else {
            printf("'%c', ", mmail[i]);
         }
      }
      if (i%6 == 0) printf("\r\n            ");
   }
   printf("'\\0'};\r\n\r\n");
   printf("   for (i=0; mail[i] != '\\0'; i++) { \r\n");
   printf("      (mail[i] > 100) ? (mail[i] -= 3) : (mail[i] += 7);\r\n");
   printf("       printf(\"%%c\", mail[i]);\r\n");
   printf("   }\r\n");
   printf("   printf(\"\\r\\n\"); \r\n");
   printf("   return(0);\r\n");
   printf("}\r\n\r\n");
   return(0);
} 
Come da commento compiliamolo con

Code: Select all

gcc -Wall krymail.c -o krymail
e convertiamo la nostra email in codice C

Code: Select all

$./krymail email@about.me >> miaemail.c
Dopodichè testiamo il risultato:

Code: Select all

gcc miaemail.c -o miaemail
nessun errore chiaramente se usate i caratteri normali per le email ;)

Code: Select all

$ ./miaemail
email@about.me
ed ecco il codice per questa email

Code: Select all

#include <stdio.h>

int main() {
   unsigned char i;
   unsigned char mail[] = {104, 
            'p', 0132, 0x6C, 0157, '9', 0x5A, 
            91, 0162, 0x78, 0167, '\'', 0x70, 
            'h', '\0'};

   for (i=0; mail[i] != '\0'; i++) { 
      (mail[i] > 100) ? (mail[i] -= 3) : (mail[i] += 7);
       printf("%c", mail[i]);
   }
   printf("\r\n"); 
   return(0);
}
Spero vi piaccia!
Ciao da koma e grazie ancora sys/sid
http://www.youtube.com/watch?v=_yoJI-Tl94g GLORY GLORY HYPNOTOAD
Top
gaffiere
Guru
Guru
User avatar
Posts: 406
Joined: Thu Nov 13, 2003 10:33 pm
Location: Provincia Milano

  • Quote

Post by gaffiere » Sun Dec 05, 2004 1:20 pm

carina come cosa! :)
non ne vedo al momento nessuna utilità pratica, ma è cmq interessante.
anzi: suggerimenti per un eventuale utilizzo?

see ya
Thomaz "Gaffiere"
Middle-Earth XP2200+, 1Gb Ram, 80Gb + 160Gb Hd, SbLive!, Nvidia 6800GT AGP8x
Gentoo Gnu/Linux 2.6.12-gentoo-r10
Top
koma
Advocate
Advocate
User avatar
Posts: 2702
Joined: Fri Jun 06, 2003 10:13 am
Location: Italy
Contact:
Contact koma
Website

  • Quote

Post by koma » Sun Dec 05, 2004 1:23 pm

evitare lo spam readng cioè quello spam provocato dall'esplorazione dei siti da parte di bot che leggono le email. ormai non basta nemmeno + il formato email[at]dominio[.]qualcosa perchè lo capiscono ugualmente le soluzioni sono soltanto due le immagini o una scrittura ancora più complessa (e inutile secondo me dato che ormai qst bot sono molto ben autimatizzati)
http://www.youtube.com/watch?v=_yoJI-Tl94g GLORY GLORY HYPNOTOAD
Top
Dhaki
Guru
Guru
User avatar
Posts: 325
Joined: Wed Jun 16, 2004 3:23 pm
Location: Ticino - CH

  • Quote

Post by Dhaki » Sun Dec 05, 2004 1:45 pm

Ehehehe :lol:

Direi che come idea é originale, no? Adesso lo provo subito :P , anche solo per provarlo. Bravi Sys & Koma!
Top
oRDeX
Veteran
Veteran
User avatar
Posts: 1325
Joined: Sun Oct 19, 2003 12:08 pm
Location: Italy
Contact:
Contact oRDeX
Website

  • Quote

Post by oRDeX » Sun Dec 05, 2004 1:59 pm

spaccaaaa
Top
koma
Advocate
Advocate
User avatar
Posts: 2702
Joined: Fri Jun 06, 2003 10:13 am
Location: Italy
Contact:
Contact koma
Website

  • Quote

Post by koma » Sun Dec 05, 2004 2:03 pm

comunque funziona anche per criptare un po' di messaggi del tipo

Code: Select all

#include <stdio.h>

int main() {
   unsigned char i;
   unsigned char mail[] = {60, 
            'l', 0132, 0x72, 031, 'u', 0x5A, 
            106, 0132, 0x7D, 0175, 'l', 0x19, 
            ']', 104, 0x6F, 031, 'i', 0x72, 
            'u', 0170, 112, 031, ']', 0x6C, 
            '', 0152, 0x68, 113, 'w', 0x72, 
            'r', 031, 0x74, 0170, 104, 0x76, 
            'w', 0162, 0x19, 0160, 'h', 118, 
            'v', 0132, 0x6A, 0152, 'l', 0x72, 
            25, 037777777741, 0x19, 0166, 'w', 0x5A, 
            'w', 114, 0x19, 0134, 'u', 0x6C, 
            's', 0167, 90, 0167, 'r', 0x19, 
            '\', 0162, 0x71, 25, 'n', 0x75, 
            '|', 0160, 0x5A, 0154, 111, 0x19, 
            '3', 075, '\0'};

   for (i=0; mail[i] != '\0'; i++) { 
      (mail[i] > 100) ? (mail[i] -= 3) : (mail[i] += 7);
       printf("%c", mail[i]);
   }
   printf("\r\n"); 
   return(0);
}
http://www.youtube.com/watch?v=_yoJI-Tl94g GLORY GLORY HYPNOTOAD
Top
oRDeX
Veteran
Veteran
User avatar
Posts: 1325
Joined: Sun Oct 19, 2003 12:08 pm
Location: Italy
Contact:
Contact oRDeX
Website

  • Quote

Post by oRDeX » Sun Dec 05, 2004 2:08 pm

Effettivamente, visto che "l'algoritmo di criptazione è fisso":

Code: Select all

for (i=0; mail[i] != '\0'; i++) {
      (mail[i] > 100) ? (mail[i] -= 3) : (mail[i] += 7);
       printf("%c", mail[i]);
   }
   printf("\r\n"); 
lo si può usare per passare messaggi segreti scambiandosi solo il vettore contenente i caratteri criptati:

Code: Select all

mail[] = {60,
            'l', 0132, 0x72, 031, 'u', 0x5A,
            106, 0132, 0x7D, 0175, 'l', 0x19,
            ']', 104, 0x6F, 031, 'i', 0x72,
            'u', 0170, 112, 031, ']', 0x6C,
            '', 0152, 0x68, 113, 'w', 0x72,
            'r', 031, 0x74, 0170, 104, 0x76,
            'w', 0162, 0x19, 0160, 'h', 118,
            'v', 0132, 0x6A, 0152, 'l', 0x72,
            25, 037777777741, 0x19, 0166, 'w', 0x5A,
            'w', 114, 0x19, 0134, 'u', 0x6C,
            's', 0167, 90, 0167, 'r', 0x19,
            '\', 0162, 0x71, 25, 'n', 0x75,
            '|', 0160, 0x5A, 0154, 111, 0x19,
            '3', 075, '\0'}; 
Top
randomaze
Bodhisattva
Bodhisattva
User avatar
Posts: 9985
Joined: Tue Oct 21, 2003 7:55 am
Contact:
Contact randomaze
Website

  • Quote

Post by randomaze » Sun Dec 05, 2004 2:27 pm

Beh io avevo una cosa simile come signature per un tot. di tempo... e avevo fatto anche la guida su gentoo italia
Ciao da me!
Top
Post Reply
  • Print view

8 posts • Page 1 of 1

Return to “Risorse italiane (documentazione e tools)”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic