Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

PHP and cURL


ghost's Avatar
0 0

I am trying to make a program that will log me into enigmagroup.org. I am using php and cURL. The thing is though it isn't working. I get to errors when I try to use it. cURl is installed on the server. Here is my code.

**<?php

    $ch = curl_init();

    $ip=&quot;70.176.49.197&quot;;

$user=&quot;knutrainer&quot;;

    $passwrd=&quot;some pass&quot;;
    
$url=&quot;http://www.enigmagroup.org&quot;;


    

curl_setopt($ch, curlopt_url, $url);

    curl_setopt($ch, CURLOPT_POSTFIELDS, $user&$passwrd);

?> **

Thanks for the help weather it is critical or not.


ghost's Avatar
0 0

 $username = &#39;knutrainer&#39;;
 $password = &#39;&#39;;

 $cURL = curl_init( &#39;http://www.enigmagroup.org&#39; );
   curl_setopt($cURL, CURLOPT_HEADER, FALSE);
   curl_setopt($cURL, CURLOPT_RETURNTRANSFER, 1);
   curl_setopt($cURL, CURLOPT_POSTFIELDS, &quot;$username&$password&quot;);
 $response = curl_exec( $cURL );
   curl_close( $cURL );


 echo $response;

?&gt;```

ghost's Avatar
0 0

so if you just put that into a php script, then uploaded it somewhere, what exactly would it do? brute force the password for the given usrname? and curious to why you chose enigmagroup.org lol. Random or they dont have anything to protect against bruteforcers?


ghost's Avatar
0 0

I am not trying to hack any one. I want to learn how to do this so I can collect mass amounts of data. Also enigma group has a challenge that uses this. Thanks Jake for the information. I see now that I was way off.


ghost's Avatar
0 0

Can anyone point me in the direction of a "decent" cURL tutorial.

Please.

P.S. I'm pretty desperate.


ghost's Avatar
0 0

Cheers man! I'll check 'em out and let you know how I go.


ghost's Avatar
0 0

As soon as you log in you are redirected, personally I'd do something like this:

&lt;?php

$username = &#39;Mals&#39;;
$password = &#39;example&#39;;
$url= &quot;http://www.enigmagroup.org/forums/index.php?action=login2&quot;;
$post_vars = &quot;&user=$username&passwrd=$password&cookielength=-1&quot;;

$cURL = curl_init();
    curl_setopt($cURL, CURLOPT_URL, $url);
	curl_setopt($cURL, CURLOPT_POST, 1);
	curl_setopt($cURL, CURLOPT_HEADER, FALSE);
	curl_setopt($cURL, CURLOPT_REFERER, &#39;http://www.enigmagroup.org/index.php?page=main&#39;);
	curl_setopt($cURL, CURLOPT_USERAGENT, $_SERVER[&#39;HTTP_USER_AGENT&#39;]);
	curl_setopt($cURL, CURLOPT_POSTFIELDS, $post_vars);
	curl_setopt($cURL, CURLOPT_FOLLOWLOCATION, 1);
	$response = curl_exec($cURL);
	curl_close($cURL);

	echo $response;

?&gt;

.|Mals