lunes, 27 de enero de 2014

SQL INJECTION

Injection SQL con sentencia 'or'1'=1 

Paso 1: Buscar Panel de Administración: 

Al entrar al panel adminsitrativo de la pagina victima y en Usuario hay que introducir ' OR '1'='1 y en contraseña, lo mismo,  ' OR '1'='1 

Bypassing

Al subir una imagen con una shell incrustada es posible tener el control de la web
con cmd y 7-zip

Una vez subida la imagen accedemos a ella a traves del navegador y ya tenemos acceso a la shell remota

viernes, 3 de enero de 2014

Hot keys Cisco

Hot Keys and Shortcuts

The IOS CLI provides hot keys and shortcuts that make configuring, monitoring, and troubleshooting easier.

The figure shows most of the shortcuts. The following are worthy of special note:

  • Down Arrow - Allows the user to scroll forward through former commands

  • Up Arrow - Allows the user to scroll backward through former commands

  • Tab - Completes the remainder of a partially typed command or keyword

  • Ctrl-A - Moves to the beginning of the line

  • Ctrl-E - Moves to the end of the line

  • Ctrl-R - Redisplays a line

  • Ctrl-Z - Exits the configuration mode and returns to user EXEC

  • Ctrl-C - Exits the configuration mode or aborts the current command

  • Ctrl-Shift-6 - Allows the user to interrupt an IOS process such as ping or traceroute

Examining some of these in more detail:

Tab

Tab complete is used to complete the remainder of abbreviated commands and parameters if the abbreviation contains enough letters to be different from any other currently available commands or parameters. When enough of the command or keyword has been entered to appear unique, press the Tab key and the CLI will display the rest of the command or keyword.

This is a good technique to use when you are learning because it allows you to see the full word used for the command or keyword.

Ctrl-R

Redisplay the line will refresh the line just typed. Use Ctrl-R to redisplay the line. For example, you may find that the IOS is returning a message to the CLI just as you are typing a line. You can use Ctrl-R to refresh the line and avoid having to retype it.

In this example, a message regarding a failed interface is returned in the middle of a command.

Switch# show mac-

16w4d: %LINK-5-CHANGED: Interface FastEthernet0/10, changed state to down

16w4d: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/10, changed state to down

To redisplay to line that you were typing useCtrl-R:

Switch# show mac

Ctrl-Z

Exit configuration mode will leave any configuration mode and return to privileged EXEC mode. Because the IOS has a hierarchical mode structure, you may find yourself several levels down. Rather than exit each mode individually, use Ctrl-Z to return directly to the privileged EXEC prompt at the top level.

Up and Down Arrows

Previous command keys will recall the history of commands entered. The Cisco IOS software buffers several past commands and characters so that entries can be recalled. The buffer is useful for re-entering commands without retyping.

Key sequences are available to scroll through these buffered commands. Use theUp Arrow key (Ctrl-P) to display the previously entered commands. Each time this key is pressed, the next successively older command will be displayed. Use theDown Arrow key (Ctrl-N) to scroll forward through the history to display the more recent commands.

Ctrl-Shift-6

The escape sequence will interrupt any running process. When an IOS process is initiated from the CLI, such as a ping or traceroute, the command runs until it is complete or is interrupted. While the process is running, the CLI is unresponsive. To interrupt the output and interact with the CLI, press Ctrl-Shift-6.

Ctrl-C

This interrupts the entry of a command and exits the configuration mode. This is useful after entering a command that needs to be cancelled.

Abbreviated commands or keywords

Commands and keywords can be abbreviated to the minimum number of characters that identify a unique selection. For example, the configure command can be abbreviated to conf becauseconfigure is the only command that begins with conf. An abbreviation of conwill not work because more than one command begins with con.

Keywords can also be abbreviated.

As another example, show interfacescan be abbreviated like this:

Switch# show interfaces

Switch# show int

You can abbreviate both the command and the keywords, for example:

Switch# sh int

jueves, 5 de diciembre de 2013

Como restringir el acceso de una ip a una carpeta de tu servidor web

Muchas veces almacenamos datos delicados, o simplemente tenemos el panel de administración de algún CMS del cual hay 500 tipos de vulnerabilidades, videos detallados sobre como hacer el ataque etc... En caso de no haber ningun tipo de vulnerabilidad en el momento de instalarlo con la ultima versión de aquí a 1 año los habrá. Con toda seguridad.
Es por eso que puede ser interesarte poner otro tipo de barrera, como es el acceso restringido a la carpeta de administración por IP.

De cualquier manera, vamos al grano.

1.- Abre tu gestor FTP y ubicate en el directorio donde quieres efectuar la restricción.

2.-Busca y edita el archivo .htaccess De no existir puedes crearlo con cualquier editor de textos

3.-Esto es el código que hace la restricción, lo agregas al archivo

<Limit GET>
    Order Deny,Allow
    Deny from all
    Allow from XXX.XXX.XXX.XXX
</Limit>

Donde (XXX.XXX.XXX.XXX) va a ser nuestra la IP a la que permitiremos el acceso

En este caso hemos puesto la restricción de acceso para una única IP. Pero.. ¿Qué ocurre si queremos darle acceso a varias?

Para poder permitir acceso a varias IPs se puede hacer de dos maneras, poniendo tantas lineas como IPs se quieran permitir:

Allow from XXX.XXX.XXX.XX1
Allow from XXX.XXX.XXX.XX2
Allow from XXX.XXX.XXX.XX3

O simplemente separando por comas las IPs

Allow from XXX.XXX.XXX.XX1,XXX.XXX.XXX.XX2,XXX.XXX.XXX.XX3


Otra posibilidad es la de permitir el acceso a un rango de IPs, pues bien esto lo haremos de la siguiente manera

Allow from XXX.XXX.XXX.

Allow from XXX.XXX.


Decir que si tienes una IP dinámica, esto puede que no sea la solución que estás buscando. Me explico, en el caso de las IPs dinámicas hay ISPs (internet services provider) como por ejemplo ONO que aunque tu IP sea dinámica, ésta no se suele cambiar. Es decir, a efectos prácticos se podría decir que tienes una IP estática. Aunque se pueda dar el caso de que te la cambien.

Otro ejemplo, con telefonica, cada vez que reinicias el router, tu ip si que cambia.

Lo ideal sería tener una IP estática para que la modificación sobre la restricción del acceso sea siempre la misma.


501!




domingo, 1 de diciembre de 2013

Menu aparece duplicado en Wordpress

Debido a que algunas plantillas no estan actualizadas con las nuevas versiones de wordpress, es posible que al crear un menu, este nos aparezca duplicado.

Inicio Proyectos Contacto Inicio Proyectos Contacto


Para solucionar este problema de versiones tendremos que ir a header.php y buscar la siguiente linea: 

<?php wp_nav_menu('menu=header_menu&container=false&menu_class=pages_menu'); ?>


Unicamente con comentarla ( poniendo // delante de wp_nav ) se anula esa linea por lo que ya solo queda el menu que hayamos creado desde el gestor de menus

Como saber la version de wordpress y evitar que otros la conozcan

En este post vamos a ver de qué manera se puede averiguar la versión de un wordpress y cómo hacer para evitar que otros la vean por esos métodos.


Las dos formas mas sencillas para conocer la versión de wordpress de una pagina o blog son las siguientes:

1.- En el mismo código fuente de la página buscamos la etiqueta en el head de la pagina. 

<meta name="generator" content="WordPress 3.6" />

Basta con buscar en el archivo functions.php y añadir al final del archivo (, siempre dentro del php, es decir, justo antes de ?> ) la siguiente linea

//desactivar el wp_generator
remove_action('wp_head', 'wp_generator');


2.- Muchas veces esta etiqueta se desactiva por temas de seguridad, ya que sabiendo la versión se puede buscar fácilmente las vulnerabilidades. Pero hay un archivo que no se suele tener tanto en cuenta como es el readme.html

Simplemente acceder a él y tachaaan aparece el numero de versión y además esta ahi en grande para que se vea mejor


Para evitar esto simplemente basta con borrar el archivo readme.html que en realidad no te ayuda en nada y si ayuda mucho a que accedan a tu sitio web.