> For the complete documentation index, see [llms.txt](https://krjaeh0.gitbook.io/j-log/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://krjaeh0.gitbook.io/j-log/security/archive/old-4.md).

# old 4

{% code title="challenge4.php" %}

```php
<?php  include "../../config.php";  
  if($_GET['view-source'] == 1) view_source();  
?><html>  
<head>  
<title>Challenge 4</title>  
<style type="text/css">  
body { background:black; color:white; font-size:9pt; }  
table { color:white; font-size:10pt; }  
</style>  
</head>  
<body><br><br>  
<center>  
<?php  
  sleep(1); // anti brute force
  if((isset($_SESSION['chall4'])) && ($_POST['key'] == $_SESSION['chall4'])) solve(4);  $hash = rand(10000000,99999999)."salt_for_you";  $_SESSION['chall4'] = $hash;  
  for($i=0;$i<500;$i++) $hash = sha1($hash);  
?><br>  
<form method=post>  
<table border=0 align=center cellpadding=10>  
<tr><td colspan=3 style=background:silver;color:green;><b><?=$hash?></b></td></tr>  
<tr align=center><td>Password</td><td><input name=key type=text size=30></td><td><input type=submit></td></tr>  
</table>  
</form>  
<a href=?view-source=1>[view-source]</a>  
</center>  
</body>  
</html>
```

{% endcode %}

* 레인보우 테이블?

{% code title="generate\_table.py" %}

```python
from hashlib import *

from multiprocessing import *

def create(num):

    start = 10000000*num

    end = 10000000*(num+1)

    f = open('table.csv', mode = 'w', encoding = 'utf-8')

    for i in range(start, end):

        txt = str(i) + "salt_for_you"

        result = txt

        for j in range(0, 500):

            result = sha1(result.encode('utf-8')).hexdigest()

        print(result)

        f.write(f'{txt} ======> result : {result}\n')

    f.close()

  
if __name__ == '__main__':

    procs = []

    for i in range(1, 10):

        proc = Process(target = create, args = (i,))

        procs.append(proc)

        proc.start()

  
    for proc in procs:

        proc.join()
```

{% endcode %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://krjaeh0.gitbook.io/j-log/security/archive/old-4.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
