Login Register






Making a post request using curl and compare the results filter_list
Author
Message
Making a post request using curl and compare the results #1
Please i need help on this one, i want to make an http post using php curl function and cache that page. After that i want to search for the presence of a specific line. I know that buffering the page is not reliable but i want to give a try.

I know that this works, i had this piece of code working a few years back i eventually lost it.

Thanks in Advance

Reply

RE: Making a post request using curl and compare the results #2
Do you actually mean you want to cache it, or do you just need it in a variable so you can parse it?

Reply

RE: Making a post request using curl and compare the results #3
I remember I wrote a script that did something similar when I discovered this vulnerability:
https://sinister.li/Thread-Tutorial-...s-4-1-to-5

Unfortunately, I no longer have it. I'm sure @Reiko or @roger_smith might know.
[Image: 7ajmN5P.jpg]

Telegram: Oni_SL (Link)

Reply

RE: Making a post request using curl and compare the results #4
returntransfer?
PGP
Sign: F202 79C9 76F7 40BB 54EC 494F 5DEF 1D70 14C1 C4CC
Encrypt: A5B3 1B21 55E1 80AF 4C6E DE83 467B 8EFC 3DEE 681C
Auth: CD55 E8A5 1A08 2933 8BA6 BC88 D81F 1943 739A 3C47

Reply

RE: Making a post request using curl and compare the results #5
http://www.hackingwithphp.com/15/10/3/th...rl-options
XMPP - wrath@xmpp.jp

Reply

RE: Making a post request using curl and compare the results #6
(07-20-2015, 01:32 PM)Crypt Wrote: http://www.hackingwithphp.com/15/10/3/th...rl-options

CURLOPT_RETURNTRANSFER
PGP
Sign: F202 79C9 76F7 40BB 54EC 494F 5DEF 1D70 14C1 C4CC
Encrypt: A5B3 1B21 55E1 80AF 4C6E DE83 467B 8EFC 3DEE 681C
Auth: CD55 E8A5 1A08 2933 8BA6 BC88 D81F 1943 739A 3C47

Reply

RE: Making a post request using curl and compare the results #7
Using curl.exe won't work i think as i want to make a post request and search for a text string, after the post, if the text string exists then echo "Yes it is present" if not echo "No it isn't present".

It will be very good if it was possible in batch, any sugestions?

Reply

RE: Making a post request using curl and compare the results #8
Since no one will do it for you:
PHP Code:
<?php $string = "STRING TO SEARCH FOR"; $ch = curl_init(); $curlConfig = array( CURLOPT_URL => "URL TO SEND POST REQUEST TO", CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_POSTFIELDS => array( 'field1' => 'some data', 'field2' => 'some other data', ) ); curl_setopt_array($ch, $curlConfig); $result = curl_exec($ch); if (strpos($result, $string) !== false) { echo "true\n"; } else { echo "false\n"; } curl_close($ch); ?>

I'm pretty sure that's what you are looking for. It will print true if the string is found in the post request response, and print false otherwise. Shout out Stackoverflow.

[+] 2 users Like Dyme's post
Reply

RE: Making a post request using curl and compare the results #9
Thanks, i got the code working Smile

Step 2: How do i add a form where the string becomes a user input and add multiple sites.

(This is my first project in this language)

Reply

RE: Making a post request using curl and compare the results #10
(07-22-2015, 12:39 AM)privateloader Wrote: Thanks, i got the code working Smile

Step 2: How do i add a form where the string becomes a user input and add multiple sites.

(This is my first project in this language)

Why are you calling it "your" first project when all you're doing is getting spoonfed code?

You can make the string come from user input by doing one of these two:
$argv[1] if you're executing it inside a terminal.
$_REQUEST['anything'] if you're accessing it on a web interface.

If this is your project, you should be figuring these things out, not having others do it for you. You should do the multiple sites part on your own.
XMPP - wrath@xmpp.jp

Reply