GitHub Search Syntax, HTTP Request Status Codes, Encode/Decode Tools

GitHub Search Syntax

1. Qualifiers

Supported qualifiers: repository name (name), project description (description), content, README file (readme)

Keyword Example Description
<span>in:name</span> java in:name Search for projects with ‘java’ in the repository name.
<span>in:description</span> java in:description Search for projects with ‘java’ in the project description.
<span>in:readme</span> java in:readme Search for projects with ‘java’ in the README file.
<span>repo:owner/name</span> repo:annwyn/helloworld Search for the ‘helloworld’ project under user ‘annwyn’.

Additional qualifiers: You can filter projects by size (size), number of followers (followers), number of forks (forks), number of stars (stars), creation time (created), update time (pushed), programming language (language), topic tags (topic), number of topic tags (topics)… You can use multiple additional qualifiers separated by spaces, and they can be used in conjunction with qualifiers or alone.

2. Querying Values Greater Than or Less Than Another Value

You can use <span>></span>, <span>>=</span>, <span><</span>, and <span><=</span> to search for values greater than, greater than or equal to, less than, and less than or equal to another value.

Query Example Description
<span>>n</span> cats stars:>1000 Matches repositories containing the word ‘cats’ with more than 1000 stars.
<span>>=n</span> cats topics:>=5 Matches repositories containing the word ‘cats’ with 5 or more topics.
<span><n</span> cats size:<10000 Matches code containing the word ‘cats’ in files smaller than 10 KB.
<span><=n</span> cats stars:<=50 Matches repositories containing the word ‘cats’ with no more than 50 stars.

You can also use range queries to search for values greater than or equal to or less than or equal to another value.

Query Example Description
<span>n..*</span> cats size:10…* Equivalent to<span>stars:>=10</span> and matches repositories containing the word ‘cats’ with 10 or more stars.
<span>*..n</span> cats stars:*…10 Equivalent to<span>stars:<=10</span> and matches repositories containing the word ‘cats’ with no more than 10 stars.

3. Querying Values Between Ranges

You can use range syntax <span>n..n</span> to search for values within a range, where the first number n is the minimum value and the second is the maximum value.

Query Example Description
<span>n..n</span> cats stars:10…50 Matches repositories containing the word ‘cats’ with between 10 and 50 stars.

4. Querying Dates

You can search for dates earlier or later than another date, or within a date range using <span>></span>, <span>>=</span>, <span><</span>, <span><=</span>, and range queries. The date format must follow the [ISO8601] standard, which is <span>yyyy-MM-dd</span> (year-month-day).

Query Example Description
<span>>yyyy-MM-dd</span> cats created:>2016-04-29 Matches issues containing the word ‘cats’ created after April 29, 2016.
<span>>=yyyy-MM-dd</span> cats created:>=2017-04-01 Matches issues containing the word ‘cats’ created on or after April 1, 2017.
<span><yyyy-MM-dd</span> cats pushed:<2012-07-05 Matches code containing the word ‘cats’ pushed before July 5, 2012.
<span><=yyyy-MM-dd</span> cats created:<=2012-07-04 Matches issues containing the word ‘cats’ created on or before July 4, 2012.
<span>yyyy-MM-dd..yyyy-MM-dd</span> cats pushed:2016-04-30..2016-07-04 Matches repositories containing the word ‘cats’ pushed between the end of April 2016 and July 2016.
<span>yyyy-MM-dd..*</span> cats created:>2012-04-30..* Matches issues containing the word ‘cats’ created after April 30, 2012.
<span>*..yyyy-MM-dd</span> cats created:>*..2016-04-30 Matches issues containing the word ‘cats’ created before April 30, 2016.

You can also add optional time information after the date <span>THH:MM:SS+00:00</span> to search by hour, minute, and second. This is <span>T</span>, followed by <span>HH:MM:SS</span> (hour-minute-second) and UTC offset (<span>+00:00</span>).

Query Example Description
<span>yyyy-MM-ddTHH:mm:ss+00:00</span> cats created:>2017-01-01T01:00:00+07:00 Matches issues created after 1 AM on January 1, 2017 (UTC offset of <span>07:00</span>).
<span>yyyy-MM-ddTHH:mm:ssZ</span> cats created:>2017-01-01T01:00:00Z Matches issues created after 1 AM on January 1, 2017.

5. Excluding Specific Results

You can use <span>NOT</span> syntax to exclude results containing specific words. The <span>NOT</span> operator can only be used with string keywords, not with numbers or dates.

Query Example Description
<span>NOT</span> hello NOT world Matches repositories containing the word ‘hello’ but not ‘world’.
<span>-</span> cats stars:>10 -language:java Matches repositories containing the word ‘cats’ with more than 10 stars but not written in Java.

Website Source Code Platforms

Mutual Station: https://www.huzhan.com/

Search Engine: https://cn.bing.com/

Search for relevant source code on GitHub based on specific source code suffixes.

Source Code Information Leakage Scenarios

  • git directory leakage

The .git directory often appears when initializing or cloning a git repository, and it contains a complete record of the project’s version history, content, and change information. In summary, if developers misconfigure and expose the .git directory, attackers can use it to restore the complete project source code, leading to source code leakage.

Tool: https://github.com/lijiejie/GitHack

  • .svn directory leakage

When developers use the SVN version control system, a .svn directory is automatically generated in the root directory. Like the .git directory, if misconfigured and exposed, attackers can restore the entire project source code using the leaked .svn/entries file.

Tool: https://github.com/callmefeifei/SvnHack

  • DS_Store file leakage

A hidden file in MacOS, automatically generated by Finder (MacOS file manager), used to store folder display properties and view settings, and exists in every directory. However, unlike .git and .svn leaks that can restore the entire system source code, if a DS_Store file is leaked, attackers can only restore the DS_Store file, which is of little significance. If anything, it reveals the directory structure of the source code.

Tool: https://github.com/lijiejie/ds_store_exp

  • composer.json file leakage

The composer.json file is the configuration file for the PHP dependency management tool Composer, used to record basic information about the PHP project, such as dependencies, project name, version, and configuration, similar to requirements.txt (pip) in Python or pom.xml (maven) in Java. If the composer.json file is leaked, it may expose sensitive information in the project.

  • Webpack leakage

Webpack is a JavaScript bundler that can bundle various files in a project (such as JavaScript, CSS, images, etc.), improving project performance and maintainability. Webpack leakage often occurs in Vue and Node.js projects. If attackers discover Webpack leakage, they can extract the entire front-end source code packaged by Webpack.

Tool: https://github.com/NothingCw/SourceDetector-dist (Google plugin)

Information Dotting

  • Tianyancha

  • Little Blue Book

  • Aiqicha

  • Qichacha

  • Foreign Enterprise Check

  • Qixinbao

  • Record Information Query

  • Record Management System

  • Sogou WeChat Search (https://weixin.sougou.com)

  • Domain Registration Query

  • IP Reverse Domain Lookup (https://x.threatbook.com/)

  • Online Subdomain Query

  • 360 Intelligence Threat Center (https://ti.360.cn/)

  • Domain DNS Resolution Query (https://dnsdumpster.com/)

  • Network Space Information Query

    • FOFA (https://fofa.info/)
    • 360 Quark (https://quake.360.net)
    • Global Hawk (https://hunter.qianxin.com/)
  • Community Tool Collection (https://forum.ywhack.com/bountytips.php?tools)

HTTP Request Status Codes

HTTP status codes are server response status indicators for client requests, divided into five categories (distinguished by the first digit), commonly used status codes:

1xx (Informational): Request has been received, continuing processing

  • 100 Continue: The server has received the request header, and the client can continue sending the request body.

2xx (Success): Request has been successfully processed

  • 200 OK: Request succeeded, returning corresponding data.
  • 201 Created: Request succeeded, and a new resource has been created (e.g., POST creating data).
  • 204 No Content: Request succeeded, but no content is returned (e.g., DELETE success).

3xx (Redirection): Further action required by the client

  • 301 Moved Permanently: Resource has been permanently moved to a new URL, and the browser will cache the new address.
  • 302 Found: Resource has been temporarily moved to a new URL, and the browser does not cache the new address.
  • 304 Not Modified: Resource has not been modified, and local cache can be used for cache optimization.

4xx (Client Error): There is an error in the request

  • 400 Bad Request: Request parameters are incorrect or format is invalid.
  • 401 Unauthorized: Authentication required (e.g., not logged in).
  • 403 Forbidden: Server refuses the request (e.g., insufficient permissions).
  • 404 Not Found: Requested resource does not exist.
  • 405 Method Not Allowed: Request method is not allowed (e.g., using POST method for an interface that only supports GET).

5xx (Server Error): Server encountered an error processing the request

  • 500 Internal Server Error: Unknown internal server error.
  • 502 Bad Gateway: Gateway/proxy server received an invalid response.
  • 503 Service Unavailable: Server temporarily unavailable (e.g., under maintenance).
  • 504 Gateway Timeout: Gateway/proxy server timed out waiting.

JavaScript Source Code Reverse Engineering

Public key/private key encryption **<—>** private key/public key decryption.

JSON formatting:

https://www.bejson.com/

PHP code online execution:

https://www.bejson.com/runcode/php/

Online timestamp conversion:

https://tool.lu/timestamp/

Online AES encryption and decryption: http://tool.chacuo.net/cryptaes

MD5 online decryption: https://www.cmd5.com/

BUGKU target field: https://ctf.bugku.com/challenges

https://www.yuque.com/u21437924/ap9vtm/gqkc3dcfmfpe5p85?singleDoc#I7sOj

Super encryption and decryption conversion tool V2.1 green free version: https://www.cr173.com/soft/21692.html

Encoding/Decoding Tools

CaptfEncoder is a cross-platform network security tool suite designed to provide convenient tool support for network security professionals and enthusiasts. This tool integrates various network security-related encoding conversions, classical ciphers, cryptography, special encoding, and aggregates various online tools, allowing users to quickly operate in different scenarios.

https://gitcode.com/open-source-toolkit/4aa73/?utm_source=tools_gitcode&index=top&type=card&

Leave a Comment