You are browsing as a guest. Sign up (or log in) to start making projects!

Slack-ASM

  • 19 Devlogs
  • 34 Total hours

A slack bot written in pure x86-64 assembly (with ARM support) :hehe: Channel: https://hackclub.enterprise.slack.com/archives/C0B8BL6P3T3

Open comments for this post

1h 45m 15s logged

Updates

  • Did a banner & Logo
  • Add a pung command, it pings a certain user when you use it
  • Added slash commands where the slash cmd msg is deleted instead of kept
  • Fixed help cmd deleting slash cmd msg when it should not be
0
0
48
Open comments for this post

1h 13m 26s logged

Updates

  • Updated docker-compose
  • Added pinging bot as a way to use its commands
  • Auto reconnect ws after slack api decides to end it
  • help cmd responds without threading due to slack api limitations
  • Commands when pinging bot always responds in thread, even help cmd
  • Added a meow cmd
0
1
43
Open comments for this post

8h 14m 30s logged

Updates

  • This Devlog took a while 😭

Anyway on to the changes..

  • Slack-asm help command
  • Ability to respond in threads
  • Roadmap updates
  • Docker updates
  • Minor help message updates
  • Just check the commit messages 😭
  • Added Slack bot token handling and HTTP POST functionality
  • Introduced load_bot_token function to extract the bot token from the environment buffer.
  • Implemented slack_send_http_post function for making HTTP POST requests to Slack API with optional authorization.
  • Updated slack_fetch_channel_ts to utilize the new bot token for API calls.
  • Enhanced slash command handlers to send responses using slack_send_http_post.
  • Added support for response URLs in slash command responses.
  • Introduced memmem function for searching byte sequences in memory.
  • Added debug logging for TLS operations to aid in troubleshooting.
  • /slack-asm help now replies in a thread, though its not the correct thread :sob-wx:

The screeny below is from after i ram /slack-asm help
What happened is it deleted the /slack-asm help msg and instead replied in my most recent other message

3
0
42
Open comments for this post

2h 4m 18s logged

Updates

  • We implemented a frick ton of tests

  • sha256 hmac tests

  • prf kdf tests

  • tls record tests

  • tls handshake tests

  • tls connect tests

  • aes cbc tests

  • encrypted record tests

  • x509 tests

  • http tests

  • rsa tests

  • gcm tests

2
0
68
Open comments for this post

1h 3m 24s logged

updates

  • WE GOT WORKING SLASH COMMANDS :yayayayayay:
    (See screenshot below)
  • Also fixed an indirect address displacement warning
  • Fixed us not replying to the slack api with proper json
  • Still not deployed

Next up

  • Messages that are visible to everyone
  • It replying to certain phrases (maybe)
2
0
54
Open comments for this post

3h 43m 16s logged

Updates

  • FD might kill me

  • We spent 2hrs fixing the first 3 bytes of keystream being wrong for the last block when we were calling the slack api.

  • Implemented a ENV parser

  • Yet another gitignore update

  • Fixed parsing extensions wrong

  • Reached 8.2K LOC

1
1
51
Open comments for this post

28m 24s logged

Updates/Status Report

Changes for this devlog

  • TLS alert Handling
  • Updated content length from 32 to 64 bit for >4GB response bodies

Status Report

We have Full HTTPS working end-to-end
This includes but not limited to:

  • Full TLS 1.2 incl handshakes
  • Full HTTP support
  • TLS libraries:
    • SHA-256
    • HMAC-SHA256
    • AES-128- CBC & GCM
    • RSA support
    • ECDHE key exchange
    • They are implemented enough for TLS
  • We have Linux syscalls
  • We at 10161 lines of asm, 7.6k LOC, 1.2k Comments & 1.3K blanks

What Next?

We integrating this bad boy with slack api :hehe:

PS: ignore the bad request part in the image below

0
0
20
Open comments for this post

2h 15m 58s logged

Updates

  • Padding fix
  • HTTP versioning parsing implementation
  • Chunked transfer encoding as https is horrible
  • 2 commits i did were just random gitignore updates in between a massive 2k line addition commit
  • Made an abbreviation YAGU or Yet another gitignore update
  • Implemented P-256 elliptic curve primitives for ECDHE Key Exchange
  • AES-128-GCM for TLS1.2
  • Tests for AES-128-GCM (they were horrible to do, purely because my GCM code was not working
  • TLS code updates for aes128 & ecc
  • Yes i am aware my gcm_tests below give horrible information to help lmao
0
0
14
Open comments for this post

1h 13m 36s logged

Updates

  • TLS Handshake fixes:
    • Added server_ccs field to the tls_ctx struct
    • Initialized server_ccs in tls_init
    • Fixed PKCS#7 padding byte value in tls_send
    • fixed big endian length field encoding in CCS header
    • Removed CCS Peak
    • Probably something I missed
  • RSA Big integer rewrite
  • Added STDERR & increased tls_ctx_buf
  • Commented out test_harness call and added dump_keys stub
  • Updated the Makefile
  • Discovered i messed something up in compiled binary
0
0
11
Open comments for this post

40m logged

Updates

  • DNS resolution in pure assembly :fear:
  • Fixed a bug where exit 255 was not in the RSA big_mod code, it was instead in the tls code for whatever reason
  • We at like 5.4K LOC in Assembly now :yay:
  • Thats it :cwy:
0
0
17
Open comments for this post

44m 16s logged

Updates

  • Removed the need of der file in the repo by hardcoding the value of the RSA-2048 test key
  • Implemented Basic HTTP response parsing
  • Began work on a very very basic dns resoultion system
0
0
11
Open comments for this post

4h 32m 32s logged

Updates

f952ca5

  • Added push rdp/ pop rbp to preserve rdp across sha256_transform updates

rsa.asm

  • RSA PKCS#1
  • RSA OAEP encoding
  • Montgomery ladder modular exponentiation
  • Big number helpers

tls.asm

  • New exports
  • New externs
  • More constants
  • A bunch of file changes, see the actual commit for all of it

test.asm

  • Extend test_harness
  • SHA256, HMAC-SHA256 test vectors
  • KDF intermediate HMAC computation test
  • PRF output comparison against known vector
  • Key derivation: client/server write MAC keys, write keys, IVs
  • Full TLS 1.2 handshake
  • Some more i dont remember about

Slack.asm

  • Updated banner, added externs for new functions
  • Cleaned up _start to call main then exit

2 Random commits just updating gitignore imbetween

38dad3c

tls.asm

  • Register clobber fix
  • CCS read_seq
  • MAC double-count fix
  • Verify_data mismatch
  • Removed debug writes
  • Disconnect Comment

test.asm

  • ServerHello hash offset update
  • PRF target address update
  • Fix MAC length byte-order
  • Seq number update
  • Child ClientHello receive update

socket.asm

  • sys_send update

Summary

Frick me, most of this devlog what trying to fix one single bug.

The hardest part of this devlog was fixing the stupid bugs i had.

0
0
14
Open comments for this post

1h 5m 14s logged

Updates

  • Agents file and Contributing file
  • X.509 certificate parsing & basic validity checking
  • No longer include .der files (gitignore change)
  • Updated Commenting, ie. made it more clearer and standardized it a bit.
  • Updated Readme & Roadmap

Code

  • Now at 4.5k lines of assembly, 3.3k lines are actual code, 701 commenting lines.
  • By the way its 3,300 lines exactly for the asm code lines
0
0
8
Open comments for this post

1h 36m 28s logged

Updates

  • Added AES-128-CBC encryption & decryption
  • Implement pre_master_secret generation

The line counts have increased

Currently 3.7k lines of asm, (2.8k LOC)

AES-128-CBC Notes:

  • Most of my time was spent debugging it
  • Thats it I think

Oh Yeah and somehow all tests pass!

0
0
8
Open comments for this post

51m 14s logged

Updates

  • Added Key derivation functions & its tests
  • Added TLS 1.2 PRF implemnentation & its tests
  • Sitting at 1759 lines of asm code now
  • Still a bunch to go
0
0
18
Open comments for this post

53m 59s logged

Updates

  • Stardance went off as I tried to post a devlog (this is redoing it)
  • Added TLS 1.2 handshake & TLS record layer
  • Finished RFC 4231 test cases
1
0
22
Open comments for this post

50m 40s logged

Updates

  • My wakatime broke
  • Added SHA256 in pure asm
  • Added hmac_sha256 in pure asm
  • Fixed the sha256 error
  • Comment out object files
  • Readme & Roadmap polishing
  • Update repo structure to now have code in src/
0
0
23

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…