Giter Site home page Giter Site logo

How to run foresight? about foresight HOT 8 OPEN

alschwalm avatar alschwalm commented on July 17, 2024
How to run foresight?

from foresight.

Comments (8)

ALSchwalm avatar ALSchwalm commented on July 17, 2024

foresight is not compatible with python2. I believe 3.3 is the earliest python version that can run it.

from foresight.

mutepigz avatar mutepigz commented on July 17, 2024

thanks very much!

from foresight.

mutepigz avatar mutepigz commented on July 17, 2024

I have another problem ..... if i have a series of number generated by PHP's rand() likes 1341324123,can i use this library to find the seed?

from foresight.

mutepigz avatar mutepigz commented on July 17, 2024

by the way .... how to use the option '-o' in the command line?

from foresight.

ALSchwalm avatar ALSchwalm commented on July 17, 2024

This answer requires a little setup, so bear with me. PHP's rand has very different behavior based on platform. For example, a PHP server on linux is (generally) much less predictable than one on windows. This is why foresight requires that you provide the platform before it can make any predictions for PHP.

The rest of this answer will address PHP on windows. If you do not know the number of times 'rand' was called between the outputs you have and the seed point, then this is impossible. Not as a limitation of foresight, but in general. This is because the seed is just being used to establish an initial state for the RNG. There is nothing else special about it. So, it is impossible to know which prior state is the initial state (or 'seed' state).

Say, however, you know that there were 4 calls to rand that you do not have output from after the call to srand, but you do have the output from 10 calls after those 4. It is (in principle) possible to recover the seed value used in the srand call.

However, foresight does not have an easy way to do this in general. In the special case that the outputs you have are from immediately after the call to srand, (that is, there are no 'rand' calls you don't have outputs from) then you could recover the state by calling the function php.rand.predict_state(your_list_of_outputs, "windows"). But this is not really what foresight is designed for.

The excellent 'untwister' project here has some additional facilities for predicting seeds. 'glibc' prediction would be what you want for PHP on linux.

from foresight.

mutepigz avatar mutepigz commented on July 17, 2024

Thanks for your patiently explain! But can i do this if i know the time when 'rand()' was called?i can get this with the return time from the server.....But i have only one rand number beacause the server gives me only one number when i fresh it....... but If i can't find the seed ,can i predict the number follow on it?

from foresight.

ALSchwalm avatar ALSchwalm commented on July 17, 2024

That depends a lot on whether the time is being used to seed the RNG. If you know the server is seeding with srand(time()) each time the page is refreshed, then yes, you could predict the outputs by just running foresee php windows rand -s <time from the server response>. Otherwise, you will not be able to predict future outputs with only one number. Default RNGs are weak, but they are not usually that weak.

from foresight.

mutepigz avatar mutepigz commented on July 17, 2024

OK... thank you always..

from foresight.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.