jueves, 27 de octubre de 2011

Activar sudo en Fedora

En Fedora no viene activado el comando sudo , así que si lo queremos tener, para poder instalar y hacer cambios desde nuestro usuario, sin tener que idenficarnos como root (su).

Solo tenemos que abrir un terminal

$ su
$ nano /etc/sudoers

Y busca donde ponga: root ALL=(ALL) ALL
y ponemos debajo: nuestro_usuario ALL=(ALL) ALL

Quedando así:

Ahora guardamos el archivo con Ctrl+O y salimos con Ctrl+X

Ahora ya podemos escribir: $ exit
Y salimos del root.

martes, 25 de octubre de 2011

Lista de dorks para SQLi

Aquí tenemos una pequeña lista de dorks usados para la famosa SQL injection...

inurl:index.php?id=
inurl:trainers.php?id=
inurl:buy.php?category=
inurl:article.php?ID=
inurl:play_old.php?id=
inurl:declaration_more.php?decl_id=
inurl:pageid=
inurl:games.php?id=
inurl:page.php?file=
inurl:newsDetail.php?id=
inurl:gallery.php?id=
inurl:article.php?id=
inurl:show.php?id=
inurl:staff_id=
inurl:newsitem.php?num=
inurl:readnews.php?id=
inurl:top10.php?cat=
inurl:historialeer.php?num=
inurl:reagir.php?num=
inurl:Stray-Questions-View.php?num=
inurl:forum_bds.php?num=
inurl:game.php?id=
inurl:view_product.php?id=
inurl:newsone.php?id=
inurl:sw_comment.php?id=
inurl:news.php?id=
inurl:avd_start.php?avd=
inurl:event.php?id=
inurl:product-item.php?id=
inurl:sql.php?id=
inurl:news_view.php?id=
inurl:select_biblio.php?id=
inurl:humor.php?id=
inurl:aboutbook.php?id=
inurl:ogl_inet.php?ogl_id=
inurl:fiche_spectacle.php?id=
inurl:communique_detail.php?id=
inurl:sem.php3?id=
inurl:kategorie.php4?id=
inurl:news.php?id=
inurl:index.php?id=
inurl:faq2.php?id=
inurl:show_an.php?id=
inurl:preview.php?id=
inurl:loadpsb.php?id=
inurl:opinions.php?id=
inurl:spr.php?id=
inurl:pages.php?id=
inurl:announce.php?id=
inurl:clanek.php4?id=
inurl:participant.php?id=
inurl:download.php?id=
inurl:main.php?id=
inurl:review.php?id=
inurl:chappies.php?id=
inurl:read.php?id=
inurl:prod_detail.php?id=
inurl:viewphoto.php?id=
inurl:article.php?id=
inurl:person.php?id=
inurl:productinfo.php?id=
inurl:showimg.php?id=
inurl:view.php?id=
inurl:website.php?id=
inurl:hosting_info.php?id=
inurl:gallery.php?id=
inurl:rub.php?idr=
inurl:view_faq.php?id=
inurl:artikelinfo.php?id=
inurl:detail.php?ID=
inurl:index.php?=
inurl:profile_view.php?id=
inurl:category.php?id=
inurl:publications.php?id=
inurl:fellows.php?id=
inurl:downloads_info.php?id=
inurl:prod_info.php?id=
inurl:shop.php?do=part&id=
inurl:productinfo.php?id=
inurl:collectionitem.php?id=
inurl:band_info.php?id=
inurl:product.php?id=
inurl:releases.php?id=
inurl:ray.php?id=
inurl:produit.php?id=
inurl:pop.php?id=
inurl:shopping.php?id=
inurl:productdetail.php?id=
inurl:post.php?id=
inurl:viewshowdetail.php?id=
inurl:clubpage.php?id=
inurl:memberInfo.php?id=
inurl:section.php?id=
inurl:theme.php?id=
inurl:page.php?id=
inurl:shredder-categories.php?id=
inurl:tradeCategory.php?id=
inurl:product_ranges_view.php?ID=
inurl:shop_category.php?id=
inurl:transcript.php?id=
inurl:channel_id=
inurl:item_id=
inurl:newsid=
inurl:trainers.php?id=
inurl:news-full.php?id=
inurl:news_display.php?getid=
inurl:index2.php?option=
inurl:readnews.php?id=
inurl:top10.php?cat=
inurl:newsone.php?id=
inurl:event.php?id=
inurl:product-item.php?id=
inurl:sql.php?id=
inurl:aboutbook.php?id=
inurl:preview.php?id=
inurl:loadpsb.php?id=
inurl:pages.php?id=
inurl:material.php?id=
inurl:clanek.php4?id=
inurl:announce.php?id=
inurl:chappies.php?id=
inurl:read.php?id=
inurl:viewapp.php?id=
inurl:viewphoto.php?id=
inurl:rub.php?idr=
inurl:galeri_info.php?l=
inurl:review.php?id=
inurl:iniziativa.php?in=
inurl:curriculum.php?id=
inurl:labels.php?id=
inurl:story.php?id=
inurl:look.php?ID=
inurl:newsone.php?id=
inurl:aboutbook.php?id=
inurl:material.php?id=
inurl:opinions.php?id=
inurl:announce.php?id=
inurl:rub.php?idr=
inurl:galeri_info.php?l=
inurl:tekst.php?idt=
inurl:newscat.php?id=
inurl:newsticker_info.php?idn=
inurl:rubrika.php?idr=
inurl:rubp.php?idr=
inurl:offer.php?idf=
inurl:art.php?idm=
inurl:title.php?id=

Usa la imaginación...

Cambiar el nombre del equipo.

Esto es algo muy sencillo:

Abrimos un terminal:



$ sudo nano /etc/hostname
(Cambiamos el nombre que tenemos actualmente por el que queremos poner, guardamos con ctr+o y salimos ctrl+x)

$ sudo reboot


viernes, 21 de octubre de 2011

JDownloader en Fedora 15

En esta entrada, vamos a instalar el famoso gestor de descargas en Fedora 15.

http://jdownloader.org


Vamos a http://jdownloader.org/download/index y descargamos jd.sh (Donde pone Linux obviamente)
Una vez descargado, lo tendremos en descargas.

Vamos a esa carpeta:

$ cd Descargas
$ chmod +x jd.sh
$ sh jd.sh

Después empezará a descargar desde una ventana.
Si en este punto os dice que hay un error en java, es porque no teneis instalado el jdk de java. Para instalarlo, basta con poner.

$ su -c 'yum install java-1.6.0-openjdk'

Una vez instalado JDownloader, para que nos salga en el Dash, tendremos que hacerlo manualmente, creando un lanzador.


$ cd /home/USER/.local/share/applications
$ gedit

Y pegamos esto en el archivo

[Desktop Entry]
Version=1.0
Type=Application
Categories=Network;
Terminal=false
Exec=java -jar /home/USER/.jd/JDownloader.jar
Name=JDownloader
Comment=Gestor de Descargas JDownloader
Icon=/home/USER/.jd/jd/img/logo/jd_logo_256_256.png


Lo guardamos como JDownloader.desktop

(Donde pone USER, tendreis que poner vuestro usuario)

Y ya lo tendremos en el Dash.

Ahora para que este gráficamente integrado en el tema, podeis ir a Ajustes, y allí cambiar el idioma, y la interfaz.



miércoles, 19 de octubre de 2011

Restaurar las X y aceleración gráfica.

Como casi siempre, cada vez que actualizamos el kernel de nuestra distribución, se nos jode la animación 3D en el escritorio. Bien, mi caso es con una tarjeta gráfica ATI Radeon X550 y Ubuntu 10.04, y después de mucho leer y sin conseguir arreglarlo, di con la tecla. Os lo resumo aquí. Primeramente debeis instalar los drivers.

Es conveniente que vayais al modo texto (alt + ctrl + F1).
1. sudo /etc/init.d/gdm stop
2. sudo Xorg -configure
3. sudo cp xorg.conf.new /etc/X11/xorg.conf
4. sudo dpkg-reconfigure xserver-xorg
5. sudo reboot

Después de reiniciar, entramos en el modo gráfico.
instalamos mesa-utils: sudo apt-get install mesa-utils
y ejecutamos: glxinfo ó glxgears.

A mí como no me funcionaba, cada vez que ponia glxinfo me salia
X Error of failed request: BadLength (poly request too large or internal Xlib length error) Major opcode of failed request:...
Total, que no me funcionaba la aceleración 3D, y no encontraba nada por internet. Al final de casualidad instalé.
sudo apt-get install libgl1-mesa-swx11-dev


Y ya funciona la aceleración 3D perfectamente, igual que antes de actualizar el kernel.
Finalmente, para comprobar si os funciona la aceleración 3D:
$ glxinfo | grep direct
$ glxgears

Aquí os dejo el archivo xorg.conf por sí hay alguna duda.


Section "ServerLayout"
Identifier "X.org Configured"
Screen 0 "Screen0" 0 0
InputDevice "Mouse0" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
ModulePath "/usr/lib/xorg/modules"
FontPath "/usr/share/fonts/X11/misc"
FontPath "/usr/share/fonts/X11/cyrillic"
FontPath "/usr/share/fonts/X11/100dpi/:unscaled"
FontPath "/usr/share/fonts/X11/75dpi/:unscaled"
FontPath "/usr/share/fonts/X11/Type1"
FontPath "/usr/share/fonts/X11/100dpi"
FontPath "/usr/share/fonts/X11/75dpi"
FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
FontPath "built-ins"
EndSection

Section "Module"
Load "extmod"
Load "record"
Load "dbe"
Load "dri2"
Load "dri"
Load "glx"
EndSection

Section "InputDevice"
Identifier "Keyboard0"
Driver "kbd"
EndSection

Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/input/mice"
Option "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
#DisplaySize 300 230 # mm
Identifier "Monitor0"
VendorName "SAM"
ModelName "SyncMaster"
HorizSync 30.0 - 61.0
VertRefresh 56.0 - 75.0
Option "DPMS"
EndSection

Section "Device"
### Available Driver options are:-
### Values: : integer, : float, : "True"/"False",
### : "String", : " Hz/kHz/MHz"
### [arg]: arg optional
#Option "NoAccel" # []
#Option "SWcursor" # []
#Option "Dac6Bit" # []
#Option "Dac8Bit" # []
#Option "BusType" # []
#Option "CPPIOMode" # []
#Option "CPusecTimeout" #
#Option "AGPMode" #
#Option "AGPFastWrite" # []
#Option "AGPSize" #
#Option "GARTSize" #
#Option "RingSize" #
#Option "BufferSize" #
#Option "EnableDepthMoves" # []
#Option "EnablePageFlip" # []
#Option "NoBackBuffer" # []
#Option "DMAForXv" # []
#Option "FBTexPercent" #
#Option "DepthBits" #
#Option "PCIAPERSize" #
#Option "AccelDFS" # []
#Option "IgnoreEDID" # []
#Option "CustomEDID" # []
#Option "DisplayPriority" # []
#Option "PanelSize" # []
#Option "ForceMinDotClock" #
#Option "ColorTiling" # []
#Option "VideoKey" #
#Option "RageTheatreCrystal" #
#Option "RageTheatreTunerPort" #
#Option "RageTheatreCompositePort" #
#Option "RageTheatreSVideoPort" #
#Option "TunerType" #
#Option "RageTheatreMicrocPath" #
#Option "RageTheatreMicrocType" #
#Option "ScalerWidth" #
#Option "RenderAccel" # []
#Option "SubPixelOrder" # []
#Option "ShowCache" # []
#Option "ClockGating" # []
#Option "VGAAccess" # []
#Option "ReverseDDC" # []
#Option "LVDSProbePLL" # []
#Option "AccelMethod" #
#Option "DRI" # []
#Option "ConnectorTable" #
#Option "DefaultConnectorTable" # []
#Option "DefaultTMDSPLL" # []
#Option "TVDACLoadDetect" # []
#Option "ForceTVOut" # []
#Option "TVStandard" #
#Option "IgnoreLidStatus" # []
#Option "DefaultTVDACAdj" # []
#Option "Int10" # []
#Option "EXAVSync" # []
#Option "ATOMTVOut" # []
#Option "R4xxATOM" # []
#Option "ForceLowPowerMode" # []
#Option "DynamicPM" # []
#Option "NewPLL" # []
#Option "ZaphodHeads" #
Option "DRI" "true"
Option "XAANoOffscreenPixmaps" "true"
Identifier "Card0"
Driver "radeon"
VendorName "ATI Technologies Inc"
BoardName "RV370 [Sapphire X550 Silent]"
BusID "PCI:2:0:0"
EndSection

Section "Screen"
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
SubSection "Display"
Viewport 0 0
Depth 1
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 4
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 8
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 15
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 16
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 24
EndSubSection
EndSection

Section "Extensions"
Option "Composite" "Disable"
EndSection

Section "DRI"
Mode 0666
EndSection





viernes, 7 de octubre de 2011

Listas en C.

#include
#include
#include


typedef struct {
char cadena[100];
void *siguiente_elemento;
} Elemento;

typedef Elemento * Lista;


//agregar elemento

void Lista_Agregar(Lista *l, const Elemento *elem){ /* agrega una copia de elem al final de la lista.*/
Elemento * nuevo = (Elemento *) malloc (sizeof (Elemento));
strcpy(nuevo->cadena,elem->cadena);

if (*l == NULL) {
nuevo->siguiente_elemento = *l;
*l = nuevo;
printf("Primer Elemento introducido\n");
}
else {
Elemento *aux = *l;
Elemento *ant = NULL;
while (aux != NULL){
ant = aux;
aux = aux->siguiente_elemento;
}
ant->siguiente_elemento = nuevo;
nuevo->siguiente_elemento = aux;
}

printf("Elemento introduco\n");
}

//imprimir lista

void ImprimirLista(Elemento *aux){
while (aux!=NULL){
printf("%s \n",aux->cadena);
aux=aux->siguiente_elemento;
}
}

//Vaciar lista
void Lista_Vaciar(Lista *l){
Elemento *aux;
while (*l){
aux = *l;
*l = aux->siguiente_elemento;
free(aux);
}

}

Google Search

En esta entrada vamos a poner las funciones avanzadas para buscar en google, ya que como todos bien sabemos, todo esta en él. Así que si aprendemos a buscar bien, podremos hacer casi cualquier cosa...

Búsqueda de frases ("") ejemplo. "hola caracola"
Búsquedas en un sitio web específico (site:) ejemplo. iraq site:elpais.com

Así, por ejemplo si ponemos en el buscador.
program: host/ip:http://www.megaupload.com login: password: Computer:

Nos saldran un listado de webs donde habrá cuentas de megaupload por ejemplo, y así con muchas otras webs.