Skip to content

Commit

Permalink
new github tokens format
Browse files Browse the repository at this point in the history
  • Loading branch information
gwen001 committed Feb 9, 2023
1 parent 71c8667 commit 72a7c41
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion class.GitHubSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function __construct()
$f_tokens = dirname(__FILE__).'/.tokens';
if( file_exists($f_tokens) ) {
$content = file_get_contents( $f_tokens );
$m = preg_match_all( '([a-f0-9]{40}|ghp_[a-zA-Z0-9]{36})', $content, $matches );
$m = preg_match_all( '([a-f0-9]{40}|ghp_[a-zA-Z0-9]{36}|github_pat_[_a-zA-Z0-9]{82})', $content, $matches );
// var_dump($m);
if( $m ) {
$this->auth_token = $matches[0];
Expand Down
2 changes: 1 addition & 1 deletion github-contributors.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
if os.path.isfile(TOKENS_FILE):
fp = open(TOKENS_FILE,'r')
for line in fp:
r = re.search( '^([a-f0-9]{40}|ghp_[a-zA-Z0-9]{36})$', line )
r = re.search( '^([a-f0-9]{40}|ghp_[a-zA-Z0-9]{36}|github_pat_[_a-zA-Z0-9]{82})$', line )
if r:
t_tokens.append( r.group(1) )

Expand Down
2 changes: 1 addition & 1 deletion github-dorks.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ function usage( $err=null ) {
$f_tokens = dirname(__FILE__).'/.tokens';
if( file_exists($f_tokens) ) {
$content = file_get_contents( $f_tokens );
$m = preg_match_all( '([a-f0-9]{40}|ghp_[a-zA-Z0-9]{36})', $content, $matches );
$m = preg_match_all( '([a-f0-9]{40}|ghp_[a-zA-Z0-9]{36}|github_pat_[_a-zA-Z0-9]{82})', $content, $matches );
if( $m ) {
$t_tokens = $matches[0];
}
Expand Down
2 changes: 1 addition & 1 deletion github-dorks.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
if os.path.isfile(TOKENS_FILE):
fp = open(TOKENS_FILE,'r')
for line in fp:
r = re.search( '^([a-f0-9]{40}|ghp_[a-zA-Z0-9]{36})$', line )
r = re.search( '^([a-f0-9]{40}|ghp_[a-zA-Z0-9]{36}|github_pat_[_a-zA-Z0-9]{82})$', line )
if r:
t_tokens.append( r.group(1) )

Expand Down
2 changes: 1 addition & 1 deletion github-employees.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
if os.path.isfile(TOKENS_FILE):
fp = open(TOKENS_FILE,'r')
for line in fp:
r = re.search( '^([a-f0-9]{40}|ghp_[a-zA-Z0-9]{36})$', line )
r = re.search( '^([a-f0-9]{40}|ghp_[a-zA-Z0-9]{36}|github_pat_[_a-zA-Z0-9]{82})$', line )
if r:
t_tokens.append( r.group(1) )

Expand Down
2 changes: 1 addition & 1 deletion github-endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def doGetCode( url ):
if os.path.isfile(TOKENS_FILE):
fp = open(TOKENS_FILE,'r')
for line in fp:
r = re.search( '^([a-f0-9]{40}|ghp_[a-zA-Z0-9]{36})$', line )
r = re.search( '^([a-f0-9]{40}|ghp_[a-zA-Z0-9]{36}|github_pat_[_a-zA-Z0-9]{82})$', line )
if r:
t_tokens.append( r.group(1) )

Expand Down
2 changes: 1 addition & 1 deletion github-secrets.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def doGetCode( url ):
if os.path.isfile(TOKENS_FILE):
fp = open(TOKENS_FILE,'r')
for line in fp:
r = re.search( '^([a-f0-9]{40}|ghp_[a-zA-Z0-9]{36})$', line )
r = re.search( '^([a-f0-9]{40}|ghp_[a-zA-Z0-9]{36}|github_pat_[_a-zA-Z0-9]{82})$', line )
if r:
t_tokens.append( r.group(1) )

Expand Down
2 changes: 1 addition & 1 deletion github-subdomains.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def doGetCode( url ):
if os.path.isfile(TOKENS_FILE):
fp = open(TOKENS_FILE,'r')
for line in fp:
r = re.search( '^([a-f0-9]{40}|ghp_[a-zA-Z0-9]{36})$', line )
r = re.search( '^([a-f0-9]{40}|ghp_[a-zA-Z0-9]{36}|github_pat_[_a-zA-Z0-9]{82})$', line )
if r:
t_tokens.append( r.group(1) )

Expand Down
2 changes: 1 addition & 1 deletion github-survey/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
exit( 'Tokens file not found!' );
}
$content = file_get_contents( $f_tokens );
$m = preg_match_all( '([a-f0-9]{40}|ghp_[a-zA-Z0-9]{36})', $content, $matches );
$m = preg_match_all( '([a-f0-9]{40}|ghp_[a-zA-Z0-9]{36}|github_pat_[_a-zA-Z0-9]{82})', $content, $matches );
if( $m ) {
$t_tokens = $matches[0];
}
Expand Down
2 changes: 1 addition & 1 deletion github-survey2.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
if os.path.isfile(TOKENS_FILE):
fp = open(TOKENS_FILE,'r')
for line in fp:
r = re.search( '^([a-f0-9]{40}|ghp_[a-zA-Z0-9]{36})$', line )
r = re.search( '^([a-f0-9]{40}|ghp_[a-zA-Z0-9]{36}|github_pat_[_a-zA-Z0-9]{82})$', line )
if r:
t_tokens.append( r.group(1) )

Expand Down
2 changes: 1 addition & 1 deletion github-users.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
if os.path.isfile(TOKENS_FILE):
fp = open(TOKENS_FILE,'r')
for line in fp:
r = re.search( '^([a-f0-9]{40}|ghp_[a-zA-Z0-9]{36})$', line )
r = re.search( '^([a-f0-9]{40}|ghp_[a-zA-Z0-9]{36}|github_pat_[_a-zA-Z0-9]{82})$', line )
if r:
t_tokens.append( r.group(1) )

Expand Down
1 change: 1 addition & 0 deletions gsearch-reflog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ t_keywords=(
"cloudfront.net"
"blob.core.windows.net"
'ghp_'
'github_pat_'
'AKIA[A-Z0-9]{16}'
)

Expand Down

0 comments on commit 72a7c41

Please sign in to comment.