Cannot get a FullHash

111 views
Skip to first unread message

Julien SOSIN

unread,
Feb 6, 2012, 12:02:57 PM2/6/12
to Google Safe Browsing API
Hi Everybody

I cannot perfom a Request for Full-Length Hashes.

For example
URL : http://ianfette.org/
Hostkey : 292e6556

So i perform an URL request with this body :
body 4:4
292e6556

And i've got a error 400.

Have you an idea on what i am doing wrong ?

Thanks

Julien Sobrier

unread,
Feb 6, 2012, 8:32:20 PM2/6/12
to google-safe-...@googlegroups.com
Do you actually send "292e6556" (8 bytes) or 0x292e6556 (4 bytes)?

Julien

> --
> You received this message because you are subscribed to the Google Groups "Google Safe Browsing API" group.
> To post to this group, send email to google-safe-...@googlegroups.com.
> To unsubscribe from this group, send email to google-safe-browsi...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/google-safe-browsing-api?hl=en.
>

Julien SOSIN

unread,
Feb 7, 2012, 4:21:06 AM2/7/12
to Google Safe Browsing API
I send 292e6556

Julien SOSIN

unread,
Feb 7, 2012, 4:50:01 AM2/7/12
to Google Safe Browsing API
And sending 0x292e6556 doesn't work either

Julien SOSIN

unread,
Feb 17, 2012, 9:23:50 AM2/17/12
to Google Safe Browsing API
Can someone give me an example of a fullhash request's body ?

Chethan prakash

unread,
Feb 19, 2012, 5:19:21 AM2/19/12
to google-safe-...@googlegroups.com
Yes the api document , doesnot provide any example forfull hash request body. It will be very helpful if some can give a example.

Patrick Kelley

unread,
Feb 21, 2012, 2:57:58 PM2/21/12
to google-safe-...@googlegroups.com
Would a snippet of Java code help?  You'll have to add your own exception handling below, and realize that this snippet only sends one prefix over the connection.  It sends the correct bytes over the wire, and correctly prints a human readable representation to stdout.  If you're using Java, make sure to use a DataOutputStream and not an OutputStreamWriter

/* OutputStreamWriter behaves weird when writing a byte where the most significant 4 bits are an 8 or 9 (1000 or 1001).
* It will instead write a "3f" instead of the "[89][0-9a-f]".  Using a DataOutputStream fixes this problem.
* (This took a little while to figure out, and the use of WireShark.)
*/

byte[] prefix = ...
connection.setDoOutput(true);
DataOutputStream out = new DataOutputStream(
connection.getOutputStream());
System.out.println("\tSENT TO GOOGLE:");
out.writeBytes(prefix.length+":"+prefix.length+"\n");
System.out.print("\t\t"+prefix.length+":"+prefix.length+"\n\t\t");
for(int b=0; b< prefix.length; b++) {
out.writeByte((int)(prefix[b] & 0xFF));
String hex = Integer.toHexString(prefix[b] & 0xFF);
if(hex.length() < 2) {
hex = "0" + hex;
}
System.out.print(hex);
}
out.close();
System.out.println();


On Sun, Feb 19, 2012 at 2:19 AM, Chethan prakash <yours...@gmail.com> wrote:
Yes the api document , doesnot provide any example forfull hash request body. It will be very helpful if some can give a example.

--
You received this message because you are subscribed to the Google Groups "Google Safe Browsing API" group.

Silence

unread,
Feb 21, 2012, 8:22:25 PM2/21/12
to Google Safe Browsing API
4:4
292e6556

292e6556 in bin type maybe will help.
(Hex2Bin)

Silence

unread,
Feb 21, 2012, 8:23:35 PM2/21/12
to Google Safe Browsing API
just like:
4:28
0<9a>^]l<85>ac.Ô×ÉéÖØ±jeU^D|wÄT<85>¡²^CÉ

Chetan prakash

unread,
Feb 22, 2012, 3:38:17 AM2/22/12
to google-safe-...@googlegroups.com
Thanks for the java code and the sample response.
chethan H P


--
You received this message because you are subscribed to the Google Groups "Google Safe Browsing API" group.
Reply all
Reply to author
Forward
0 new messages