Archive

Archive for the ‘network’ Category

Easy Host Fake Win32

December 27th, 2008

Easy Host Fake Win32

Sometimes we want to redirect some host to another ip address, the quick option is edit the hosts file.

Well i made this tool to do that.

Java Desktop Application, needs Java RunTime:

Easy Host Fake Java Setup

Is my first Java desktop application on NetBeans

PHP5 script, needs Console Getopt Pear Package (getopt function don’t work on Windows, in the next php 5.3.0 could be)

need pear? run go-pear.bat on your php5 directory

c:\>pear install Console_Getopt

Windows Batch file:

:save this ehf.cmd on your %windir%
:set php-cli to your php.exe path
@set php-cli=c:\php5\php.exe
:set ehf script path
@set ehf=c:\develop\php\scripts\ehf.php
@%php-cli% %ehf% %1 %2 %3 %4

Script ehf.php:

 /* Script: Easy Host Fake
  * Author: Albertux (Alberto Isaac Ayala Esquivias)
  * WebSite: http://Albertux.AyalaSoft.com
  * FeedBack: <albertoi7@gmail.com>
  * License: GPLv3 (http://www.gnu.org/licenses/gpl.txt)
  * Note: you need Pear Package Console Getopt
  */
$ip_default = '127.0.0.1'; // default ip
$hosts_file = 'c:/windows/system32/drivers/etc/hosts'; // default hosts file
 
require_once 'Console/Getopt.php';
$options = Console_Getopt::getopt($_SERVER["argv"],"a:e:r:");
 
function about() {
echo "
Easy Host Fake (version 1.0.1) [2008-12-27]
 
Usage: ehf [OPTIONS]
 
Mandatory: \"-r\" or \"-e\" [host]
 
Options:
 
  -r [host] [redirect host to 127.0.0.1 (or other ip address)]
  -e [host] [erase host on hosts file]
  -a [ip address]
 
Examples:
 
  ewf -r google.com -a 192.168.1.1
  ewf -e google.com
 
More info [http://Albertux.AyalaSoft.com/2008/12/28/easy-host-fake-win32/]
";
}
 
function AddHost($host,$ip) {
	global $hosts_file;
	$handle = fopen($hosts_file,"a");
	fwrite($handle,"\r\n$ip\t$host\t# Easy Host Fake");
	fclose($handle);
}
 
function removeHost($host) {
	global $hosts_file;
	$handle = fopen($hosts_file, "r");
	$contents = fread($handle, filesize($hosts_file));
	fclose($handle);
	$pattern = '/\\r\\n(\d+)\.(\d+)\.(\d+)\.(\d+)\t'.$host.'\t# Easy Host Fake/';
	$replacement = "";
	$newcontents = preg_replace($pattern, $replacement, $contents);
	$handle = fopen($hosts_file,"w");
	fwrite($handle,$newcontents);
	fclose($handle);
}
 
function getValue($data,$var) {
	for ($i=0; $i<count($data[0]); $i++) {
		if ($var == $data[0][$i][0]) {
			break;
		}
	}
	return $data[0][$i][1];
}
 
if ($options->message) { about(); die(); }
 
$host = getValue($options,"r");
$ip = getValue($options,"a");
 
if (!$host) {
	$host = getValue($options,"e");
	if ($ip) { about(); die(); }
	if (!$host) { about(); die(); }
	removeHost($host); die();
}
 
if (!$host) { about(); die(); }
if (!$ip) { $ip = $ip_default; }
 
addHost($host,$ip);

Download php script + batch cmd

Note: on Windows Vista you need some permissions on hosts file, and remember all Web browsers use cache.

network, projects, security, web, windows , , ,

Send Fake Mail

December 5th, 2008

Send Fake Mail

Remember is very posible the mail was arrived on Junk Box.

#!/usr/bin/perl
# Script: fakemail.pl, Version 1.0  [2008-12-04]
# Author: Albertux (Alberto Isaac Ayala Esquivias)
# Web Author: http://Albertux.AyalaSoft.com
# FeedBack:
# Description: Send fake mail.
# Licence: GPLv3
 
use strict;
use warnings;
 
# Chouse the host to connect on port 25
my $host='localhost'; 
 
# The vars
my @raw_data=;
my ($mail1, $mail2, $name1, $name2, $subject, $data );
 
print "Fake Mail: ";
chomp($mail1 = &lt;&gt;);
print "Destiny Mail: ";
chomp($mail2 = &lt;&gt;);
print "Fake Name: ";
chomp($name1 = &lt;&gt;);
print "Destiny Name: ";
chomp($name2 = &lt;&gt;);
print "Subject: ";
chomp($subject = &lt;&gt;);
print "Data: ";
chomp($data = &lt;&gt;);
 
foreach(@raw_data) {
	$_ =~ s/MAIL1/$mail1/g;
	$_ =~ s/MAIL2/$mail2/g;
	$_ =~ s/NAME1/$name1/g;
	$_ =~ s/NAME2/$name2/g;
	$_ =~ s/SUBJECT/$subject/g;
	$_ =~ s/DATA/$data/g;
	$_ =~ s/\\n/\n/g;
}
 
print "mail send.\n";
 
open(STDOUT, "| telnet ".$host." 25 &gt; /dev/null 2&gt;&amp;1");
foreach (@raw_data) {
	print STDOUT $_;
}
 
1;
 
__DATA__
mail from: MAIL1
rcpt to: MAIL2
data
From: NAME1
To: NAME2
Subject: SUBJECT
DATA
.
quit

develop, network, security ,

jugando con una IP

November 28th, 2008

jugando con una IP

Me llegaron unos comentarios a mi Blog una persona me firmo como si tuviera un correo de otro pais, la otra persona se que su correo es de Mexico, pero ambos procedian de la misma IP, como la curiosidad mato al gato empeze a jugar con la IP donde habia recibido los mensajes.

Bueno para no hacer el cuento largo me meti al Router aqui dejo un screenshoot:

[2008-11-28]

Por lo visto el Router no lo han reiniciado sigo teniendo acceso a el ahora ando curiosando que opciones tiene el Router:

Aqui dejo la IP de Router: https://200.67.0.184/

Saludos

network, personal, security

C Compile on Demand

November 24th, 2008

C Compile on Demand

If you want to use C/C++ as CGI you need compile the code you can compile on demand check C Cod WebSite

See the Documentation some aspects similars to ASP(VBScript).

you now:

#!/usr/bin/php
#!/usr/bin/perl
#!/usr/bin/python
#!/bin/bash
...

Add this #!/usr/bin/ccod to use C/C++, one simple example:

#!/usr/bin/ccod

Download C Cod.

develop, network, projects, unix/linux, web, windows ,

Saturday Morning Hacking

November 8th, 2008

Saturday Morning Hacking

Este sabado en la mañana (madrugada para mi) acompañe a mi tia a un curso de RNA (Redes Neuronales Artificiales) aplicadas a la valuacion (mi tia es Arquitecta)

Me meti a un ruter AirLink101 (pesimo password: admin) aburrido un poco empeze a jugar con la pagina de AINetSolutions, despues de un tiempo consegui el usuario y password de MySQL.

Aqui un screenshoot:

No modifique nada, solo estuve de observador.

Saludos a toda la raza del MHT, recordando viejas costumbres este dia.

Les mande un correo a los de AINetSolutions espero no se molesten por publicarlo en mi Blog.

Como medidas de seguridad siempre cambien el password del ruter nunca dejen el password que viene por defecto, de preferencia no utilizen conexiones remotas de MySQL o si las requieren utilizen un filtro de IP.

database, network, personal, security, web ,

Google App Engine

November 5th, 2008

Google App Engine

Downloads (http://code.google.com/appengine/downloads.html)

Google App Engine use Django, webob, yaml.

You need Python (http://www.python.org) (Python 2.5)

The configuration file app.yaml

There are two main Python scripts:

Video from the The Google Code Channel:

See the applications gallery

Google App Engine

database, develop, hardware, network, projects, web , ,

QEMU Emulator

November 1st, 2008

QEMU Emulator

QEMU is a great emulator, like VMware or VirtualBox you can use to manage many guest operating system on your computer of course you need a lot of RAM

Install on Debian:

apt-get install qemu
wget http://bellard.org/qemu/kqemu-1.3.0pre11.tar.gz
tar xvzf kqemu-1.3.0pre11.tar.gz
cd kqemu-1.3.0pre11
./configure
make
make install

To load kqemu on Windows:

net start kqemu

To load kqemu on GNU/Linux:

modprobe kqemu

Port redirection use the flag option “-redir” some examples:

-redir tcp:8000::80  # redirect host port 8000 to port 80 on the guest.
-redir tcp:22::22 # ssh server on the guest

Note: I have a little trouble to install kqemu.inf on Windows Vista Bussiness i need to download the setup file on “Accelerators” section on QEMU for Win32

Damn Small Linux is a light distro use old kernel but run very wheel on old computer systems, you can run on CD-Rom, USB or Embedded System (using QEMU emulator)

Some times you need test some software but you want to install on your personal computer system, emulate and test the software is the best solution

network, unix/linux, windows , ,