2024-04-07 03:13:19 +00:00
# Çeşitli JS Hileleri ve İlgili Bilgiler
2022-04-28 16:01:33 +00:00
< details >
2024-04-07 03:13:19 +00:00
< summary > < strong > Sı fı rdan Kahraman'a AWS hackleme öğrenin< / strong > < a href = "https://training.hacktricks.xyz/courses/arte" > < strong > htARTE (HackTricks AWS Kı rmı zı Takı m Uzmanı )< / strong > < / a > < strong > !< / strong > < / summary >
2022-04-28 16:01:33 +00:00
2024-04-07 03:13:19 +00:00
* **Bir **cybersecurity şirketinde mi çalı şı yorsunuz? **Şirketinizi HackTricks'te** görmek ister misiniz? ya da **PEASS'ı n en son sürümüne veya HackTricks'i PDF olarak indirmek** ister misiniz? [**ABONELİK PLANLARI** ](https://github.com/sponsors/carlospolop )'na göz atı n!
* [**PEASS Ailesi'ni** ](https://opensea.io/collection/the-peass-family ) keşfedin, özel [**NFT'lerimiz** ](https://opensea.io/collection/the-peass-family ) koleksiyonumuz
* [**Resmi PEASS & HackTricks ürünlerini** ](https://peass.creator-spring.com ) edinin
* **Katı lı n** [**💬** ](https://emojipedia.org/speech-balloon/ ) [**Discord grubuna** ](https://discord.gg/hRep4RUj7f ) veya [**telegram grubuna** ](https://t.me/peass ) veya beni **Twitter** 🐦[**@carlospolopm**](https://twitter.com/hacktricks\_live)** takip edin.**
* **Hacking hilelerinizi paylaşarak PR'ler göndererek** [**hacktricks repo** ](https://github.com/carlospolop/hacktricks ) **ve** [**hacktricks-cloud repo** ](https://github.com/carlospolop/hacktricks-cloud ).
2022-04-28 16:01:33 +00:00
< / details >
2023-02-07 23:15:13 +00:00
## Javascript Fuzzing
2022-04-28 16:01:33 +00:00
2024-02-10 18:14:16 +00:00
### Geçerli JS Yorum Karakterleri
2021-11-07 17:40:05 +00:00
```javascript
//This is a 1 line comment
/* This is a multiline comment*/
#!This is a 1 line comment, but "#!" must to be at the beggining of the line
-->This is a 1 line comment, but "-->" must to be at the beggining of the line
2023-02-07 10:56:16 +00:00
for (let j = 0; j < 128 ; j + + ) {
2024-02-10 18:14:16 +00:00
for (let k = 0; k < 128 ; k + + ) {
for (let l = 0; l < 128 ; l + + ) {
if (j == 34 || k ==34 || l ==34)
continue;
if (j == 0x0a || k ==0x0a || l ==0x0a)
continue;
if (j == 0x0d || k ==0x0d || l ==0x0d)
continue;
if (j == 0x3c || k ==0x3c || l ==0x3c)
continue;
if (
(j == 47 & & k == 47)
||(k == 47 & & l == 47)
)
continue;
try {
var cmd = String.fromCharCode(j) + String.fromCharCode(k) + String.fromCharCode(l) + 'a.orange.ctf"';
eval(cmd);
} catch(e) {
var err = e.toString().split('\n')[0].split(':')[0];
if (err === 'SyntaxError' || err === "ReferenceError")
continue
err = e.toString().split('\n')[0]
}
console.log(err,cmd);
}
}
2023-02-07 10:56:16 +00:00
}
//From: https://balsn.tw/ctf_writeup/20191012-hitconctfquals/#bounty-pl33z
2023-02-07 23:15:13 +00:00
2024-02-10 18:14:16 +00:00
// From: Heyes, Gareth. JavaScript for hackers: Learn to think like a hacker (p. 43). Kindle Edition.
2023-02-07 23:15:13 +00:00
log=[];
for(let i=0;i< =0xff;i++){
2024-02-10 18:14:16 +00:00
for(let j=0;j< =0xfff;j++){
try {
eval(`${String.fromCodePoint(i,j)}%$£234$`)
log.push([i,j])
}catch(e){}
}
2023-02-07 23:15:13 +00:00
}
console.log(log)//[35,33],[47,47]
2021-11-07 17:40:05 +00:00
```
2024-02-10 18:14:16 +00:00
### Geçerli JS Yeni Satı r Karakterleri
2021-11-07 17:40:05 +00:00
```javascript
//Javascript interpret as new line these chars:
String.fromCharCode(10) //0x0a
String.fromCharCode(13) //0x0d
String.fromCharCode(8232) //0xe2 0x80 0xa8
String.fromCharCode(8233) //0xe2 0x80 0xa8
2023-02-07 10:56:16 +00:00
for (let j = 0; j < 65536 ; j + + ) {
2024-02-10 18:14:16 +00:00
try {
var cmd = '"aaaaa";'+String.fromCharCode(j) + '-->a.orange.ctf"';
eval(cmd);
} catch(e) {
var err = e.toString().split('\n')[0].split(':')[0];
if (err === 'SyntaxError' || err === "ReferenceError")
continue;
err = e.toString().split('\n')[0]
}
console.log(`[${err}]`,j,cmd);
2023-02-07 10:56:16 +00:00
}
2021-11-07 17:40:05 +00:00
//From: https://balsn.tw/ctf_writeup/20191012-hitconctfquals/#bounty-pl33z
```
2024-04-07 03:13:19 +00:00
### Geçerli JS Boşlukları işlev çağrı sı nda
2024-04-06 19:40:41 +00:00
2024-04-07 03:13:19 +00:00
In some cases, you may encounter a web application that filters out certain keywords or characters but allows spaces in between. This can be exploited to bypass filters and execute malicious code. One common technique is to use valid JavaScript spaces in a function call.
2024-02-10 18:14:16 +00:00
2024-04-07 03:13:19 +00:00
```html
< script >
alert`\x48\x61\x63\x6b\x65\x64\x20\x42\x79\x20\x48\x61\x63\x6b\x65\x72`;
< / script >
```
2024-04-06 19:40:41 +00:00
2024-04-07 03:13:19 +00:00
This code snippet uses template literals and Unicode escape sequences to create a valid function call to display an alert box. The spaces between the characters are valid JavaScript spaces and can help evade detection by filters.
2023-02-07 23:15:13 +00:00
```javascript
2024-02-10 18:14:16 +00:00
// Heyes, Gareth. JavaScript for hackers: Learn to think like a hacker (pp. 40-41). Kindle Edition.
2023-02-07 23:15:13 +00:00
// Check chars that can be put in between in func name and the ()
function x(){}
log=[];
for(let i=0;i< =0x10ffff;i++){
2024-02-10 18:14:16 +00:00
try {
eval(`x${String.fromCodePoint(i)}()`)
log.push(i)
}catch(e){}
2023-02-07 23:15:13 +00:00
}
2024-02-10 18:14:16 +00:00
2023-02-07 23:15:13 +00:00
console.log(log)v//9,10,11,12,13,32,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,813 232,8233,8239,8287,12288,65279
```
2024-02-10 18:14:16 +00:00
### **Dize Oluşturmak için Geçerli Karakterler**
2023-02-07 23:15:13 +00:00
```javascript
2024-02-10 18:14:16 +00:00
// Heyes, Gareth. JavaScript for hackers: Learn to think like a hacker (pp. 41-42). Kindle Edition.
2023-02-07 23:15:13 +00:00
// Check which pairs of chars can make something be a valid string
log=[];
for(let i=0;i< =0x10ffff;i++){
2024-02-10 18:14:16 +00:00
try {
eval(`${String.fromCodePoint(i)}%$£234${String.fromCodePoint(i)}`)
log.push(i)
}catch(e){}
2023-02-07 23:15:13 +00:00
}
console.log(log) //34,39,47,96
//single quote, quotes, backticks & // (regex)
```
2024-04-07 03:13:19 +00:00
### **Yedek Çiftler BF**
2024-04-06 19:40:41 +00:00
2024-04-07 03:13:19 +00:00
Bu teknik XSS için çok faydalı olmayabilir ancak WAF korumaları nı atlamak için faydalı olabilir. Bu python kodu, girdi olarak 2 bayt alı r ve yüksek yedek çiftin son baytı nı ve düşük yedek çiftin son baytı nı içeren bir yedek çift arar.
2021-11-07 17:40:05 +00:00
```python
def unicode(findHex):
2024-02-10 18:14:16 +00:00
for i in range(0,0xFFFFF):
H = hex(int(((i - 0x10000) / 0x400) + 0xD800))
h = chr(int(H[-2:],16))
L = hex(int(((i - 0x10000) % 0x400 + 0xDC00)))
l = chr(int(L[-2:],16))
if(h == findHex[0]) and (l == findHex[1]):
print(H.replace("0x","\\u")+L.replace("0x","\\u"))
2021-11-07 17:40:05 +00:00
```
2024-02-10 18:14:16 +00:00
Daha fazla bilgi:
2021-11-07 17:40:05 +00:00
* [https://github.com/dreadlocked/ctf-writeups/blob/master/nn8ed/README.md ](https://github.com/dreadlocked/ctf-writeups/blob/master/nn8ed/README.md )
* [https://mathiasbynens.be/notes/javascript-unicode ](https://mathiasbynens.be/notes/javascript-unicode ) [https://mathiasbynens.be/notes/javascript-encoding ](https://mathiasbynens.be/notes/javascript-encoding )
2024-02-10 18:14:16 +00:00
### `javascript{}:` Protokolü Fuzzing'i
2023-02-07 23:15:13 +00:00
```javascript
2024-02-10 18:14:16 +00:00
// Heyes, Gareth. JavaScript for hackers: Learn to think like a hacker (p. 34). Kindle Edition.
2023-02-07 23:15:13 +00:00
log=[];
let anchor = document.createElement('a');
for(let i=0;i< =0x10ffff;i++){
2024-02-10 18:14:16 +00:00
anchor.href = `javascript${String.fromCodePoint(i)}:` ;
if(anchor.protocol === 'javascript:') {
log.push(i);
}
2023-02-07 23:15:13 +00:00
}
console.log(log)//9,10,13,58
// Note that you could BF also other possitions of the use of multiple chars
// Test one option
let anchor = document.createElement('a');
anchor.href = `javascript${String.fromCodePoint(58)}:alert(1337)` ;
anchor.append('Click me')
document.body.append(anchor)
// Another way to test
< a href = "javascript:alert(1337)" > Test< / a >
```
### URL Fuzzing
2024-04-07 03:13:19 +00:00
### URL Fuzzing
2023-02-07 23:15:13 +00:00
```javascript
2024-02-10 18:14:16 +00:00
// Heyes, Gareth. JavaScript for hackers: Learn to think like a hacker (pp. 36-37). Kindle Edition.
2023-02-07 23:15:13 +00:00
// Before the protocol
a=document.createElement('a');
log=[];
for(let i=0;i< =0x10ffff;i++){
2024-02-10 18:14:16 +00:00
a.href = `${String.fromCodePoint(i)}https://hacktricks.xyz` ;
if(a.hostname === 'hacktricks.xyz'){
log.push(i);
}
2023-02-07 23:15:13 +00:00
}
console.log(log) //0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32
// Between the slashes
a=document.createElement('a');
log=[];
for(let i=0;i< =0x10ffff;i++){
2024-02-10 18:14:16 +00:00
a.href = `/${String.fromCodePoint(i)}/hacktricks.xyz` ;
if(a.hostname === 'hacktricks.xyz'){
log.push(i);
}
2023-02-07 23:15:13 +00:00
}
console.log(log) //9,10,13,47,92
```
### HTML Fuzzing
2024-04-07 03:13:19 +00:00
### HTML Fuzzing
2023-02-07 23:15:13 +00:00
```javascript
2024-02-10 18:14:16 +00:00
// Heyes, Gareth. JavaScript for hackers: Learn to think like a hacker (p. 38). Kindle Edition.
2023-02-07 23:15:13 +00:00
// Fuzzing chars that can close an HTML comment
let log=[];
let div = document.createElement('div');
for(let i=0;i< =0x10ffff;i++){
2024-02-10 18:14:16 +00:00
div.innerHTML=`<!-- - - ${String.fromCodePoint(i)}><span></span> --> `;
if(div.querySelector('span')){
log.push(i);
}
2023-02-07 23:15:13 +00:00
}
console.log(log)//33,45,62
```
2024-04-07 03:13:19 +00:00
## **Öznitelikleri Analiz Etme**
2024-04-06 19:40:41 +00:00
2024-04-07 03:13:19 +00:00
Portswigger'ı n **Hackability inspector** aracı , bir JavaScript nesnesinin **özniteliklerini analiz etmeye** yardı mcı olur. Kontrol et: [https://portswigger-labs.net/hackability/inspector/?input=x.contentWindow\&html=%3Ciframe%20src=//subdomain1.portswigger-labs.net%20id=x%3E ](https://portswigger-labs.net/hackability/inspector/?input=x.contentWindow\&html=%3Ciframe%20src=//subdomain1.portswigger-labs.net%20id=x%3E )
2023-03-03 15:39:23 +00:00
2024-02-10 18:14:16 +00:00
## **.map js dosyaları **
2023-03-03 15:39:23 +00:00
2024-02-10 18:14:16 +00:00
* .map js dosyaları nı indirmek için bir hile: [https://medium.com/@bitthebyte/javascript-for-bug-bounty-hunters-part-2-f82164917e7 ](https://medium.com/@bitthebyte/javascript-for-bug-bounty-hunters-part-2-f82164917e7 )
* Bu dosyaları analiz etmek için bu aracı kullanabilirsiniz: [https://github.com/paazmaya/shuji ](https://github.com/paazmaya/shuji )
2021-11-07 17:40:05 +00:00
2024-02-10 18:14:16 +00:00
## "--" Atama
2021-11-07 17:40:05 +00:00
2024-04-07 03:13:19 +00:00
Azaltma operatörü `--` aynı zamanda bir atamadı r. Bu operatör bir değeri alı r ve sonra bir azaltı r. Eğer bu değer bir sayı değilse, `NaN` olarak ayarlanı r. Bu, değişkenlerin içeriğini ortamdan **kaldı rmak** için kullanı labilir.
2021-11-07 17:40:05 +00:00
2024-04-07 03:13:19 +00:00
![](< .. / . . / . gitbook / assets / image ( 990 ) . png > )
2021-11-07 17:40:05 +00:00
2024-04-07 03:13:19 +00:00
![](< .. / . . / . gitbook / assets / image ( 326 ) . png > )
2021-11-07 17:40:05 +00:00
2024-02-10 18:14:16 +00:00
## Fonksiyon Hileleri
2021-11-07 17:40:05 +00:00
2024-02-10 18:14:16 +00:00
### .call ve .apply
2023-02-07 10:56:16 +00:00
2024-02-10 18:14:16 +00:00
Bir fonksiyonun ** `.call` ** yöntemi, fonksiyonu **çalı ştı rmak** için kullanı lı r.\
2024-04-07 03:13:19 +00:00
Varsayı lan olarak beklediği **ilk argüman** , ** `this` ** değeridir ve **hiçbir şey** sağlanmazsa, bu değer ** `window` ** olacaktı r (eğer ** `strict mode` ** kullanı lmı yorsa).
2023-02-07 10:56:16 +00:00
```javascript
function test_call(){
2024-02-10 18:14:16 +00:00
console.log(this.value); //baz
2023-02-07 10:56:16 +00:00
}
new_this={value:"hey!"}
test_call.call(new_this);
// To pass more arguments, just pass then inside .call()
function test_call() {
2024-02-10 18:14:16 +00:00
console.log(arguments[0]); //"arg1"
console.log(arguments[1]); //"arg2"
console.log(this); //[object Window]
2023-02-07 10:56:16 +00:00
}
test_call.call(null, "arg1", "arg2")
// If you use the "use strict" directive "this" will be null instead of window:
function test_call() {
2024-02-10 18:14:16 +00:00
"use strict";
console.log(this); //null
2023-02-07 10:56:16 +00:00
}
test_call.call(null)
2024-02-10 18:14:16 +00:00
2023-02-07 10:56:16 +00:00
//The apply function is pretty much exactly the same as the call function with one important difference, you can supply an array of arguments in the second argument:
function test_apply() {
2024-02-10 18:14:16 +00:00
console.log(arguments[0]); //"arg1"
console.log(arguments[1]); //"arg2"
console.log(this); //[object Window]
2023-02-07 10:56:16 +00:00
}
test_apply.apply(null, ["arg1", "arg2"])
```
2024-02-10 18:14:16 +00:00
### Ok işlevleri
2023-02-07 10:56:16 +00:00
2024-04-07 03:13:19 +00:00
Ok işlevleri, işlevleri daha kolay bir şekilde tek satı rda oluşturmanı za olanak tanı r (eğer onları anlı yorsanı z)
2021-11-07 17:40:05 +00:00
```javascript
// Traditional
function (a){ return a + 1; }
// Arrow forms
a => a + 100;
a => {a + 100};
// Traditional
function (a, b){ return a + b + 1; }
// Arrow
(a, b) => a + b + 100;
// Tradictional no args
let a = 4;
let b = 2;
function (){ return a + b + 1; }
// Arrow
let a = 4;
let b = 2;
() => a + b + 1;
```
2024-04-07 03:13:19 +00:00
Yani, önceki işlevlerin çoğu aslı nda gereksizdir çünkü onları kaydetmiyoruz ve çağı rmak için bir yerde saklamı yoruz. Örneğin `plusone` işlevi oluşturmak:
2021-11-07 17:40:05 +00:00
```javascript
// Traductional
function plusone (a){ return a + 1; }
//Arrow
plusone = a => a + 100;
```
2024-02-10 18:14:16 +00:00
### Bind fonksiyonu
2021-11-07 17:40:05 +00:00
2024-04-07 03:13:19 +00:00
Bind fonksiyonu, ** `this` ** nesnesini ve verilen **parametreleri değiştirerek** bir **fonksiyonun kopyası nı oluşturmaya** olanak tanı r.
2021-11-07 17:40:05 +00:00
```javascript
//This will use the this object and print "Hello World"
var fn = function ( param1, param2 ) {
2024-02-10 18:14:16 +00:00
console.info( this, param1, param2 );
2021-11-07 17:40:05 +00:00
}
fn('Hello', 'World')
//This will still use the this object and print "Hello World"
var copyFn = fn.bind();
copyFn('Hello', 'World')
//This will use the "console" object as "this" object inside the function and print "fixingparam1 Hello"
var bindFn_change = fn.bind(console, "fixingparam1");
2024-02-10 18:14:16 +00:00
bindFn_change('Hello', 'World')
2021-11-07 17:40:05 +00:00
//This will still use the this object and print "fixingparam1 Hello"
var bindFn_thisnull = fn.bind(null, "fixingparam1");
bindFn_change('Hello', 'World')
//This will still use the this object and print "fixingparam1 Hello"
var bindFn_this = fn.bind(this, "fixingparam1");
bindFn_change('Hello', 'World')
```
{% hint style="info" %}
2024-04-07 03:13:19 +00:00
**`bind`** kullanarak, fonksiyon çağrı lı rken kullanı lacak olan ** `this` ** nesnesini manipüle edebilirsiniz.
2021-11-07 17:40:05 +00:00
{% endhint %}
2024-02-10 18:14:16 +00:00
### Fonksiyon kodu sı zı ntı sı
2021-11-07 17:40:05 +00:00
2024-04-07 03:13:19 +00:00
Bir fonksiyonun nesnesine **erişebilirseniz** , o fonksiyonun **kodunu alabilirsiniz** .
2021-11-07 17:40:05 +00:00
```javascript
function afunc(){
2024-02-10 18:14:16 +00:00
return 1+1;
2021-11-07 17:40:05 +00:00
}
console.log(afunc.toString()); //This will print the code of the function
console.log(String(afunc)); //This will print the code of the function
console.log(this.afunc.toString()); //This will print the code of the function
console.log(global.afunc.toString()); //This will print the code of the function
```
2024-04-07 03:13:19 +00:00
Eğer **fonksiyonun bir ismi yoksa** , yine de **fonksiyon kodunu** içeriden yazdı rabilirsiniz:
2021-11-07 17:40:05 +00:00
```javascript
(function (){ return arguments.callee.toString(); })()
(function (){ return arguments[0]; })("arg0")
```
2024-04-07 03:13:19 +00:00
Bir fonksiyonun kodunu (hatta yorumları ) başka bir fonksiyondan çı karmak için bazı **rastgele** yollar:
2021-11-07 17:40:05 +00:00
```javascript
(function (){ return retFunc => String(arguments[0]) })(a=>{/* Hidden commment */})()
(function (){ return retFunc => Array(arguments[0].toString()) })(a=>{/* Hidden commment */})()
(function (){ return String(this)}).bind(()=>{ /* Hidden commment */ })()
(u=>(String(u)))(_=>{ /* Hidden commment */ })
(u=>_=>(String(u)))(_=>{ /* Hidden commment */ })()
```
2024-04-07 03:13:19 +00:00
## Kum Sandı ğı Kaçı şı - Pencere nesnesini kurtarma
2021-11-07 17:40:05 +00:00
2024-02-10 18:14:16 +00:00
Pencere nesnesi, alert veya eval gibi global olarak tanı mlanmı ş fonksiyonlara erişmeyi sağlar.
2023-02-09 23:44:03 +00:00
{% code overflow="wrap" %}
```javascript
// Some ways to access window
window.eval("alert(1)")
frames
globalThis
parent
self
top //If inside a frame, this is top most window
// Access window from document
document.defaultView.alert(1)
// Access document from a node object
node = document.createElement('div')
node.ownerDocument.defaultView.alert(1)
// There is a path property on each error event whose last element is the window
< img src onerror = event.path.pop().alert(1337) >
// In other browsers the method is
< img src onerror = event.composedPath().pop().alert(1337) >
// In case of svg, the "event" object is called "evt"
< svg > < image href = 1 onerror = evt.composedPath().pop().alert(1337) >
// Abusing Error.prepareStackTrace to get Window back
Error.prepareStackTrace=function(error, callSites){
2 callSites.shift().getThis().alert(1337);
3 };
4 new Error().stack
2023-02-14 11:55:05 +00:00
// From an HTML event
// Events from HTML are executed in this context
with(document) {
2024-02-10 18:14:16 +00:00
with(element) {
//executed event
}
2023-02-14 11:55:05 +00:00
}
// Because of that with(document) it's possible to access properties of document like:
< img src onerror = defaultView.alert(1337) >
< img src onerror = s=createElement('script');s.append('alert(1337)');appendChild(s) >
2023-02-09 23:44:03 +00:00
```
{% endcode %}
2024-02-10 18:14:16 +00:00
## Değere erişimde kesme noktası
2021-11-07 17:40:05 +00:00
```javascript
// Stop when a property in sessionStorage or localStorage is set/get
// via getItem or setItem functions
sessionStorage.getItem = localStorage.getItem = function(prop) {
2024-02-10 18:14:16 +00:00
debugger;
return sessionStorage[prop];
2021-11-07 17:40:05 +00:00
}
localStorage.setItem = function(prop, val) {
2024-02-10 18:14:16 +00:00
debugger;
localStorage[prop] = val;
2021-11-07 17:40:05 +00:00
}
```
```javascript
// Stop when anyone sets or gets the property "ppmap" in any object
// For example sessionStorage.ppmap
// "123".ppmap
// Useful to find where weird properties are being set or accessed
2024-02-10 18:14:16 +00:00
// or to find where prototype pollutions are occurring
2021-11-07 17:40:05 +00:00
function debugAccess(obj, prop, debugGet=true){
2024-02-10 18:14:16 +00:00
var origValue = obj[prop];
Object.defineProperty(obj, prop, {
get: function () {
if ( debugGet )
debugger;
return origValue;
},
set: function(val) {
debugger;
origValue = val;
}
});
2021-11-07 17:40:05 +00:00
};
debugAccess(Object.prototype, 'ppmap')
```
2024-04-07 03:13:19 +00:00
## Otomatik Tarayı cı Erişimi için payloadları test etme
2021-11-07 17:40:05 +00:00
```javascript
//Taken from https://github.com/svennergr/writeups/blob/master/inti/0621/README.md
const puppeteer = require("puppeteer");
const realPasswordLength = 3000;
async function sleep(ms) {
2024-02-10 18:14:16 +00:00
return new Promise((resolve) => setTimeout(resolve, ms));
2021-11-07 17:40:05 +00:00
}
(async () => {
2024-02-10 18:14:16 +00:00
const browser = await puppeteer.launch();
const page = await browser.newPage();
//Loop to iterate through different values
for (let i = 0; i < 10000 ; i + = 100 ) {
console.log(`Run number ${i}`);
const input = `${"0".repeat(i)}${realPasswordLength}` ;
console.log(` https://challenge-0621.intigriti.io/passgen.php?passwordLength=${input}&allowNumbers=true&allowSymbols=true×tamp=1624556811000`);
//Go to the page
await page.goto(
`https://challenge-0621.intigriti.io/passgen.php?passwordLength=${input}&allowNumbers=true&allowSymbols=true×tamp=1624556811000`
);
//Call function "generate()" inside the page
await page.evaluate("generate()");
//Get node inner text from an HTML element
const passwordContent = await page.$$eval(
".alert .page-content",
(node) => node[0].innerText
);
//Transform the content and print it in console
const plainPassword = passwordContent.replace("Your password is: ", "");
if (plainPassword.length != realPasswordLength) {
console.log(i, plainPassword.length, plainPassword);
}
await sleep(1000);
}
await browser.close();
2021-11-07 17:40:05 +00:00
})();
```
2022-04-28 16:01:33 +00:00
< details >
2024-04-07 03:13:19 +00:00
< summary > < strong > AWS hacklemeyi sı fı rdan kahramana öğrenin< / strong > < a href = "https://training.hacktricks.xyz/courses/arte" > < strong > htARTE (HackTricks AWS Kı rmı zı Takı m Uzmanı )< / strong > < / a > < strong > !< / strong > < / summary >
2022-04-28 16:01:33 +00:00
2024-04-07 03:13:19 +00:00
* **Bir **cybersecurity şirketinde mi çalı şı yorsunuz** ? **Şirketinizi HackTricks'te reklamı nı görmek ister misiniz** ? ya da **PEASS'ı n en son sürümüne erişmek veya HackTricks'i PDF olarak indirmek ister misiniz** ? [**ABONELİK PLANLARI** ](https://github.com/sponsors/carlospolop )'na göz atı n!
* [**PEASS Ailesi'ni** ](https://opensea.io/collection/the-peass-family ) keşfedin, özel [**NFT'lerimiz** ](https://opensea.io/collection/the-peass-family ) koleksiyonumuz
* [**Resmi PEASS & HackTricks ürünlerini alı n** ](https://peass.creator-spring.com )
* **Katı lı n** [**💬** ](https://emojipedia.org/speech-balloon/ ) [**Discord grubuna** ](https://discord.gg/hRep4RUj7f ) veya [**telegram grubuna** ](https://t.me/peass ) veya **Twitter'da** beni takip edin 🐦[**@carlospolopm**](https://twitter.com/hacktricks\_live)**.**
* **Hackleme hilelerinizi paylaşarak PR'ler göndererek** [**hacktricks repo** ](https://github.com/carlospolop/hacktricks ) **ve** [**hacktricks-cloud repo** ](https://github.com/carlospolop/hacktricks-cloud ).
2022-04-28 16:01:33 +00:00
< / details >