Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - fr0g

Pages: [1]
1
Web Oriented Coding / Re: [PhP] List the codes of a database
« on: December 01, 2011, 11:50:38 pm »
Code: [Select]
<?php


if (is_numeric($_GET['id'])) { // only if $_GET['id'] is a number
       
$id $_GET['id'];
       ...
      ....
}
 else{                 
// if $_GET['id'] isn't a number

?>


      <script>                alert("ERROR : \n Numero de ressource invalide");
      location.href="index.php"; </script>     
      <?php      

}?>




you can try it here :

http://hwc.kegtux.org/index.php?id='








 

3
Reverse Engineering / [Linux] basic Reversing with GDB
« on: December 01, 2011, 02:54:43 pm »

   Here is a short paper (in French, do not hit me ^ ^), explaining the bases useful in reversing with GDB.

http://www.exploit-db.com/papers/17723/

4
Web Oriented Coding / [PhP] List the codes of a database
« on: December 01, 2011, 02:49:24 pm »


French :
Quote
Juste un projet (à l'image du site Exploit-DB) , visant à répertorier toutes les ressources partagées par le collectif n-pn, hwc-crew & co' Tutoriels, codes sources, tools, etc ...

Voilà, je ne pense pas qu'il y ai grand chose à dire de plus, je vais le peaufiner et trouver un hébergeur stable pour le publier, j'ajouterai le sous-domaine db.hwc-crew.com dessus.

Version de démonstration pour le lancement du projet ici => http://www.hwc.kegtux.org/index.php

English :

Quote
This script will list the source code and papers stored in a database, the website is still under development, as you can see here: http://hwc.kegtux.org/




Quote
Table mysq : "listfile"

champs :

- id
- title
- author
- category
- date
- content

Code: [Select]
<?php

 

 
/**

  * 

  * File Lister for repository

  * 

  * Author : fr0g

  * 

  * Thank's : hwc-crew, n-pn.info

  */

 

 

    

 

    /**

     * Constantes & variables d'information (a modifier selon l'utilisateur du script)

     **/

     



    

    
$types = Array('papers''exploits''webcoding''tools''apps'); // : liste des rubriques

    
$count count($types);                                                   // : calcule la longueur du tableau





    //-----------------------------------------------------------------------------------------------------







    /**

     * Tentative de connexion a la base de donnee

     **/

     
try{

         

        
$pdo_options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;

        
$bdd = new PDO('mysql:host=localhost;dbname='''''$pdo_options);

    }

    

    catch (
Exception $e){

        

        die(
'Erreur : ' $e->getMessage());

    }

    



    
//-----------------------------------------------------------------------------------------------------

    

    

    

    /**

     * Analyse de la requete

     **/

    
if (isset($_GET['cat']) && ! isset($_GET['id'])){

        

        for (
$i 0$i $count$i++){

            



                

            if (
$_GET['cat'] == $types[$i]){

                

                
$query "SELECT * FROM listfile WHERE category='$types[$i]'";

                

                
$content $bdd->query($query);

                
?>


                <table class="table" id="TheList" cellspacing="0" cellpadding="0">

                    <tr class="rowtitle">   

                        <td class="col1 cell"><?php ?>Date</td>

                        <td class="col2 cell">Title</td>

                        <td class="col3 cell">Author</td>

                        <td class="col4 cell">ID</td>

                    </tr>

                <?php

                
while ($donnees $content->fetch()){

                    
?>


                    <tr class="row">   

                        <td class="col1 cell"><?php echo $donnees['date']; ?></td>

                        <td class="col2 cell"><a href="index.php?id=<?php echo $donnees['id']; ?>"><?php echo $donnees['title']; ?></a></td>

                        <td class="col3 cell"><?php echo $donnees['author']; ?></td>

                        <td class="col4 cell"><?php echo $donnees['id']; ?></td>

                    </tr>



                    <?php

                
}

                
?>


                </table>

               

                <?php

            
}            

        }

    }

    

    

    else if (isset(
$_GET['id']) && ! isset($_GET['cat'])){

        

        if (
is_numeric($_GET['id'])){

            

            
$id $_GET['id'];

            

            
$query "SELECT * FROM listfile WHERE id='$id'";

            
$content $bdd->query($query);

            

            while (
$donnees $content->fetch()){

                

                
?>


                <h1><?php echo $donnees['title']; ?></h1>

                <br><br>

                <h3># Author : <?php echo $donnees['author']; ?></h3><br>

                <h3># Date : <?php echo $donnees['date']; ?></h3><br>

               

               

               

                </br>

                <?php echo $donnees['content']; 



            }

            
$content->closeCursor();

        }

        

        else{

            
?>


            <script>

                alert("ERROR : \n Numero de ressource invalide");

                location.href="index.php";

            </script>

            <?php      //s'execute si $_GET['id'] n'est pas un nombre ou s'il est <= $num_rows

        
}

    }    

    

    else{

        

        
$query "SELECT * FROM listfile ORDER BY date DESC";

        

        
$content $bdd->query($query);

        
?>


        <table class="table" id="TheList" cellspacing="0" cellpadding="0">

            <tr class="rowtitle">   

                <td class="col1 cell"><?php ?>Date</td>

                <td class="col2 cell">Title</td>

                <td class="col3 cell">Author</td>

                <td class="col4 cell">ID</td>

            </tr>

        <?php

        
while ($donnees $content->fetch()){

            
?>


            <tr class="row">   

                <td class="col1 cell"><?php echo $donnees['date']; ?></td>

                <td class="col2 cell"><a href="index.php?id=<?php echo $donnees['id']; ?>"><?php echo $donnees['title']; ?></a></td>

                <td class="col3 cell"><?php echo $donnees['author']; ?></td>

                <td class="col4 cell"><?php echo $donnees['id']; ?></td>

            </tr>



        <?php

        
}

    }

?>



5
Other / [Au3] Ascii/bin/hex converter
« on: December 01, 2011, 02:39:44 pm »
   Hello, here's a little tool that I coded, improved by a friend.

it is a simple binary, hexadecimal, ASCII, values converter



Code: [Select]
#include <string.au3>

#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
Global $Form1 = GUICreate("StrHex - by fr0g & Gr4ph0s", 489, 170, 192, 124)
Global $Group1 = GUICtrlCreateGroup("Origin@l t3xt", 8, 16, 185, 129)
Global $Edit1 = GUICtrlCreateEdit("", 16, 32, 169, 105, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN,$WS_VSCROLL,$WS_HSCROLL))
GUICtrlSetData(-1, StringFormat("Entrez ici votre texte..."))
GUICtrlCreateGroup("", -99, -99, 1, 1)
Global $Group2 = GUICtrlCreateGroup("C0nvert3d Text", 288, 16, 193, 129)
Global $Edit2 = GUICtrlCreateEdit("", 296, 32, 177, 105, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN,$WS_VSCROLL,$WS_HSCROLL))
GUICtrlCreateGroup("", -99, -99, 1, 1)
Global $Button1 = GUICtrlCreateButton("C0nvert", 200, 112, 81, 25, $WS_GROUP)
Global $Combo1 = GUICtrlCreateCombo("", 200, 56, 81, 25)
GUICtrlSetData(-1, "STR -> HEX|STR -> INT|STR -> BIN|STR -> DEC|   |HEX -> STR|HEX -> INT|HEX -> BIN|HEX -> DEC|    |BIN -> HEX|BIN -> STR|BIN -> DEC |   |DEC -> STR|DEC -> HEX|DEC -> BIN|    |INT -> HEX|INT -> BIN|")
Global $Label1 = GUICtrlCreateLabel("http://hwc-crew.com", 190, 152, 131, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1

$nMsg = GUIGetMsg()

Switch $nMsg
    Case $GUI_EVENT_CLOSE
Exit

Case $GUI_EVENT_CLOSE
    exit 1

Case $Button1

    $initial_text = GuiCtrlRead($Edit1)
    $method = GuiCtrlRead($combo1)

    if ($method == "STR -> HEX") Then
        $output_hex = _StringToHex($initial_text)
        GUICtrlSetData($Edit2, $output_hex)


    ElseIf ($method == "STR -> INT") Then
        $output_int = Int($initial_text)
        GUICtrlSetData($Edit2, $output_int)


    ElseIf ($method == "STR -> BIN") Then
        $initial_text_split = StringSplit($initial_text, "")
        $output_bin = ""
        For $a = 1 to $initial_text_split[0]
            $asc = Asc($initial_text_split[$a])
            $mod = ""
            For $b = 1 to 8
                $mod = Mod($asc, 2) & $mod
                $asc = Floor($asc/2)
            Next
        $output_bin &= " "&$mod
        Next
        GUICtrlSetData($Edit2, $output_bin)


    ElseIf ($method == "STR -> DEC") Then
        $output_dec =""
        Local $lettre = StringSplit($initial_text,'')
        For $i = 1 To $lettre[0]
            $lettre_dec = Asc($lettre[$i])
            $output_dec &= " "& $lettre_dec
        Next
        GUICtrlSetData($Edit2, $output_dec)




    ElseIf ($method == "HEX -> STR") Then
        $output_text = _HexToString($initial_text)
        GUICtrlSetData($Edit2, $output_text)


    ElseIf ($method == "HEX -> INT") Then
        $output_int = _HexToString($initial_text)
        $output_int = Int($output_int)
        GUICtrlSetData($Edit2, $output_int)


    ElseIf ($method == "HEX -> BIN") Then
        $output_bin = _HexToString($initial_text)
        $output_text_split = StringSplit($output_bin, "")
        $output_bin = ""
        For $a = 1 to $output_text_split[0]
            $asc = Asc($output_text_split[$a])
            $mod = ""
            For $b = 1 to 8
                $mod = Mod($asc, 2) & $mod
                $asc = Floor($asc/2)
            Next
        $output_bin &= " "&$mod
        Next
        GUICtrlSetData($Edit2, $output_bin)


    ElseIf ($method == "HEX -> DEC") Then
        $input_hex = _HexToString($initial_text)
        $input_hex = StringReplace($input_hex,"0x","")
        $input_hex = StringReplace($input_hex," ","")
        $input_hex = _HexToString($input_hex)
        $input_hex = StringReplace($input_hex,"0x","")
        $output_dec =""
        $lettre = StringSplit($input_hex,'')
        For $i = 1 To $lettre[0]
            $lettre_dec = Asc($lettre[$i])
            $output_dec &= " "& $lettre_dec
        Next
        GUICtrlSetData($Edit2, $output_dec)




        $initial_text_split = StringSplit($initial_text, "")
        $output_bin = ""
        For $a = 1 to $initial_text_split[0]
            $asc = Asc($initial_text_split[$a])
            $mod = ""
            For $b = 1 to 8
                $mod = Mod($asc, 2) & $mod
                $asc = Floor($asc/2)
            Next
        $output_bin &= " "&$mod
        Next
        GUICtrlSetData($Edit2, $output_bin)



    ElseIf ($method == "BIN -> HEX") Then
    $initial_text = StringReplace($initial_text," ","")
    $initial_text_split = StringSplit($initial_text, "")
    $output_hex = ""
        For $a = 1 to $initial_text_split[0] Step 8
            $temp = ""
            For $b = 0 To 7
                $temp &= $initial_text_split[$a+$b]
            Next
            $chr = 0
            $temp = StringSplit($temp, "")
            For $c = 1 to $temp[0]
                $chr *= 2
                $chr += Number($temp[$c])
            Next
            $output_hex &= " "&Chr($chr)
        Next
        $output_hex = StringReplace($output_hex," ","")
        $lettre = StringSplit($output_hex,'')
        $output_hex_final = ""
        For $i = 1 To $lettre[0]
            $lettre_hex = _StringToHex($lettre[$i])
            $output_hex_final &= " "& $lettre_hex
        Next
        GUICtrlSetData($Edit2, $output_hex_final)


    ElseIf ($method == "BIN -> STR") Then
    $initial_text_split = StringSplit($initial_text, "")
    $output_text = ""
    For $a = 1 to $initial_text_split[0] Step 8
        $temp = ""
        For $b = 0 To 7
            $temp &= $initial_text_split[$a+$b]
        Next
        $chr = 0
        $temp = StringSplit($temp, "")
        For $c = 1 to $temp[0]
            $chr *= 2
            $chr += Number($temp[$c])
        Next
        $output_text &= " "&Chr($chr)
    Next
    GUICtrlSetData($Edit2, $output_text)


    ElseIf ($method == "BIN -> DEC") Then
    $initial_text = StringReplace($initial_text," ","")
    $initial_text_split = StringSplit($initial_text, "")
    $output_dec = ""
        For $a = 1 to $initial_text_split[0] Step 8
            $temp = ""
            For $b = 0 To 7
                $temp &= $initial_text_split[$a+$b]
            Next
            $chr = 0
            $temp = StringSplit($temp, "")
            For $c = 1 to $temp[0]
                $chr *= 2
                $chr += Number($temp[$c])
            Next
            $output_dec &= " "&Chr($chr)
        Next
        $output_dec_final =""
        $output_dec = StringReplace($output_dec," ","")
        $lettre = StringSplit($output_dec,'')
        For $i = 1 To $lettre[0]
            $lettre_dec = Asc($lettre[$i])
            $output_dec_final &= " "& $lettre_dec
        Next
        GUICtrlSetData($Edit2, $output_dec_final)







    ElseIf ($method == "DEC -> STR") Then
        $output_str =""
        $lettre = StringReplace($initial_text," ","")
        $lettre = StringSplit($lettre,'')
        For $i = 1 To $lettre[0] Step 2
            $lettre_str = Chr($lettre[$i]&$lettre[$i+1])
            $output_str &= " "& $lettre_str
        Next
        GUICtrlSetData($Edit2, $output_str)

    ElseIf ($method == "DEC -> HEX") Then
        $output_hex =""
        $lettre = StringReplace($initial_text," ","")
        $lettre = StringSplit($lettre,'')
        For $i = 1 To $lettre[0] Step 2
            $lettre_hex = Chr($lettre[$i]&$lettre[$i+1])
            $output_hex &= " "& $lettre_hex
        Next
        $output_hex = StringReplace($output_hex," ","")
        $lettre = StringSplit($output_hex,'')
        $output_hex_final = ""
        For $i = 1 To $lettre[0]
            $lettre_hex = _StringToHex($lettre[$i])
            $output_hex_final &= " "& $lettre_hex
        Next
        GUICtrlSetData($Edit2, $output_hex_final)



    ElseIf ($method == "DEC -> BIN") Then
        $output_bin =""
        $lettre = StringReplace($initial_text," ","")
        $lettre = StringSplit($lettre,'')
        For $i = 1 To $lettre[0] Step 2
            $lettre_bin = Chr($lettre[$i]&$lettre[$i+1])
            $output_bin &= " "& $lettre_bin
        Next
        $output_bin = stringreplace($output_bin," ","")
        $output_text_split = StringSplit($output_bin, "")
        $output_bin = ""
        For $a = 1 to $output_text_split[0]
            $asc = Asc($output_text_split[$a])
            $mod = ""
            For $b = 1 to 8
                $mod = Mod($asc, 2) & $mod
                $asc = Floor($asc/2)
            Next
        $output_bin &= " "&$mod
        Next
        GUICtrlSetData($Edit2, $output_bin)


    ElseIf ($method == "INT -> HEX") Then
        $output_int = String($initial_text)
        $output_int = hex($output_int)
        GUICtrlSetData($Edit2, $output_int)


    ElseIf ($method == "INT -> BIN") Then
        $initial_text_split = StringSplit($initial_text, "")
        $output_bin = ""
        For $a = 1 to $initial_text_split[0]
            $asc = Asc($initial_text_split[$a])
            $mod = ""
            For $b = 1 to 8
                $mod = Mod($asc, 2) & $mod
                $asc = Floor($asc/2)
            Next
        $output_bin &= " "&$mod
        Next
        GUICtrlSetData($Edit2, $output_bin)

    Else
        MsgBox(64,"Err0r","Erreur : Méthode inconnue par le programme")
    EndIf

Case $Label1
    MsgBox(64,"Infos...","Developper :" & @CRLF & "   - fr0g(HWC te@m)" & @CRLF & "   - Gr4ph0s // Ptifou78(HWC te@m)"& @CRLF & "Website : http://hwc-crew.com" & @CRLF & "Th@nk's :"& @CRLF &"   - All HWC members")
EndSwitch
WEnd

6
Scripting Languages / Re: [Python] Batch rename
« on: November 30, 2011, 06:31:53 am »
why not ask the user which folder he wants to work ?

example :
Code: [Select]
dir = str(input('Type a dirname > '))
This will simplify the use of the script (no need to modify every time)




Pages: [1]